/**
 * Domain-specific error codes for consistent error identification across the platform.
 * Format: DOMAIN_ACTION_REASON
 */
export enum ErrorCode {
  // General
  INTERNAL_ERROR = 'INTERNAL_ERROR',
  VALIDATION_FAILED = 'VALIDATION_FAILED',
  NOT_FOUND = 'NOT_FOUND',
  CONFLICT = 'CONFLICT',
  UNAUTHORIZED = 'UNAUTHORIZED',
  FORBIDDEN = 'FORBIDDEN',
  BAD_REQUEST = 'BAD_REQUEST',
  TOO_MANY_REQUESTS = 'TOO_MANY_REQUESTS',

  // Auth
  AUTH_INVALID_CREDENTIALS = 'AUTH_INVALID_CREDENTIALS',
  AUTH_TOKEN_EXPIRED = 'AUTH_TOKEN_EXPIRED',
  AUTH_TOKEN_INVALID = 'AUTH_TOKEN_INVALID',
  AUTH_INSUFFICIENT_PERMISSIONS = 'AUTH_INSUFFICIENT_PERMISSIONS',

  // User
  USER_NOT_FOUND = 'USER_NOT_FOUND',
  USER_ALREADY_EXISTS = 'USER_ALREADY_EXISTS',
  USER_INVALID_PHONE = 'USER_INVALID_PHONE',

  // Course
  COURSE_NOT_FOUND = 'COURSE_NOT_FOUND',
  COURSE_ALREADY_PUBLISHED = 'COURSE_ALREADY_PUBLISHED',
  COURSE_ENROLLMENT_CLOSED = 'COURSE_ENROLLMENT_CLOSED',

  // Listing
  LISTING_NOT_FOUND = 'LISTING_NOT_FOUND',
  LISTING_INVALID_STATUS_TRANSITION = 'LISTING_INVALID_STATUS_TRANSITION',
  LISTING_ALREADY_ACTIVE = 'LISTING_ALREADY_ACTIVE',
  LISTING_EXPIRED = 'LISTING_EXPIRED',

  // Property
  PROPERTY_NOT_FOUND = 'PROPERTY_NOT_FOUND',

  // Project (residential development)
  PROJECT_NOT_FOUND = 'PROJECT_NOT_FOUND',

  // Media
  MEDIA_UPLOAD_FAILED = 'MEDIA_UPLOAD_FAILED',
  MEDIA_LIMIT_EXCEEDED = 'MEDIA_LIMIT_EXCEEDED',

  // Payment
  PAYMENT_FAILED = 'PAYMENT_FAILED',
  PAYMENT_ALREADY_PROCESSED = 'PAYMENT_ALREADY_PROCESSED',
  PAYMENT_INVALID_AMOUNT = 'PAYMENT_INVALID_AMOUNT',

  // Order
  ORDER_NOT_FOUND = 'ORDER_NOT_FOUND',
  ORDER_INVALID_STATUS_TRANSITION = 'ORDER_INVALID_STATUS_TRANSITION',
  ORDER_ALREADY_EXISTS = 'ORDER_ALREADY_EXISTS',

  // Escrow
  ESCROW_NOT_FOUND = 'ESCROW_NOT_FOUND',
  ESCROW_INVALID_STATE = 'ESCROW_INVALID_STATE',

  // Subscription
  SUBSCRIPTION_NOT_FOUND = 'SUBSCRIPTION_NOT_FOUND',
  SUBSCRIPTION_ALREADY_ACTIVE = 'SUBSCRIPTION_ALREADY_ACTIVE',
  SUBSCRIPTION_ALREADY_CANCELLED = 'SUBSCRIPTION_ALREADY_CANCELLED',
  SUBSCRIPTION_INACTIVE = 'SUBSCRIPTION_INACTIVE',
  QUOTA_EXCEEDED = 'QUOTA_EXCEEDED',

  // AI / Claude integration
  AI_NOT_CONFIGURED = 'AI_NOT_CONFIGURED',
  AI_PROVIDER_ERROR = 'AI_PROVIDER_ERROR',
}
