erp-construccion-database-v2/schemas
Adrian Flores Cortes 8a9db6f9d1 [GAP-001,002,003] feat(ddl): Add KPIs, tool loans and depreciation tables
- Add 12-analytics-kpis-ddl.sql with kpis_config and kpis_values tables
- Add tool_loans table with loan_status enum (GAP-002)
- Add depreciation_schedule and depreciation_entries tables (GAP-003)
- Add depreciation_method enum and calculate_monthly_depreciation function

Implements 13 SP of critical gaps identified in EPIC-003.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 00:46:00 -06:00
..
01-construction-schema-ddl.sql [MAI-012] feat: Add DDL for contrato_addendas table 2026-01-25 09:08:50 -06:00
02-hr-schema-ddl.sql [EPIC-002] feat: Add user_id FK to employees + rename warehouse_type 2026-02-04 00:20:02 -06:00
03-hse-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
04-estimates-schema-ddl.sql Migración desde erp-construccion/database - Estándar multi-repo v2 2026-01-16 08:11:21 -06:00
05-infonavit-schema-ddl.sql Migración desde erp-construccion/database - Estándar multi-repo v2 2026-01-16 08:11:21 -06:00
06-inventory-ext-schema-ddl.sql [EPIC-002] feat: Add user_id FK to employees + rename warehouse_type 2026-02-04 00:20:02 -06:00
07-purchase-ext-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
08-finance-schema-ddl.sql [MAE-014] feat: Add finance schema DDL with 11 tables and 20 ENUMs 2026-01-25 05:08:19 -06:00
09-assets-schema-ddl.sql [GAP-001,002,003] feat(ddl): Add KPIs, tool loans and depreciation tables 2026-02-04 00:46:00 -06:00
10-documents-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
11-compound-indices.sql [ST-P2-002,ST-P2-003] feat: Add compound indices and JSONB schema documentation 2026-02-03 07:39:14 -06:00
12-analytics-kpis-ddl.sql [GAP-001,002,003] feat(ddl): Add KPIs, tool loans and depreciation tables 2026-02-04 00:46:00 -06:00
99-rls-policies.sql [TASK-029] security: Add RLS policies for 86 construction tables 2026-01-24 22:32:39 -06:00