diff --git a/CertReports.Syncfusion/Controllers/ReportController.cs b/CertReports.Syncfusion/Controllers/ReportController.cs index 1633b11..b4a1dba 100644 --- a/CertReports.Syncfusion/Controllers/ReportController.cs +++ b/CertReports.Syncfusion/Controllers/ReportController.cs @@ -44,7 +44,8 @@ public class ReportController : ControllerBase [FromQuery(Name = "p")] string? encryptedIsin = null, [FromQuery(Name = "alias")] string? aliasId = null, [FromQuery(Name = "branding")] bool showBranding = false, - [FromQuery(Name = "dividend")] bool showDividend = false) + [FromQuery(Name = "dividend")] bool showDividend = false, + [FromQuery(Name = "natixis")] bool showNatixis = false) { string? isin = null; @@ -71,7 +72,7 @@ public class ReportController : ControllerBase return BadRequest("Specificare il parametro 'p' (ISIN cifrato) o 'alias' (alias ID)."); } - return await GenerateAndReturnPdf(isin, showBranding, showDividend); + return await GenerateAndReturnPdf(isin, showBranding, showDividend, showNatixis); } /// @@ -82,14 +83,15 @@ public class ReportController : ControllerBase public async Task GenerateReportByIsin( string isin, [FromQuery(Name = "branding")] bool showBranding = false, - [FromQuery(Name = "dividend")] bool showDividend = false) + [FromQuery(Name = "dividend")] bool showDividend = false, + [FromQuery(Name = "natixis")] bool showNatixis = false) { if (string.IsNullOrWhiteSpace(isin) || isin.Length < 12) { return BadRequest("ISIN non valido."); } - return await GenerateAndReturnPdf(isin, showBranding, showDividend); + return await GenerateAndReturnPdf(isin, showBranding, showDividend, showNatixis); } /// @@ -100,7 +102,8 @@ public class ReportController : ControllerBase [FromQuery(Name = "p")] string? encryptedIsin = null, [FromQuery(Name = "alias")] string? aliasId = null, [FromQuery(Name = "branding")] bool showBranding = false, - [FromQuery(Name = "dividend")] bool showDividend = false) + [FromQuery(Name = "dividend")] bool showDividend = false, + [FromQuery(Name = "natixis")] bool showNatixis = false) { string? isin = null; @@ -114,7 +117,7 @@ public class ReportController : ControllerBase try { - var pdfBytes = await _orchestrator.GenerateReportAsync(isin, showBranding, showDividend); + var pdfBytes = await _orchestrator.GenerateReportAsync(isin, showBranding, showDividend, showNatixis); return File(pdfBytes, "application/pdf", $"{isin}.pdf"); } catch (Exception ex) @@ -126,12 +129,12 @@ public class ReportController : ControllerBase // ─── Helper ──────────────────────────────────────────────────────── - private async Task GenerateAndReturnPdf(string isin, bool showBranding = false, bool showDividend = false) + private async Task GenerateAndReturnPdf(string isin, bool showBranding = false, bool showDividend = false, bool showNatixis = false) { try { _logger.LogInformation("Richiesta report per ISIN {Isin}", isin); - var pdfBytes = await _orchestrator.GenerateReportAsync(isin, showBranding, showDividend); + var pdfBytes = await _orchestrator.GenerateReportAsync(isin, showBranding, showDividend, showNatixis); // Inline: il PDF si apre direttamente nel browser Response.Headers.Append("Content-Disposition", $"inline; filename={isin}.pdf");