using RpgRoller.Services;

namespace RpgRoller.Api;

internal static class RollEndpoints
{
    public static RouteGroupBuilder MapRollEndpoints(this RouteGroupBuilder group)
    {
        group.MapGet("/rolls/{rollId:guid}", (Guid rollId, HttpContext context, IGameService game) =>
        {
            var result = game.GetRollDetail(context.GetRequiredSessionToken(), rollId);
            return ApiResultMapper.ToApiResult(result);
        });

        return group;
    }
}