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 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,12 @@ namespace ROLAC.API.Controllers;
|
|||||||
public class Form1099ReportController : ControllerBase
|
public class Form1099ReportController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IForm1099ReportService _svc;
|
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")]
|
[HttpGet("boxes")]
|
||||||
public async Task<IActionResult> Boxes() => Ok(await _svc.GetBoxesAsync());
|
public async Task<IActionResult> Boxes() => Ok(await _svc.GetBoxesAsync());
|
||||||
@@ -22,4 +27,18 @@ public class Form1099ReportController : ControllerBase
|
|||||||
[HttpGet("recipient/{payeeId:int}")]
|
[HttpGet("recipient/{payeeId:int}")]
|
||||||
public async Task<IActionResult> Recipient(int payeeId, [FromQuery] int taxYear)
|
public async Task<IActionResult> Recipient(int payeeId, [FromQuery] int taxYear)
|
||||||
=> await _svc.GetRecipientDetailAsync(payeeId, taxYear) is { } d ? Ok(d) : NotFound();
|
=> await _svc.GetRecipientDetailAsync(payeeId, taxYear) is { } d ? Ok(d) : NotFound();
|
||||||
|
|
||||||
|
[HttpGet("recipient/{payeeId:int}/copy-b")]
|
||||||
|
public async Task<IActionResult> 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<IActionResult> ExportCsv([FromQuery] int taxYear)
|
||||||
|
{
|
||||||
|
var (stream, contentType, fileName) = await _form.ExportFilingCsvAsync(taxYear);
|
||||||
|
return File(stream, contentType, fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ builder.Services.AddScoped<IFinanceDashboardService, FinanceDashboardService>();
|
|||||||
builder.Services.AddScoped<IForm990ReportService, Form990ReportService>();
|
builder.Services.AddScoped<IForm990ReportService, Form990ReportService>();
|
||||||
builder.Services.AddScoped<IForm1099ReportService, Form1099ReportService>();
|
builder.Services.AddScoped<IForm1099ReportService, Form1099ReportService>();
|
||||||
builder.Services.AddScoped<IPayee1099Service, Payee1099Service>();
|
builder.Services.AddScoped<IPayee1099Service, Payee1099Service>();
|
||||||
|
builder.Services.AddScoped<I1099FormService, Form1099FormService>();
|
||||||
builder.Services.AddDataProtection();
|
builder.Services.AddDataProtection();
|
||||||
builder.Services.AddScoped<ITinProtector, TinProtector>();
|
builder.Services.AddScoped<ITinProtector, TinProtector>();
|
||||||
builder.Services.AddScoped<IChurchProfileService, ChurchProfileService>();
|
builder.Services.AddScoped<IChurchProfileService, ChurchProfileService>();
|
||||||
|
|||||||
Reference in New Issue
Block a user