解耦订单和申诉模块外部依赖

This commit is contained in:
yml2213
2026-06-10 15:41:31 +08:00
parent ca50b103ec
commit 28c4efc669
8 changed files with 112 additions and 85 deletions
@@ -172,14 +172,14 @@ func (r *Repository) AdminRefund(ctx context.Context, orderID uint64) (*RefundSt
if order.RefundStatus == refundStatusRefunded {
return r.buildRefundStatusDTO(&order), nil
}
if r.refundFunc == nil {
if r.refundStarter == nil {
return nil, ErrDependencyUnavailable
}
totalCent := order.RentAmountCent + order.DepositAmountCent
if totalCent <= 0 {
return nil, ErrInvalidCheckoutAmount
}
status, err := r.refundFunc(ctx, orderID, totalCent, refundBizAdmin, "后台人工退款")
status, err := r.refundStarter.StartRefund(ctx, orderID, totalCent, refundBizAdmin, "后台人工退款")
if err != nil {
return nil, err
}