feat: order action per status change
This commit is contained in:
@@ -71,6 +71,8 @@ var (
|
||||
// Typed errors for orders handler
|
||||
ErrEmptyCart = errors.New("the cart is empty")
|
||||
ErrUserHasNoSuchOrder = errors.New("user does not have order with given id")
|
||||
ErrInvalidStatus = errors.New("invalid order status")
|
||||
ErrOrderNotFound = errors.New("order not found")
|
||||
|
||||
// Typed errors for price reduction handler
|
||||
ErrInvalidReductionType = errors.New("invalid reduction type: must be 'amount' or 'percentage'")
|
||||
@@ -314,7 +316,8 @@ func GetErrorStatus(err error) int {
|
||||
errors.Is(err, ErrMaxAmtOfAddressesReached),
|
||||
errors.Is(err, ErrUserHasNoSuchAddress),
|
||||
errors.Is(err, ErrInvalidCountryID),
|
||||
errors.Is(err, ErrInvalidAddressJSON):
|
||||
errors.Is(err, ErrInvalidAddressJSON),
|
||||
errors.Is(err, ErrInvalidStatus):
|
||||
return fiber.StatusBadRequest
|
||||
case errors.Is(err, ErrSpecificPriceNotFound):
|
||||
return fiber.StatusNotFound
|
||||
|
||||
Reference in New Issue
Block a user