refactor(database): 仓储边界 - 标注通用写入口与计费状态约束
This commit is contained in:
1 parent
e20df8e29b
commit
7acaa71d28
2 files changed
+4
No files matched your search
@@ -438,6 +438,7 @@ func (r *Repository) MarkBillingRunning(id string) error {
|
||||
}
|
||||
|
||||
func (r *Repository) MarkBillingUncertain(id string, errorText string) error {
|
||||
// uncertain 保留冻结积分,直到人工核对;这里故意不自动结算或退款。
|
||||
return r.db.Model(&model.BillingOrder{}).
|
||||
Where("id = ? AND status IN ?", id, []model.BillingStatus{model.BillingStatusReserved, model.BillingStatusRunning}).
|
||||
Updates(map[string]any{"status": model.BillingStatusUncertain, "error": errorText, "updated_at": time.Now()}).Error
|
||||
|
||||
Reference in new issue
Block a user