using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.MongoModels;
using MongoDB.Bson;
using MongoDB.Driver;

namespace adas_core.Application.Repositories.Interfaces;

public interface IDisplayRepository : IMongoRepository<Display>
{
    Task<List<Display>> GetAll();

    // ¿FilterByAuthorities / FindByUser
    // Delete
    // FindByUnit
    // UpdateConfig -> algo en específico? ¿Toda la colección?
    Task<List<Display>> GetByPointOfCare(PointOfCare pointOfCare);

    // Task<List<Display>> GetByUser();
    Task<Display?> GetByName(string name);
    Task<Display?> GetById(ObjectId id);
    Task<Display?> GetByIdWithConfigDisplay(ObjectId id);
    Task<List<Display>> GetByUnitId(ObjectId id);
    Task<List<Display>> GetByConfigId(ObjectId id);

    Task<Display?> UpdatePointOfCareList(ObjectId objectId, List<ObjectId> listPocObId);
    Task<Display?> UpdateConfig(ObjectId oldDisplayId, DisplayConfig newDisplayConfigCast);
    Task<Display?> UpdateConfigPreset(ObjectId objectIdDisplay, ObjectId objectIdConfigDisplay);
    Task<Display> UpdateName(Display display, string name);
    IFindFluent<Display, Display> GetPaginatedDisplays(PaginationFilter filter);
    Task<long> IsDisplayConfigInUse(ObjectId displayConfigId);
    Task<Display?> UpdateConfigId(ObjectId objectId, ObjectId displayConfigId);
    Task<long> CountByUnitId(ObjectId unitId);
    Task<bool> DeleteManyByUnitId(ObjectId unitId);
    Task<List<Display>> GetByCardConfigId(ObjectId configId);
}