refactor(models): convert to json format per database-table-definition-spec

This commit is contained in:
yumoqing 2026-05-27 13:23:35 +08:00
parent 5f62326ce2
commit 48294e95fb
4 changed files with 90 additions and 56 deletions

View File

@ -3,27 +3,31 @@
"fields": [ "fields": [
{ {
"name": "id", "name": "id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "主键ID" "comment": "主键ID",
"length": 32
}, },
{ {
"name": "workflow_id", "name": "workflow_id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "工作流ID" "comment": "工作流ID",
"length": 32
}, },
{ {
"name": "business_type", "name": "business_type",
"type": "varchar(50)", "type": "str",
"not_null": true, "not_null": true,
"comment": "业务类型: contract/customer/opportunity" "comment": "业务类型: contract/customer/opportunity",
"length": 50
}, },
{ {
"name": "business_id", "name": "business_id",
"type": "varchar(64)", "type": "str",
"not_null": true, "not_null": true,
"comment": "业务记录ID" "comment": "业务记录ID",
"length": 64
}, },
{ {
"name": "current_step", "name": "current_step",
@ -32,18 +36,21 @@
}, },
{ {
"name": "status", "name": "status",
"type": "varchar(20)", "type": "str",
"comment": "状态: pending/approved/rejected/cancelled" "comment": "状态: pending/approved/rejected/cancelled",
"length": 20
}, },
{ {
"name": "initiator_id", "name": "initiator_id",
"type": "varchar(32)", "type": "str",
"comment": "发起人ID" "comment": "发起人ID",
"length": 32
}, },
{ {
"name": "org_id", "name": "org_id",
"type": "varchar(32)", "type": "str",
"comment": "组织ID" "comment": "组织ID",
"length": 32
}, },
{ {
"name": "initiated_at", "name": "initiated_at",
@ -114,7 +121,9 @@
{ {
"name": "approval_instance", "name": "approval_instance",
"title": "审批实例", "title": "审批实例",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
] ]

View File

@ -3,21 +3,24 @@
"fields": [ "fields": [
{ {
"name": "id", "name": "id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "主键ID" "comment": "主键ID",
"length": 32
}, },
{ {
"name": "workflow_id", "name": "workflow_id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "所属工作流ID" "comment": "所属工作流ID",
"length": 32
}, },
{ {
"name": "step_name", "name": "step_name",
"type": "varchar(100)", "type": "str",
"not_null": true, "not_null": true,
"comment": "步骤名称" "comment": "步骤名称",
"length": 100
}, },
{ {
"name": "step_number", "name": "step_number",
@ -27,18 +30,21 @@
}, },
{ {
"name": "approver_role", "name": "approver_role",
"type": "varchar(20)", "type": "str",
"comment": "审批角色: role/user" "comment": "审批角色: role/user",
"length": 20
}, },
{ {
"name": "approver_id", "name": "approver_id",
"type": "varchar(32)", "type": "str",
"comment": "审批人ID" "comment": "审批人ID",
"length": 32
}, },
{ {
"name": "description", "name": "description",
"type": "varchar(500)", "type": "str",
"comment": "步骤描述" "comment": "步骤描述",
"length": 500
}, },
{ {
"name": "timeout_hours", "name": "timeout_hours",
@ -80,7 +86,9 @@
{ {
"name": "approval_step", "name": "approval_step",
"title": "审批步骤", "title": "审批步骤",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
] ]

View File

@ -3,41 +3,48 @@
"fields": [ "fields": [
{ {
"name": "id", "name": "id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "主键ID" "comment": "主键ID",
"length": 32
}, },
{ {
"name": "instance_id", "name": "instance_id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "所属实例ID" "comment": "所属实例ID",
"length": 32
}, },
{ {
"name": "step_id", "name": "step_id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "审批步骤ID" "comment": "审批步骤ID",
"length": 32
}, },
{ {
"name": "assignee_id", "name": "assignee_id",
"type": "varchar(32)", "type": "str",
"comment": "审批人ID" "comment": "审批人ID",
"length": 32
}, },
{ {
"name": "status", "name": "status",
"type": "varchar(20)", "type": "str",
"comment": "状态: pending/approved/rejected" "comment": "状态: pending/approved/rejected",
"length": 20
}, },
{ {
"name": "comment", "name": "comment",
"type": "varchar(1000)", "type": "str",
"comment": "审批意见" "comment": "审批意见",
"length": 1000
}, },
{ {
"name": "org_id", "name": "org_id",
"type": "varchar(32)", "type": "str",
"comment": "组织ID" "comment": "组织ID",
"length": 32
}, },
{ {
"name": "assigned_at", "name": "assigned_at",
@ -94,7 +101,9 @@
{ {
"name": "approval_task", "name": "approval_task",
"title": "审批任务", "title": "审批任务",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
] ]

View File

@ -3,26 +3,30 @@
"fields": [ "fields": [
{ {
"name": "id", "name": "id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"comment": "主键ID" "comment": "主键ID",
"length": 32
}, },
{ {
"name": "name", "name": "name",
"type": "varchar(100)", "type": "str",
"not_null": true, "not_null": true,
"comment": "工作流名称" "comment": "工作流名称",
"length": 100
}, },
{ {
"name": "module", "name": "module",
"type": "varchar(50)", "type": "str",
"not_null": true, "not_null": true,
"comment": "所属模块" "comment": "所属模块",
"length": 50
}, },
{ {
"name": "trigger_event", "name": "trigger_event",
"type": "varchar(100)", "type": "str",
"comment": "触发事件" "comment": "触发事件",
"length": 100
}, },
{ {
"name": "description", "name": "description",
@ -31,14 +35,16 @@
}, },
{ {
"name": "org_id", "name": "org_id",
"type": "varchar(32)", "type": "str",
"comment": "组织ID" "comment": "组织ID",
"length": 32
}, },
{ {
"name": "status", "name": "status",
"type": "varchar(20)", "type": "str",
"default": "Y", "default": "Y",
"comment": "状态 Y-启用 N-禁用" "comment": "状态 Y-启用 N-禁用",
"length": 20
}, },
{ {
"name": "created_at", "name": "created_at",
@ -95,7 +101,9 @@
{ {
"name": "approval_workflow", "name": "approval_workflow",
"title": "审批工作流定义", "title": "审批工作流定义",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
] ]