/**
 * Constants
 * Constantes globales del proyecto
 */

// Contexto de aplicacion para PostgreSQL RLS
export const APP_CONTEXT = {
  TENANT_ID: 'app.current_tenant',
  USER_ID: 'app.current_user_id',
} as const;

// Estados de proyecto
export const PROJECT_STATUS = {
  PLANNING: 'planning',
  ACTIVE: 'active',
  PAUSED: 'paused',
  COMPLETED: 'completed',
  CANCELLED: 'cancelled',
} as const;

// Tipos de proyecto
export const PROJECT_TYPE = {
  HORIZONTAL: 'horizontal',
  VERTICAL: 'vertical',
  MIXED: 'mixed',
} as const;

// Estados de fraccionamiento
export const FRACCIONAMIENTO_STATUS = {
  ACTIVE: 'activo',
  PAUSED: 'pausado',
  COMPLETED: 'completado',
  CANCELLED: 'cancelado',
} as const;

// Roles del sistema
export const ROLES = {
  SUPER_ADMIN: 'super_admin',
  ADMIN: 'admin',
  MANAGER: 'manager',
  SUPERVISOR: 'supervisor',
  OPERATOR: 'operator',
  VIEWER: 'viewer',
} as const;

// Headers HTTP personalizados
export const CUSTOM_HEADERS = {
  TENANT_ID: 'x-tenant-id',
  CORRELATION_ID: 'x-correlation-id',
} as const;

// Pagination defaults
export const PAGINATION = {
  DEFAULT_PAGE: 1,
  DEFAULT_LIMIT: 20,
  MAX_LIMIT: 100,
} as const;

// Regex patterns
export const PATTERNS = {
  UUID: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
  RFC: /^[A-Z&Ñ]{3,4}[0-9]{6}[A-Z0-9]{3}$/,
  CURP: /^[A-Z]{4}[0-9]{6}[HM][A-Z]{5}[0-9A-Z][0-9]$/,
  NSS: /^[0-9]{11}$/,
  EMAIL: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
} as const;
