refactor: 出库时间更名为首次购买套餐时间,换货新资产不再按换货完成时间记录
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 38s
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:
@@ -275,7 +275,7 @@ func (s *Service) ListStandalone(ctx context.Context, req *dto.ListStandaloneIot
|
||||
if req.IsAuthorizedToEnterprise != nil {
|
||||
filters["is_authorized_to_enterprise"] = *req.IsAuthorizedToEnterprise
|
||||
}
|
||||
if err := applyOutboundFilters(filters, req.OutboundStart, req.OutboundEnd); err != nil {
|
||||
if err := applyFirstPurchaseFilters(filters, req.FirstPurchaseStart, req.FirstPurchaseEnd); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ func (s *Service) toStandaloneResponse(card *model.IotCard, shopMap map[uint]str
|
||||
ID: card.ID,
|
||||
ICCID: card.ICCID,
|
||||
VirtualNo: card.VirtualNo,
|
||||
OutboundAt: card.OutboundAt,
|
||||
FirstPurchaseAt: card.FirstPurchaseAt,
|
||||
CardCategory: card.CardCategory,
|
||||
CarrierID: card.CarrierID,
|
||||
CarrierType: card.CarrierType,
|
||||
@@ -2078,21 +2078,21 @@ func (s *Service) clearRealnameReversalCounter(ctx context.Context, cardID uint)
|
||||
}
|
||||
}
|
||||
|
||||
// applyOutboundFilters 解析出库时间范围筛选(RFC3339)。
|
||||
func applyOutboundFilters(filters map[string]any, start, end string) error {
|
||||
// applyFirstPurchaseFilters 解析首次购买套餐时间范围筛选(RFC3339)。
|
||||
func applyFirstPurchaseFilters(filters map[string]any, start, end string) error {
|
||||
if start != "" {
|
||||
value, err := time.Parse(time.RFC3339, start)
|
||||
if err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "出库时间起格式应为 RFC3339")
|
||||
return errors.New(errors.CodeInvalidParam, "首次购买套餐时间起格式应为 RFC3339")
|
||||
}
|
||||
filters["outbound_start"] = value
|
||||
filters["first_purchase_start"] = value
|
||||
}
|
||||
if end != "" {
|
||||
value, err := time.Parse(time.RFC3339, end)
|
||||
if err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "出库时间止格式应为 RFC3339")
|
||||
return errors.New(errors.CodeInvalidParam, "首次购买套餐时间止格式应为 RFC3339")
|
||||
}
|
||||
filters["outbound_end"] = value
|
||||
filters["first_purchase_end"] = value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user