Files
2026-07-21 14:41:46 +07:00

23 lines
836 B
C#

using Indotalent.ConfigBackEnd.Extensions;
using Indotalent.Features.Root.Home.Cqrs;
using MediatR;
using Microsoft.AspNetCore.Authentication.JwtBearer;
namespace Indotalent.Features.Root.Home;
public static class HomeEndpoint
{
public static void MapHomeEndpoints(this IEndpointRouteBuilder app)
{
var group = app.MapGroup("/dashboard").WithTags("Dashboard")
.RequireAuthorization(policy => policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
.RequireAuthenticatedUser());
group.MapGet("/wms-stats", async (IMediator mediator) =>
{
var result = await mediator.Send(new GetWmsDashboardQuery());
return result.ToApiResponse("WMS Dashboard data retrieved successfully");
})
.WithName("GetWmsDashboardStats");
}
}