auth layer implemented

This commit is contained in:
Kalana B. Thilakarathna
2026-10-09 09:37:05 +05:30
parent 3c17047550
commit 9adfff48a7
26 changed files with 367 additions and 85 deletions
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Distribution.Features.Payment;
@@ -7,6 +8,7 @@ namespace Distribution.Features.Payment;
public class PaymentController(PaymentService service) : ControllerBase
{
[HttpGet]
[Authorize("invoice.view")]
public async Task<IActionResult> GetByInvoice(Guid invoiceId)
{
var result = await service.GetByInvoiceIdAsync(invoiceId);
@@ -14,6 +16,7 @@ public class PaymentController(PaymentService service) : ControllerBase
}
[HttpPost]
[Authorize("payment.manage")]
public async Task<IActionResult> Create(Guid invoiceId, CreatePaymentRequest request, CancellationToken ct)
{
try