Commit Graph

654 Commits

Author SHA1 Message Date
shanshanzhong147 30221232c9 fix: 修复订单状态机 claim 机制的三个 Bug 并增加 stuck 订单恢复
- 将 OrderStatusClaimed 从 4 改为 6,消除与 OrderStatusFailed 的值冲突
- finalizeCouponAndOrder 改用直接 DB 更新(WHERE status=6→SET status=5),
  绕过 UpdateOrderStatus 的 status<target 守卫,同时用 model.Update 刷新缓存
- releaseClaim 返回 error,调用处检查并记录日志;releaseClaim 失败由 stuck
  recovery 定时任务兜底
- claimAndGetOrder 对 status=claimed 返回可重试错误而非静默跳过;
  ProcessTask 区分 "stuck in claimed" 与 "非 paid 跳过" 两种场景
- 新增 StuckOrderRecoveryLogic:每 10 分钟扫描超时 claimed 订单,
  重置 status=paid 并重新入队 ForthwithActivateOrder,确保不依赖
  asynq 原始重试(可能已超 maxRetry)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-05-25 02:18:19 -07:00
shanshanzhong147 80751eb8ef fix: move withdrawal commission deduction from application to approval
Build docker and publish / build (20.15.1) (push) Failing after 8m28s
- commissionWithdrawLogic: remove upfront commission deduction;
  balance check now includes sum of all pending withdrawals to prevent
  double-spending; transaction only creates the withdrawal record (status=0)
- approveWithdrawal: add FOR UPDATE lock on user row, balance check before
  deducting, atomic commission decrement and commission log inside one
  transaction; clear user cache after commit
- rejectWithdrawal: remove commission refund and log — commission was never
  deducted on application under the new flow
- add migration 02150: refund commission for existing status=0 withdrawals
  that were deducted under the old logic; includes rollback script

Co-authored-by: multica-agent <github@multica.ai>
2026-05-24 20:26:42 -07:00
shanshanzhong147 3bbce5ce84 fix: 修复退款与仪表盘订单统计口径
Build docker and publish / build (20.15.1) (push) Failing after 8m16s
Co-authored-by: multica-agent <github@multica.ai>
2026-05-24 17:50:29 -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 f2033fd4b9 feat: add rustfs direct upload endpoint
Build docker and publish / build (20.15.1) (push) Failing after 8m36s
2026-05-14 23:33:50 -07:00
shanshanzhong147 3284cb45f0 ci: trigger internal branch workflow
Build docker and publish / build (20.15.1) (push) Failing after 8m36s
2026-05-14 05:58:05 -07:00
shanshanzhong147 6041bc3419 x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-14 05:50:44 -07:00
shanshanzhong147 4581a6fc17 ci: use ssh key for main deploy
Build docker and publish / build (20.15.1) (push) Failing after 8m20s
2026-05-13 11:43:01 -07:00
shanshanzhong147 2bdce44e12 merge: add direct s3 upload flow
Build docker and publish / build (20.15.1) (push) Failing after 8m49s
2026-05-13 11:24:31 -07:00
shanshanzhong147 4fa9fcd232 feat: add direct s3 upload flow 2026-05-13 11:24:13 -07:00
shanshanzhong147 f6911965dc chore: snapshot current aws standby and backup tooling work 2026-05-13 10:59:03 -07:00
shanshanzhong147 c4b2ebf7e1 x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-10 10:41:50 -07:00
shanshanzhong147 f946504cb8 x 2026-05-08 06:19:59 -07:00
shanshanzhong147 7d2f98b7c9 fix: 修复管理员更新用户信息时意外覆盖字段的问题
Build docker and publish / build (20.15.1) (push) Has been cancelled
- Enable/IsAdmin/OnlyFirstPurchase 改为 *bool,未传时不更新
- Avatar/Remark/ReferCode/ReferralPercentage 加空值保护
- getDeviceList: 恢复 hifastday@hifast.com 家庭成员受限逻辑

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 02:21:35 -07:00
shanshanzhong147 8bc8e81e95 补单逻辑
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 05:42:48 -07:00
shanshanzhong147 54daa923da 补单逻辑
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 04:59:04 -07:00
shanshanzhong147 463d3e2315 x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 03:19:04 -07:00
shanshanzhong147 559d59b4f8 000000
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 03:09:15 -07:00
shanshanzhong147 d4f0d559cf 设备1
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 02:53:18 -07:00
shanshanzhong147 cbb451d18c x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 02:34:43 -07:00
shanshanzhong147 595e4c62f9 x
Build docker and publish / build (20.15.1) (push) Successful in 5m25s
2026-05-03 18:34:14 -07:00
shanshanzhong147 9dd5dcb9d2 fix(order): mark first renewal payments as new
Build docker and publish / build (20.15.1) (push) Failing after 5m32s
2026-05-02 16:48:45 -07:00
shanshanzhong147 110c97ada4 feat(auth): add test bypass code 202511 for bind_email_with_verification
Build docker and publish / build (20.15.1) (push) Failing after 5m30s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 08:00:39 -07:00
shanshanzhong147 d748a7e75d fix(user): move bind-email subscriptions to owner
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-01 05:24:11 -07:00
shanshanzhong147 cf70838142 fix(order): restore expired subscribe for invite gifts
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-30 13:16:45 -07:00
shanshanzhong147 280437be91 fix(order): guard renewal activation owner
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-30 12:54:02 -07:00
shanshanzhong147 59b7056a20 fix family member renewal target
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-30 09:26:52 -07:00
shanshanzhong147 769622f087 x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-29 23:30:38 -07:00
shanshanzhong147 91935e3109 Revert "test(auth): add HTTP device no-trial check"
Build docker and publish / build (20.15.1) (push) Has been cancelled
This reverts commit 3b3ed7b3c1.
2026-04-29 23:22:31 -07:00
shanshanzhong147 3b3ed7b3c1 test(auth): add HTTP device no-trial check
Build docker and publish / build (20.15.1) (push) Successful in 5m10s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-29 23:00:18 -07:00
shanshanzhong147 b52e01eaa2 fix(auth): grant trial only on email bind
Build docker and publish / build (20.15.1) (push) Successful in 5m17s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-29 22:36:17 -07:00
shanshanzhong147 32e3dc3c73 fix(order): cover invite gifts and inactive renewals
Build docker and publish / build (20.15.1) (push) Successful in 5m36s
2026-04-29 21:52:28 -07:00
shanshanzhong147 6b64e8c461 test(auth): add device trial registration script
Build docker and publish / build (20.15.1) (push) Successful in 5m6s
2026-04-29 21:05:52 -07:00
shanshanzhong147 47696b9e68 fix(order): reconcile subscriptions and grant device trials
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-29 21:00:46 -07:00
shanshanzhong147 79427c9f4c 0430
Build docker and publish / build (20.15.1) (push) Successful in 5m47s
2026-04-29 12:49:45 -07:00
shanshanzhong147 bcefb274ab perf(server): cache speed limit calculations
Build docker and publish / build (20.15.1) (push) Successful in 5m37s
2026-04-29 01:37:59 -07:00
shanshanzhong147 3ae85f68ea 0428
Build docker and publish / build (20.15.1) (push) Successful in 5m25s
2026-04-28 17:44:28 -07:00
shanshanzhong147 ac57272018 x
Build docker and publish / build (20.15.1) (push) Successful in 6m26s
2026-04-28 06:19:10 -07:00
shanshanzhong147 68c7b0a8ec chore(deploy): add replication deployment assets
Build docker and publish / build (20.15.1) (push) Successful in 5m52s
2026-04-28 05:22:48 -07:00
shanshanzhong147 0ec0e2b9d2 fix(order): align invite gift ownership
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-28 05:19:57 -07:00
shanshanzhong147 ab38cd4943 x
Build docker and publish / build (20.15.1) (push) Failing after 4m44s
2026-04-26 21:12:22 -07:00
shanshanzhong147 5b49aa8242 fix(auth): disable trial grants on public email flows
Build docker and publish / build (20.15.1) (push) Successful in 5m29s
2026-04-25 01:11:27 -07:00
shanshanzhong147 9db4762904 fix(order): prevent duplicate subscriptions and repair invite gifts
Build docker and publish / build (20.15.1) (push) Successful in 5m6s
2026-04-24 21:16:21 -07:00
shanshanzhong147 ae62ecc6b3 fix: 加入家庭组时无条件丢弃成员订阅,防止重复订阅
Build docker and publish / build (20.15.1) (push) Failing after 5m17s
加入家庭组前若成员已购买订阅,原逻辑将订阅转移给 owner,
导致 owner 同时持有自身订阅与成员转入订阅,违反单订阅模式。

