discount/models/discount_customer_bind.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

99 lines
2.4 KiB
JSON

{
"summary": [
{
"name": "discount_customer_bind",
"title": "客户归属关系",
"primary": ["id"],
"catelog": "relation"
}
],
"fields": [
{
"name": "id",
"title": "id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "customerid",
"title": "客户用户id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "resellerid",
"title": "归属商户机构id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "sale_id",
"title": "归属销售用户id",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "promo_code_id",
"title": "促销码id(可空=手动分配)",
"type": "str",
"length": 32
},
{
"name": "bind_type",
"title": "绑定方式(1=促销码 2=手动分配)",
"type": "char",
"length": 1,
"default": "1",
"nullable": "no"
},
{
"name": "created_at",
"title": "绑定时间",
"type": "timestamp",
"default": "CURRENT_TIMESTAMP",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_dcb_customer",
"idxtype": "unique",
"idxfields": ["customerid"]
},
{
"name": "idx_dcb_reseller",
"idxtype": "index",
"idxfields": ["resellerid"]
},
{
"name": "idx_dcb_sale",
"idxtype": "index",
"idxfields": ["sale_id"]
},
{
"name": "idx_dcb_promo",
"idxtype": "index",
"idxfields": ["promo_code_id"]
}
],
"codes": [
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "bind_type",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='bind_type'"
}
]
}