Commit Graph

17 Commits

Author SHA1 Message Date
Adrian Flores Cortes
89948663e9 feat(MMD-013): Implement Asset Management module
- 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>
2026-01-27 01:44:58 -06:00
Adrian Flores Cortes
b927bafeb0 feat(MMD-014): Implement GPS module backend
- Add 5 entities: GpsDevice, GpsPosition, Geofence, GeofenceEvent, RouteSegment
- Add 4 services with full business logic
- Add 4 controllers with REST endpoints
- Integrate GPS module into main.ts
- Endpoints: /api/v1/gps/devices, positions, geofences, routes
- Features: device management, position tracking, geofencing, route calculation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:33:59 -06:00
Adrian Flores Cortes
e3baa0a480 chore: Update package-lock.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:10:42 -06:00
Adrian Flores Cortes
f74f713482 [MMD-010] feat: Add FiadosService module for customer credit management
- Create fiados module with 3 entities:
  - CustomerCreditAccount: Credit accounts per customer
  - Fiado: Individual credit sales (fiados)
  - FiadoPayment: Payment/abono tracking
- Implement FiadosService with full business logic:
  - Credit eligibility checking
  - Fiado creation with automatic due dates
  - Payment registration with FIFO allocation
  - Overdue tracking and account freezing
- Connect FiadosToolsService to real FiadosService
- Update MCP module registration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:22:28 -06:00
Adrian Flores Cortes
e26ab24aa5 feat: Connect MCP tools to real services
Analytics Module:
- Created AnalyticsService with sales/financial reporting
- Supports sales summary, reports, top products/customers, KPIs
- Uses analytics schema and service_management tables

MCP Tools Connected:
- products-tools → PartService (real inventory data)
- sales-tools → AnalyticsService (real sales analytics)
- financial-tools → AnalyticsService (real P&L and KPIs)

Updated tool registry to pass DataSource to connected tools.

MCP Tools Status:
- orders-tools: Connected to ServiceOrderService
- inventory-tools: Connected to PartService
- customers-tools: Connected to CustomersService
- products-tools: Connected to PartService (NEW)
- sales-tools: Connected to AnalyticsService (NEW)
- financial-tools: Connected to AnalyticsService (NEW)
- fiados-tools: Mock (needs FiadosService)
- branch-tools: Mock (single tenant)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:56:10 -06:00
Adrian Flores Cortes
eefbc8a7cd [SYNC] Synchronize mcp module from erp-core canonical
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>
2026-01-25 07:02:31 -06:00
Adrian Flores Cortes
5842d2003e [SYNC] Synchronize payment-terminals module from erp-core canonical
Source: erp-core (checksum: c9040e545cf55beb87d3e437a4998855)
Priority: P1 - HIGH
Context: TASK-2026-01-25-SISTEMA-REUTILIZACION

Before: Diverged version (one of 3 different versions)
After: Synced with canonical

Changes:
- Complete payment-terminals module synchronized from erp-core
- 21 TypeScript files updated
- Unified payment terminal integration (MercadoPago + Clip)
- Consistent webhook handling across all ERP projects

Benefits:
- Single source of truth for payment terminals functionality
- Consistent TPV integration behavior
- Reduced maintenance burden (~4,000 lines saved)
- Unified webhook processing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 06:52:13 -06:00
Adrian Flores Cortes
63be8167bf [ADD] BaseService propagated from erp-core canonical
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>
2026-01-25 06:43:32 -06:00
Adrian Flores Cortes
e7b68b4558 [SYNC] Synchronize ai module from erp-core canonical
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>
2026-01-25 06:36:16 -06:00
Adrian Flores Cortes
d5f1453492 [MCP] feat: Connect MCP tools to actual services
- orders-tools.service.ts → ServiceOrderService (6 tools)
  - create_service_order, get_service_order, list_service_orders
  - update_order_status, get_orders_kanban, get_orders_dashboard
- inventory-tools.service.ts → PartService (8 tools)
  - search_parts, get_part_details, check_stock
  - get_low_stock_parts, adjust_stock, get_inventory_value
  - create_part, list_parts
- customers-tools.service.ts → CustomersService (6 tools)
  - search_customers, get_customer, create_customer
  - update_customer, list_customers, get_customer_stats

Removed mock data, now using real database operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:25:16 -06:00
Adrian Flores Cortes
669c0c2911 [PROP-CORE-004] feat: Register payment-terminals module in app
- 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>
2026-01-25 03:13:51 -06:00
Adrian Flores Cortes
db63fd17c9 [PROP-CORE-004] fix: Remove external entity references from payment-terminals
Fixed getEntities() to only reference own entities, avoiding require errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 03:08:31 -06:00
Adrian Flores Cortes
940095a170 [PROP-CORE-004] feat: Adapt AI roles for diesel mechanics domain
- Roles: ADMIN, JEFE_TALLER, MECANICO, CLIENTE
- Domain-specific tools (diagnostics, vehicles, OBD codes)
- Automotive workshop terminology

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:57:51 -06:00
Adrian Flores Cortes
5c7134cc03 [PROP-CORE-004] feat: Add Phase 6 modules from erp-core
Propagated modules:
- payment-terminals: MercadoPago + Clip TPV
- ai: Role-based AI access (ADMIN, JEFE_TALLER, MECANICO, CLIENTE)
- mcp: 18 ERP tools for AI assistants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:45:37 -06:00
ceb6363bfd chore: Add .gitignore for clean repository
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 07:31:50 -06:00
8ed7d24e96 Migración desde erp-mecanicas-diesel/backend - Estándar multi-repo v2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:11:24 -06:00
13cedb2959 Initial commit 2026-01-16 14:04:56 +00:00