using adas_core.Domain.Enums;
using adas_core.Domain.Models.DTO.Display;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.GroupedObservations;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;
using MongoDB.Driver;

namespace adas_core.Application.Repositories.Interfaces;

public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
{
    Task<List<DisplayConfig>> GetAll();
    IFindFluent<DisplayConfig, DisplayConfigSummary> GetAllPaginated(PaginationFilter request);
    Task<List<DisplayConfig>> GetByType(DisplayConfigEnums.DisplayType type);
    Task<DisplayConfig?> GetById(ObjectId id);
    Task<DisplayConfig?> GetDefault(DisplayConfigEnums.DisplayType type);
    Task<DisplayConfig?> InsertOneAsyncAndReturn(DisplayConfig config);
    Task<SmartDisplay?> UpdateSmartDisplay(ObjectId displayConfigId, SmartDisplay? newDisplayConfig);

    Task<DisplayNurse?> UpdateDisplayNurse(ObjectId displayConfigId, DisplayNurseDto? newDisplayConfig,
        List<string> nurseObs);

    Task<DisplayConfig?> GetDefaultByUnitIdAndType(ObjectId unitId, DisplayConfigEnums.DisplayType displayType);
    Task<bool> UpdateConfigColor(ObjectId objectIdConfigDisplay, ColorConfig colorConfig);
    Task<bool> UpdateSetHomeBanner(ObjectId objectIdConfigDisplay, List<BannerItem> bannerItems);
    Task<bool> UpdateBaseConfig(ObjectId objectIdConfigDisplay, DisplayConfig baseConfig);
    Task<bool> UpdateHeaderConfig(ObjectId objectIdConfigDisplay, HeaderConfig headerConfig);
    Task<bool> UpdateDisplayConfigHospitalName(ObjectId objectIdConfigDisplay, string name);
    Task<bool> UpdateFieldList(ObjectId objectIdConfigDisplay, List<Field> fields);
    Task<DisplayConfig?> DeleteDisplayConfig(ObjectId objectIdConfigDisplay);
    Task<List<DisplayConfigMinimalResponse>> GetAllCompact();
    Task<List<ObjectId>> GetAllByCardConfigId(ObjectId cardConfigId);
    Task<List<ObjectId>> GetAllByCardConfigIdAndRotating(ObjectId cardConfigId);
    Task<bool> UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId);
    Task<bool> AddChartId(ObjectId? displayConfigId, ObjectId newChartIdToAdd);
    Task<UpdateResult> UpdateDeletedChartConfig(ObjectId deletedId);
    Task<ChartConfig> GetChartConfig(ObjectId objectIdConfigChart);
    Task<bool> UpdateDetailConfigId(ObjectId? displayConfigId, ObjectId? resultId);
    Task<List<ObjectId>> GetAllByCardDetailConfigId(ObjectId baseConfigId);
}