discount/models/discount_marketing.json
Hermes Agent f5250fb261 feat: 营销方案、促销码、客户归属绑定功能
- 新增3个数据模型: discount_marketing, discount_promo_code, discount_customer_bind
- 新增CRUD定义: marketing/promo_code/customer_bind 的list和api
- 新增init/data.json: appcodes编码(促销码类型、绑定方式)
- init.py: bind_customer支持customerid参数覆盖(注册场景)
- 折扣校验放宽至 0 < discount <= 1
2026-06-24 00:56:32 +08:00

98 lines
2.3 KiB
JSON

{
"summary": [
{
"name": "discount_marketing",
"title": "营销方案",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "resellerid",
"title": "商户机构id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "name",
"title": "方案名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "enabled_date",
"title": "启用日期",
"type": "date"
},
{
"name": "expired_date",
"title": "失效日期",
"type": "date"
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"default": "1"
},
{
"name": "created_by",
"title": "创建人",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "timestamp",
"default": "CURRENT_TIMESTAMP",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "timestamp",
"default": "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_dm_reseller",
"idxtype": "index",
"idxfields": ["resellerid"]
},
{
"name": "idx_dm_status",
"idxtype": "index",
"idxfields": ["status"]
}
],
"codes": [
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='product_status'"
}
]
}