- Added SequelizeProformaV2RecipientDomainMapper for mapping recipient data to domain model. - Introduced SequelizeProformaV2TaxesDomainMapper for handling tax data mapping. - Created SequelizeProformaV2RecipientSummaryMapper for summarizing recipient information. - Developed SequelizeProformaV2SummaryMapper for mapping Proforma summary data. - Implemented SequelizeProformaRepositoryV2 for managing Proforma data persistence. - Added SequelizeProformaV2NumberGenerator for generating Proforma numbers. |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .env.acana | ||
| .env.development | ||
| .env.production | ||
| .env.rodax | ||
| Dockerfile | ||
| index.html | ||
| package.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.mts | ||
apps/web
Aplicación frontend principal del ERP.
Runtime actual de autenticación
La app usa:
@erp/identity/client
IdentityAuthSessionProvider
DataSourceProvider
Axios compartido
No debe usarse @erp/auth/client como runtime nuevo.
Flujo actual
login
-> GET /identity/auth/session
-> GET /companies/available
-> resolver empresa activa
-> auto-selección si hay una sola empresa
-> selector si hay varias
-> /no-companies si no hay empresas
-> X-Company-Id en rutas tenant-scoped
Headers
No enviar X-Company-Id a:
POST /identity/auth/login
POST /identity/auth/refresh
POST /identity/auth/logout
GET /identity/auth/session
GET /companies/available
Sí enviarlo a rutas tenant-scoped cuando exista activeCompanyId.
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
availableCompaniesde la sesión actual
Reglas:
- usar el contexto de
identity - no manejar tokens
- no llamar directamente a
GET /companies/available - no usar
companySlugpara auth - no modificar el access token
Refresh automático
La app implementa refresh automático global sobre 401 con retry único por request y refreshPromise compartida.
Si el refresh falla:
- limpiar sesión
- limpiar empresa activa persistida
- redirigir a
/login