erp-construccion-backend/dist/shared/constants/index.js
rckrdmrd 9bddee7320 chore: Remove dist/ from git tracking (now in .gitignore)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 11:47:55 -06:00

143 lines
9.3 KiB
JavaScript

"use strict";
/**
* Constants - SSOT Entry Point
*
* Este archivo es el punto de entrada para todas las constantes del sistema.
* Exporta desde los modulos especializados para mantener SSOT.
*
* @module @shared/constants
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DATE_FORMATS = exports.CACHE_TTL = exports.FILE_LIMITS = exports.PATTERNS = exports.PAGINATION = exports.CUSTOM_HEADERS = exports.APP_CONTEXT = exports.AUDIT_ACTION = exports.WORKFLOW_ACTION = exports.DOCUMENT_TYPE = exports.DOCUMENT_STATUS = exports.TICKET_PRIORITY = exports.TICKET_STATUS = exports.INFONAVIT_PROGRAM = exports.INFONAVIT_ASSIGNMENT_STATUS = exports.ATTENDANCE_VALIDATION = exports.ATTENDANCE_TYPE = exports.EMPLOYEE_TYPE = exports.WORK_PERMIT_TYPE = exports.TRAINING_TYPE = exports.INCIDENT_STATUS = exports.INCIDENT_TYPE = exports.INCIDENT_SEVERITY = exports.RETENTION_TYPE = exports.ESTIMATION_STATUS = exports.STOCK_MOVE_TYPE = exports.REQUISITION_STATUS = exports.PURCHASE_ORDER_STATUS = exports.BUDGET_STATUS = exports.CONCEPT_TYPE = exports.LOT_STATUS = exports.FRACCIONAMIENTO_STATUS = exports.PROJECT_TYPE = exports.PROJECT_STATUS = exports.USER_STATUS = exports.ROLES = exports.CONTENT_TYPES = exports.HTTP_STATUS = exports.HTTP_METHODS = exports.API_ROUTES = exports.API_PREFIX = exports.API_VERSION = exports.getFullTableName = exports.TABLE_REFS = exports.DB_COLUMNS = exports.DB_TABLES = exports.DB_SCHEMAS = void 0;
// ============================================================================
// DATABASE CONSTANTS
// ============================================================================
var database_constants_1 = require("./database.constants");
Object.defineProperty(exports, "DB_SCHEMAS", { enumerable: true, get: function () { return database_constants_1.DB_SCHEMAS; } });
Object.defineProperty(exports, "DB_TABLES", { enumerable: true, get: function () { return database_constants_1.DB_TABLES; } });
Object.defineProperty(exports, "DB_COLUMNS", { enumerable: true, get: function () { return database_constants_1.DB_COLUMNS; } });
Object.defineProperty(exports, "TABLE_REFS", { enumerable: true, get: function () { return database_constants_1.TABLE_REFS; } });
Object.defineProperty(exports, "getFullTableName", { enumerable: true, get: function () { return database_constants_1.getFullTableName; } });
// ============================================================================
// API CONSTANTS
// ============================================================================
var api_constants_1 = require("./api.constants");
Object.defineProperty(exports, "API_VERSION", { enumerable: true, get: function () { return api_constants_1.API_VERSION; } });
Object.defineProperty(exports, "API_PREFIX", { enumerable: true, get: function () { return api_constants_1.API_PREFIX; } });
Object.defineProperty(exports, "API_ROUTES", { enumerable: true, get: function () { return api_constants_1.API_ROUTES; } });
Object.defineProperty(exports, "HTTP_METHODS", { enumerable: true, get: function () { return api_constants_1.HTTP_METHODS; } });
Object.defineProperty(exports, "HTTP_STATUS", { enumerable: true, get: function () { return api_constants_1.HTTP_STATUS; } });
Object.defineProperty(exports, "CONTENT_TYPES", { enumerable: true, get: function () { return api_constants_1.CONTENT_TYPES; } });
// ============================================================================
// ENUMS
// ============================================================================
var enums_constants_1 = require("./enums.constants");
// Auth
Object.defineProperty(exports, "ROLES", { enumerable: true, get: function () { return enums_constants_1.ROLES; } });
Object.defineProperty(exports, "USER_STATUS", { enumerable: true, get: function () { return enums_constants_1.USER_STATUS; } });
// Projects
Object.defineProperty(exports, "PROJECT_STATUS", { enumerable: true, get: function () { return enums_constants_1.PROJECT_STATUS; } });
Object.defineProperty(exports, "PROJECT_TYPE", { enumerable: true, get: function () { return enums_constants_1.PROJECT_TYPE; } });
Object.defineProperty(exports, "FRACCIONAMIENTO_STATUS", { enumerable: true, get: function () { return enums_constants_1.FRACCIONAMIENTO_STATUS; } });
Object.defineProperty(exports, "LOT_STATUS", { enumerable: true, get: function () { return enums_constants_1.LOT_STATUS; } });
// Budget
Object.defineProperty(exports, "CONCEPT_TYPE", { enumerable: true, get: function () { return enums_constants_1.CONCEPT_TYPE; } });
Object.defineProperty(exports, "BUDGET_STATUS", { enumerable: true, get: function () { return enums_constants_1.BUDGET_STATUS; } });
// Purchases
Object.defineProperty(exports, "PURCHASE_ORDER_STATUS", { enumerable: true, get: function () { return enums_constants_1.PURCHASE_ORDER_STATUS; } });
Object.defineProperty(exports, "REQUISITION_STATUS", { enumerable: true, get: function () { return enums_constants_1.REQUISITION_STATUS; } });
Object.defineProperty(exports, "STOCK_MOVE_TYPE", { enumerable: true, get: function () { return enums_constants_1.STOCK_MOVE_TYPE; } });
// Estimates
Object.defineProperty(exports, "ESTIMATION_STATUS", { enumerable: true, get: function () { return enums_constants_1.ESTIMATION_STATUS; } });
Object.defineProperty(exports, "RETENTION_TYPE", { enumerable: true, get: function () { return enums_constants_1.RETENTION_TYPE; } });
// HSE
Object.defineProperty(exports, "INCIDENT_SEVERITY", { enumerable: true, get: function () { return enums_constants_1.INCIDENT_SEVERITY; } });
Object.defineProperty(exports, "INCIDENT_TYPE", { enumerable: true, get: function () { return enums_constants_1.INCIDENT_TYPE; } });
Object.defineProperty(exports, "INCIDENT_STATUS", { enumerable: true, get: function () { return enums_constants_1.INCIDENT_STATUS; } });
Object.defineProperty(exports, "TRAINING_TYPE", { enumerable: true, get: function () { return enums_constants_1.TRAINING_TYPE; } });
Object.defineProperty(exports, "WORK_PERMIT_TYPE", { enumerable: true, get: function () { return enums_constants_1.WORK_PERMIT_TYPE; } });
// HR
Object.defineProperty(exports, "EMPLOYEE_TYPE", { enumerable: true, get: function () { return enums_constants_1.EMPLOYEE_TYPE; } });
Object.defineProperty(exports, "ATTENDANCE_TYPE", { enumerable: true, get: function () { return enums_constants_1.ATTENDANCE_TYPE; } });
Object.defineProperty(exports, "ATTENDANCE_VALIDATION", { enumerable: true, get: function () { return enums_constants_1.ATTENDANCE_VALIDATION; } });
// INFONAVIT
Object.defineProperty(exports, "INFONAVIT_ASSIGNMENT_STATUS", { enumerable: true, get: function () { return enums_constants_1.INFONAVIT_ASSIGNMENT_STATUS; } });
Object.defineProperty(exports, "INFONAVIT_PROGRAM", { enumerable: true, get: function () { return enums_constants_1.INFONAVIT_PROGRAM; } });
// Quality
Object.defineProperty(exports, "TICKET_STATUS", { enumerable: true, get: function () { return enums_constants_1.TICKET_STATUS; } });
Object.defineProperty(exports, "TICKET_PRIORITY", { enumerable: true, get: function () { return enums_constants_1.TICKET_PRIORITY; } });
// Documents
Object.defineProperty(exports, "DOCUMENT_STATUS", { enumerable: true, get: function () { return enums_constants_1.DOCUMENT_STATUS; } });
Object.defineProperty(exports, "DOCUMENT_TYPE", { enumerable: true, get: function () { return enums_constants_1.DOCUMENT_TYPE; } });
// Workflow
Object.defineProperty(exports, "WORKFLOW_ACTION", { enumerable: true, get: function () { return enums_constants_1.WORKFLOW_ACTION; } });
// Audit
Object.defineProperty(exports, "AUDIT_ACTION", { enumerable: true, get: function () { return enums_constants_1.AUDIT_ACTION; } });
// ============================================================================
// APP CONFIG CONSTANTS
// ============================================================================
/**
* Application Context for PostgreSQL RLS
*/
exports.APP_CONTEXT = {
TENANT_ID: 'app.current_tenant_id',
USER_ID: 'app.current_user_id',
};
/**
* Custom HTTP Headers
*/
exports.CUSTOM_HEADERS = {
TENANT_ID: 'x-tenant-id',
CORRELATION_ID: 'x-correlation-id',
API_KEY: 'x-api-key',
};
/**
* Pagination Defaults
*/
exports.PAGINATION = {
DEFAULT_PAGE: 1,
DEFAULT_LIMIT: 20,
MAX_LIMIT: 100,
};
/**
* Regex Patterns for Validation
*/
exports.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@]+$/,
PHONE_MX: /^(\+52)?[0-9]{10}$/,
POSTAL_CODE_MX: /^[0-9]{5}$/,
};
/**
* File Upload Limits
*/
exports.FILE_LIMITS = {
MAX_FILE_SIZE: 10 * 1024 * 1024, // 10MB
MAX_FILES: 10,
ALLOWED_IMAGE_TYPES: ['image/jpeg', 'image/png', 'image/webp'],
ALLOWED_DOC_TYPES: ['application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
ALLOWED_SPREADSHEET_TYPES: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
};
/**
* Cache TTL (Time To Live) in seconds
*/
exports.CACHE_TTL = {
SHORT: 60, // 1 minute
MEDIUM: 300, // 5 minutes
LONG: 3600, // 1 hour
DAY: 86400, // 24 hours
};
/**
* Date Formats
*/
exports.DATE_FORMATS = {
ISO: 'YYYY-MM-DDTHH:mm:ss.sssZ',
DATE_ONLY: 'YYYY-MM-DD',
TIME_ONLY: 'HH:mm:ss',
DISPLAY_MX: 'DD/MM/YYYY',
DISPLAY_FULL_MX: 'DD/MM/YYYY HH:mm',
};
//# sourceMappingURL=index.js.map