## 1. 数据库迁移

- [x] 1.1 新建迁移文件 `migrations/000129_add_paid_amount_to_package_usage.up.sql`：`ALTER TABLE tb_package_usage ADD COLUMN IF NOT EXISTS paid_amount BIGINT`，添加字段注释，执行存量数据回填（`UPDATE ... FROM tb_order WHERE order_id != 0`）
- [x] 1.2 新建迁移文件 `migrations/000129_add_paid_amount_to_package_usage.down.sql`：`ALTER TABLE tb_package_usage DROP COLUMN IF EXISTS paid_amount`
- [x] 1.3 执行迁移并通过 PostgreSQL MCP 验证字段已添加，存量数据已回填

## 2. Model 层

- [x] 2.1 在 `internal/model/package.go` 的 `PackageUsage` 结构体中新增字段 `PaidAmount *int64`，添加 GORM tag `gorm:"column:paid_amount;type:bigint;comment:购买实付金额快照（分，从订单复制，无订单或线下支付时为null）"` 及 JSON tag `json:"paid_amount,omitempty"`

## 3. 套餐激活写入点

- [x] 3.1 `internal/service/order/service.go` `activateMainPackage()`：在初始化 `usage := &model.PackageUsage{...}` 中新增 `PaidAmount: order.ActualPaidAmount`
- [x] 3.2 `internal/service/order/service.go` `activateAddonPackage()`：在初始化 `usage := &model.PackageUsage{...}` 中新增 `PaidAmount: order.ActualPaidAmount`
- [x] 3.3 `internal/task/auto_purchase.go` `activateMainPackage()`（line ~507）：在初始化 `usage := &model.PackageUsage{...}` 中新增 `PaidAmount: order.ActualPaidAmount`
- [x] 3.4 `internal/task/auto_purchase.go` `activateAddonPackage()`（line ~578）：在初始化 `usage := &model.PackageUsage{...}` 中新增 `PaidAmount: order.ActualPaidAmount`

## 4. DTO 层

- [x] 4.1 `internal/model/dto/asset_dto.go` 的 `AssetPackageResponse` 结构体新增字段 `PaidAmount *int64`，添加 JSON tag `json:"paid_amount,omitempty"`，description tag `description:"购买实付金额（分），线下支付或无订单分配时为空"`

## 5. Asset Service 查询填充

- [x] 5.1 `internal/service/asset/service.go` `GetCurrentPackage()` 方法：在构建 `AssetPackageResponse` 时填充 `PaidAmount: usage.PaidAmount`
- [x] 5.2 `internal/service/asset/service.go` `GetPackages()` 方法：在构建每条 `AssetPackageResponse` 时填充 `PaidAmount: usage.PaidAmount`

## 6. 验证

- [x] 6.1 通过 PostgreSQL MCP 验证新套餐记录的 `paid_amount` 字段已正确写入（分别验证钱包支付和线下支付场景）
- [ ] 6.2 调用 `GET /api/admin/assets/{id}/current-package` 验证响应包含 `paid_amount` 字段
- [ ] 6.3 调用 `GET /api/admin/assets/{id}/packages` 验证响应 items 中包含 `paid_amount` 字段
- [x] 6.4 运行 `go build ./...` 确认无编译错误
