81 lines
3.8 KiB
Markdown
81 lines
3.8 KiB
Markdown
# Design Spec: Campo Memoria + Parametro Natixis
|
|
|
|
**Data:** 2026-03-26
|
|
**Scope:** `CertReports.Syncfusion` — tutti i report (quotazione + expired)
|
|
|
|
---
|
|
|
|
## Panoramica
|
|
|
|
Due feature indipendenti da aggiungere a tutti i report PDF generati dall'API:
|
|
|
|
1. **Campo Memoria** — nuovo KV nella sezione Analisi, subito dopo Leva, che mostra il valore del campo `Memory` della SP `rpt_Master_CFT_ISIN`.
|
|
2. **Parametro `?natixis`** — flag URL che modifica il campo Tipologia: se `true`, usa `info.Nome` dalla SP; se `false` (default), usa `info.Categoria` come adesso.
|
|
|
|
---
|
|
|
|
## Feature 1: Campo Memoria
|
|
|
|
### Origine dati
|
|
- Il campo `Memory` (string) esiste già in `CertificateInfo` (riga 22 di `CertificateModels.cs`) e viene già letto dalla SP `rpt_Master_CFT_ISIN`.
|
|
- Nessuna modifica al modello o al data service necessaria.
|
|
|
|
### Rendering
|
|
- Aggiunto come 9° item nella **colonna sinistra** di `DrawAnalisi` in entrambi i renderer:
|
|
- `AnagraficaSectionRenderer` (report in quotazione)
|
|
- `ExpiredAnagraficaSectionRenderer` (report expired: Scaduto/Rimborsato/Revocato)
|
|
- Posizione: subito dopo `("Leva", ...)`.
|
|
- Valore: `string.IsNullOrWhiteSpace(info.Memory) ? "—" : info.Memory`
|
|
- La colonna sinistra passa da 8 a **9 item**, simmetrica alla colonna destra che ne ha già 9.
|
|
|
|
---
|
|
|
|
## Feature 2: Parametro `?natixis`
|
|
|
|
### Comportamento
|
|
- `?natixis=false` (default): `Tipologia = info.Categoria` — comportamento invariato
|
|
- `?natixis=true`: `Tipologia = info.Nome` (campo Nome dalla SP `rpt_Master_CFT_ISIN`)
|
|
|
|
### Propagazione del flag
|
|
Il flag segue lo stesso pattern di `showBranding` e `showDividend`:
|
|
|
|
1. **`CertificateReportData`**: aggiungere `bool ShowNatixis { get; set; } = false;`
|
|
2. **`ReportController`**: aggiungere `[FromQuery(Name = "natixis")] bool showNatixis = false` a tutti e 3 gli endpoint (`GenerateReport`, `GenerateReportByIsin`, `DownloadReport`) e al metodo helper `GenerateAndReturnPdf`.
|
|
3. **`IReportOrchestrator` / `ReportOrchestrator.GenerateReportAsync`**: aggiungere parametro `bool showNatixis = false`, propagarlo in `CertificateReportData.ShowNatixis`.
|
|
4. **Renderer**: `AnagraficaSectionRenderer.DrawTitolo` e `ExpiredAnagraficaSectionRenderer.DrawTitolo` usano già `info.Categoria` per il box Tipologia — sostituire con `data.ShowNatixis ? info.Nome : info.Categoria`.
|
|
|
|
### Cache (Approccio A — flag concatenati)
|
|
La chiave cache segue il pattern esistente:
|
|
|
|
| Flags attivi | Chiave cache |
|
|
|------------------------|--------------------------|
|
|
| nessuno | `{isin}` |
|
|
| branding | `{isin}:branded` |
|
|
| natixis | `{isin}:natixis` |
|
|
| branding + natixis | `{isin}:branded:natixis` |
|
|
| dividend | `{isin}:dividend` |
|
|
| (combinazioni varie) | concatenazione ordinata |
|
|
|
|
La logica di composizione della chiave cache va aggiornata in `ReportOrchestrator` per includere il suffisso `:natixis` quando `showNatixis == true`.
|
|
|
|
---
|
|
|
|
## File modificati
|
|
|
|
| File | Modifica |
|
|
|------|----------|
|
|
| `Models/CertificateModels.cs` | Aggiungere `bool ShowNatixis` a `CertificateReportData` |
|
|
| `Controllers/ReportController.cs` | Aggiungere param `natixis` a tutti gli endpoint |
|
|
| `Services/Interfaces/IServices.cs` | Aggiornare firma `GenerateReportAsync` |
|
|
| `Services/Implementations/ReportOrchestrator.cs` | Aggiungere param, propagare flag, aggiornare cache key |
|
|
| `Services/Implementations/AnagraficaSectionRenderer.cs` | Aggiungere Memoria in DrawAnalisi; usare ShowNatixis in DrawTitolo |
|
|
| `Services/Implementations/ExpiredAnagraficaSectionRenderer.cs` | Stesse modifiche |
|
|
|
|
---
|
|
|
|
## Non in scope
|
|
|
|
- Modifica al data service o alle stored procedure (i campi `Memory` e `Nome` sono già letti)
|
|
- Modifica a `EventiSectionRenderer`, `ScenarioSectionRenderer`, `ChartSectionRenderer`, `DividendSectionRenderer`
|
|
- Aggiornamento documentazione API pubblica
|