FactuGES_ERP/apps/web
david cf07de4836 feat: add proforma customer change evaluation utility
- Implemented `evaluateProformaCustomerChange` function to assess changes in customer details for proforma invoices.
- Introduced types for customer change details, blockers, field differences, and fiscal targets.
- Added utility functions for normalizing text and formatting recipient information.

test: add unit tests for customer payment resolver

- Created tests for `CustomerPaymentResolver` to validate payment term retrieval and handling of inactive terms.
- Ensured proper behavior when clearing payment terms and handling non-existent terms.

test: add unit tests for customer default payment term resolver

- Developed tests for `CustomerDefaultPaymentTermResolver` to verify default payment term resolution logic.
- Included scenarios for creating customers with and without explicit payment term IDs.

feat: implement customer default payment term resolver

- Created `CustomerDefaultPaymentTermResolver` to manage default payment term resolution during customer creation.
- Integrated with company finder and payment resolver services.

test: add unit tests for create customer use case

- Implemented tests for `CreateCustomerUseCase` to ensure correct handling of payment term IDs during customer creation.
- Validated behavior when no explicit payment term ID is provided.

test: add unit tests for update customer use case

- Developed tests for `UpdateCustomerUseCase` to verify payment term handling during customer updates.
- Ensured that inactive payment terms are not assigned and that explicit null values are respected.

feat: add dependency injection for customer company services

- Implemented DI for customer company dependencies to facilitate service resolution.

test: add tests for customer create data utility

- Created tests for `buildCustomerCreateData` to validate payment term handling based on user input.
2026-08-17 11:25:34 +02:00
..
public . 2025-05-28 16:21:09 +02:00
src feat: add proforma customer change evaluation utility 2026-08-17 11:25:34 +02:00
.env.acana Subida a producción como Acana 2025-11-27 20:07:30 +01:00
.env.development . 2025-05-27 19:47:03 +02:00
.env.production Subida a producción como Acana 2025-11-28 16:00:18 +01:00
.env.rodax Subida a producción como Acana 2025-11-27 20:07:30 +01:00
Dockerfile . 2025-11-04 16:59:37 +01:00
index.html v0.6.5 2026-05-05 13:34:36 +02:00
package.json feat: add proforma customer change evaluation utility 2026-08-17 11:25:34 +02:00
README.md feat: add error handling and feedback state management for customer and proforma updates 2026-08-06 13:03:48 +02:00
tsconfig.app.json . 2026-07-14 20:39:31 +02:00
tsconfig.json v0.6.2 2026-04-23 12:34:00 +02:00
tsconfig.node.json . 2025-05-10 10:40:40 +02:00
vite.config.mts Identity -> pantalla de login 2026-07-05 13:43:13 +02:00

apps/web

Aplicación frontend principal del ERP.

Documentación canónica

Runtime actual de autenticación

La app usa @erp/identity/client como runtime actual.

Flujo actual

  • La sesión y la empresa activa se resuelven según el flujo documentado en docs/frontend/auth-and-company-selection.md.
  • Las rutas tenant-scoped deben respetar las reglas de X-Company-Id documentadas en docs/architecture/tenant-context.md.

Headers

  • No duplicar aquí la matriz de headers.
  • Consultar docs/frontend/auth-and-company-selection.md para endpoints excluidos y tenant-context.md para reglas tenant-scoped.

App company switcher

Componente:

apps/web/src/layout/app-company-switcher.tsx

Propósito:

  • mostrar la empresa activa real en el layout autenticado
  • permitir cambiar entre availableCompanies de la sesión actual

Reglas:

  • usar el contexto de identity
  • no manejar tokens
  • no llamar directamente a GET /companies/available
  • no usar companySlug para auth
  • no modificar el access token
  • respetar el flujo canónico documentado en docs/frontend/auth-and-company-selection.md

Refresh automático

La app implementa refresh automático global sobre 401.

La semántica completa de retry, exclusiones y limpieza de sesión se documenta en docs/frontend/auth-and-company-selection.md.