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:
@@ -1,12 +1,12 @@
|
||||
// silence-backfill 是沉默期与出库时间历史回填工具(add-package-silence-period,技术方案 §6、§17.4)。
|
||||
// silence-backfill 是沉默期与首次购买套餐时间历史回填工具(add-package-silence-period,技术方案 §6、§17.4)。
|
||||
//
|
||||
// 用法(数据库连接只读取显式传入的 DB_* 环境变量):
|
||||
//
|
||||
// DB_HOST=... DB_PORT=... DB_USER=... DB_PASSWORD=... DB_NAME=... DB_SSLMODE=disable \
|
||||
// go run ./cmd/silence-backfill -target silence # 只输出影响清单(默认 dry-run)
|
||||
// go run ./cmd/silence-backfill -target silence -execute # 业务确认清单后执行
|
||||
// go run ./cmd/silence-backfill -target outbound # 出库时间:只输出可回填数与无订单数
|
||||
// go run ./cmd/silence-backfill -target outbound -execute
|
||||
// go run ./cmd/silence-backfill -target first_purchase # 首次购买套餐时间:只输出可回填数与无订单数
|
||||
// go run ./cmd/silence-backfill -target first_purchase -execute
|
||||
//
|
||||
// 两种回填都只处理为空的记录、分批执行、可重复执行;可在沉默期总开关关闭时运行。
|
||||
package main
|
||||
@@ -31,11 +31,11 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
target := flag.String("target", "", "回填对象:silence(套餐沉默期)/ outbound(资产出库时间)")
|
||||
target := flag.String("target", "", "回填对象:silence(套餐沉默期)/ first_purchase(资产首次购买套餐时间)")
|
||||
execute := flag.Bool("execute", false, "执行写入;不传时只输出影响清单")
|
||||
flag.Parse()
|
||||
if *target != "silence" && *target != "outbound" {
|
||||
fail("必须指定 -target silence 或 -target outbound")
|
||||
if *target != "silence" && *target != "first_purchase" {
|
||||
fail("必须指定 -target silence 或 -target first_purchase")
|
||||
}
|
||||
db, err := openDB()
|
||||
if err != nil {
|
||||
@@ -61,12 +61,12 @@ func main() {
|
||||
}
|
||||
printSilence(silence)
|
||||
report = silence
|
||||
case "outbound":
|
||||
outbound, err := backfill.OutboundBackfill(ctx, *execute)
|
||||
case "first_purchase":
|
||||
firstPurchase, err := backfill.FirstPurchaseBackfill(ctx, *execute)
|
||||
if err != nil {
|
||||
fail(err.Error())
|
||||
}
|
||||
report = outbound
|
||||
report = firstPurchase
|
||||
}
|
||||
encoded, _ := json.MarshalIndent(report, "", " ")
|
||||
fmt.Println(string(encoded))
|
||||
|
||||
Reference in New Issue
Block a user