feat: 移除“租户管理员为用户充值 / 每租户一套余额”能力:余额统一为全局用户余额

This commit is contained in:
2025-12-23 10:59:59 +08:00
parent dd7bcdfb98
commit a80c9b759b
39 changed files with 566 additions and 1869 deletions

View File

@@ -14,7 +14,7 @@ import (
// - 查询/展示时可以先看 kind再按需解析 data。
// - 兼容历史数据:如果旧数据没有 kind/data则按 legacy 处理data = 原始 JSON
type OrdersSnapshot struct {
// Kind 快照类型:建议与订单类型对齐(例如 content_purchase / topup)。
// Kind 快照类型:建议与订单类型对齐(例如 content_purchase
Kind string `json:"kind"`
// Data 具体快照数据(按 Kind 对应不同结构)。
Data json.RawMessage `json:"data"`
@@ -78,21 +78,3 @@ type OrdersContentPurchaseSnapshot struct {
// PurchasePricingNotes 价格计算补充说明(可选,便于排查争议)。
PurchasePricingNotes string `json:"purchase_pricing_notes,omitempty"`
}
// OrdersTopupSnapshot 为“后台充值订单”的快照(用于审计与追责)。
type OrdersTopupSnapshot struct {
// OperatorUserID 充值操作人用户ID租户管理员
OperatorUserID int64 `json:"operator_user_id"`
// TargetUserID 充值目标用户ID租户成员
TargetUserID int64 `json:"target_user_id"`
// Amount 充值金额(分)。
Amount int64 `json:"amount"`
// Currency 币种:当前固定 CNY金额单位为分
Currency consts.Currency `json:"currency"`
// Reason 充值原因(可选,强烈建议填写用于审计)。
Reason string `json:"reason,omitempty"`
// IdempotencyKey 幂等键(可选)。
IdempotencyKey string `json:"idempotency_key,omitempty"`
// TopupAt 充值时间(逻辑时间)。
TopupAt time.Time `json:"topup_at"`
}