Aman-Mittal opened a new issue, #302:
URL: https://github.com/apache/fineract-backoffice-ui/issues/302

   Part of #299. Best taken after #300.
   
   ## Business value
   
   `run-report.component.ts:250` reads the report type from the query string 
and never uses it again. Every report is run as tabular HTML (`:308`), so:
   
   - **Chart reports render as a table of numbers.** The report was authored as 
a chart because the shape of the data is the point; a table of the same figures 
is not a substitute for a trend line in a board pack.
   - **Pentaho and BIRT reports cannot be produced at all.** These are the 
document-shaped outputs — member statements, loan certificates, receipts, 
regulatory returns. An institution that must hand a member a statement cannot 
do it from this UI.
   
   ## What to build
   
   Dispatch on the report type rather than discarding it:
   
   | Type | Behaviour |
   |---|---|
   | Table / SMS | current tabular render (keep as-is) |
   | Chart | render the returned series as a chart |
   | Pentaho / BIRT | request the appropriate output type and deliver the 
returned file |
   
   For charts, the app already has chart components under 
`src/app/shared/components/charts` used by the dashboard — reuse them rather 
than adding a second charting approach.
   
   For file outputs, go through the `DOWNLOAD` adapter in 
`src/app/core/adapters`, not `window.open` or a synthesised anchor. That 
boundary exists for exactly this (ADR-0003), and a direct DOM download will 
fail lint.
   
   ## Two things to get right
   
   1. **Pentaho parameters are named differently.** Pentaho-style reports use a 
distinct parameter naming convention from table reports, so the values 
collected by #300 may need mapping before they are sent. Verify against a live 
instance rather than assuming they pass through unchanged.
   2. **A failed export must say so.** A download that silently does nothing is 
indistinguishable from a click that missed. Surface the failure.
   
   ## Testing
   
   - **Unit spec:** each report type takes its own branch and requests the 
correct output type.
   - **Unit spec:** a chart report passes the returned series to the chart 
component; a table report does not.
   - **Unit spec:** file output goes through the `DOWNLOAD` adapter — assert 
against the fake from `provideFakeAdapters()` in `src/app/testing/adapters.ts`, 
which records downloads.
   - **Mocked e2e:** run a chart report and assert a chart renders rather than 
a table.
   
   ## Scope
   
   In scope: type dispatch, chart rendering, file output for document-shaped 
reports.
   
   Out of scope: parameter discovery (#300) and cascading (#301); report 
definition CRUD; the export-to-CSV path that already exists at `:271`, beyond 
making sure it still works.
   
   ## Getting started
   
   - `src/app/features/reporting/run-report.component.ts`
   - Charts: `src/app/shared/components/charts`
   - Download adapter: `src/app/core/adapters` — see 
`DOCS/adr/0003-adapter-boundary.md`
   - `npm test`, `npm run lint:prune`, `npm run i18n:check`, `npm run build`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to