using FastEndpoints;
using SpaceGame.Api.Universe.Simulation;

namespace SpaceGame.Api.Universe.Api;

public sealed class GetBalanceHandler(IBalanceService balanceService) : EndpointWithoutRequest
{
    public override void Configure()
    {
        Get("/api/balance");
        Policies(AuthPolicyNames.GmAccess);
    }

    public override Task HandleAsync(CancellationToken cancellationToken) =>
      SendOkAsync(balanceService.GetCurrent(), cancellationToken);
}
