Commit 42241b14 by mercymodest

feat: add user_card_reservation_config table for membership card reservation limits

parent a717a4f6
# 新增 会员卡审核人管理菜单
# 新增 会员卡审核人管理菜单
......@@ -62,3 +62,29 @@ CREATE TABLE user_approval_template_store (
CREATE INDEX idx_template_name
ON user_approval_template (template_name(191));
-- 会员卡预约次数配置表(下月生效功能)
-- 创建时间: 2024-12-01
-- 需求: 会员卡预约次数配置下月生效
CREATE TABLE `user_card_reservation_config` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`user_card_uuid` bigint(20) NOT NULL COMMENT '会员卡UUID',
`company_uuid` bigint(20) NOT NULL COMMENT '公司UUID',
`store_uuid` bigint(20) DEFAULT NULL COMMENT '门店UUID',
`term_card_reservation_limit` int(11) NOT NULL COMMENT '期限卡每月可约次数上限取值',
`term_card_reservation_limit_type` tinyint(1) NOT NULL COMMENT '期限卡每月可预约次数上限类型 0:自然月限制(每月的1号到月底) 1:开卡日期限制(开卡日期的当月到下月的开卡日期)',
`effective_date` date NOT NULL COMMENT '生效日期(格式:2025-01-01)',
`effective_month` varchar(7) NOT NULL COMMENT '生效月份(格式:2025-01),用于唯一索引去重',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态: 0-待生效, 1-已生效, 2-已作废',
`create_uuid` bigint(20) DEFAULT NULL COMMENT '创建人UUID',
`create_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_user_card_month` (`user_card_uuid`, `effective_month`) COMMENT '同一会员卡在同一月份只有一条待生效配置',
KEY `idx_user_card_uuid` (`user_card_uuid`) COMMENT '会员卡UUID索引',
KEY `idx_effective_date` (`effective_date`) COMMENT '生效日期索引',
KEY `idx_status` (`status`) COMMENT '状态索引'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员卡预约次数配置表(下月生效)';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment