feat: 新增套餐使用记录实付金额快照字段 paid_amount
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m19s

- 新增迁移 000129:tb_package_usage 添加 paid_amount BIGINT 字段,存量数据通过 JOIN tb_order 回填
- PackageUsage Model 新增 PaidAmount *int64 字段
- 4 个写入点(order service 主套餐/加油包、auto_purchase 主套餐/加油包)赋值 order.ActualPaidAmount
- AssetPackageResponse DTO 新增 paid_amount 字段
- GetCurrentPackage / GetPackages 填充 paid_amount,接口直接返回购买价格无需 JOIN 订单表
This commit is contained in:
2026-04-18 10:19:21 +08:00
parent 4b8784d5e7
commit 2b3a9cb33f
15 changed files with 391 additions and 5 deletions

View File

@@ -519,6 +519,7 @@ func (h *AutoPurchaseHandler) activateMainPackage(
DataResetCycle: pkg.DataResetCycle,
PendingRealnameActivation: pendingRealnameActivation,
Generation: order.Generation,
PaidAmount: order.ActualPaidAmount,
}
if carrierType == constants.AssetWalletResourceTypeIotCard {
@@ -592,6 +593,7 @@ func (h *AutoPurchaseHandler) activateAddonPackage(
ExpiresAt: expiresAt,
DataResetCycle: pkg.DataResetCycle,
Generation: order.Generation,
PaidAmount: order.ActualPaidAmount,
}
if carrierType == constants.AssetWalletResourceTypeIotCard {