From 323022ea2f53575d45b2fdf4ed4bc389e5be5351 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Thu, 25 Dec 2025 23:03:53 +0000 Subject: [PATCH] config: dbal,hpp,cpp (3 files) --- dbal/common/contracts/conformance_cases.yaml | 60 ++++++++++++++++++++ dbal/cpp/include/dbal/adapters/adapter.hpp | 6 ++ dbal/cpp/include/dbal/types.hpp | 33 +++++++++++ 3 files changed, 99 insertions(+) diff --git a/dbal/common/contracts/conformance_cases.yaml b/dbal/common/contracts/conformance_cases.yaml index 60946fbba..45d3739c5 100644 --- a/dbal/common/contracts/conformance_cases.yaml +++ b/dbal/common/contracts/conformance_cases.yaml @@ -133,3 +133,63 @@ status: error error: code: 422 + +- name: "Workflow CRUD operations" + description: "Test basic create, read, update, delete operations for Workflow entity" + operations: + - action: create + entity: User + input: + username: "workflow_user" + email: "workflow@example.com" + role: "admin" + expected: + status: success + + - action: create + entity: Workflow + input: + name: "daily_digest" + description: "Daily digest workflow" + trigger: "schedule" + triggerConfig: + cron: "0 9 * * *" + steps: + actions: ["send_email"] + isActive: true + createdBy: "$steps[0].id" + expected: + status: success + output: + name: "daily_digest" + trigger: "schedule" + isActive: true + + - action: read + entity: Workflow + input: + id: "$steps[1].id" + expected: + status: success + output: + name: "daily_digest" + + - action: update + entity: Workflow + input: + id: "$steps[1].id" + isActive: false + description: "Paused for maintenance" + expected: + status: success + output: + isActive: false + description: "Paused for maintenance" + + - action: delete + entity: Workflow + input: + id: "$steps[1].id" + expected: + status: success + output: true diff --git a/dbal/cpp/include/dbal/adapters/adapter.hpp b/dbal/cpp/include/dbal/adapters/adapter.hpp index 2b695953b..a752a82d5 100644 --- a/dbal/cpp/include/dbal/adapters/adapter.hpp +++ b/dbal/cpp/include/dbal/adapters/adapter.hpp @@ -24,6 +24,12 @@ public: virtual Result updatePage(const std::string& id, const UpdatePageInput& input) = 0; virtual Result deletePage(const std::string& id) = 0; virtual Result> listPages(const ListOptions& options) = 0; + + virtual Result createWorkflow(const CreateWorkflowInput& input) = 0; + virtual Result getWorkflow(const std::string& id) = 0; + virtual Result updateWorkflow(const std::string& id, const UpdateWorkflowInput& input) = 0; + virtual Result deleteWorkflow(const std::string& id) = 0; + virtual Result> listWorkflows(const ListOptions& options) = 0; virtual void close() = 0; }; diff --git a/dbal/cpp/include/dbal/types.hpp b/dbal/cpp/include/dbal/types.hpp index 82eedccf5..f35fb3366 100644 --- a/dbal/cpp/include/dbal/types.hpp +++ b/dbal/cpp/include/dbal/types.hpp @@ -70,6 +70,39 @@ struct UpdatePageInput { std::optional is_active; }; +struct Workflow { + std::string id; + std::string name; + std::optional description; + std::string trigger; + Json trigger_config; + Json steps; + bool is_active; + std::string created_by; + Timestamp created_at; + Timestamp updated_at; +}; + +struct CreateWorkflowInput { + std::string name; + std::optional description; + std::string trigger; + Json trigger_config; + Json steps; + bool is_active = true; + std::string created_by; +}; + +struct UpdateWorkflowInput { + std::optional name; + std::optional description; + std::optional trigger; + std::optional trigger_config; + std::optional steps; + std::optional is_active; + std::optional created_by; +}; + struct ListOptions { std::map filter; std::map sort;