Commit Graph

3 Commits

Author SHA1 Message Date
Adrian Flores Cortes
efce73bdbd [GAP-006,007] feat: Add DDL for Digital Signatures and Audit Triggers
GAP-006: Digital Signatures
- documents.signature_type ENUM
- documents.signature_status ENUM
- documents.digital_signatures table with RLS

GAP-007: Audit Triggers
- audit schema
- audit.change_log table
- audit.log_changes() trigger function
- Triggers on 13 critical tables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 01:15:16 -06:00
Adrian Flores Cortes
2b69098fd4 [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references
Add 19 conditional FK constraints to 4 schema files:
- 06-inventory-ext: 7 FKs (warehouses, products, uom, stock_moves)
- 07-purchase-ext: 5 FKs (purchase_orders, partners, products)
- 03-hse: 3 FKs (almacen_temporal for EPP)
- 10-documents: 4 FKs (documents, users)

Features:
- Constraints are conditional (only created if target tables exist)
- Idempotent (can be re-run without errors)
- Added 6 new indexes for FK fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 00:00:23 -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