namespace RpgRoller.Api;

public static class ApiEndpointRegistration
{
    public static void MapRpgRollerApi(this IEndpointRouteBuilder app)
    {
        var api = app.MapGroup("/api");
        api.MapSystemEndpoints();
        api.MapAuthEndpoints();

        var authenticatedApi = api.MapGroup(string.Empty).AddEndpointFilter<RequireSessionTokenFilter>();

        authenticatedApi.MapMeEndpoints();
        authenticatedApi.MapCampaignEndpoints();
        authenticatedApi.MapCharacterEndpoints();
        authenticatedApi.MapAdminEndpoints();
        authenticatedApi.MapSkillEndpoints();
        authenticatedApi.MapRollEndpoints();
        authenticatedApi.MapStateEventEndpoints();
    }
}