Commit Graph

18 Commits

Author SHA1 Message Date
shanshanzhong147 fedad36089 修复(#131): 退款幂等校验 + 已退款订单防重新激活
P01:在 RefundOrder 事务内、lockCommissionSource 之前,先扫描 system_logs
是否已存在该 order_no 的 333 (CommissionTypeRefund) 日志。命中即返回
OrderAlreadyRefunded,不写日志、不动 commission、不动 order.status,
堵住「同一订单被运营人重复退款 → 邀请人佣金被多次扣减」的写入路径。

P02:guard「已退款订单(status=6 + 333 日志)被重新激活」入口。
OrderStatusClaimed(6) 与 orderStatusRefunded(6) 共用同一枚举值,
stuckOrderRecovery 把 10 分钟前的 status=6 当成「卡住的 claim」重置回 5
并重新入队 activate,进而让管理员可二次触发退款。新增 logmodel
HasRefundCommissionLog helper:
- queue/logic/order/stuckOrderRecoveryLogic: 跳过已有 333 日志的订单。
- queue/logic/order/activateOrderLogic.releaseClaim: 同一守卫(防御性)。

新增 internal/model/log/refund.go + 单元测试覆盖 6 个分支(命中、未命中、
子串误判、非法 JSON、空 order_no、DB 错误)。
新增 refundOrderLogic_test.go 覆盖:333 日志已存在 → 直接 rollback、
status==6 短路、status 非 2/5 短路;用 sqlmock 严格断言不再触发 commission
锁/更新/插入。

不做范围:
- 不动 activateOrderLogic.calculateCommission(D03.3 单独立项)。
- 不动 OrderStatusClaimed(6) 与 OrderStatusRefunded 枚举值。
- 不动用户 34456 余额数据(D02 待架构师另行决策)。

Co-authored-by: multica-agent <github@multica.ai>
2026-05-31 20:10:39 -07:00
shanshanzhong147 f9fa4756e9 新功能(#41): 提现优化 — 收款方式选择 + 取消提现 + 收款码上传
Build docker and publish / build (20.15.1) (push) Failing after 8m37s
Co-authored-by: multica-agent <github@multica.ai>
2026-05-26 08:36:25 -07:00
shanshanzhong147 eba256bdc9 merge: sync internal with main
Build docker and publish / build (20.15.1) (push) Failing after 8m22s
Co-authored-by: multica-agent <github@multica.ai>
2026-05-25 10:32:06 -07:00
shanshanzhong147 1726a584fa feat: add admin order refund flow
Co-authored-by: multica-agent <github@multica.ai>
2026-05-24 17:50:23 -07:00
shanshanzhong147 fd522b6c71 path
Build docker and publish / build (20.15.1) (push) Successful in 8m56s
2026-05-19 19:35:44 -07:00
EUForest 76ff9a658d Merge branch perfect-panel/master/server into develop 2025-12-11 23:53:32 +08:00
Chang lue Tsen 3f5aac239b feat(quota): enhance quota task management with new request structures and processing logic 2025-09-10 14:53:48 -04:00
Chang lue Tsen 0199dc7fa2 feat(log): add logging for balance, gift amount, and commission adjustments 2025-09-05 11:00:19 -04:00
Chang lue Tsen 1d878592ed fix(log): rename OrderId to OrderNo for consistency in balance logging 2025-09-05 10:25:19 -04:00
Chang lue Tsen 2f4cc46a38 fix(log): correct comment for CommissionTypeRefund to improve clarity 2025-09-05 09:51:28 -04:00
Chang lue Tsen 107fe82f10 fix(model): correct filter condition to use 'date' instead of 'data' 2025-09-03 06:49:55 -04:00
Chang lue Tsen 4184a32c0f feat(api): update server total data response to use 'OnlineUsers' and implement daily traffic statistics logging 2025-09-01 05:30:05 -04:00
Chang lue Tsen 82fd674ae4 feat(api): standardize timestamp field across log structures 2025-08-26 14:39:54 -04:00
Chang lue Tsen 9b3cdbbb4f feat(api): add traffic log details filtering and enhance traffic log structures 2025-08-26 02:29:25 -04:00
Chang lue Tsen ad4f3df74e feat(server): implement server management handlers and database schema 2025-08-25 14:06:37 -04:00
Chang lue Tsen d33f4cd1ce feat(traffic): add traffic statistics logging and scheduling 2025-08-21 14:11:03 -04:00
Chang lue Tsen 87c771bbd4 refactor(log): consolidate logging models and update related logic for improved clarity and functionality 2025-08-20 13:36:06 -04:00
Chang lue Tsen 8addcc584b init: 1.0.0 2025-04-25 12:08:29 +09:00