using Library.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Supabase;

namespace Library
{
    public interface ISuitService
    {
        Task<List<Suits>> GetAllSuitsAsync();
    }
    public class SuitService : ISuitService
    {
        private readonly Client _client;

        public SuitService(Client client)
        {
            _client = client;
        }

        public async Task<List<Suits>> GetAllSuitsAsync()
        {
            var response = await _client.From<Suits>().Get();
            if (response != null && response.Models != null)
            {
                return response.Models; // Возвращаем модели
            }

            return new List<Suits>();
        }
    }
}
