export const WEBHOOK_DELIVERY_QUEUE = "webhook-delivery";

/** Catálogo de event types emitidos por el gateway. */
export const WEBHOOK_EVENT_TYPES = {
  paymentIntentCreated: "payment_intent.created",
  paymentIntentProcessing: "payment_intent.processing",
  paymentIntentSucceeded: "payment_intent.succeeded",
  paymentIntentFailed: "payment_intent.failed",
  paymentIntentExpired: "payment_intent.expired",
  paymentIntentRefunded: "payment_intent.refunded",
  paymentIntentPartiallyRefunded: "payment_intent.partially_refunded",
  checkoutSessionCompleted: "checkout_session.completed",
  checkoutSessionExpired: "checkout_session.expired",
} as const;

export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[keyof typeof WEBHOOK_EVENT_TYPES];

/** Backoff exponencial en minutos: 1, 5, 30, 120, 360, 720, 1440. */
export const WEBHOOK_RETRY_SCHEDULE_MIN = [1, 5, 30, 120, 360, 720, 1440];

export const WEBHOOK_MAX_ATTEMPTS = WEBHOOK_RETRY_SCHEDULE_MIN.length + 1;
