docs: update README and DOCS with ?dividend=true feature
- Document ?dividend=true parameter in all report endpoints - Add DividendSectionRenderer to architecture diagrams and file structure - Update Struttura del report sections (Sezione 1b optional) - Document 4-key cache combinations (base/branded/dividend/branded+dividend) - Add 2026-03-23 changelog entries in DOCS.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,8 @@ ReportOrchestrator
|
||||
│ ├── rpt_Events_CFT_ISIN → Eventi
|
||||
│ └── rpt_AnalisiScenario_ISIN → Analisi scenario
|
||||
│
|
||||
├──→ AnagraficaSectionRenderer → PDF Sezione 1
|
||||
├──→ AnagraficaSectionRenderer → PDF Sezione 1 (tabella sottostanti omessa se showDividend=true)
|
||||
├──→ DividendSectionRenderer → PDF Sezione 1b (solo se showDividend=true, landscape A4)
|
||||
├──→ EventiSectionRenderer → PDF Sezione 2
|
||||
├──→ ScenarioSectionRenderer → PDF Sezione 3 (se dati presenti)
|
||||
│
|
||||
@@ -72,14 +73,16 @@ SmartReports/ ← Solution
|
||||
│ └── Implementations/
|
||||
│ ├── CertificateDataService.cs ← Accesso DB: anagrafica, eventi, scenario
|
||||
│ ├── ChartDataService.cs ← Accesso DB: dati grafico (3 SP)
|
||||
│ ├── AnagraficaSectionRenderer.cs ← Sezione 1: anagrafica + sottostanti
|
||||
│ ├── EventiSectionRenderer.cs ← Sezione 2: tabella eventi (multi-pagina)
|
||||
│ ├── ScenarioSectionRenderer.cs ← Sezione 3: matrice scenario con gradiente
|
||||
│ ├── ChartSectionRenderer.cs ← Sezione 4: inserisce chart PNG nel PDF
|
||||
│ ├── SkiaChartRenderer.cs ← Genera il grafico con SkiaSharp
|
||||
│ ├── PdfMergerService.cs ← Merge PDF con Syncfusion
|
||||
│ ├── PdfCacheService.cs ← Cache in memoria (IMemoryCache)
|
||||
│ └── ReportOrchestrator.cs ← Coordinatore principale
|
||||
│ ├── AnagraficaSectionRenderer.cs ← Sezione 1: anagrafica + sottostanti (in quotazione)
|
||||
│ ├── ExpiredAnagraficaSectionRenderer.cs ← Sezione 1: anagrafica + sottostanti (scaduti)
|
||||
│ ├── DividendSectionRenderer.cs ← Sezione 1b: tabella Sottostanti+Dividendi landscape (opzionale)
|
||||
│ ├── EventiSectionRenderer.cs ← Sezione 2: tabella eventi (multi-pagina)
|
||||
│ ├── ScenarioSectionRenderer.cs ← Sezione 3: matrice scenario con gradiente
|
||||
│ ├── ChartSectionRenderer.cs ← Sezione 4: inserisce chart PNG nel PDF
|
||||
│ ├── SkiaChartRenderer.cs ← Genera il grafico con SkiaSharp
|
||||
│ ├── PdfMergerService.cs ← Merge PDF con Syncfusion
|
||||
│ ├── PdfCacheService.cs ← Cache in memoria (IMemoryCache)
|
||||
│ └── ReportOrchestrator.cs ← Coordinatore principale
|
||||
│
|
||||
├── Program.cs ← Entry point, DI, middleware
|
||||
├── GlobalUsings.cs ← Using globali
|
||||
@@ -156,6 +159,15 @@ GET /api/report/download?p={isin_cifrato}
|
||||
GET /api/report/download?alias={alias_id}
|
||||
```
|
||||
|
||||
### Parametri opzionali (tutti gli endpoint report)
|
||||
|
||||
| Parametro | Default | Effetto |
|
||||
|-----------|---------|---------|
|
||||
| `?branding=true` | `false` | Aggiunge footer "Powered by Smart Roots" con hyperlink cliccabile |
|
||||
| `?dividend=true` | `false` | Inserisce pagina landscape Sottostanti+Dividendi dopo la Sezione 1; omette la tabella sottostanti dalla Sezione 1 |
|
||||
|
||||
I parametri sono combinabili: `?branding=true÷nd=true`. La cache usa 4 chiavi distinte: `{isin}`, `{isin}:branded`, `{isin}:dividend`, `{isin}:branded:dividend`.
|
||||
|
||||
### Grafico standalone (richiamabile da altri progetti)
|
||||
|
||||
```
|
||||
@@ -238,6 +250,8 @@ Tutti i servizi sono registrati in `Program.cs`:
|
||||
- `ICertificateDataService` → `CertificateDataService` (Scoped)
|
||||
- `IChartDataService` → `ChartDataService` (Scoped)
|
||||
- `IPdfSectionRenderer` → registrati multipli: `Anagrafica`, `Eventi`, `Scenario` (Scoped)
|
||||
- `ExpiredAnagraficaSectionRenderer` (Scoped, iniettata direttamente nell'orchestratore — senza interfaccia)
|
||||
- `DividendSectionRenderer` (Scoped, iniettata direttamente nell'orchestratore — senza interfaccia)
|
||||
- `IChartSectionRenderer` → `ChartSectionRenderer` (Scoped)
|
||||
- `IPdfMergerService` → `PdfMergerService` (Scoped)
|
||||
- `IReportOrchestrator` → `ReportOrchestrator` (Scoped)
|
||||
@@ -424,3 +438,10 @@ Ogni step del flusso è loggato:
|
||||
| 18/03/2026 | Rimozione colonne Trigger Capitale e Valore Capitale dalla tabella eventi |
|
||||
| 18/03/2026 | Fix bordi tabelle: `PdfTheme.ApplyThinBorders()` con linee 0.25pt |
|
||||
| 18/03/2026 | Fix SkiaSharp: migrazione a API moderna `SKFont` (rimozione warning obsoleti) |
|
||||
| 23/03/2026 | Aggiunto parametro `?dividend=true` su tutti gli endpoint report |
|
||||
| 23/03/2026 | Aggiunto `DividendSectionRenderer`: pagina landscape con tabella Sottostanti+Dividendi (header raggruppati SOTTOSTANTE / BARRIERE / DIVIDENDI) |
|
||||
| 23/03/2026 | Quando `dividend=true`: tabella Sottostanti omessa dalla Sezione 1 (entrambi i flussi attivo/expired) |
|
||||
| 23/03/2026 | Cache aggiornata a 4 chiavi: `{isin}`, `{isin}:branded`, `{isin}:dividend`, `{isin}:branded:dividend` |
|
||||
| 23/03/2026 | Label italianizzate uniformemente: Strike→Livello Iniziale, Buffer→Protezione, Trigger→Livello (Cedola/Richiamo Anticipato), IRR→Tasso Rendimento Interno |
|
||||
| 23/03/2026 | Stile titoli sezioni uniformato (DrawSectionLabel): barra blu 3pt + testo AccentBlue su bianco (Events, Scenario, Dividend) |
|
||||
| 23/03/2026 | Font tabelle Sottostanti allineati a EventiSectionRenderer: `PdfTheme.Header` per header, `PdfTheme.Small` per dati |
|
||||
|
||||
28
README.md
28
README.md
@@ -6,9 +6,10 @@ Generatore di report PDF per certificati finanziari strutturati, sviluppato in A
|
||||
|
||||
- Generazione PDF multi-sezione da dati SQL Server
|
||||
- **Due template report**: certificati in quotazione (4 sezioni) e certificati non in quotazione / scaduti / rimborsati / revocati (3 sezioni) — rilevamento automatico dal campo `Stato`
|
||||
- **Pagina dividendi opzionale** (`?dividend=true`): pagina landscape con tabella Sottostanti+Dividendi a header raggruppati (SOTTOSTANTE / BARRIERE / DIVIDENDI), inserita dopo la Sezione 1
|
||||
- Grafico performance sottostanti (SkiaSharp → PNG in memoria)
|
||||
- Footer con branding opzionale e hyperlink cliccabile
|
||||
- Cache in memoria per ISIN già generati (chiavi separate per tipo report e branding)
|
||||
- Cache in memoria per ISIN già generati (4 chiavi separate: base, branded, dividend, branded+dividend)
|
||||
- Endpoint per PDF inline, download e grafico standalone
|
||||
- Supporto Docker
|
||||
|
||||
@@ -24,20 +25,22 @@ Generatore di report PDF per certificati finanziari strutturati, sviluppato in A
|
||||
|
||||
## Struttura del report
|
||||
|
||||
### Certificati in quotazione (Stato = "Quotazione") — 4 sezioni
|
||||
### Certificati in quotazione (Stato = "Quotazione") — 4 sezioni (+1 opzionale)
|
||||
|
||||
| Sezione | Contenuto |
|
||||
|---------|-----------|
|
||||
| **1 — Anagrafica** | Header con Tipologia / Data / Bid / Ask, caratteristiche prodotto, analisi KV, tabella sottostanti |
|
||||
| **1 — Anagrafica** | Header con Tipologia / Data / Bid / Ask, caratteristiche prodotto, analisi KV, tabella sottostanti (omessa se `?dividend=true`) |
|
||||
| **1b — Sottostanti e Dividendi** *(opzionale, `?dividend=true`)* | Pagina landscape: tabella unificata con colonne SOTTOSTANTE / BARRIERE / DIVIDENDI a 2 livelli di header |
|
||||
| **2 — Eventi** | Lista eventi cedole e autocall (tabella landscape multi-pagina) |
|
||||
| **3 — Scenario** | Scenari di rendimento (opzionale, saltato se assente) |
|
||||
| **4 — Grafico** | Performance storica dei sottostanti |
|
||||
|
||||
### Certificati non in quotazione (Stato = "Scaduto" / "Rimborsato" / "Revocato") — 3 sezioni
|
||||
### Certificati non in quotazione (Stato = "Scaduto" / "Rimborsato" / "Revocato") — 3 sezioni (+1 opzionale)
|
||||
|
||||
| Sezione | Contenuto |
|
||||
|---------|-----------|
|
||||
| **1 — Anagrafica (semplificata)** | Header con solo Tipologia, caratteristiche con Valore/Data Rimborso, analisi KV, tabella sottostanti (9 colonne, senza Bid/Ask) |
|
||||
| **1 — Anagrafica (semplificata)** | Header con solo Tipologia, caratteristiche con Valore/Data Rimborso, analisi KV, tabella sottostanti (omessa se `?dividend=true`) |
|
||||
| **1b — Sottostanti e Dividendi** *(opzionale, `?dividend=true`)* | Pagina landscape: tabella unificata con colonne SOTTOSTANTE / BARRIERE / DIVIDENDI a 2 livelli di header |
|
||||
| **2 — Eventi** | Lista eventi con colonne adattate (Barriera Cedola, Soglia Rimborso, Barriera Capitale, Rimborso Capitale) |
|
||||
| **3 — Grafico** | Performance storica dei sottostanti |
|
||||
|
||||
@@ -55,7 +58,14 @@ GET /api/chart/{isin} → Grafico standalone (PNG/PDF)
|
||||
GET /health → Health check DB + chart service
|
||||
```
|
||||
|
||||
Tutti gli endpoint report accettano `?branding=true` per aggiungere il footer "Powered by Smart Roots".
|
||||
Parametri opzionali accettati da tutti gli endpoint report:
|
||||
|
||||
| Parametro | Default | Effetto |
|
||||
|-----------|---------|---------|
|
||||
| `?branding=true` | `false` | Aggiunge footer "Powered by Smart Roots" con hyperlink |
|
||||
| `?dividend=true` | `false` | Inserisce pagina landscape Sottostanti+Dividendi dopo la Sezione 1; omette la tabella sottostanti dalla Sezione 1 |
|
||||
|
||||
I due parametri sono combinabili: `?branding=true÷nd=true`.
|
||||
|
||||
## Avvio locale
|
||||
|
||||
@@ -117,13 +127,15 @@ HTTP (ISIN) → ReportController → ReportOrchestrator
|
||||
├── CertificateDataService (SP → anagrafica, sottostanti, eventi, scenario)
|
||||
│
|
||||
├── [Stato == "Quotazione"] ──────────────────────────────────────────
|
||||
│ ├── AnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── AnagraficaSectionRenderer → PdfDocument (Sezione 1, senza tabella sottostanti se dividend=true)
|
||||
│ ├── DividendSectionRenderer → PdfDocument (Sezione 1b, solo se ?dividend=true, landscape)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2)
|
||||
│ ├── ScenarioSectionRenderer → PdfDocument (Sezione 3, opzionale)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 4)
|
||||
│
|
||||
├── [Stato != "Quotazione"] ─────────────────────────────────────────
|
||||
│ ├── ExpiredAnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── ExpiredAnagraficaSectionRenderer → PdfDocument (Sezione 1, senza tabella sottostanti se dividend=true)
|
||||
│ ├── DividendSectionRenderer → PdfDocument (Sezione 1b, solo se ?dividend=true, landscape)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2, colonne adattate)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 3)
|
||||
│
|
||||
|
||||
Reference in New Issue
Block a user