voucher/models/voucher_usage_log.json
yumoqing 2c56aa904a feat: 代金券模块初始实现
- 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权限配置
- 一次性使用,不找零
2026-05-29 00:28:01 +08:00

36 lines
1.7 KiB
JSON

{
"summary": [
{
"name": "voucher_usage_log",
"title": "代金券使用流水",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"},
{"name": "instance_id", "title": "券实例ID", "type": "str", "length": 32, "nullable": "no"},
{"name": "customer_id", "title": "客户ID", "type": "str", "length": 32, "nullable": "no"},
{"name": "order_id", "title": "订单/消费ID", "type": "str", "length": 64, "nullable": "no"},
{"name": "face_value", "title": "券面值", "type": "double", "length": 10, "dec": 2, "nullable": "no"},
{"name": "deducted_amount", "title": "实际抵扣金额", "type": "double", "length": 10, "dec": 2, "nullable": "no"},
{"name": "used_at", "title": "使用时间", "type": "datetime", "nullable": "no"},
{"name": "used_by", "title": "操作人", "type": "str", "length": 32, "nullable": "yes"},
{"name": "product_type", "title": "产品类型", "type": "str", "length": 32, "nullable": "yes"},
{"name": "product_name", "title": "产品名称", "type": "str", "length": 64, "nullable": "yes"}
],
"indexes": [
{"name": "idx_log_instance", "idxtype": "index", "idxfields": ["instance_id"]},
{"name": "idx_log_customer", "idxtype": "index", "idxfields": ["customer_id"]},
{"name": "idx_log_order", "idxtype": "index", "idxfields": ["order_id"]}
],
"codes": [
{
"field": "instance_id",
"table": "voucher_instance",
"valuefield": "id",
"textfield": "code"
}
]
}