Commit Graph

19 Commits

Author SHA1 Message Date
irving
56239450d4 Add earnings adjustments, withdrawal reject, and auth guard 2026-01-12 12:46:42 -05:00
irving
17a8c358a8 feat(pk): implement PK (Player-Killer) system with lifecycle management
- Add PK entity fields: winner, scores, and setting_id
- Implement force start/end API endpoints for clerk PK
- Add PK lifecycle service with auto-start/end scheduling
- Add Redis-based PK state management
- Implement PK detail service with live/history/upcoming queries
- Add WeChat PK controller with history and live PK endpoints
- Add comprehensive PK integration tests
- Create PK setting management with tenant-specific configs
- Add database migrations for PK scores, winner, settings, and menu
- Add PK-related DTOs and enums (status, menu paths)
- Add TenantScope utility for tenant context management
2026-01-02 01:34:03 -05:00
irving
a7e567e9b4 working but not tested 2026-01-01 00:41:55 -05:00
irving
911a974e51 feat: implement order relation type tracking
- Add OrderRelationType enum (UNASSIGNED, LEGACY, FIRST, CONTINUED, NEUTRAL)
- Create play_clerk_customer_relation table to track first-completed history
- Add order_relation_type column to play_order_info
- Migrate existing orders to set relation types based on completion history
- Update order services to determine relation type on creation
- Update order VOs and controllers to expose relation type in API responses
- Update clerk performance calculations to account for relation types
- Update revenue calculations to distinguish between first and continued orders
- Add comprehensive API and unit tests for order relation functionality
2025-12-31 22:06:05 -05:00
irving
8558d203af wip: media migration progress 2025-11-16 11:33:58 -05:00
irving
29ff0a2637 feat: add flyway cli wrapper and staging restore 2025-11-07 22:38:47 -05:00
irving
cc59f859af update db to use unicode8
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
2025-11-06 23:54:10 -05:00
irving
d6402d60b2 chore: update V14 migration and add application-local-staging.yml
Some checks failed
Build and Push Backend / docker (push) Failing after 5s
- Updated play-admin migration: V14__add_clerk_level_order_number.sql
- Added play-admin/src/main/resources/application-local-staging.yml
2025-11-05 23:12:58 -05:00
irving
0b7e86cfa3 chore: commit all changes (2025-11-04) 2025-11-04 22:00:31 -05:00
irving
a8cdb27e8e 新增店员等级排序功能
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
- 添加数据库迁移脚本,为 play_clerk_level_info 表新增 order_number 字段
- 更新测试数据种子,设置默认等级的排序号
- 新增店员用户API测试,验证按等级排序号和在线状态的排序逻辑
2025-11-04 21:20:42 -05:00
irving
422e781c60 feat: 实现盲盒功能模块
新增功能:
- 盲盒配置管理:支持盲盒的创建、编辑、上下架
- 盲盒奖池管理:支持奖池配置、Excel导入、权重抽奖、库存管理
- 盲盒购买流程:客户购买盲盒并抽取奖励
- 奖励兑现流程:客户可将盲盒奖励兑现为实际礼物订单
- 店员提成:奖励兑现时自动增加店员礼物提成

核心实现:
- BlindBoxService: 抽奖核心逻辑,支持权重算法和库存扣减
- BlindBoxDispatchService: 奖励兑现订单创建
- BlindBoxInventoryService: 奖池库存管理
- BlindBoxPoolAdminService: 奖池配置管理,支持批量导入

API接口:
- /play/blind-box/config: 盲盒配置CRUD
- /play/blind-box/pool: 奖池配置管理和导入
- /wx/blind-box: 客户端盲盒购买和奖励查询

数据库变更:
- blind_box_config: 盲盒配置表
- blind_box_pool: 盲盒奖池表
- blind_box_reward: 盲盒奖励记录表
- play_order_info: 新增 payment_source 和 source_reward_id 字段

其他改进:
- 订单模块支持盲盒支付来源,区分余额扣款和奖励抵扣
- 优惠券校验:盲盒相关订单不支持使用优惠券
- 完善单元测试覆盖
2025-10-31 02:46:51 -04:00
irving
7db9318a7b feat: 完善订单生命周期幂等与日志追踪 2025-10-28 23:24:33 -04:00
irving
0356834b88 feat(gift): 修复赠礼事务并补充租户隔离
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
2025-10-26 01:30:02 -04:00
irving
0725c94bbe 修复:防止提现创建中的竞态条件和重复收益
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
- 在 earnings_line 表添加唯一约束 (tenant_id, order_id, clerk_id, earning_type, deleted)
- 重排提现创建流程:先预留收益行,成功后才创建提现请求
- 在收益行预留时添加状态验证,检测并发修改
- 使用临时提现ID进行预留,创建请求后替换为真实ID
- 添加唯一约束前先清理重复的收益记录(V10 迁移)

此修复解决了关键的竞态条件问题:并发提现可能创建没有资金支持的孤儿请求记录。
修复后确保快速失败行为 - 如果收益行已被占用,提现请求永远不会被创建。
2025-10-13 22:45:53 -04:00
irving
5438a8e1f0 功能:新增收款码档案和收益补算功能
- 新增店员收款码档案管理(上传二维码和确认收款码)
- 提现请求新增收款码快照用于审计追踪
- 新增收益补算服务用于历史订单数据补录
- 新增收益补算日志表用于审计追踪
- 优化收益创建逻辑,根据解冻时间设置正确的初始状态
- 更新提现流程,要求店员确认收款码后才能提现
- 新增数据库迁移脚本 V7-V9
2025-10-13 22:13:51 -04:00
irving
8faa23e9c3 refactor(salary): completely refactor the salary logi
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
fix: ignore empty clerk performance filters

fix: generate earnings for completed orders

fix: ensure reward orders create earnings

fix: add reward earnings to new order flow
2025-10-11 13:28:30 -04:00
irving
e6106ecb88 feat(coupon): add enum ClaimConditionType and whitelist support\n\n- Add CouponClaimConditionType enum (ALL/FILTER/WHITELIST)\n- Schema: add custom_whitelist JSON column (Flyway V2)\n- Entity/VO: add customWhitelist; claimConditionType now 0/1/2\n- Service: enforce whitelist when claimConditionType=2\n- Controller: validate whitelist when creating coupon\n- Fix imports per formatting 2025-10-06 23:52:20 -04:00
huchuansai
725d14c125 feat: 店铺装修 2025-06-11 16:09:23 +08:00
Irving
9d8293f327 feat: introduce flyway 2025-04-26 21:16:31 -04:00