FactuGES_ERP/docs/architecture/history/dto-schema-naming-legacy.md
David dac22372b9 feat(docs): archive legacy DTO design and naming guidelines, introduce HTTP request flow, module boundaries, and testing guidelines
- Archived historical documents for DTO design and naming conventions.
- Added normative documentation for HTTP request flow and module boundaries.
- Introduced testing guidelines for backend layers.
- Updated onboarding module documentation and clarified onboarding requirements.
- Deprecated backend prompt base and prompt auth documents.
- Adjusted paths in testing documentation for consistency.
2026-09-08 23:40:49 +02:00

103 lines
2.6 KiB
Markdown

# ARCHIVADO — Convención anterior de nombres de schemas DTO
> Estado: **HISTÓRICO — NO NORMATIVO**. El naming y diseño vigentes están en [../dto-guidelines.md](../dto-guidelines.md).
---
# Convención de Nombres de Schemas DTO
Guía específica de naming para schemas DTO. Su referencia vigente es [../dto-guidelines.md](../dto-guidelines.md).
## Alcance
Usa este documento cuando la duda sea cómo nombrar un schema. Si la duda es de semántica, tipado, opcionalidad o modelado del contrato, usa antes la guía general de DTOs.
## Reglas base
1. Usar singular para el nombre base de la entidad: `Customer`, `Product`, `Proforma`.
2. En operaciones sobre recurso único, el verbo va primero.
3. En listados, el sustantivo principal va primero: `CustomerList`, nunca `ListCustomer`.
4. Mantener sufijos estables según el rol del schema.
5. No mezclar convenciones distintas para la misma familia de endpoints.
## Patrones recomendados
### Recurso único
```text
<Verb><Entity><Condition><SchemaRole>
```
Ejemplos:
- `GetCustomerByIdParamsSchema`
- `DeleteCustomerByIdParamsSchema`
- `UpdateIssuedInvoiceByIdCommandSchema`
### Colecciones
```text
<Entity>List<CriteriaOrFilter><SchemaRole>
```
Ejemplos:
- `CustomerListCriteriaSchema`
- `ProformaListResponseSchema`
- `IssuedInvoiceListQuerySchema`
## Sufijos estables
### Request
- `CommandSchema`: body de create, update o patch
- `ParamsSchema`: route params
- `QuerySchema`: query string raw
- `CriteriaSchema`: query normalizada con patrón Criteria
### Response
- `SummarySchema`: item de listado
- `ResourceSchema`: representación completa del recurso
- `DetailResponseSchema`: response de detalle
- `ListResponseSchema`: response de listado
- `CreatedResponseSchema`: confirmación o payload de creación
- `DeletedResponseSchema`: confirmación explícita de borrado cuando no se usa `204`
## Ejemplos
### Customers
- `CreateCustomerCommandSchema`
- `GetCustomerByIdParamsSchema`
- `CustomerListCriteriaSchema`
- `CustomerSummarySchema`
- `CustomerResourceSchema`
- `CustomerListResponseSchema`
### Proformas
- `CreateProformaCommandSchema`
- `UpdateProformaByIdParamsSchema`
- `ProformaListCriteriaSchema`
- `ProformaSummarySchema`
- `ProformaDetailResponseSchema`
## Errores a evitar
- `ListCustomerCriteriaSchema`
- `CustomersListResponseSchema`
- `UpdateCustomerCommandByIdSchema`
- `ProductGetByIdParamsSchema`
## Relación con la guía general
La guía de DTOs define:
- organización por carpetas
- tipado semántico
- manejo de `null`, `optional()` y colecciones
- diseño de `create`, `update`, `list` y `detail`
Este documento solo fija el naming.