Actualiza catálogos de definiciones técnicas con nuevos módulos, servicios, entidades y esquemas de base de datos. Cambios por archivo: DATABASE-SCHEMA.md (+138 líneas): - Agregado simco_version: 4.0.1 - Schemas: 12 -> 15 (ai, onboarding, predictions) - Tablas: ~49 -> ~65 - Nuevas tablas documentadas: conversations, inventory_predictions - Diagrama de relaciones actualizado ENTITIES-CATALOG.md (+54 líneas): - Agregado simco_version: 4.0.1 - Entities: 25 -> 35+ - Nuevos módulos: AI/MCP, Predictions, Onboarding, Notifications - Relaciones actualizadas para nuevas entidades MODULES-CATALOG.md (+94 líneas): - Agregado simco_version: 4.0.1 - Módulos: 18 -> 24 - Agregados: MCH-M19 a MCH-M24 (Offline, Referrals, CoDi, Widgets, i18n, SAT) - Detalles completos de MCH-M10 (Predictions) y MCH-M11 (MCP Server) - Matriz de dependencias expandida SERVICES-CATALOG.md (+60 líneas): - Agregado simco_version: 4.0.1 - Services: 18+ -> 30+ - Nuevos módulos: MCP Server, Predictions, Onboarding, Notifications - Inyección de dependencias actualizada _INDEX.yml: - version: 1.0.0 -> 1.1.0 - Totales actualizados (entities: 35, services: 30, modules: 24) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
203 lines
6.3 KiB
Markdown
203 lines
6.3 KiB
Markdown
---
|
|
id: DEF-MCH-SERVICES
|
|
type: Definition
|
|
title: "Services Catalog"
|
|
simco_version: "4.0.1"
|
|
updated_at: 2026-01-17
|
|
---
|
|
|
|
# Services Catalog - MiChangarrito
|
|
|
|
**Alias:** @MCH_DEF_SERVICES
|
|
**Version:** 1.0.0
|
|
**Ultima actualizacion:** 2026-01-17
|
|
|
|
---
|
|
|
|
## 1. RESUMEN
|
|
|
|
| Metrica | Valor |
|
|
|---------|-------|
|
|
| **Total Services** | 30+ |
|
|
| **Por Modulo** | Ver seccion 2 |
|
|
|
|
---
|
|
|
|
## 2. SERVICES POR MODULO
|
|
|
|
### 2.1 Modulo: Auth
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| AuthService | `auth.service.ts` | JwtService, UsersService | Autenticacion de usuarios |
|
|
| JwtService | `jwt.service.ts` | ConfigService | Generacion/validacion JWT |
|
|
| SessionService | `session.service.ts` | Repository | Gestion de sesiones |
|
|
|
|
### 2.2 Modulo: Users
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| UsersService | `users.service.ts` | Repository | CRUD de usuarios |
|
|
|
|
### 2.3 Modulo: Stores
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| StoresService | `stores.service.ts` | Repository | CRUD de tiendas |
|
|
| StoreSettingsService | `store-settings.service.ts` | Repository | Configuracion de tiendas |
|
|
|
|
### 2.4 Modulo: Products
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| ProductsService | `products.service.ts` | Repository | CRUD de productos |
|
|
| CategoriesService | `categories.service.ts` | Repository | CRUD de categorias |
|
|
| InventoryService | `inventory.service.ts` | Repository | Control de stock |
|
|
|
|
### 2.5 Modulo: Sales (POS)
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| SalesService | `sales.service.ts` | Repository, ProductsService | Procesamiento de ventas |
|
|
| PaymentsService | `payments.service.ts` | StripeService | Procesamiento de pagos |
|
|
| CashRegisterService | `cash-register.service.ts` | Repository | Control de caja |
|
|
|
|
### 2.6 Modulo: Customers
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| CustomersService | `customers.service.ts` | Repository | CRUD de clientes |
|
|
|
|
### 2.7 Modulo: Fiados
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| FiadosService | `fiados.service.ts` | Repository, CustomersService | Gestion de creditos |
|
|
| CreditService | `credit.service.ts` | Repository | Limites de credito |
|
|
|
|
### 2.8 Modulo: Orders
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| OrdersService | `orders.service.ts` | Repository, ProductsService | Gestion de pedidos |
|
|
| DeliveriesService | `deliveries.service.ts` | Repository | Entregas a domicilio |
|
|
|
|
### 2.9 Modulo: Subscriptions
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| SubscriptionsService | `subscriptions.service.ts` | Repository, StripeService | Gestion de suscripciones |
|
|
| PlansService | `plans.service.ts` | Repository | CRUD de planes |
|
|
| TokensService | `tokens.service.ts` | Repository | Gestion de tokens IA |
|
|
|
|
### 2.10 Modulo: Integraciones
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| WhatsAppService | `whatsapp.service.ts` | HttpService, ConfigService | Integracion Meta API |
|
|
| LLMService | `llm.service.ts` | HttpService, ConfigService | Integracion OpenRouter |
|
|
| StripeService | `stripe.service.ts` | Stripe SDK | Integracion Stripe |
|
|
|
|
### 2.11 Modulo: MCP Server
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| MCPService | `mcp.service.ts` | LLMService, ToolsRegistry | Gateway LLM agnostico |
|
|
| ToolsService | `tools.service.ts` | ProductsService, SalesService | Ejecutor de tools MCP |
|
|
| ConversationsService | `conversations.service.ts` | Repository | Gestion de conversaciones IA |
|
|
|
|
### 2.12 Modulo: Predictions
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| PredictionsService | `predictions.service.ts` | Repository, SalesService | Prediccion de demanda |
|
|
| ReorderService | `reorder.service.ts` | Repository, InventoryService | Sugerencias de reorden |
|
|
| AlertsService | `alerts.service.ts` | Repository, NotificationsService | Alertas de stock bajo |
|
|
|
|
### 2.13 Modulo: Onboarding
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| OnboardingService | `onboarding.service.ts` | Repository, WhatsAppService | Flujo de onboarding |
|
|
| OCRService | `ocr.service.ts` | GoogleVisionClient | Procesamiento de imagenes |
|
|
| TranscriptionService | `transcription.service.ts` | WhisperClient | Transcripcion de audio |
|
|
|
|
### 2.14 Modulo: Notifications
|
|
|
|
| Service | Archivo | Dependencias | Descripcion |
|
|
|---------|---------|--------------|-------------|
|
|
| NotificationsService | `notifications.service.ts` | Repository, FCMService | Gestion de notificaciones |
|
|
| FCMService | `fcm.service.ts` | Firebase Admin | Push notifications |
|
|
| EmailService | `email.service.ts` | SendGridClient | Envio de emails |
|
|
|
|
---
|
|
|
|
## 3. INYECCION DE DEPENDENCIAS
|
|
|
|
```yaml
|
|
dependencias:
|
|
AuthService:
|
|
inyecta:
|
|
- JwtService
|
|
- UsersService
|
|
- SessionService
|
|
inyectado_en:
|
|
- AuthController
|
|
- JwtAuthGuard
|
|
|
|
SalesService:
|
|
inyecta:
|
|
- ProductsService
|
|
- InventoryService
|
|
- PaymentsService
|
|
inyectado_en:
|
|
- SalesController
|
|
- OrdersService
|
|
|
|
FiadosService:
|
|
inyecta:
|
|
- CustomersService
|
|
- CreditService
|
|
inyectado_en:
|
|
- FiadosController
|
|
- SalesService
|
|
|
|
WhatsAppService:
|
|
inyecta:
|
|
- HttpService
|
|
- ConfigService
|
|
- LLMService
|
|
inyectado_en:
|
|
- WhatsAppController
|
|
- OrdersService
|
|
- NotificationsService
|
|
|
|
MCPService:
|
|
inyecta:
|
|
- LLMService
|
|
- ToolsService
|
|
inyectado_en:
|
|
- WhatsAppService
|
|
- ChatController
|
|
|
|
PredictionsService:
|
|
inyecta:
|
|
- SalesService
|
|
- InventoryService
|
|
inyectado_en:
|
|
- MCPService
|
|
- ReportsController
|
|
```
|
|
|
|
---
|
|
|
|
## 4. REFERENCIAS
|
|
|
|
- Entities: @MCH_DEF_ENTITIES
|
|
- Controllers: Ver documentacion API en `/api/docs`
|
|
- Ubicacion: `apps/backend/src/modules/*/services/`
|
|
|
|
---
|
|
|
|
*Definicion canonica v1.0.0 - MiChangarrito*
|