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

73 lines
1.8 KiB
TypeScript

export const CAMPAIGN_ERRORS = {
CAMPAIGN_COUPON_EXISTS: [
409,
'Campaign already has a coupon',
'Duplicate campaign coupon association',
],
CAMPAIGN_COUPON_WINDOW: [
400,
'Coupon dates must fit inside the campaign window',
'Campaign coupon window mismatch',
],
COUPON_CAMPAIGN_INELIGIBLE: [
409,
'Campaign coupon is not eligible for this cart',
'Campaign coupon scope or lifecycle gate failed',
],
CAMPAIGN_COLLECTION_EMPTY: [
409,
'Collection needs a published product with an active variant',
'Campaign collection publication eligibility failed',
],
CAMPAIGN_EXPIRED: [
409,
'Campaign end time has passed',
'Expired campaign publication rejected',
],
CAMPAIGN_CANCELLATION_CONFLICT: [
409,
'Campaign was cancelled with a different reason',
'Cancellation replay mismatch',
],
CAMPAIGN_NOT_FOUND: [
404,
'Campaign not found',
'Scoped campaign lookup failed',
],
CAMPAIGN_COLLECTION_NOT_FOUND: [
404,
'Collection not found',
'Scoped campaign collection lookup failed',
],
CAMPAIGN_REPLAY_CONFLICT: [
409,
'Idempotency key was used for a different campaign',
'Campaign create replay mismatch',
],
CAMPAIGN_SLUG_EXISTS: [
409,
'Campaign slug already exists',
'Organization campaign slug collision',
],
CAMPAIGN_STATE_CONFLICT: [
409,
'Campaign is not eligible for this action',
'Campaign lifecycle conflict',
],
CAMPAIGN_CHANGED: [
409,
'Campaign changed; fetch its current version',
'Campaign version mismatch',
],
CAMPAIGN_INVALID_WINDOW: [
400,
'End must be after start',
'Campaign time window invalid',
],
CAMPAIGN_VERSION_LIMIT: [
409,
'Campaign version limit reached',
'Campaign integer version capacity reached',
],
} as const;