Commit Graph

12 Commits

Author SHA1 Message Date
Adrian Flores Cortes
dcdc15e162 [ST-P2-002,ST-P2-003] feat: Add compound indices and JSONB schema documentation
- 11-compound-indices.sql: 14 compound indices for common queries
- docs/JSONB-SCHEMAS.md: 50+ TypeScript interfaces documenting JSONB fields
- DDL-EXECUTION-ORDER.md: Updated to include compound indices step

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:39:14 -06:00
Adrian Flores Cortes
6b02d8ab08 [ST-P0-003] docs: Add DDL execution order and update README
- Create DDL-EXECUTION-ORDER.md with schema dependencies
- Document execution order for erp-core + erp-construccion
- Add WSL commands for database recreation
- Update README.md with current schema counts (10 schemas, 143 tables, 115 ENUMs)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:19:45 -06:00
Adrian Flores Cortes
f76afed513 [MAI-012] feat: Add DDL for contrato_addendas table
- Add contrato_addendas table for contract addendums/modifications
- Includes workflow status, amount changes, date extensions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:08:50 -06:00
Adrian Flores Cortes
9d0457622f [MAI-009] feat: Add DDL for quality module missing tables
- Add no_conformidades table for non-conformity tracking
- Add acciones_correctivas table for corrective actions
- Add ticket_asignaciones table for ticket assignments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:54:24 -06:00
Adrian Flores Cortes
80dd204db2 [MAE-016] feat: Add documents schema DDL with 11 tables and 8 ENUMs
- document_categories: Categorias jerarquicas
- documents: Registro principal
- document_versions: Control de versiones
- document_permissions: Permisos granulares
- approval_workflows: Definicion de flujos
- approval_instances: Instancias de aprobacion
- approval_steps: Pasos de aprobacion
- approval_actions: Acciones de aprobacion
- annotations: Anotaciones sobre documentos
- access_logs: Historial de acceso
- document_shares: Compartidos externos

Includes: RLS, indices, triggers, fulltext search

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:12:59 -06:00
Adrian Flores Cortes
e927cafc90 [MAE-015] feat: Add assets schema DDL with 11 tables and 9 ENUMs
- asset_categories: Categorias de activos
- assets: Catalogo principal de activos
- asset_assignments: Asignaciones a proyectos
- maintenance_plans: Planes de mantenimiento preventivo
- maintenance_schedules: Programacion de mantenimientos
- work_orders: Ordenes de trabajo
- work_order_parts: Refacciones utilizadas
- maintenance_history: Historial de mantenimientos
- asset_costs: Costos TCO
- asset_locations: Ubicaciones GPS
- fuel_logs: Registro de combustible

Includes: RLS, indices, triggers, TCO calculation function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:11:02 -06:00
Adrian Flores Cortes
3e3d2d6eac [MAE-014] feat: Add finance schema DDL with 11 tables and 20 ENUMs
- chart_of_accounts: Catalogo de cuentas contables con jerarquia
- accounting_entries: Polizas contables
- accounting_entry_lines: Lineas de poliza
- accounts_payable: Cuentas por pagar
- accounts_receivable: Cuentas por cobrar
- bank_accounts: Cuentas bancarias
- bank_movements: Movimientos bancarios
- bank_reconciliations: Conciliacion bancaria
- ap_payments: Pagos a proveedores
- ar_payments: Cobros de clientes
- cash_flow_projections: Flujo de efectivo

Includes: RLS, indices, triggers, audit functions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:08:19 -06:00
Adrian Flores Cortes
f1582ebd43 [PROP-CORE-004] feat: Add payment_terminals schema DDL
Propagated from erp-core v1.5.0
Use: Anticipos de obra, pagos parciales

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:46:34 -06:00
Adrian Flores Cortes
8e118a84cd [TASK-029] security: Add RLS policies for 86 construction tables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 22:32:39 -06:00
3dde4643d0 chore: Add .gitignore for clean repository
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 07:31:41 -06:00
bf97e26cdf Migración desde erp-construccion/database - Estándar multi-repo v2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:11:21 -06:00
5744bc50ed Initial commit 2026-01-16 14:04:08 +00:00