修改 transferMemberSubscribesToOwner:
- 移除转移逻辑,改为无条件删除成员所有订阅
- 成员加入后通过 owner 的订阅使用服务
- 后续购买以 entitlement.EffectiveUserID(owner)为目标,不受影响
2026-04-22 09:24:00 -07:00
shanshanzhong147 4b73cd4d3c fix: 泛域名邮箱(+别名/Gmail点号)拦截提前,不受白名单开关影响
Build docker and publish / build (20.15.1) (push) Successful in 5m38s
2026-04-21 09:44:00 -07:00
shanshanzhong147 2c9833df58 fix: 有返佣路径首单漏发被邀请用户赠天
Build docker and publish / build (20.15.1) (push) Successful in 5m37s
邀请人有返佣比例时,handleCommission 走佣金路径,
之前完全未调用 grantGiftDays,导致设备首单付费后
被邀请用户拿不到 N 天赠送。

修复:佣金处理完成后,若 IsNew(首单),
额外给被邀请用户调用 grantGiftDays(邀请人不重复赠天,
已通过佣金受益)。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-21 01:57:22 -07:00
shanshanzhong147 23a7a292ef fix: Gmail 泛域名邮箱(含点号/+别名)直接拒绝赠送试用
Build docker and publish / build (20.15.1) (push) Successful in 5m23s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-21 01:09:34 -07:00
shanshanzhong147 f1bfc78d66 fix: 统一日期统计查询方式,使用 DATE_FORMAT 替代 time.Time 边界
Build docker and publish / build (20.15.1) (push) Successful in 4m58s
QueryDateOrders 和 QueryDateUserCounts 改用 DATE_FORMAT 字符串比较,
与 QueryDailyOrdersList 的 GROUP BY 逻辑一致,避免 go-sql-driver 时区转换导致金额不一致。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-20 22:36:16 -07:00
shanshanzhong147 9912df9ac6 fix: 修复时区问题 - FixedZone 兜底 + Dockerfile 复制完整 zoneinfo
Build docker and publish / build (20.15.1) (push) Successful in 4m56s
1. ppanel.go: LoadLocation 失败时用 FixedZone("CST", +8h) 兜底
2. Dockerfile: 复制完整 /usr/share/zoneinfo 目录,确保 go-sql-driver 也能加载 Asia/Shanghai

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-20 21:53:48 -07:00
shanshanzhong147 bafb13cf06 fix: 修复 scratch 容器中 time.Local 默认 UTC 导致收入统计时间窗口偏移 8 小时
Build docker and publish / build (20.15.1) (push) Has been cancelled
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-20 21:46:55 -07:00