From 8cb6245560883e96a24b785b7ba5999a15280284 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Thu, 25 Jun 2026 17:21:14 -0700 Subject: [PATCH] feat(1099): add 1099 Copy B + filing CSV download endpoints Injects I1099FormService into Form1099ReportController and adds two Read-gated GET endpoints: recipient/{payeeId}/copy-b (Copy B PDF) and export-csv (filing-data CSV). Registers Form1099FormService in DI. Co-Authored-By: Claude Opus 4.8 --- .../Controllers/Form1099ReportController.cs | 21 ++++++++++++++++++- API/ROLAC.API/Program.cs | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/API/ROLAC.API/Controllers/Form1099ReportController.cs b/API/ROLAC.API/Controllers/Form1099ReportController.cs index fde93e3..c83617e 100644 --- a/API/ROLAC.API/Controllers/Form1099ReportController.cs +++ b/API/ROLAC.API/Controllers/Form1099ReportController.cs @@ -10,7 +10,12 @@ namespace ROLAC.API.Controllers; public class Form1099ReportController : ControllerBase { private readonly IForm1099ReportService _svc; - public Form1099ReportController(IForm1099ReportService svc) => _svc = svc; + private readonly I1099FormService _form; + public Form1099ReportController(IForm1099ReportService svc, I1099FormService form) + { + _svc = svc; + _form = form; + } [HttpGet("boxes")] public async Task Boxes() => Ok(await _svc.GetBoxesAsync()); @@ -22,4 +27,18 @@ public class Form1099ReportController : ControllerBase [HttpGet("recipient/{payeeId:int}")] public async Task Recipient(int payeeId, [FromQuery] int taxYear) => await _svc.GetRecipientDetailAsync(payeeId, taxYear) is { } d ? Ok(d) : NotFound(); + + [HttpGet("recipient/{payeeId:int}/copy-b")] + public async Task CopyB(int payeeId, [FromQuery] int taxYear) + { + var (stream, contentType, fileName) = await _form.RenderCopyBAsync(payeeId, taxYear); + return File(stream, contentType, fileName); + } + + [HttpGet("export-csv")] + public async Task ExportCsv([FromQuery] int taxYear) + { + var (stream, contentType, fileName) = await _form.ExportFilingCsvAsync(taxYear); + return File(stream, contentType, fileName); + } } diff --git a/API/ROLAC.API/Program.cs b/API/ROLAC.API/Program.cs index dcaa3b2..ee7da4e 100644 --- a/API/ROLAC.API/Program.cs +++ b/API/ROLAC.API/Program.cs @@ -160,6 +160,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddDataProtection(); builder.Services.AddScoped(); builder.Services.AddScoped();