feat: Implement Payment Report feature with repository, service, and controller

This commit is contained in:
2026-10-22 17:32:28 +05:30
parent 7d7e9f1318
commit 455ce699ad
6 changed files with 238 additions and 0 deletions
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
namespace Distribution.Features.PaymentReport;
[ApiController]
[Route("api/reports/payments")]
public class PaymentReportController(PaymentReportService service) : ControllerBase
{
[HttpGet("analytics")]
public async Task<IActionResult> Analytics(
[FromQuery] DateTime? from, [FromQuery] DateTime? to, [FromQuery] Guid? regionId)
{
var f = PaymentReportService.BuildFilter(from, to, regionId);
var error = PaymentReportService.Validate(f);
return error is null ? Ok(await service.GetAnalyticsAsync(f)) : BadRequest(new { message = error });
}
}