- Add audit module with controllers, DTOs, middleware and services
- Add MFA controller, routes and services
- Add feature flags module with controllers, DTOs and services
- Update audit entities with proper TypeORM decorators
- Update auth service and DTOs
- Update main.ts configuration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added Jest configuration and unit tests:
- jest.config.js: Jest configuration with ts-jest
- setup.ts: Global test setup with custom matchers
Test files (30 tests passing):
- service-order.service.test.ts: CRUD, status transitions, cost calculation
- diagnostic.service.test.ts: CRUD, OBD codes, completion workflow
- part.service.test.ts: CRUD, stock management, low stock alerts
- vehicle.service.test.ts: CRUD, VIN validation, odometer updates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getCostBreakdown() for order cost calculation
- Add getOrderHistory() for change tracking
- Add assignTechnician() for mechanic assignment
- Add addDiscount() for order-level discounts
- Add updatePriority() for priority management
- Add searchOrders() with multi-field search
- Export new DTOs: ServiceContext, CostBreakdown, OrderHistoryEntry
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add work-execution.service.ts (701 lines, 10+ methods)
- Work lifecycle management (start, pause, complete)
- Part consumption tracking and reservation
- Time tracking with pause/resume
- Quality control integration
- Add warehouse-entry.service.ts for inventory entries
- Add stock-alert.service.ts for minimum stock alerts
- Add inventory-movement.entity.ts for kardex tracking
- Add stock-alert.entity.ts for alert management
- Enhance part.service.ts with new inventory methods
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace class-validator with plain TypeScript interfaces in AI DTOs
- Fix AIModel field names (inputCostPer1k instead of inputCostPer1m)
- Fix AIUsageLog field mapping (promptTokens, completionTokens, cost)
- Add 'branches', 'financial', 'sales' to MCP ToolCategory
- Add branchId to McpContext interface
- Create stub entities for BranchPaymentTerminal and PaymentTransaction
- Create CircuitBreaker utility for payment transactions
- Create database config and error classes for base.service.ts
- Fix type assertions for fetch response.json() calls
- Align PaymentStatus and PaymentMethod types between entities and DTOs
- Add @types/pg dependency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 6 entities: Asset, AssetCategory, AssetAssignment, AssetAudit, AssetAuditItem, AssetMaintenance
- 4 services with CRUD, assignment, audit, and maintenance operations
- 4 controllers with REST endpoints
- Integration in main.ts with routes registration
- Multi-tenant support with RLS
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Source: erp-core (checksum: 9c067e47e556cc79e29a85923f8fe65b)
Priority: P1 - HIGH
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION
Before: Diverged version
After: Synced with canonical
Changes:
- Complete mcp module synchronized from erp-core
- MCP Server integration unified
- Tool registry and logging standardized
- Consistent MCP protocol implementation
Benefits:
- Single source of truth for MCP functionality
- Unified Claude AI integration via MCP
- Reduced maintenance burden (~500 lines per project)
- Following erp-construccion example (already synced)
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: "Missing"
After: Synced with canonical
Changes:
- BaseService "added" 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 and entities imports
- Added entities to TypeORM DataSource
- 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>