docs: fix spec issues - DrawTitolo signature strategy, cache key expired path, showTip guard
This commit is contained in:
@@ -42,21 +42,33 @@ Il flag segue lo stesso pattern di `showBranding` e `showDividend`:
|
|||||||
1. **`CertificateReportData`**: aggiungere `bool ShowNatixis { get; set; } = false;`
|
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`.
|
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`.
|
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`.
|
4. **Renderer — `DrawTitolo`**: i metodi privati `DrawTitolo` in entrambi i renderer hanno firma `(PdfGraphics g, CertificateInfo info, float w, float y)` e non ricevono `CertificateReportData`. La strategia adottata è **Option A**: aggiungere `bool showNatixis` come parametro aggiuntivo e aggiornare il sito di chiamata in `Render` passando `data.ShowNatixis`.
|
||||||
|
```csharp
|
||||||
|
// firma aggiornata
|
||||||
|
private float DrawTitolo(PdfGraphics g, CertificateInfo info, float w, float y, bool showNatixis)
|
||||||
|
// call site in Render
|
||||||
|
y = DrawTitolo(g, info, PageW, y, data.ShowNatixis);
|
||||||
|
// uso interno
|
||||||
|
string tipologia = showNatixis ? info.Nome : info.Categoria;
|
||||||
|
```
|
||||||
|
Il guard di visibilità del box Tipologia va aggiornato di conseguenza:
|
||||||
|
```csharp
|
||||||
|
bool showTip = !string.IsNullOrEmpty(showNatixis ? info.Nome : info.Categoria);
|
||||||
|
```
|
||||||
|
Questo evita che il box venga soppresso quando `natixis=true` ma `Categoria` è vuota.
|
||||||
|
|
||||||
### Cache (Approccio A — flag concatenati)
|
### Cache (Approccio A — flag concatenati)
|
||||||
La chiave cache segue il pattern esistente:
|
La chiave cache segue il pattern esistente. Il suffisso `:natixis` si applica **sia al path base che al path expired** (`{isin}:expired`):
|
||||||
|
|
||||||
| Flags attivi | Chiave cache |
|
| Flags attivi | Chiave base | Chiave expired |
|
||||||
|------------------------|--------------------------|
|
|---------------------------------|--------------------------------|---------------------------------------|
|
||||||
| nessuno | `{isin}` |
|
| nessuno | `{isin}` | `{isin}:expired` |
|
||||||
| branding | `{isin}:branded` |
|
| branding | `{isin}:branded` | `{isin}:expired:branded` |
|
||||||
| natixis | `{isin}:natixis` |
|
| natixis | `{isin}:natixis` | `{isin}:expired:natixis` |
|
||||||
| branding + natixis | `{isin}:branded:natixis` |
|
| branding + natixis | `{isin}:branded:natixis` | `{isin}:expired:branded:natixis` |
|
||||||
| dividend | `{isin}:dividend` |
|
| dividend | `{isin}:dividend` | n/a (dividend solo per expired path) |
|
||||||
| (combinazioni varie) | concatenazione ordinata |
|
|
||||||
|
|
||||||
La logica di composizione della chiave cache va aggiornata in `ReportOrchestrator` per includere il suffisso `:natixis` quando `showNatixis == true`.
|
La logica in `ReportOrchestrator` aggiunge `:natixis` a entrambe le chiavi (base ed expired) quando `showNatixis == true`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user