docs: update README and CLAUDE.md with expired certificate report feature
This commit is contained in:
24
CLAUDE.md
24
CLAUDE.md
@@ -27,21 +27,33 @@ Non esistono test automatici al momento.
|
||||
|
||||
## Architettura
|
||||
|
||||
Il flusso di generazione è orchestrato da `ReportOrchestrator`:
|
||||
Il flusso di generazione è orchestrato da `ReportOrchestrator`, che sceglie il template in base al campo `Stato` del certificato:
|
||||
|
||||
```
|
||||
HTTP (ISIN) → ReportController → ReportOrchestrator
|
||||
├── CertificateDataService (4 SP → anagrafica, sottostanti, eventi, scenario)
|
||||
├── AnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
├── EventiSectionRenderer → PdfDocument (Sezione 2)
|
||||
├── ScenarioSectionRenderer → PdfDocument (Sezione 3, opzionale)
|
||||
│
|
||||
├── [Stato == "Quotazione"] — report certificati in quotazione (4 sezioni)
|
||||
│ ├── AnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2)
|
||||
│ ├── ScenarioSectionRenderer → PdfDocument (Sezione 3, opzionale)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 4)
|
||||
│
|
||||
├── [Stato != "Quotazione"] — report certificati non in quotazione (3 sezioni)
|
||||
│ ├── ExpiredAnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2, colonne adattate)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 3)
|
||||
│
|
||||
├── ChartDataService (3 SP → dati grafico)
|
||||
├── SkiaChartRenderer → PNG in memoria
|
||||
├── ChartSectionRenderer → PdfDocument (Sezione 4)
|
||||
└── PdfMergerService → byte[] → Response
|
||||
```
|
||||
|
||||
**Aggiungere una nuova sezione PDF**: implementare `IPdfSectionRenderer`, impostare `SectionName` e `Order`, registrare in `Program.cs` come `AddScoped<IPdfSectionRenderer, NuovaSezione>()`. L'orchestratore la include automaticamente ordinandola per `Order`.
|
||||
**Stato certificato**: il campo `Stato` viene dalla SP `rpt_Master_CFT_ISIN`. Valori: `"Quotazione"` (report attivo), `"Scaduto"` / `"Rimborsato"` / `"Revocato"` (report expired). Se `Stato` è vuoto, viene usato il flusso attivo come fallback.
|
||||
|
||||
**Aggiungere una nuova sezione PDF al flusso attivo**: implementare `IPdfSectionRenderer`, impostare `SectionName` e `Order`, registrare in `Program.cs` come `AddScoped<IPdfSectionRenderer, NuovaSezione>()`. L'orchestratore la include automaticamente ordinandola per `Order`.
|
||||
|
||||
**`ExpiredAnagraficaSectionRenderer`**: registrata come `AddScoped<ExpiredAnagraficaSectionRenderer>()` (senza interfaccia) e iniettata direttamente nell'orchestratore — non partecipa al ciclo `IEnumerable<IPdfSectionRenderer>`.
|
||||
|
||||
**Tema**: tutto in `PdfTheme.cs` — colori, font, layout, brush/pen. Modificare lì per aggiornare tutti i renderer.
|
||||
|
||||
|
||||
33
README.md
33
README.md
@@ -5,9 +5,10 @@ Generatore di report PDF per certificati finanziari strutturati, sviluppato in A
|
||||
## Caratteristiche principali
|
||||
|
||||
- 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`
|
||||
- Grafico performance sottostanti (SkiaSharp → PNG in memoria)
|
||||
- Footer con branding opzionale e hyperlink cliccabile
|
||||
- Cache in memoria per ISIN già generati
|
||||
- Cache in memoria per ISIN già generati (chiavi separate per tipo report e branding)
|
||||
- Endpoint per PDF inline, download e grafico standalone
|
||||
- Supporto Docker
|
||||
|
||||
@@ -23,13 +24,25 @@ Generatore di report PDF per certificati finanziari strutturati, sviluppato in A
|
||||
|
||||
## Struttura del report
|
||||
|
||||
### Certificati in quotazione (Stato = "Quotazione") — 4 sezioni
|
||||
|
||||
| Sezione | Contenuto |
|
||||
|---------|-----------|
|
||||
| **1 — Anagrafica** | Header con Tipologia / Data / Bid / Ask, caratteristiche prodotto, analisi KV, tabella sottostanti |
|
||||
| **2 — Eventi** | Lista eventi cedole e autocall (tabella landscape multi-pagina) |
|
||||
| **3 — Scenario** | Scenari di rendimento (opzionale) |
|
||||
| **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
|
||||
|
||||
| Sezione | Contenuto |
|
||||
|---------|-----------|
|
||||
| **1 — Anagrafica (semplificata)** | Header con solo Tipologia, caratteristiche con Valore/Data Rimborso, analisi KV senza Sottostanti né Bid/Ask |
|
||||
| **2 — Eventi** | Lista eventi con colonne adattate (Barriera Cedola, Soglia Rimborso, Barriera Capitale, Rimborso Capitale) |
|
||||
| **3 — Grafico** | Performance storica dei sottostanti |
|
||||
|
||||
Il tipo di report viene selezionato automaticamente dall'orchestratore in base al campo `Stato` restituito dalla SP `rpt_Master_CFT_ISIN`.
|
||||
|
||||
## API Endpoints
|
||||
|
||||
```
|
||||
@@ -102,12 +115,20 @@ Tutto il tema (colori, font, layout, brush/pen) è centralizzato in `CertReports
|
||||
```
|
||||
HTTP (ISIN) → ReportController → ReportOrchestrator
|
||||
├── CertificateDataService (SP → anagrafica, sottostanti, eventi, scenario)
|
||||
├── AnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
├── EventiSectionRenderer → PdfDocument (Sezione 2)
|
||||
├── ScenarioSectionRenderer → PdfDocument (Sezione 3, opzionale)
|
||||
│
|
||||
├── [Stato == "Quotazione"] ──────────────────────────────────────────
|
||||
│ ├── AnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2)
|
||||
│ ├── ScenarioSectionRenderer → PdfDocument (Sezione 3, opzionale)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 4)
|
||||
│
|
||||
├── [Stato != "Quotazione"] ─────────────────────────────────────────
|
||||
│ ├── ExpiredAnagraficaSectionRenderer → PdfDocument (Sezione 1)
|
||||
│ ├── EventiSectionRenderer → PdfDocument (Sezione 2, colonne adattate)
|
||||
│ └── ChartSectionRenderer → PdfDocument (Sezione 3)
|
||||
│
|
||||
├── ChartDataService (SP → dati grafico)
|
||||
├── SkiaChartRenderer → PNG in memoria
|
||||
├── ChartSectionRenderer → PdfDocument (Sezione 4)
|
||||
└── PdfMergerService → byte[] → Response
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user