- GET /reports/dashboard/stats - Dashboard aggregate statistics
- GET /reports/projects/summary - Projects summary with EVM KPIs
- GET /reports/projects/:id/kpis - Project KPIs
- GET /reports/projects/:id/earned-value - EVM metrics
- GET /reports/projects/:id/s-curve - S-curve data
- GET /reports/alerts - Active alerts
- PATCH /reports/alerts/:id/acknowledge|resolve
Integrates EarnedValueService for EVM calculations.
Build: PASSED
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sprint 2 - S2-T01 backend support
New service with methods:
- createPrograma: Create new work schedule with auto-generated code
- findAll/findById: List and get programas with actividades
- updatePrograma: Update programa details
- createVersion: Create new version for reprogramming
- addActividad/updateActividad/removeActividad: Activity management
- reorderActividades: Reorder with WBS code regeneration
- getGanttData: Data formatted for Gantt chart
- getSCurveData: Planned vs actual progress curves
DTOs: CreateProgramaDto, UpdateProgramaDto, CreateActividadDto, etc.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- SystemSettingService: Global system-wide settings with CRUD, get/set by key,
validation rules, and bulk operations
- PlanSettingService: Plan-level defaults with inheritance support and
copy between plans functionality
- TenantSettingService: Tenant-specific settings with hierarchy
(system < plan < tenant), effective value resolution, and override management
- UserPreferenceService: Personal preferences with defaults, sync support,
and cross-user operations
- SettingsController: Unified REST endpoints for all settings types with
proper authentication and authorization
Implements hierarchical inheritance: system_settings < plan_settings <
tenant_settings < user_preferences. All services follow ServiceContext
pattern with tenantId for multi-tenant support.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement four new services for the quality module (MAI-009):
- CorrectiveActionService: CAPA (Corrective and Preventive Actions)
workflow with create, start, complete, verify, and reopen operations
- NonConformityService: NC lifecycle management with severity-based
SLA, contractor assignment, and status workflow
- InspectionResultService: Recording and batch recording of inspection
results with summary statistics
- TicketAssignmentService: Ticket assignment, reassignment, scheduling,
and technician workload tracking
All services follow the ServiceContext pattern with tenantId.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements missing service for project-specific warehouse assignments:
- CRUD operations for project warehouse assignments
- Stock queries by project (fraccionamiento)
- Transfer between project warehouses with transaction support
- Project inventory summary with stock value calculations
- Integration with ERP Core inventory tables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added contract partidas (items) management to ContractService:
- getPartidas: Retrieve all partidas for a contract
- addPartida: Add new partida to draft/review contracts
- updatePartida: Update quantity/price of existing partida
- removePartida: Soft delete partida from contract
- recalculateContractAmount: Recalculate contract total from partidas
Enhanced SubcontractorService with additional methods:
- reactivate: Reactivate inactive subcontractors (blocks blacklisted)
- getTopRated: Get top-rated active subcontractors
- getStatistics: Get aggregate statistics (totals, ratings)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- construction/torre: Service + Controller for vertical buildings
- construction/nivel: Service + Controller for floor levels
- construction/departamento: Service + Controller for units
- purchase/purchase-order-construction: Controller for PO extensions
- purchase/supplier-construction: Controller for supplier extensions
- quality/checklist: Controller for inspection templates
All endpoints follow existing patterns with multi-tenancy support.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove meta wrapper from PaginatedResult returns in findWithFilters and findAll
- Return flat format with total, page, limit, totalPages at top level
- Align with base.service.ts interface definition
- Controllers already updated to access flat pagination structure
Parameter 's' in the categoryStats.map() callback on line 404 was implicitly typed as 'any', causing TS7006 error. Added explicit 'any' type annotation to resolve the TypeScript compilation error.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix entity property mismatches in ar.service.ts (customerId vs partnerId, balance vs balanceAmount)
- Fix entity property mismatches in ap.service.ts (supplierId vs partnerId, balance vs balanceAmount)
- Fix entity property mismatches in cash-flow.service.ts
- Fix entity property mismatches in erp-integration.service.ts (currency, sapCode, description)
- Fix unused imports and dataSource declarations in all finance services
- Error count: 410 -> 346
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Cleaned up ap.service.ts
- Refactored ar.service.ts
- Minor fixes in bank-reconciliation.service.ts
- Updated cash-flow.service.ts
- Cleaned erp-integration.service.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix PaginatedResult to use flat format instead of meta wrapper
- Replace debitAmount/creditAmount with debit/credit (entity property names)
- Replace currencyCode with currency on AccountingEntry
- Replace partnerId/partnerName with supplierId/supplierName on AccountPayable
- Replace balanceAmount with balance on AccountPayable
- Replace reversalEntryId with reversedEntryId
- Replace acceptsMovements with allowsDirectPosting on ChartOfAccounts
- Fix APPayment properties: amount, currency, remove non-existent properties
- Remove unused imports (Between, In, LessThan, PaymentStatus)
- Fix unused dataSource parameter in constructors
Errors reduced from 507 to 443 (13% reduction in this commit)
Total reduction from initial ~730: 287 errors (39%)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>