解耦订单和申诉模块外部依赖
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user