集中订单状态常量
This commit is contained in:
@@ -18,7 +18,7 @@ func (r *Repository) SubmitHandoff(userID uint64, orderID uint64, req SubmitHand
|
||||
if order.OwnerID != userID {
|
||||
return ErrPermissionDenied
|
||||
}
|
||||
if order.Status != "pending_handoff" || order.HandoffStatus != "pending_owner" {
|
||||
if order.Status != orderStatusPendingHandoff || order.HandoffStatus != handoffStatusPendingOwner {
|
||||
return ErrOrderCannotHandoff
|
||||
}
|
||||
record := model.HandoffRecord{
|
||||
@@ -31,7 +31,7 @@ func (r *Repository) SubmitHandoff(userID uint64, orderID uint64, req SubmitHand
|
||||
if err := tx.Create(&record).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
order.HandoffStatus = "pending_renter_confirm"
|
||||
order.HandoffStatus = handoffStatusPendingRenterConfirm
|
||||
orderID := order.ID
|
||||
if err := notification.Append(tx, notification.Entry{
|
||||
UserID: order.RenterID,
|
||||
|
||||
Reference in New Issue
Block a user