manicanldes-backend/src/common/errors/checkout-errors.ts

51 lines
1.3 KiB
TypeScript

export const CHECKOUT_ERRORS = {
CART_EMPTY: [
409,
'Add items before checkout',
'Empty cart checkout rejected',
],
CART_CHANGED: [
409,
'Cart version has changed',
'Stale cart command rejected',
],
CART_LIMIT: [409, 'Cart line limit reached', 'Cart resource quota exceeded'],
CART_ITEM_UNAVAILABLE: [
409,
'Cart item is no longer available',
'Non-sellable cart variant rejected',
],
CART_CURRENCY: [
409,
'Cart items must use one currency',
'Mixed currency cart rejected',
],
COUPON_NOT_FOUND: [404, 'Coupon not found', 'Scoped coupon lookup failed'],
COUPON_INELIGIBLE: [
409,
'Coupon is not eligible for this checkout',
'Coupon eligibility rule rejected checkout',
],
ORDER_NOT_FOUND: [404, 'Order not found', 'Scoped order lookup failed'],
ORDER_LIMIT: [
409,
'Too many active orders',
'Account active order quota exceeded',
],
ORDER_RESERVATION_MANAGED: [
409,
'Manage this reservation through its order',
'Standalone order reservation mutation rejected',
],
STOCK_ALLOCATION_LIMIT: [
409,
'Too many stock locations for one checkout',
'Checkout stock allocation bound exceeded',
],
MONEY_RANGE: [
409,
'Order amount exceeds the supported limit',
'Checkout arithmetic bound exceeded',
],
} as const;