Constraint: 在线热修前必须保存当前迭代分支全部有效代码进展 Confidence: medium Scope-risk: broad Directive: 后续修改需保持审计事件与业务事务边界一致 Tested: git diff --cached --check Not-tested: 未运行全量测试,提交用于切换分支前保存既有工作
28 lines
701 B
Go
28 lines
701 B
Go
package agentrecharge
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"github.com/break/junhong_cmp_fiber/internal/model"
|
|
)
|
|
|
|
// RechargeAudit 描述代理充值申请或资金终态的实际变化。
|
|
type RechargeAudit struct {
|
|
ActionCode string
|
|
Summary string
|
|
Record *model.AgentRechargeRecord
|
|
Payment *model.Payment
|
|
Approval *model.ApprovalInstance
|
|
Wallet *model.AgentWallet
|
|
Transaction *model.AgentWalletTransaction
|
|
BeforeData map[string]any
|
|
AfterData map[string]any
|
|
}
|
|
|
|
// RechargeAuditWriter 在代理充值业务事务内追加统一 Audit Event。
|
|
type RechargeAuditWriter interface {
|
|
WriteAgentRecharge(ctx context.Context, tx *gorm.DB, change RechargeAudit) error
|
|
}
|