initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Indotalent.ConfigBackEnd.Extensions;
|
||||
using Indotalent.Features.Sales.PaymentReceiveReport.Cqrs;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
|
||||
namespace Indotalent.Features.Sales.PaymentReceiveReport;
|
||||
|
||||
public static class PaymentReceiveReportEndpoint
|
||||
{
|
||||
public static void MapPaymentReceiveReportEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.MapGroup("/payment-receive-report").WithTags("PaymentReceiveReports")
|
||||
.RequireAuthorization(policy => policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
|
||||
.RequireAuthenticatedUser());
|
||||
|
||||
group.MapGet("/", async (IMediator mediator) =>
|
||||
{
|
||||
var result = await mediator.Send(new GetPaymentReceiveReportListQuery());
|
||||
return result.ToApiResponse("Payment receive report list retrieved successfully");
|
||||
})
|
||||
.WithName("GetPaymentReceiveReportList");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user