Some checks failed
ERP Core CI / Backend Lint (push) Has been cancelled
ERP Core CI / Backend Unit Tests (push) Has been cancelled
ERP Core CI / Backend Integration Tests (push) Has been cancelled
ERP Core CI / Frontend Lint (push) Has been cancelled
ERP Core CI / Frontend Unit Tests (push) Has been cancelled
ERP Core CI / Frontend E2E Tests (push) Has been cancelled
ERP Core CI / Database DDL Validation (push) Has been cancelled
ERP Core CI / Backend Build (push) Has been cancelled
ERP Core CI / Frontend Build (push) Has been cancelled
ERP Core CI / CI Success (push) Has been cancelled
Performance Tests / Lighthouse CI (push) Has been cancelled
Performance Tests / Bundle Size Analysis (push) Has been cancelled
Performance Tests / k6 Load Tests (push) Has been cancelled
Performance Tests / Performance Summary (push) Has been cancelled
- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones en modulos CRM y OpenAPI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
798 lines
31 KiB
Markdown
798 lines
31 KiB
Markdown
# PROXIMA ACCION - ERP Core
|
|
|
|
**Fecha:** 2026-01-07
|
|
**Estado:** MGN-009 Reports + MGN-010 Financial + BE-027 + DOC-001 + FE-003 + TEST-007 + TEST-008 + TEST-009 + PERF-001 + MOB-001 + MOB-002 + BE-028 + MOB-003 + TEST-010 COMPLETADOS
|
|
**Version:** 9.5
|
|
|
|
---
|
|
|
|
## RESUMEN DE ESTADO ACTUAL
|
|
|
|
### MGN-009 Reports - COMPLETADO (100% + Tests)
|
|
|
|
| Sprint | Layer | Estado | SP | Descripcion |
|
|
|--------|-------|--------|---:|-------------|
|
|
| Sprint 8 | Backend | ✅ Completado | 10 | DDL + API Dashboards & Reports |
|
|
| Sprint 9 | Frontend | ✅ Completado | 10 | Dashboard UI (24 archivos) |
|
|
| Sprint 10 | Frontend | ✅ Completado | 8 | Report Builder UI (13 archivos) |
|
|
| Sprint 11 | Frontend | ✅ Completado | 7 | Scheduled Reports UI (11 archivos) |
|
|
| Sprint 12 | Frontend | ✅ Completado | 5 | Paginas, Rutas y Navegacion |
|
|
| Sprint 13 | Testing | ✅ Completado | 5 | Unit Tests (56 tests) |
|
|
|
|
**Progreso MGN-009:** 45/45 SP (100%)
|
|
|
|
### Fases Completadas
|
|
|
|
| Fase | Estado | Fecha |
|
|
|------|--------|-------|
|
|
| Fase 1: Foundation Core (4 modulos P0) | COMPLETADO | 2025-12-05 |
|
|
| Fase 2: Core Business RF (6 modulos) | COMPLETADO | 2025-12-05 |
|
|
| Fase 3: Gap Analysis vs Odoo 18 | COMPLETADO | 2025-12-08 |
|
|
| Fase 4-6: Implementacion Correcciones DDL | COMPLETADO | 2026-01-04 |
|
|
| Fase 7: Validacion Final | COMPLETADO | 2026-01-04 |
|
|
| Fase 8: Cobertura Maxima DDL | COMPLETADO | 2026-01-04 |
|
|
| Fase 9: Frontend Reports | COMPLETADO | 2026-01-07 |
|
|
| Fase 10: Integracion Reports | COMPLETADO | 2026-01-07 |
|
|
| **Fase 11: Unit Tests Reports** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 12: APIs BE-027 P2-P3** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 13: API Docs Swagger** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 14: Dark Mode UI** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 15: Integration Tests + CI** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 16: Performance Tests** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 17: Mobile App Foundation** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 18: Mobile Extended Features** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 19: API Optimization** | **COMPLETADO** | **2026-01-07** |
|
|
| **Fase 20: Mobile Scanner + Testing** | **COMPLETADO** | **2026-01-07** |
|
|
|
|
### Metricas Actuales
|
|
|
|
| Metrica | Valor |
|
|
|---------|-------|
|
|
| Correcciones DDL implementadas | 65 (COR-001 a COR-066) |
|
|
| Tablas en database | 181+ |
|
|
| Schemas | 14 |
|
|
| Features Frontend | 4 (dashboards, report-builder, scheduled-reports, financial) |
|
|
| Componentes React | 48+ |
|
|
| Pages Frontend | 9 (Reports 3, Financial 6) |
|
|
| Unit Tests MGN-009 | 56 (4 archivos) |
|
|
| Unit Tests MGN-010 | 62 (3 archivos) |
|
|
| Tests Suite Frontend | 156 (9 archivos) |
|
|
| Integration Tests Backend | 4 archivos (partners, financial, auth, inventory) |
|
|
| CI Pipeline | GitHub Actions (8 jobs) |
|
|
| Performance Pipeline | Lighthouse CI + k6 Load Tests |
|
|
| Mobile App (Expo) | 30+ archivos (6 screens, auth, navigation, offline, notifications, biometrics, camera) |
|
|
| Mobile Extended | Offline sync, Push notifications, Camera/QR, Biometrics, Scanner Screen |
|
|
| Mobile Tests | 3 test files (auth.store, offline.service, biometrics.service) |
|
|
| Backend Middleware | Cache service, Rate limiting (standard, strict, auth, reports, export) |
|
|
| Cobertura global DDL | ~78% |
|
|
|
|
---
|
|
|
|
## TAREAS COMPLETADAS HOY
|
|
|
|
### FE-001: Crear Paginas Reports ✅
|
|
|
|
**Archivos Creados:**
|
|
- `pages/reports/ReportsPage.tsx` - Landing page con cards de navegacion
|
|
- `pages/reports/ReportBuilderPage.tsx` - Integra componente ReportBuilder
|
|
- `pages/reports/ScheduledReportsPage.tsx` - Integra ScheduleList, ScheduleForm, ExecutionHistory
|
|
|
|
### FE-002: Integrar en Navegacion ✅
|
|
|
|
**Cambios:**
|
|
- `app/router/routes.tsx` - Rutas lazy loading para /reports/*
|
|
- `app/layouts/DashboardLayout.tsx` - Items Dashboards y Reportes en sidebar
|
|
|
|
### TEST-004: Tests Unitarios Reports ✅
|
|
|
|
**Archivos Creados:**
|
|
- `scheduled-reports/__tests__/CronBuilder.test.tsx` - 12 tests
|
|
- `scheduled-reports/__tests__/RecipientManager.test.tsx` - 13 tests
|
|
- `report-builder/__tests__/FilterBuilder.test.tsx` - 10 tests
|
|
- `report-builder/__tests__/EntityExplorer.test.tsx` - 21 tests
|
|
|
|
**Cobertura:**
|
|
- Rendering, interaccion, validacion, estados
|
|
- Mocking de stores (Zustand) y APIs
|
|
- Total: 56 tests nuevos, 94 en suite completa
|
|
|
|
### DB-001: Script Migracion Consolidado ✅
|
|
|
|
**Archivos Creados:**
|
|
- `database/migrations/V8_0_0__erp_core_complete.sql` - Script idempotente
|
|
- `database/migrations/README.md` - Documentacion del proceso
|
|
|
|
**Contenido:**
|
|
- Auth MFA + Email Verification
|
|
- Reports Schema (12 tablas)
|
|
- Verificacion de prerequisitos
|
|
- Script seguro para re-ejecutar
|
|
|
|
### BE-026: Export PDF ✅
|
|
|
|
**Archivos Creados/Modificados:**
|
|
- `backend/src/modules/reports/pdf.service.ts` - Servicio Puppeteer para PDF
|
|
- `backend/src/modules/reports/templates/report-templates.ts` - Templates HTML
|
|
- `backend/src/modules/reports/export.service.ts` - Actualizado para usar PdfService
|
|
- `backend/src/modules/reports/reports.controller.ts` - Nuevos endpoints exportacion
|
|
- `backend/src/modules/reports/reports.routes.ts` - Rutas de exportacion
|
|
|
|
**Funcionalidades:**
|
|
- Generacion PDF desde HTML con Puppeteer
|
|
- Templates especializados: tabular, financial, trialBalance, dashboard
|
|
- Endpoints: POST /executions/:id/export, GET /trial-balance/export
|
|
- Health check: GET /pdf/health
|
|
- Soporte formatos: PDF, XLSX, CSV, JSON, HTML
|
|
|
|
### FE-MGN-005: Frontend Catalogs Index ✅
|
|
|
|
**Archivos Creados:**
|
|
- `frontend/src/pages/catalogs/CatalogsIndexPage.tsx` - Pagina indice de catalogos
|
|
- `frontend/src/features/catalogs/stores/states.store.ts` - Store Zustand para Estados
|
|
|
|
**Archivos Modificados:**
|
|
- `frontend/src/features/catalogs/stores/index.ts` - Export useStatesStore
|
|
- `frontend/src/app/router/routes.tsx` - Ruta /catalogs con CatalogsIndexPage
|
|
|
|
**Funcionalidades:**
|
|
- Pagina indice con cards navegables a cada catalogo
|
|
- Store de estados para gestion CRUD
|
|
- Integracion con sistema de componentes existente
|
|
|
|
### FE-008: UI Financial (MGN-010) ✅
|
|
|
|
**SP:** 15
|
|
**Descripcion:** Frontend completo para modulo financiero
|
|
|
|
**Archivos Creados:**
|
|
- `features/financial/types/financial.types.ts` - 9 enums, 15+ interfaces, DTOs
|
|
- `features/financial/api/financial.api.ts` - API client para 7 endpoints
|
|
- `features/financial/stores/*.ts` - 5 stores Zustand (accounts, journals, invoices, payments, taxes)
|
|
- `pages/financial/FinancialIndexPage.tsx` - Landing page con stats y navegacion
|
|
- `pages/financial/accounts/AccountsPage.tsx` - CRUD cuentas contables
|
|
- `pages/financial/invoices/InvoicesPage.tsx` - CRUD facturas (validar, cancelar)
|
|
- `pages/financial/payments/PaymentsPage.tsx` - CRUD pagos (publicar, conciliar)
|
|
|
|
**Archivos Modificados:**
|
|
- `app/router/routes.tsx` - Rutas /financial/* con lazy loading
|
|
|
|
**Funcionalidades:**
|
|
- Feature structure completa (types, api, stores, pages)
|
|
- Stores con persistencia en sessionStorage
|
|
- Paginas con DataTable, filtros, busqueda, modales
|
|
- Acciones de estado: validar/cancelar facturas, publicar/conciliar pagos
|
|
- Build validado sin errores TypeScript
|
|
|
|
### BE-027-P2: API Reconcile Models ✅
|
|
|
|
**SP:** 5
|
|
**Descripcion:** API CRUD para modelos de reconciliacion financiera
|
|
|
|
**Archivos Creados:**
|
|
- `backend/src/modules/financial/entities/reconcile-model.entity.ts` - Entidad TypeORM
|
|
- `backend/src/modules/financial/entities/reconcile-model-line.entity.ts` - Entidad lineas
|
|
- `backend/src/modules/financial/reconcile-models.service.ts` - Servicio CRUD completo
|
|
|
|
**Archivos Modificados:**
|
|
- `backend/src/modules/financial/entities/index.ts` - Exports nuevas entidades
|
|
- `backend/src/modules/financial/financial.controller.ts` - Zod schemas + handlers
|
|
- `backend/src/modules/financial/financial.routes.ts` - Rutas CRUD + lines
|
|
|
|
**Endpoints:**
|
|
- GET/POST `/api/financial/reconcile-models` - List/Create
|
|
- GET/PUT/DELETE `/api/financial/reconcile-models/:id` - Read/Update/Delete
|
|
- POST/PUT/DELETE `/api/financial/reconcile-models/:id/lines` - Manage lines
|
|
|
|
### BE-027-P3: API HR Skills, Expenses, Payslips ✅
|
|
|
|
**SP:** 13
|
|
**Descripcion:** APIs completas para modulos HR extendidos
|
|
|
|
**Archivos Creados:**
|
|
- `backend/src/modules/hr/skills.service.ts` - SkillTypes, Skills, SkillLevels, EmployeeSkills
|
|
- `backend/src/modules/hr/expenses.service.ts` - ExpenseSheets, Expenses con state machine
|
|
- `backend/src/modules/hr/payslips.service.ts` - PayslipStructures, Payslips, PayslipLines
|
|
- `backend/src/modules/hr/hr-extended.controller.ts` - Controller con Zod schemas (~900 lineas)
|
|
|
|
**Archivos Modificados:**
|
|
- `backend/src/modules/hr/hr.routes.ts` - 40+ nuevas rutas
|
|
- `backend/src/modules/hr/index.ts` - Exports nuevos services/controller
|
|
|
|
**Funcionalidades:**
|
|
- Skills: Tipos, habilidades, niveles, asignacion a empleados
|
|
- Expenses: Hojas de gastos con flujo draft→submitted→approved/rejected→posted→paid
|
|
- Payslips: Estructuras, nominas, lineas con flujo draft→verify→done/cancel
|
|
- Recalculo automatico de totales en sheets y payslips
|
|
|
|
### DOC-001: API Docs Swagger ✅
|
|
|
|
**SP:** 5
|
|
**Descripcion:** Documentacion OpenAPI completa para todos los endpoints
|
|
|
|
**Archivos Modificados:**
|
|
- `backend/src/docs/openapi.yaml` - Documentacion completa (~2768 lineas)
|
|
|
|
**Contenido:**
|
|
- 18 tags organizando endpoints por modulo
|
|
- 12 schemas reutilizables (User, Partner, Product, Invoice, Employee, etc.)
|
|
- 80+ endpoints documentados
|
|
- Schemas de request/response con ejemplos
|
|
- Autenticacion BearerAuth y ApiKeyAuth
|
|
- Parametros de paginacion, filtros y busqueda
|
|
|
|
**Endpoints Documentados:**
|
|
- Auth: login, register, refresh, profile, change-password, logout, MFA, API Keys
|
|
- Users: CRUD completo con roles
|
|
- Partners: CRUD + customers/suppliers convenience endpoints
|
|
- Inventory: Products, Warehouses, Locations, Pickings, Stock
|
|
- Financial: Accounts, Invoices, Payments, Reconcile Models
|
|
- HR: Employees, Departments, Leaves, Payslips, Expense Sheets
|
|
- Dashboards: CRUD + Widgets
|
|
- Reports: Definitions, Executions, Export, Trial Balance
|
|
- Audit: Logs, Security Events
|
|
- System: Settings
|
|
|
|
### FE-003: Tema Dark Mode ✅
|
|
|
|
**SP:** 3
|
|
**Descripcion:** Soporte dark mode completo para frontend
|
|
|
|
**Archivos Creados:**
|
|
- `frontend/src/shared/components/atoms/ThemeSelector/index.tsx` - Componente toggle
|
|
|
|
**Archivos Modificados:**
|
|
- `frontend/tailwind.config.js` - Agregado `darkMode: 'class'`
|
|
- `frontend/src/index.css` - Clases dark: para componentes base
|
|
- `frontend/src/app/providers/index.tsx` - Integrado ThemeProvider
|
|
- `frontend/src/app/layouts/DashboardLayout.tsx` - Dark mode en layout completo
|
|
- `frontend/src/shared/components/atoms/index.ts` - Export ThemeSelector
|
|
|
|
**Funcionalidades:**
|
|
- Toggle en header (icono Sol/Luna/Monitor)
|
|
- 3 modos: Light, Dark, System (detecta preferencia OS)
|
|
- Transicion suave al cambiar tema
|
|
- Persistencia en localStorage
|
|
- Clases dark: en sidebar, header, navigation, cards, inputs, buttons
|
|
|
|
---
|
|
|
|
## TAREAS COMPLETADAS HOY (Continuacion)
|
|
|
|
### TEST-007: Unit Tests Backend - HR & Partners (8 SP) ✅
|
|
|
|
**Descripcion:** Tests unitarios para servicios backend sin cobertura
|
|
|
|
**Archivos Creados:**
|
|
- `tests/factories/hr.factory.ts` - Factory para SkillTypes, Skills, Expenses, Payslips
|
|
- `tests/factories/partners.factory.ts` - Factory para Partners y Rankings
|
|
- `src/modules/hr/__tests__/skills.service.spec.ts` - 17 tests
|
|
- `src/modules/hr/__tests__/expenses.service.spec.ts` - 20 tests
|
|
- `src/modules/partners/__tests__/partners.service.spec.ts` - 15+ tests
|
|
|
|
**Archivos Modificados:**
|
|
- `tests/factories/index.ts` - Exports para nuevas factories
|
|
|
|
**Cobertura:**
|
|
- HR Skills: CRUD SkillTypes, Skills, EmployeeSkills
|
|
- HR Expenses: CRUD ExpenseSheets, state machine (draft→submitted→approved→posted→paid)
|
|
- Partners: CRUD con filtros customer/supplier, tenant isolation
|
|
|
|
**Tests Totales Backend:** 52+ nuevos tests
|
|
|
|
### TEST-008: E2E Tests Frontend - Playwright (8 SP) ✅
|
|
|
|
**Descripcion:** Tests end-to-end con Playwright
|
|
|
|
**Archivos Creados:**
|
|
- `playwright.config.ts` - Configuracion Playwright
|
|
- `e2e/auth.spec.ts` - Tests login, logout, protected routes
|
|
- `e2e/navigation.spec.ts` - Tests sidebar, theme toggle
|
|
- `e2e/partners.spec.ts` - Tests CRUD partners, filtros
|
|
- `e2e/financial.spec.ts` - Tests modulo financiero
|
|
|
|
**Archivos Modificados:**
|
|
- `package.json` - Scripts npm para Playwright
|
|
|
|
**Scripts Disponibles:**
|
|
- `npm run test:e2e` - Ejecutar tests E2E
|
|
- `npm run test:e2e:ui` - UI interactivo
|
|
- `npm run test:e2e:headed` - Con navegador visible
|
|
- `npm run test:e2e:debug` - Modo debug
|
|
- `npm run test:e2e:report` - Ver reporte HTML
|
|
|
|
**Flujos Cubiertos:**
|
|
- Autenticacion: login, logout, rutas protegidas
|
|
- Navegacion: sidebar, enlaces, theme toggle
|
|
- Partners: CRUD, filtros, validacion
|
|
- Financial: index, accounts, invoices, payments
|
|
|
|
### TEST-009: Integration Tests + CI Pipeline (8 SP) ✅
|
|
|
|
**Descripcion:** Tests de integracion con base de datos real y pipeline CI completo
|
|
|
|
**Archivos Creados:**
|
|
- `database/scripts/create-test-database.sh` - Script creacion BD de prueba
|
|
- `database/seeds/test/fixtures.sql` - Fixtures minimos para tests
|
|
- `backend/tests/integration/partners.integration.test.ts` - Tests Partners (15+ tests)
|
|
- `backend/tests/integration/financial.integration.test.ts` - Tests Financial (15+ tests)
|
|
- `backend/tests/integration/auth.integration.test.ts` - Tests Auth (15+ tests)
|
|
- `backend/tests/integration/inventory.integration.test.ts` - Tests Inventory (15+ tests)
|
|
- `.github/workflows/ci.yml` - Pipeline CI completo
|
|
|
|
**CI Pipeline Jobs (8):**
|
|
1. `backend-lint` - ESLint backend
|
|
2. `backend-unit-tests` - Jest unit tests
|
|
3. `backend-integration-tests` - Integration tests con PostgreSQL service
|
|
4. `backend-build` - Compilacion TypeScript
|
|
5. `frontend-lint` - ESLint frontend
|
|
6. `frontend-unit-tests` - Vitest unit tests
|
|
7. `frontend-e2e-tests` - Playwright E2E tests
|
|
8. `database-validation` - Validacion DDL files
|
|
|
|
**Fixtures Incluidos:**
|
|
- 2 tenants (test + isolation)
|
|
- 2 companies
|
|
- 4 users (admin, regular, inactive, other tenant)
|
|
- 5 partners (customer, supplier, both, inactive, other tenant)
|
|
- 9 accounts contables (asset, liability, equity, revenue, expense)
|
|
- 4 journals (cash, bank, sale, purchase)
|
|
- 1 fiscal year + 3 periods
|
|
- 4 products + 3 categories
|
|
- 2 warehouses + 3 locations
|
|
- 2 stock quants (initial inventory)
|
|
- 2 skill types + 3 skills
|
|
|
|
**Test Coverage:**
|
|
- Partners: CRUD, filtros, tenant isolation, credit limit
|
|
- Financial: Accounts, Journals, Fiscal Periods, Journal Entries, Balances
|
|
- Auth: Users, Roles, Companies, Tenants, Sessions
|
|
- Inventory: Categories, Products, Warehouses, Locations, Stock Quants, Valuation
|
|
|
|
### PERF-001: Performance Tests (5 SP) ✅
|
|
|
|
**Descripcion:** Infraestructura de tests de rendimiento
|
|
|
|
**Archivos Creados:**
|
|
- `frontend/lighthouserc.js` - Configuracion Lighthouse CI
|
|
- `backend/tests/performance/load-test.js` - k6 load tests (smoke, load, stress)
|
|
- `backend/tests/performance/api-stress.js` - k6 API stress test
|
|
- `.github/workflows/performance.yml` - CI workflow para performance
|
|
|
|
**Archivos Modificados:**
|
|
- `frontend/vite.config.ts` - Bundle chunking optimization
|
|
- `frontend/package.json` - Scripts: lighthouse, build:analyze
|
|
|
|
**Lighthouse CI:**
|
|
- Core Web Vitals checks (LCP, TBT, CLS)
|
|
- Performance, Accessibility, Best Practices, SEO scores
|
|
- Resource optimization checks
|
|
|
|
**k6 Load Tests:**
|
|
- Smoke test: 1 VU, 30s
|
|
- Load test: 10-20 VUs, 9 min
|
|
- Stress test: 50-100 VUs, 3.5 min
|
|
- Custom metrics por endpoint (auth, partners, products, accounts)
|
|
- Thresholds: <1% errors, p95 <500ms
|
|
|
|
**Bundle Optimization:**
|
|
- vendor-react, vendor-ui, vendor-forms, vendor-state, vendor-utils chunks
|
|
- Source maps solo en desarrollo
|
|
- Chunk size warning: 500KB
|
|
|
|
### MOB-001: Mobile App Foundation (13 SP) ✅
|
|
|
|
**Descripcion:** App movil base con Expo/React Native
|
|
|
|
**Archivos Creados:**
|
|
|
|
*Configuracion:*
|
|
- `mobile/package.json` - Dependencias Expo 51
|
|
- `mobile/app.json` - Configuracion Expo
|
|
- `mobile/tsconfig.json` - TypeScript con path aliases
|
|
|
|
*Types y Services:*
|
|
- `mobile/src/types/index.ts` - Tipos (User, Partner, Product, Invoice, etc.)
|
|
- `mobile/src/services/api.ts` - Axios client con interceptors
|
|
- `mobile/src/stores/auth.store.ts` - Zustand auth state
|
|
- `mobile/src/stores/index.ts` - Exports
|
|
|
|
*Layouts:*
|
|
- `mobile/app/_layout.tsx` - Root layout con auth flow
|
|
- `mobile/app/(auth)/_layout.tsx` - Auth stack
|
|
- `mobile/app/(tabs)/_layout.tsx` - Tab navigation
|
|
|
|
*Auth Screens:*
|
|
- `mobile/app/(auth)/login.tsx` - Login screen
|
|
- `mobile/app/(auth)/forgot-password.tsx` - Password recovery
|
|
|
|
*Main Screens:*
|
|
- `mobile/app/(tabs)/index.tsx` - Home/Dashboard
|
|
- `mobile/app/(tabs)/partners.tsx` - Partners list
|
|
- `mobile/app/(tabs)/products.tsx` - Products list
|
|
- `mobile/app/(tabs)/invoices.tsx` - Invoices list
|
|
- `mobile/app/(tabs)/settings.tsx` - User settings
|
|
|
|
**Features:**
|
|
- Expo Router file-based navigation
|
|
- expo-secure-store para tokens
|
|
- Zustand para state management
|
|
- Auto-refresh de token
|
|
- Tenant isolation via headers
|
|
- 5 tabs: Home, Contactos, Productos, Facturas, Ajustes
|
|
- Pull-to-refresh en listas
|
|
- Filtros y busqueda
|
|
- Mock data para demo
|
|
- Dark mode toggle (preparado)
|
|
|
|
### MOB-002: Mobile App Extended Features (8 SP) ✅
|
|
|
|
**Descripcion:** Funcionalidades extendidas para app movil
|
|
|
|
**Archivos Creados:**
|
|
|
|
*Offline Sync:*
|
|
- `mobile/src/services/offline.ts` - Offline store, cache service, network monitor, sync manager
|
|
- `mobile/src/hooks/useOfflineQuery.ts` - Hooks para offline-first data fetching
|
|
|
|
*Push Notifications:*
|
|
- `mobile/src/services/notifications.ts` - Notification store, service, Android channels
|
|
- `mobile/src/hooks/useNotifications.ts` - Hook para gestion de notificaciones
|
|
|
|
*Camera/QR Scanner:*
|
|
- `mobile/src/services/barcode.ts` - Barcode service, validadores EAN/UPC, QR parser
|
|
- `mobile/src/hooks/useBarcode.ts` - Hook para escaneo de codigos
|
|
- `mobile/src/components/BarcodeScanner.tsx` - Componente full-screen scanner
|
|
|
|
*Biometrics:*
|
|
- `mobile/src/services/biometrics.ts` - Biometric store, service, Face ID/Touch ID
|
|
- `mobile/src/hooks/useBiometrics.ts` - Hook para autenticacion biometrica
|
|
|
|
*Indices y Exports:*
|
|
- `mobile/src/hooks/index.ts` - Export de todos los hooks
|
|
- `mobile/src/components/index.ts` - Export de componentes
|
|
- `mobile/src/services/index.ts` - Export de servicios
|
|
|
|
**Archivos Modificados:**
|
|
- `mobile/package.json` - Nuevas dependencias (async-storage, netinfo, expo-notifications, expo-camera, expo-local-authentication, expo-haptics)
|
|
- `mobile/src/stores/index.ts` - Re-export de stores de servicios
|
|
- `mobile/app/(tabs)/settings.tsx` - Integrado biometrics, notifications, sync status
|
|
|
|
**Features:**
|
|
|
|
*Offline Sync:*
|
|
- AsyncStorage para cache persistente
|
|
- NetInfo para monitoreo de red
|
|
- Sync queue para operaciones offline
|
|
- useOfflineQuery hook con stale-while-revalidate
|
|
- useOfflineMutation hook para mutaciones offline-capable
|
|
|
|
*Push Notifications:*
|
|
- expo-notifications para push/local notifications
|
|
- Android channels configurados (default, alerts, sync)
|
|
- Badge count management
|
|
- Notification history con persistencia
|
|
- Callbacks para received/tapped events
|
|
|
|
*Camera/QR Scanner:*
|
|
- expo-camera para scanner
|
|
- Soporte EAN-13, EAN-8, UPC-A, UPC-E, Code128, Code39, QR
|
|
- Validacion de checksums
|
|
- QR parser para URLs, JSON, app deep links
|
|
- Haptic feedback al escanear
|
|
- Historial de scans
|
|
|
|
*Biometrics:*
|
|
- expo-local-authentication para Face ID/Touch ID/Fingerprint
|
|
- Deteccion de capacidades del dispositivo
|
|
- Login biometrico con token storage
|
|
- Manejo de errores: lockout, not_enrolled, etc.
|
|
- Integracion con Settings screen
|
|
|
|
### BE-028: API Optimization (5 SP) ✅
|
|
|
|
**Descripcion:** Optimización de APIs con caching y rate limiting
|
|
|
|
**Archivos Creados:**
|
|
- `backend/src/shared/services/cache.service.ts` - Servicio de cache Redis
|
|
- `backend/src/shared/middleware/rateLimit.middleware.ts` - Middleware rate limiting
|
|
- `backend/src/shared/middleware/cache.middleware.ts` - Middleware de cache automático
|
|
- `backend/src/shared/middleware/index.ts` - Index de exports
|
|
|
|
**Archivos Modificados:**
|
|
- `backend/src/shared/services/index.ts` - Export cacheService
|
|
|
|
**Features:**
|
|
|
|
*Cache Service:*
|
|
- Redis-based caching con TTL configurable
|
|
- get/set/delete/deletePattern operations
|
|
- getOrSet pattern para fetch automático
|
|
- Cache tags para invalidación granular
|
|
- Cache statistics (hits, misses, hit rate)
|
|
- Key generators para entities, lists, counts, aggregations
|
|
- TTL presets: SHORT (1m), MEDIUM (5m), LONG (15m), VERY_LONG (1h), DAY (24h)
|
|
|
|
*Rate Limiting:*
|
|
- Redis-based sliding window rate limiting
|
|
- Headers X-RateLimit-Limit/Remaining/Reset
|
|
- Pre-configured limiters:
|
|
- `standard`: 100 req/min
|
|
- `strict`: 10 req/min
|
|
- `auth`: 5 req/15min
|
|
- `passwordReset`: 3 req/hour
|
|
- `upload`: 10 req/min
|
|
- `reports`: 5 req/min
|
|
- `export`: 10 req/5min
|
|
- `search`: 60 req/min
|
|
- `webhooks`: 1000 req/min
|
|
- Tier-based dynamic rate limiting
|
|
|
|
*Cache Middleware:*
|
|
- Automatic response caching para GET requests
|
|
- X-Cache header (HIT/MISS)
|
|
- Vary headers support
|
|
- Invalidation por patterns o tags
|
|
- Pre-configured middlewares para list, entity, aggregation, static
|
|
|
|
### MOB-003: Scanner Screen (5 SP) ✅
|
|
|
|
**Descripcion:** Pantalla dedicada para escaneo de productos
|
|
|
|
**Archivos Creados:**
|
|
- `mobile/app/(tabs)/scanner.tsx` - Screen de scanner con product lookup
|
|
|
|
**Archivos Modificados:**
|
|
- `mobile/app/(tabs)/_layout.tsx` - Agregado tab Scanner
|
|
- `mobile/src/types/index.ts` - Tipos ScannedBarcode, ProductBarcode, ParsedQRData
|
|
|
|
**Features:**
|
|
- Selector de modo: Productos, QR, Todos
|
|
- Boton de inicio de escaneo
|
|
- Integracion con BarcodeScanner component
|
|
- Product lookup via API
|
|
- Detalles de producto escaneado
|
|
- Acciones: Agregar a Inventario, Agregar a Pedido
|
|
- Historial de escaneos (ultimos 20)
|
|
- Crear producto si no existe
|
|
- 6 tabs ahora: Home, Contactos, Escáner, Productos, Facturas, Ajustes
|
|
|
|
### TEST-010: Mobile Unit Tests (5 SP) ✅
|
|
|
|
**Descripcion:** Tests unitarios para app móvil
|
|
|
|
**Archivos Creados:**
|
|
- `mobile/jest.config.js` - Configuración Jest
|
|
- `mobile/jest.setup.js` - Setup con mocks de Expo modules
|
|
- `mobile/src/__tests__/auth.store.test.ts` - Tests auth store (12 tests)
|
|
- `mobile/src/__tests__/offline.service.test.ts` - Tests offline service (25+ tests)
|
|
- `mobile/src/__tests__/biometrics.service.test.ts` - Tests biometrics service (20+ tests)
|
|
|
|
**Archivos Modificados:**
|
|
- `mobile/package.json` - Dependencias testing-library
|
|
|
|
**Mocks Configurados:**
|
|
- expo-secure-store
|
|
- @react-native-async-storage/async-storage
|
|
- @react-native-community/netinfo
|
|
- expo-notifications
|
|
- expo-local-authentication
|
|
- expo-camera
|
|
- expo-haptics
|
|
- expo-device
|
|
|
|
**Cobertura:**
|
|
- Auth store: login, logout, loadStoredAuth, setUser, setLoading
|
|
- Offline store: addToQueue, removeFromQueue, updateQueueItem, clearQueue
|
|
- Cache service: set, get, remove, clearAll, getStats
|
|
- Network monitor: start, stop, check
|
|
- Sync manager: getPendingCount, getFailedItems, retryFailed, processQueue
|
|
- Biometric store: enable, disable, updateLastUsed, setCapabilities
|
|
- Biometric service: checkCapabilities, authenticate, enable/disable login
|
|
|
|
---
|
|
|
|
## TAREAS PENDIENTES
|
|
|
|
### Prioridad ALTA (P1)
|
|
|
|
*No hay tareas P1 pendientes.*
|
|
|
|
### Prioridad MEDIA (P2)
|
|
|
|
*No hay tareas P2 pendientes.*
|
|
|
|
### Prioridad BAJA (P3)
|
|
|
|
*No hay tareas P3 pendientes.*
|
|
|
|
---
|
|
|
|
## PROXIMA TAREA SUGERIDA
|
|
|
|
### Opcion A: Mobile App - Detox E2E Tests (P3)
|
|
|
|
**Prioridad:** BAJA
|
|
**SP Estimados:** 5
|
|
**Descripcion:** Tests E2E con Detox para app móvil
|
|
|
|
**Entregables:**
|
|
- Detox configuration
|
|
- E2E tests para auth flow
|
|
- E2E tests para navigation
|
|
- E2E tests para scanner
|
|
|
|
### Opcion B: Backend - Query Optimization (P3)
|
|
|
|
**Prioridad:** BAJA
|
|
**SP Estimados:** 5
|
|
**Descripcion:** Optimización de queries con índices
|
|
|
|
**Entregables:**
|
|
- Análisis de queries lentas
|
|
- Índices adicionales
|
|
- Query explain reports
|
|
- Migration scripts
|
|
|
|
### Opcion C: Mobile App - Orders/Sales Module (P3)
|
|
|
|
**Prioridad:** BAJA
|
|
**SP Estimados:** 8
|
|
**Descripcion:** Módulo de pedidos/ventas en la app
|
|
|
|
**Entregables:**
|
|
- Orders list screen
|
|
- Order detail screen
|
|
- Create order flow
|
|
- Integration con scanner
|
|
|
|
### Opcion D: Otro Proyecto del Workspace
|
|
|
|
**Descripcion:** Cambiar a otro proyecto en workspace-v1
|
|
|
|
---
|
|
|
|
## BACKLOG POR MODULO
|
|
|
|
### MGN-009 Reports (COMPLETADO 100% + PDF Export)
|
|
|
|
| Item | Estado | Notas |
|
|
|------|--------|-------|
|
|
| Dashboard UI | ✅ Completado | Sprint 9 |
|
|
| Report Builder UI | ✅ Completado | Sprint 10 |
|
|
| Scheduled Reports UI | ✅ Completado | Sprint 11 |
|
|
| Paginas/Rutas | ✅ Completado | Sprint 12 |
|
|
| Navegacion | ✅ Completado | Sprint 12 |
|
|
| Tests | ✅ Completado | Sprint 13 (56 tests) |
|
|
| PDF Export | ✅ Completado | BE-026 |
|
|
|
|
### Otros Modulos Core Business
|
|
|
|
| Modulo | Backend | Frontend | Pendientes |
|
|
|--------|---------|----------|------------|
|
|
| MGN-005 Catalogs | ✅ | ✅ | - (Completado) |
|
|
| MGN-006 Settings | ✅ | ✅ | - (Completado) |
|
|
| MGN-007 Audit | ✅ | ✅ | - (Completado) |
|
|
| MGN-008 Notifications | ✅ | ✅ | - (Completado) |
|
|
| MGN-010 Financial | ✅ | ✅ | Journals/Taxes pages (opcional) |
|
|
|
|
---
|
|
|
|
## NOTAS
|
|
|
|
- MGN-009 Reports completado al 100% con PDF Export
|
|
- Las 3 features (dashboards, report-builder, scheduled-reports) integradas
|
|
- Navegacion sidebar actualizada con links a Dashboards y Reportes
|
|
- 56 tests unitarios implementados para componentes de Reports
|
|
- Suite de tests frontend: 94 tests pasando
|
|
- Build validado: TypeScript y Vite sin errores
|
|
- Script de migracion V8_0_0 creado y validado (idempotente)
|
|
- Base de datos recreada exitosamente: 14 schemas, 191 tablas
|
|
- **BE-026 completado**: Puppeteer integrado para generacion PDF real
|
|
- Endpoints de exportacion implementados: /executions/:id/export, /trial-balance/export
|
|
- Templates HTML especializados para reportes financieros
|
|
- **FE-MGN-005 completado**: Pagina indice de catalogos + states.store.ts
|
|
- **FE-004 completado**: Item Catalogos agregado al sidebar
|
|
- **TEST-005 completado**: Tests SQL funciones (8 secciones, 30+ funciones)
|
|
- **FE-008 completado**: UI Financial (MGN-010) - 16 archivos, 15 SP
|
|
- Feature financial completa: types, api, 5 stores
|
|
- 4 paginas: Index, Accounts, Invoices, Payments
|
|
- Build validado sin errores
|
|
- **TEST-006 completado**: Unit Tests Financial - 62 tests en 3 archivos
|
|
- accounts.store.test.ts (22 tests)
|
|
- invoices.store.test.ts (19 tests)
|
|
- payments.store.test.ts (21 tests)
|
|
- **FE-009 completado**: Journals y Taxes Pages - 4 SP
|
|
- JournalsPage.tsx, TaxesPage.tsx creados
|
|
- toggleJournalActive, toggleTaxActive agregados a stores
|
|
- MGN-010 Financial completo con 6 paginas
|
|
- **BE-027 Phase 1 completado**: APIs de Alta Prioridad
|
|
- Financial: Incoterms API (read-only) - entity, service, controller, routes
|
|
- Financial: Payment Methods API (read-only) - entity, service, controller, routes
|
|
- CRM: Tags API (CRUD) - service, controller, routes
|
|
- Inventory: Package Types API (CRUD) - entity, service, controller, routes
|
|
- 4 nuevos endpoints en 3 modulos
|
|
- Build validado sin errores TypeScript
|
|
- **BE-027 Phase 2 completado**: Reconcile Models API
|
|
- 2 entidades TypeORM: ReconcileModel, ReconcileModelLine
|
|
- Servicio CRUD completo con gestion de lineas
|
|
- 9 endpoints para CRUD y lines management
|
|
- **BE-027 Phase 3 completado**: HR Extended APIs
|
|
- Skills: 4 servicios (SkillTypes, Skills, SkillLevels, EmployeeSkills)
|
|
- Expenses: ExpenseSheets con state machine + Expenses CRUD
|
|
- Payslips: PayslipStructures + Payslips con state machine + PayslipLines
|
|
- hr-extended.controller.ts con ~900 lineas de Zod schemas y handlers
|
|
- 40+ nuevas rutas en hr.routes.ts
|
|
- Build validado sin errores TypeScript
|
|
- **DOC-001 completado**: API Docs Swagger
|
|
- openapi.yaml con ~2768 lineas de documentacion
|
|
- 18 tags, 12 schemas, 80+ endpoints documentados
|
|
- Swagger UI disponible en /api/v1/docs
|
|
- **FE-003 completado**: Dark Mode UI
|
|
- ThemeSelector component con 3 variantes (icon, buttons, dropdown)
|
|
- Tailwind darkMode: 'class' habilitado
|
|
- ThemeProvider integrado en AppProviders
|
|
- DashboardLayout con soporte dark mode completo
|
|
- Transicion suave y persistencia en localStorage
|
|
- **TEST-007 completado**: Unit Tests Backend HR & Partners
|
|
- 2 nuevas factories: hr.factory.ts, partners.factory.ts
|
|
- 3 archivos de tests: skills.service.spec, expenses.service.spec, partners.service.spec
|
|
- 52+ tests nuevos para HR Skills, HR Expenses, Partners
|
|
- Cobertura: state machines, tenant isolation, CRUD operations
|
|
- **TEST-008 completado**: E2E Tests Frontend con Playwright
|
|
- playwright.config.ts configurado
|
|
- 4 archivos de tests E2E: auth, navigation, partners, financial
|
|
- Scripts npm: test:e2e, test:e2e:ui, test:e2e:headed, test:e2e:debug
|
|
- Flujos criticos: login, navegacion, CRUD partners, modulo financiero
|
|
- **TEST-009 completado**: Integration Tests + CI Pipeline
|
|
- Script create-test-database.sh para BD de prueba
|
|
- fixtures.sql con datos minimos: tenants, users, partners, accounts, products
|
|
- 4 archivos de tests de integracion: partners, financial, auth, inventory
|
|
- CI Pipeline en .github/workflows/ci.yml con 8 jobs
|
|
- PostgreSQL service en CI para integration tests
|
|
- Database validation job para DDL files
|
|
- Coverage reports con codecov
|
|
- Artifacts para builds y Playwright reports
|
|
- **PERF-001 completado**: Performance Tests
|
|
- Lighthouse CI para Web Vitals (LCP, TBT, CLS)
|
|
- k6 load tests: smoke, load, stress scenarios
|
|
- Bundle optimization: 5 vendor chunks
|
|
- Performance workflow en GitHub Actions
|
|
- Thresholds configurados: <1% errors, p95 <500ms
|
|
- **MOB-001 completado**: Mobile App Foundation
|
|
- Expo 51 con Router file-based navigation
|
|
- Auth flow completo: login, forgot-password
|
|
- 5 screens: Home, Partners, Products, Invoices, Settings
|
|
- Zustand state management
|
|
- expo-secure-store para tokens
|
|
- API client con interceptors y auto-refresh
|
|
- Pull-to-refresh y filtros en listas
|
|
- **MOB-002 completado**: Mobile Extended Features (8 SP)
|
|
- Offline sync: AsyncStorage cache, NetInfo, sync queue, useOfflineQuery/Mutation hooks
|
|
- Push notifications: expo-notifications, Android channels, badge management
|
|
- Camera/QR: expo-camera, EAN/UPC validation, QR parser, BarcodeScanner component
|
|
- Biometrics: expo-local-authentication, Face ID/Touch ID, biometric login
|
|
- Settings screen integrada con todas las features
|
|
- 13 archivos nuevos: 4 services, 4 hooks, 1 component, 4 index files
|
|
- **BE-028 completado**: API Optimization (5 SP)
|
|
- Cache service con Redis: get/set/delete, TTL configurable, tags, statistics
|
|
- Rate limiting middleware: sliding window, pre-configured limiters
|
|
- Cache middleware: automatic response caching, invalidation por patterns/tags
|
|
- TTL presets: SHORT (1m), MEDIUM (5m), LONG (15m), VERY_LONG (1h), DAY (24h)
|
|
- Rate limit presets: standard, strict, auth, reports, export, search, webhooks
|
|
- **MOB-003 completado**: Scanner Screen (5 SP)
|
|
- Pantalla dedicada para escaneo de productos
|
|
- Selector de modo: Productos, QR, Todos
|
|
- Product lookup via API con detalles
|
|
- Acciones: Agregar a Inventario, Agregar a Pedido
|
|
- Historial de escaneos (últimos 20)
|
|
- 6 tabs: Home, Contactos, Escáner, Productos, Facturas, Ajustes
|
|
- **TEST-010 completado**: Mobile Unit Tests (5 SP)
|
|
- Jest config con mocks de Expo modules
|
|
- 3 test files: auth.store, offline.service, biometrics.service
|
|
- 57+ tests cubriendo stores, services, hooks
|
|
- testing-library/react-hooks para hooks testing
|
|
|
|
---
|
|
|
|
*Ultima actualizacion: 2026-01-07 (v9.5)*
|