refactor: 出库时间更名为首次购买套餐时间,换货新资产不再按换货完成时间记录
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 38s

- 字段 outbound_at → first_purchase_at,记录表 tb_asset_outbound_record → tb_asset_first_purchase_record,接口 /outbound-records → /first-purchase-records,筛选参数与导出列同步更名
- 换货后的新资产不因换货写入,在当前世代真正支付套餐订单时才记录;记录来源只保留 order / backfill,去掉换货单字段
- 迁移 000266 重命名列、表、索引与约束;同步 Spec、设计、任务与前端接口变更说明

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-10-27 16:47:02 +09:00
parent 909f4d0ec2
commit 62ec94adec
46 changed files with 570 additions and 560 deletions

View File

@@ -218,19 +218,17 @@ func (PackageSilenceExtensionOrder) TableName() string {
return "tb_package_silence_extension_order"
}
// AssetOutboundRecord 资产出库记录:每个世代一条,只新增与填写结束信息。
type AssetOutboundRecord struct {
// AssetFirstPurchaseRecord 资产首次购买套餐记录:每个世代一条,只新增与填写结束信息。
type AssetFirstPurchaseRecord struct {
ID uint `gorm:"column:id;primaryKey" json:"id"`
AssetType string `gorm:"column:asset_type;type:varchar(20);not null" json:"asset_type"`
AssetID uint `gorm:"column:asset_id;not null" json:"asset_id"`
AssetIdentifierSnapshot string `gorm:"column:asset_identifier_snapshot;type:varchar(100);not null;default:''" json:"asset_identifier_snapshot"`
Generation int `gorm:"column:generation;not null" json:"generation"`
OutboundAt time.Time `gorm:"column:outbound_at;not null" json:"outbound_at"`
FirstPurchaseAt time.Time `gorm:"column:first_purchase_at;not null" json:"first_purchase_at"`
Source string `gorm:"column:source;type:varchar(20);not null" json:"source"`
OrderID *uint `gorm:"column:order_id" json:"order_id,omitempty"`
OrderNo string `gorm:"column:order_no;type:varchar(40);not null;default:''" json:"order_no"`
ExchangeOrderID *uint `gorm:"column:exchange_order_id" json:"exchange_order_id,omitempty"`
ExchangeNo string `gorm:"column:exchange_no;type:varchar(64);not null;default:''" json:"exchange_no"`
ShopID *uint `gorm:"column:shop_id" json:"shop_id,omitempty"`
EndedAt *time.Time `gorm:"column:ended_at" json:"ended_at,omitempty"`
EndReason string `gorm:"column:end_reason;type:varchar(40);not null;default:''" json:"end_reason"`
@@ -238,6 +236,6 @@ type AssetOutboundRecord struct {
}
// TableName 指定表名
func (AssetOutboundRecord) TableName() string {
return "tb_asset_outbound_record"
func (AssetFirstPurchaseRecord) TableName() string {
return "tb_asset_first_purchase_record"
}