Commit Graph

151 Commits

Author SHA1 Message Date
b44363b335 fix: 修复新建店铺未初始化代理钱包导致充值订单报错
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m6s
新建店铺时在 shop.Service.Create() 中自动初始化主钱包(main)和分佣钱包(commission),修复充值订单创建时「目标店铺主钱包不存在」错误

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-17 14:08:26 +08:00
3e8f613475 fix: 修复 OpenAPI 文档生成器启动 panic,路由缺少 path parameter 定义
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m2s
- 新增 UpdateWechatConfigParams/AgentOfflinePayParams 聚合结构体,嵌入 IDReq 提供 path:id 标签
- 修复 PUT /:id 和 POST /:id/offline-pay 路由的 Input 引用
- 修复 Makefile 构建路径从单文件改为包路径,解决多文件编译问题
- 标记 tasks.md 中 1.2.4 迁移任务为已完成
2026-03-17 09:45:51 +08:00
429edf0d19 refactor: 注册微信配置和代理充值模块到 Bootstrap 和 OpenAPI 文档生成器
- bootstrap/types.go: 新增 WechatConfigStore/WechatConfigService/WechatConfigHandler/AgentRechargeService/AgentRechargeHandler 字段
- bootstrap/stores.go: 初始化 WechatConfigStore
- bootstrap/services.go: 初始化 WechatConfigService(注入 AuditService)和 AgentRechargeService
- bootstrap/handlers.go: 初始化 WechatConfigHandler 和 AgentRechargeHandler;PaymentHandler 新增 agentRechargeService 参数
- bootstrap/worker_services.go: 补充 WechatConfigService 注入
- routes/admin.go: 注册 WechatConfig 和 AgentRecharge 路由组
- openapi/handlers.go: 注册 WechatConfigHandler 和 AgentRechargeHandler 到文档生成器

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:30:30 +08:00
7c64e433e8 feat: 改造支付回调 Handler,支持富友回调和多订单类型按前缀分发
- payment.go: WechatPayCallback 改造为按订单号前缀分发(ORD→套餐订单、CRCH→资产充值、ARCH→代理充值);新增 FuiouPayCallback(GBK→UTF-8+XML解析+验签+分发);修复 RechargeOrderPrefix 废弃引用
- order.go: 注册 POST /api/callback/fuiou-pay 路由(无需认证)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:30:17 +08:00
269769bfe4 refactor: 改造订单和资产充值 Service,支持动态支付配置
- order/service.go: 注入 wechatConfigService,CreateH5Order/CreateAdminOrder 下单时查询 active 配置并记录 payment_config_id;无配置时拒绝第三方支付;WechatPayJSAPI/WechatPayH5/FuiouPayJSAPI/FuiouPayMiniApp 添加 TODO 留桩
- recharge/service.go: Create 方法记录 payment_config_id,HandlePaymentCallback 留桩

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:30:05 +08:00
1980c846f2 feat: 订单/资产充值/代理充值模型新增 PaymentConfigID 字段
- order.go: Order 模型新增 PaymentConfigID *uint(记录下单时使用的支付配置)
- asset_wallet.go: AssetRechargeRecord 新增 PaymentConfigID *uint
- agent_wallet.go: AgentRechargeRecord 新增 PaymentConfigID *uint
配置切换时旧订单仍按 payment_config_id 加载对应配置验签,解决竞态问题

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:29:52 +08:00
89f9875a97 feat: 新增代理预充值模块(DTO、Service、Handler、路由)
- agent_recharge_dto.go: 创建/列表/详情请求响应 DTO
- service.go: 权限验证(代理只能充自己店铺)、金额范围校验、查询 active 配置、创建订单、线下充值确认(乐观锁+审计日志)、回调幂等处理
- agent_recharge.go Handler: Create/List/Get/OfflinePay 共 4 个方法
- agent_recharge.go 路由: 注册到 /api/admin/agent-recharges/*,路由层拦截企业账号

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:29:42 +08:00
30c56e66dd feat: 新增微信参数配置管理 Handler 和路由(仅平台账号可访问)
- wechat_config.go Handler: Create/List/Get/Update/Delete/Activate/Deactivate/GetActive 共 8 个方法
- wechat_config.go 路由: 注册到 /api/admin/wechat-configs/*,路由层限制平台账号权限

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:29:31 +08:00
c86afbfa8f feat: 新增微信参数配置模块(Model、DTO、Store、Service)
- wechat_config.go: WechatConfig GORM 模型,含 ProviderTypeWechat/Fuiou 常量
- wechat_config_dto.go: Create/Update/List 请求 DTO,响应 DTO 含脱敏逻辑
- wechat_config_store.go: CRUD、GetActive、ActivateInTx(事务内唯一激活)、软删除保护查询
- service.go: 业务逻辑,按渠道校验必填字段、Redis 缓存管理(wechat:config:active)、删除保护、审计日志

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 23:29:11 +08:00
7f18765911 fix: IoT 卡列表查询补充 virtual_no 字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m58s
standaloneListColumns 是为性能优化而手写的列选择列表,
virtual_no 字段新增时只加了 model 和 DTO,遗漏了这里,
导致四条列表查询路径均未 SELECT virtual_no,字段始终为空。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:48:45 +08:00
876c92095c fix: 平台账号后台创建钱包订单时,绕过代理套餐分配检查
后台钱包支付下单时,原逻辑根据卡/设备所属代理店铺触发
套餐分配上架校验,导致平台账号无法为属于代理的卡购买
未被该代理分配的套餐(如 0 元赠送套餐)。

修复:在 CreateAdminOrder wallet 分支中,按买家类型区分:
- 代理账号:保留原有校验,确保卡所属代理已分配该套餐
- 平台/超管账号:跳过代理分配检查,仅验证套餐全局状态

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 15:51:01 +08:00
d85d7bffd6 refactor: 更新路由和 OpenAPI 注册以接入 AssetWallet
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:55 +08:00
fe77d9ca72 refactor: 注册 AssetWallet 组件到 Bootstrap
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:49 +08:00
9b83f92fb6 feat: 新增 AssetWallet Handler,实现资产钱包 API 接口
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:42 +08:00
2248558bd3 refactor: 适配 asset_wallet 更名,更新订单、充值和购买验证服务
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:37 +08:00
2aae31ac5f feat: 新增 AssetWallet Service,实现资产钱包业务逻辑
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:29 +08:00
9c768e0719 refactor: 重命名 card_wallet store 为 asset_wallet,新增 transaction store
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:17 +08:00
b6c379265d refactor: 重命名 CardWallet 模型为 AssetWallet,新增 DTO
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 15:43:11 +08:00
0ef136f008 fix: 修复资产套餐列表时间字段返回异常时区偏移问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m54s
待生效套餐的 activated_at/expires_at 在 DB 中存储为零值(0001-01-01),
Go 序列化时因 Asia/Shanghai 历史 LMT(+08:05:36)导致输出异常时区偏移。

- AssetPackageResponse.ActivatedAt/ExpiresAt 改为 *time.Time + omitempty
- 新增 nonZeroTimePtr 辅助函数,零值时间转 nil,避免序列化问题
- 同步修复 GetPackages 和 GetCurrentPackage 两处赋值

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:42:39 +08:00
b1d6355a7d fix: resolve 接口 series_name 永远为空,asset service 注入套餐系列 store
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m58s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 10:59:29 +08:00
907e500ffb 修复列表没有正确返回新增字段问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m58s
2026-03-16 10:51:15 +08:00
275debdd38 fix: IoT 卡列表补充 virtual_no 字段和查询过滤,修正设备/卡导入 API 文档描述
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 10:44:38 +08:00
b9c3875c08 feat: 新增数据库迁移,重命名 device_no 为 virtual_no,新增 iot_card.virtual_no 和 package.virtual_ratio 字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-14 18:27:28 +08:00
b5147d1acb 设备的部分改造
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m34s
2026-03-10 10:34:08 +08:00
86f8d0b644 fix: 适配 Gateway 响应模型变更,更新轮询处理器和 Mock 服务
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m25s
- polling_handler: Status→RealStatus, UsedFlow→Used, parseRealnameStatus 参数改为 bool
- mock_gateway: 同步接口路径和响应结构与上游文档一致
2026-03-07 11:29:40 +08:00
a83dca2eb2 fix: 修复 Gateway 流量卡接口路径、响应模型和时间戳与上游文档不一致
- 时间戳从 UnixMilli (13位) 改为 Unix (10位秒级)
- 实名状态接口路径 /realname-status → /realName
- 实名链接接口路径 /realname-link → /RealNameVerification
- RealnameStatusResp: status string → realStatus bool + iccid
- FlowUsageResp: usedFlow int64 → used float64 + iccid
- RealnameLinkResp: link → url
2026-03-07 11:29:34 +08:00
9417179161 fix: 修复设备限速和切卡接口请求字段解析错误
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m15s
SetSpeedLimit 和 SwitchCard 的 Handler 直接解析 gateway 结构体(驼峰命名),
导致与 OpenAPI 文档(DTO 蛇形命名)不一致,前端按文档调用时参数被静默丢弃。

改为先解析 DTO,再手动映射到 gateway 结构体,使文档与实际行为一致。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 18:16:10 +08:00
b52cb9a078 fix: 修复梯度佣金档位字段缺失,补全授权接口响应字段及强充有效状态
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m27s
- OneTimeCommissionTierDTO 补充 operator 字段映射
- GrantCommissionTierItem 补充 dimension/stat_scope 字段(从全局配置合并)
- 系列授权列表/详情补充强充锁定状态和强充金额的有效值计算
- 同步 OpenSpec 主规范并归档变更文档
2026-03-05 11:23:28 +08:00
c7b8ecfebf refactor: 佣金计算适配梯度阶梯 Operator 比较,套餐服务集成代理强充逻辑
commission_calculation: matchOneTimeCommissionTier() 接收 agentTiers 参数,根据 tier.Operator(>、>=、<、<=,默认 >=)执行对应比较逻辑,支持代理专属梯度阶梯计算。package/service: 套餐购买预检调用更新后的强充层级判断接口。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:37:02 +08:00
2ca33b7172 fix: 强充预检按平台/代理层级判断,代理自设强充在平台未设时生效
checkForceRechargeRequirement() 新增层级逻辑:平台(PackageSeries)的强充配置具有最高优先级;平台未设强充时,读取 order.SellerShopID 对应的 ShopSeriesAllocation 强充配置;两者均未设时返回 need_force_recharge=false(降级处理)。GetPurchaseCheck 复用同一函数,无需额外修改。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:36:49 +08:00
769f6b8709 refactor: 更新路由总线和 OpenAPI 文档注册
admin.go 删除 registerShopSeriesAllocationRoutes、registerShopPackageAllocationRoutes 两处调用,注册 registerShopSeriesGrantRoutes。OpenAPI handlers.go 同步移除旧 Handler 引用,注册 ShopSeriesGrant Handler 供文档生成器使用。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:36:39 +08:00
dd68d0a62b refactor: 更新 Bootstrap 注册,移除旧分配服务,接入系列授权
Types、Services、Handlers 三个文件同步:删除 ShopSeriesAllocation 和 ShopPackageAllocation 的 Handler/Service 字段及初始化逻辑,注册新的 ShopSeriesGrant Handler 和 Service。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:36:30 +08:00
c5018f110f feat: 新增系列授权 Handler 和路由(/shop-series-grants)
Handler 实现 POST /shop-series-grants(创建)、GET /shop-series-grants(列表)、GET /shop-series-grants/:id(详情)、PUT /shop-series-grants/:id(更新佣金和强充配置)、PUT /shop-series-grants/:id/packages(管理授权内套餐)、DELETE /shop-series-grants/:id(删除)六个接口。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:36:20 +08:00
ad3a7a770a feat: 新增系列授权 Service,支持固定/梯度佣金模式和代理自设强充
实现 /shop-series-grants 全套业务逻辑:
- 创建授权(固定/梯度模式):原子性创建 ShopSeriesAllocation + ShopPackageAllocation;校验分配者天花板和阶梯阈值匹配;平台创建无天花板限制
- 强充层级:首次充值类型由平台锁定;累计充值类型平台已设时代理配置被忽略,平台未设时代理可自设
- 查询(列表/详情):聚合套餐列表,梯度模式从 PackageSeries 读取 operator 合并响应
- 更新佣金和强充配置;套餐增删改(事务保证)
- 删除:有下级依赖时禁止删除

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:36:09 +08:00
beed9d25e0 refactor: 删除旧套餐系列分配和套餐分配 Service
业务逻辑已全部迁移至 shop_series_grant/service.go,旧 Service 层完整删除。底层 Store(shop_series_allocation_store、shop_package_allocation_store)保留,仍被佣金计算、订单服务和 Grant Service 使用。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:35:56 +08:00
163d01dae5 refactor: 删除旧套餐系列/套餐分配 Handler 和路由
/shop-series-allocations 和 /shop-package-allocations 接口已被 /shop-series-grants 完全替代,开发阶段干净删除,不保留兼容接口。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:35:46 +08:00
e7d52db270 refactor: 新增系列授权 DTO,删除旧套餐/系列分配 DTO
新增 ShopSeriesGrantDTO(含 packages 列表聚合视图)、CreateShopSeriesGrantRequest(支持固定/梯度模式及强充配置)、UpdateShopSeriesGrantRequest、ManageGrantPackagesRequest 等请求/响应结构。删除已被 Grant 接口取代的 ShopSeriesAllocationDTO 和 ShopPackageAllocationDTO。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:35:38 +08:00
672274f9fd refactor: 更新套餐系列分配和套餐模型,支持梯度佣金和代理强充
ShopSeriesAllocation 新增 commission_tiers_json(梯度模式专属阶梯 JSON)、enable_force_recharge(代理自设强充开关)、force_recharge_amount(强充金额,0 表示使用阈值)字段;移除与 PackageSeries 重复的三个字段。Package 模型补充 PackageSeriesID 字段,用于系列授权套餐归属校验。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-04 11:35:27 +08:00
61155952a7 feat: 新增代理分配套餐上架状态(shelf_status)功能
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m56s
- 新增数据库迁移:为 shop_package_allocation 表添加 shelf_status 字段
- 更新模型/DTO:ShopPackageAllocation 增加 ShelfStatus 字段及相关枚举
- 更新套餐分配 Service:支持上架/下架状态管理逻辑
- 更新套餐 Store/Service:根据 shelf_status 过滤可售套餐
- 更新购买验证 Service:引入上架状态校验逻辑
- 归档 OpenSpec 变更:2026-03-02-agent-allocation-shelf-status
- 同步更新主规范文档:allocation-shelf-status、package-management、purchase-validation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 15:38:54 +08:00
8efe79526a fix: 修复平台自营资源(未分配代理)无法线下下单的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m56s
offline 支付分支新增平台自营子场景判断:
- 资源 shopID 为空时(未分配给任何代理商),使用零售价直接创建订单
- 资源 shopID 不为空时(属于代理商),走原有平台代购逻辑

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 11:44:18 +08:00
c5429e7287 fix: 修复平台/超管用户订单列表查询为空的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m5s
Service 层无条件将空 buyer_type 和 0 buyer_id 写入查询过滤条件,
导致平台/超管用户查询时附加 WHERE buyer_type = '' AND buyer_id = 0,
与任何订单均不匹配,返回空列表。

修复方式:仅当 buyerType 非空且 buyerID 非零时才添加过滤条件,
平台/超管用户不限定买家范围,可查看全部订单。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 10:48:11 +08:00
e661b59bb9 feat: 实现订单超时自动取消功能,支持钱包余额解冻和 Asynq Scheduler 统一调度
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m58s
- 新增 expires_at 字段和复合索引,待支付订单 30 分钟超时自动取消
- 实现 cancelOrder/unfreezeWalletForCancel 钱包余额解冻逻辑
- 创建 Asynq 定时任务(order_expire/alert_check/data_cleanup)
- 将原有 time.Ticker 轮询迁移至 Asynq Scheduler 统一调度
- 同步 delta specs 到 main specs 并归档变更
2026-02-28 17:16:15 +08:00
5bb0ff0ddf fix: 修复代理钱包订单创建逻辑,拆分后台/H5端下单方法并归档变更
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m54s
- 拆分订单创建为 CreateAdminOrder(后台一步支付)和 CreateH5Order(H5 两步支付)
- 新增 CreateAdminOrderRequest DTO,后台仅允许 wallet/offline 支付方式
- 同步 delta specs 到主规格(order-payment 更新 + admin-order-creation 新增)
- 归档 fix-agent-wallet-order-creation 变更
- 新增 implement-order-expiration 变更提案
2026-02-28 16:31:31 +08:00
8ed3d9da93 feat: 实现代理钱包订单创建和订单角色追踪功能
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m0s
新增功能:
- 代理在后台使用 wallet 支付时,订单直接完成(扣款 + 激活套餐)
- 支持代理自购和代理代购场景
- 新增订单角色追踪字段(operator_id、operator_type、actual_paid_amount、purchase_role)
- 订单查询支持 OR 逻辑(buyer_id 或 operator_id)
- 钱包流水记录交易子类型和关联店铺
- 佣金逻辑调整:代理代购不产生佣金

数据库变更:
- 订单表新增 4 个字段和 2 个索引
- 钱包流水表新增 2 个字段
- 包含迁移脚本和回滚脚本

文档:
- 功能总结文档
- 部署指南
- OpenAPI 文档更新
- Specs 同步(新增 agent-order-role-tracking capability)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 14:11:42 +08:00
c5bf85c8de refactor: 移除 IoT 卡未使用的价格字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m2s
- 移除 IotCard 模型的 cost_price 和 distribute_price 字段
- 移除 StandaloneIotCardResponse DTO 中对应的字段
- 添加数据库迁移文件 000066_remove_iot_card_price_fields
- 更新 opencode.json 配置

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-27 15:38:33 +08:00
f5000f2bfc 修复超管无法回收资产的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m0s
2026-02-27 11:03:44 +08:00
4189dbe98f debug: 添加资产回收店铺查询的调试日志
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s
在 RecallCards 方法中添加日志,用于诊断平台账号回收资产失败的问题:
- 记录操作者店铺ID
- 记录请求查询的店铺IDs
- 记录实际查询到的店铺数量和IDs
- 记录直属下级店铺集合

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-27 09:36:48 +08:00
bc60886aea fix: 修复 GetByIDs 缺少数据权限过滤导致平台账号无法回收资产
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m2s
在 ShopStore.GetByIDs 方法中添加 ApplyShopIDFilter,确保:
- 平台用户可以查询所有店铺(用于资产回收)
- 代理用户只能查询自己和下级店铺(保持权限隔离)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-26 18:07:45 +08:00
6ecc0b5adb fix: 修复套餐系列/套餐分配权限过滤问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m19s
代理用户只能看到自己分配出去的记录,而不是被分配的记录。

- 新增 ApplyAllocatorShopFilter 过滤函数
- ShopSeriesAllocationStore: List 和 GetByID 改用 ApplyAllocatorShopFilter
- ShopPackageAllocationStore: List 和 GetByID 改用 ApplyAllocatorShopFilter
- 平台用户和超管不受限制
- 代理用户只能看到 allocator_shop_id = 自己店铺ID 的记录

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-26 17:10:20 +08:00
1d602ad1f9 fix: 修复代理用户能看到全部店铺的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s
在 ShopStore.List 中应用数据权限过滤,新增 ApplyShopIDFilter
函数用于对 Shop 表的 id 字段进行过滤。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 16:55:47 +08:00