130 lines
3.0 KiB
JSON
130 lines
3.0 KiB
JSON
{
|
|
"table_name": "approval_instance",
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"type": "str",
|
|
"not_null": true,
|
|
"comment": "主键ID",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "workflow_id",
|
|
"type": "str",
|
|
"not_null": true,
|
|
"comment": "工作流ID",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "business_type",
|
|
"type": "str",
|
|
"not_null": true,
|
|
"comment": "业务类型: contract/customer/opportunity",
|
|
"length": 50
|
|
},
|
|
{
|
|
"name": "business_id",
|
|
"type": "str",
|
|
"not_null": true,
|
|
"comment": "业务记录ID",
|
|
"length": 64
|
|
},
|
|
{
|
|
"name": "current_step",
|
|
"type": "int",
|
|
"comment": "当前步骤号"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "str",
|
|
"comment": "状态: pending/approved/rejected/cancelled",
|
|
"length": 20
|
|
},
|
|
{
|
|
"name": "initiator_id",
|
|
"type": "str",
|
|
"comment": "发起人ID",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "org_id",
|
|
"type": "str",
|
|
"comment": "组织ID",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "initiated_at",
|
|
"type": "timestamp",
|
|
"comment": "发起时间"
|
|
},
|
|
{
|
|
"name": "completed_at",
|
|
"type": "timestamp",
|
|
"comment": "完成时间"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_instance_workflow",
|
|
"type": "normal",
|
|
"idxfields": [
|
|
"workflow_id"
|
|
],
|
|
"idxtype": "index"
|
|
},
|
|
{
|
|
"name": "idx_instance_business",
|
|
"type": "normal",
|
|
"comment": "复合索引:按业务类型和记录查询",
|
|
"idxfields": [
|
|
"business_type",
|
|
"business_id"
|
|
],
|
|
"idxtype": "index"
|
|
},
|
|
{
|
|
"name": "idx_instance_status",
|
|
"type": "normal",
|
|
"idxfields": [
|
|
"status"
|
|
],
|
|
"idxtype": "index"
|
|
},
|
|
{
|
|
"name": "idx_instance_initiator",
|
|
"type": "normal",
|
|
"idxfields": [
|
|
"initiator_id"
|
|
],
|
|
"idxtype": "index"
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"key": "pending",
|
|
"name": "审批中"
|
|
},
|
|
{
|
|
"key": "approved",
|
|
"name": "已通过"
|
|
},
|
|
{
|
|
"key": "rejected",
|
|
"name": "已驳回"
|
|
},
|
|
{
|
|
"key": "cancelled",
|
|
"name": "已取消"
|
|
}
|
|
],
|
|
"summary": [
|
|
{
|
|
"name": "approval_instance",
|
|
"title": "审批实例",
|
|
"primary": [
|
|
"id"
|
|
],
|
|
"catelog": "entity"
|
|
}
|
|
]
|
|
} |