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