config: dbal,hpp,cpp (3 files)

This commit is contained in:
2025-12-25 23:03:53 +00:00
parent 91af64d2f9
commit 323022ea2f
3 changed files with 99 additions and 0 deletions

View File

@@ -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

View File

@@ -24,6 +24,12 @@ public:
virtual Result<PageView> updatePage(const std::string& id, const UpdatePageInput& input) = 0;
virtual Result<bool> deletePage(const std::string& id) = 0;
virtual Result<std::vector<PageView>> listPages(const ListOptions& options) = 0;
virtual Result<Workflow> createWorkflow(const CreateWorkflowInput& input) = 0;
virtual Result<Workflow> getWorkflow(const std::string& id) = 0;
virtual Result<Workflow> updateWorkflow(const std::string& id, const UpdateWorkflowInput& input) = 0;
virtual Result<bool> deleteWorkflow(const std::string& id) = 0;
virtual Result<std::vector<Workflow>> listWorkflows(const ListOptions& options) = 0;
virtual void close() = 0;
};

View File

@@ -70,6 +70,39 @@ struct UpdatePageInput {
std::optional<bool> is_active;
};
struct Workflow {
std::string id;
std::string name;
std::optional<std::string> 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<std::string> description;
std::string trigger;
Json trigger_config;
Json steps;
bool is_active = true;
std::string created_by;
};
struct UpdateWorkflowInput {
std::optional<std::string> name;
std::optional<std::string> description;
std::optional<std::string> trigger;
std::optional<Json> trigger_config;
std::optional<Json> steps;
std::optional<bool> is_active;
std::optional<std::string> created_by;
};
struct ListOptions {
std::map<std::string, std::string> filter;
std::map<std::string, std::string> sort;