修复驳回退款恢复订单时交接进度被重置的问题
- 取消订单时从待交接状态取消不再覆盖 handoff_status,保留原有交接进度 - 驳回恢复时仅在 cancelled 或 renter_confirm_timeout 时重置为 pending_owner
This commit is contained in:
@@ -245,7 +245,6 @@ func (r *Repository) Cancel(ctx context.Context, userID uint64, orderID uint64)
|
||||
beforeStatus := order.Status
|
||||
now := time.Now()
|
||||
order.Status = orderStatusCancelled
|
||||
order.HandoffStatus = handoffStatusCancelled
|
||||
order.SettledAt = &now
|
||||
orderID := order.ID
|
||||
if beforeStatus == orderStatusPendingHandoff {
|
||||
@@ -253,6 +252,8 @@ func (r *Repository) Cancel(ctx context.Context, userID uint64, orderID uint64)
|
||||
order.RefundStatus = refundStatusPendingReview
|
||||
order.RefundAmountCent = totalCent
|
||||
order.RefundedAt = nil
|
||||
} else {
|
||||
order.HandoffStatus = handoffStatusCancelled
|
||||
}
|
||||
if err := notification.Append(tx,
|
||||
notification.Entry{
|
||||
|
||||
Reference in New Issue
Block a user