- Add ServiceContext interface to base.service.ts
- Fix admin module: audit-log, backup, cost-center, system-setting
- Define ServiceContext and PaginatedResult locally
- Convert services from extends BaseService to standalone
- Change PaginatedResult from meta format to flat format
- Fix controllers to use flat pagination format
- Fix bidding module: bid, bid-budget, opportunity
- Change PaginatedResult from meta format to flat format
- Fix controllers to use flat pagination format
Modules with remaining errors: finance, payment-terminals, estimates,
mcp, reports, progress, budgets, ai, hse (563 errors total)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert services from NestJS to Express pattern
- Remove unused ServiceContext interfaces
- Add DocumentController with full CRUD endpoints:
- GET /documents (list with filters)
- GET /documents/:id (get by ID)
- GET /documents/statistics
- GET /documents/generate-code
- GET /documents/project/:projectId
- GET /documents/:id/access-history
- GET /documents/:id/versions
- GET /documents/:id/versions/statistics
- POST /documents (create)
- POST /documents/:id/versions (create version)
- POST /documents/:id/status (change status)
- POST /documents/:id/lock
- POST /documents/:id/unlock
- POST /documents/versions/:versionId/set-current
- POST /documents/versions/:versionId/archive
- PUT /documents/:id (update)
- DELETE /documents/:id (soft delete)
- Add controllers/index.ts export
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix 3 entities schema from 'contracts' to 'construction' to match DDL
- Create ContractPartida entity for contrato_partidas table
- Fix ContractService and SubcontractorService to use local ServiceContext
- Fix ContractController and SubcontractorController pagination structure
- Update entities/index.ts to export ContractPartida
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix 8 entities schema from 'quality' to 'construction' to match DDL
- Create ChecklistService with full CRUD, duplication, item management
- Fix InspectionService and TicketService to use local ServiceContext
- Fix InspectionController and TicketController pagination structure
- Update services/index.ts to export ChecklistService
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PurchaseOrderConstruction entity for delivery and quality tracking
- Add SupplierConstruction entity for ratings, specialties and credit terms
- Add PurchaseOrderConstructionService with reception and quality workflows
- Add SupplierConstructionService with evaluation and statistics features
- Update entities and services index files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create 11 entities matching DDL:
- DocumentCategory: Hierarchical categories
- Document: Main document registry
- DocumentVersion: Version control with files
- DocumentPermission: Granular permissions
- ApprovalWorkflow: Workflow definitions
- ApprovalInstance: Active workflow instances
- ApprovalStep: Steps per instance
- ApprovalActionEntity: Actions taken
- Annotation: Comments and markups
- AccessLog: Access history
- DocumentShare: External sharing links
- Create DocumentService with full CRUD
- Create DocumentVersionService for version management
- All entities follow ERP-Construction patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Source: erp-core (checksum: 900be2ee48f2faf72ce5253aeab27c88)
Priority: P1 - HIGH (architectural gap resolution)
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION
Before: "Diverged version"
After: Synced with canonical
Changes:
- BaseService "synchronized" from erp-core
- Checksum: 900be2ee48f2faf72ce5253aeab27c88
- Provides base CRUD operations for all services
Benefits:
- Unified service architecture
- Consistent error handling and validation
- Reduced code duplication in service implementations
- Standard pagination and filtering patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Source: erp-core (checksum: 39a6e229055a21158b63cc4eb4dd232f)
Priority: P0 - CRITICAL divergence resolution
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION
Before: Diverged version with project-specific adaptations
After: Synced with canonical
Changes:
- Complete ai module synchronized from erp-core
- 24 TypeScript files updated
- Unified role-based AI configuration
- Consistent AI behavior across all ERP projects
Note: Project-specific role adaptations (if needed) can be
re-applied as documented extensions after this sync.
Benefits:
- Single source of truth for AI functionality
- Reduced maintenance burden
- Token savings from code reuse
- Consistent behavior baseline
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added PaymentTerminalsModule import and initialization
- Registered routes: /api/v1/payment-terminals, /api/v1/mercadopago, /api/v1/clip
- Registered webhooks: /webhooks/mercadopago, /webhooks/clip
- Updated API info with new endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>