using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.RazorPages;
using TaxBaik.Application.Services;
using TaxBaik.Domain.Entities;
using TaxBaik.Web.Services;

namespace TaxBaik.Web.Pages.Admin.TaxProfiles;

[Authorize(AuthenticationSchemes = AdminAuthDefaults.Scheme)]
public class IndexModel(TaxProfileService taxProfileService) : PageModel
{
    public List<TaxProfile> Items { get; private set; } = [];

    public async Task OnGetAsync(CancellationToken ct = default)
        => Items = (await taxProfileService.GetAllAsync(ct)).ToList();
}
