- 4张表: voucher_template, voucher_rule, voucher_instance, voucher_usage_log - 可配置规则引擎: registry + validators + engine - 8种内置规则: min_amount, max_amount, applicable_product_type, applicable_product, exclude_product, max_usage_count, valid_period, user_level - CRUD定义 + API接口 + 前端页面 - SQL建表脚本 + RBAC权限配置 - 一次性使用,不找零
48 lines
1.8 KiB
JSON
48 lines
1.8 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "voucher_rule",
|
|
"title": "代金券规则定义",
|
|
"primary": ["id"],
|
|
"catelog": "entity"
|
|
}
|
|
],
|
|
"fields": [
|
|
{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "template_id", "title": "模板ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "rule_type", "title": "规则类型", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "rule_config", "title": "规则配置(JSON)", "type": "text", "nullable": "no"},
|
|
{"name": "enabled", "title": "是否启用", "type": "short", "nullable": "no", "default": "1"},
|
|
{"name": "sort_order", "title": "执行顺序", "type": "int", "nullable": "no", "default": "0"},
|
|
{"name": "remark", "title": "备注", "type": "str", "length": 255, "nullable": "yes"},
|
|
{"name": "created_at", "title": "创建时间", "type": "timestamp", "nullable": "no"},
|
|
{"name": "updated_at", "title": "更新时间", "type": "timestamp", "nullable": "no"}
|
|
],
|
|
"indexes": [
|
|
{"name": "idx_rule_template", "idxtype": "index", "idxfields": ["template_id"]},
|
|
{"name": "idx_rule_enabled", "idxtype": "index", "idxfields": ["enabled"]}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "template_id",
|
|
"table": "voucher_template",
|
|
"valuefield": "id",
|
|
"textfield": "name"
|
|
},
|
|
{
|
|
"field": "rule_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='voucher_rule_type'"
|
|
},
|
|
{
|
|
"field": "enabled",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='yes_no'"
|
|
}
|
|
]
|
|
}
|