feat(F-150): completed feature
This commit is contained in:
31
work/artifacts/F-150/architect.md
Normal file
31
work/artifacts/F-150/architect.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# F-150 — Architect
|
||||
|
||||
## Feature
|
||||
Reporting: CSV export.
|
||||
|
||||
## Objetivo
|
||||
Exportar datasets filtrados a CSV con permisos, metadatos y paginación/servidor streaming.
|
||||
|
||||
## Diseño
|
||||
|
||||
### Ruta backend
|
||||
`GET /reporting/export/:report?from=&to=&...`
|
||||
- `:report` ∈ {summary, sales, products}
|
||||
- Requiere `REPORTING_EXPORT` (admin y editor).
|
||||
- Filtros iguales que los endpoints de reporting existentes.
|
||||
- Content-Type: `text/csv; charset=utf-8`.
|
||||
- Content-Disposition: `attachment; filename="<report>-<from>-<to>.csv"`.
|
||||
- Streaming: Fetch por páginas (500 rows por página) y escribir cada página al stream raw.
|
||||
- CSV headers: filas de metadatos (primera línea `# report:..., from:..., to:..., exported_at:...`).
|
||||
|
||||
### Admin
|
||||
- Componente `<ExportButton report="sales" filters={...} />`.
|
||||
- Botón que abre el CSV en nueva pestaña.
|
||||
|
||||
## Acceptance Criteria
|
||||
AC1: GET /reporting/export/{summary|sales|products} devuelve CSV válido.
|
||||
AC2: Permiso REPORTING_EXPORT requerido (admin y editor).
|
||||
AC3: Streaming: respuesta grande no carga todo en memoria.
|
||||
AC4: CSV con headers de metadatos (# report, from, to, exported_at).
|
||||
AC5: Admin ExportButton en las páginas de reporting.
|
||||
AC6: tsc 0, verify.sh verde.
|
||||
Reference in New Issue
Block a user