feat: add natixis query param to all ReportController endpoints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 12:37:50 +01:00
parent 59ff3e9ac8
commit cd1a366f77

View File

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