Files
junhong_cmp_fiber/openspec/changes/fix-package-usage-paid-amount-cost-snapshot/tasks.md
break cbadf77517
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m28s
修复价格不一致的问题
2026-08-13 17:43:14 +08:00

1.2 KiB
Raw Blame History

1. 修正套餐使用记录成本价快照来源

  • 1.1 internal/service/order/service.goactivateMainPackagePaidAmount: order.ActualPaidAmount 改为 PaidAmount: &order.SellerCostPrice
  • 1.2 internal/service/order/service.goactivateAddonPackagePaidAmount: order.ActualPaidAmount 改为 PaidAmount: &order.SellerCostPrice
  • 1.3 internal/task/auto_purchase.go 中自动购包主套餐的 PaidAmount: order.ActualPaidAmount 改为 PaidAmount: &order.SellerCostPrice
  • 1.4 internal/task/auto_purchase.go 中自动购包加油包的 PaidAmount: order.ActualPaidAmount 改为 PaidAmount: &order.SellerCostPrice

2. 同步字段注释

  • 2.1 internal/model/package.goPackageUsage.PaidAmount 的 gorm 注释由「从订单 actual_paid_amount 复制」改为「购买成本价快照(分,从订单 seller_cost_price 复制,无订单或线下支付时为 null

3. 验证

  • 3.1 gofmt -w 修改过的 Go 文件
  • 3.2 go build ./cmd/api ./cmd/worker 通过
  • 3.3 openspec validate --all 通过
  • 3.4 人工验证:个人客户为设备购买套餐后,平台账号查询资产套餐列表时 paid_amount 等于店铺成本价、retail_amount 等于零售价