using adas_core.Domain.Enums;
using adas_core.Domain.Models.DTO;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.Masters;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;

namespace adas_core.Application.Services.Interfaces;

public interface IUnitService
{
    Task<List<Unit>> GetAll(bool withPocs = false);
    Task<List<UnitInfoDto>> GetAllCompact();

    Task<UnitInfoDto> GetOneCompact(ObjectId id);

    // Task<Unit?> GetByCodeSysAndCode(string unit);
    Task<Unit?> GetByName(string unit);

    // Task<Unit?> GetByPointOfCare(PointOfCare pointOfCare);
    Task<Unit?> GetInfo(ObjectId id, LocaleEnum? dataLocale, bool fillLists = true, bool withPoCs = false);
    Task<Unit?> GetInfo(ObjectId id, bool withPoCs = true, bool withDevices = true);

    Task<Unit?> FindByPatientId(ObjectId patientId);

    // Task<List<Unit>?> FindByLocation(PatientLocation location);
    Task<Unit?> FindById(ObjectId? id);
    Task<Unit?> FindByName(string? name);

    Task<Unit?> FindByUnitNameOrPocName(string? name, string? pocName);

    //Task<Unit?> FindByPointOfCare(PointOfCare pointOfCare);
    Task<Unit?> InsertOne(Unit unit);
    Task<Unit?> UpdateUnit(Unit unit);
    Task<IEnumerable<Unit>?> FindUnitsByMasterListId(ObjectId masterListId, MasterListType masterListType);
    Task<long> CountUnitsByMasterListId(ObjectId masterListId, MasterListType masterListType);
    Task<IEnumerable<Unit>> FindUnitsByMasterListId(ObjectId masterListId);
    Task<Unit?> UpdateUnitMasterList(UpdateUnitIdListDto updateUnitListDto);
    Task<bool> UpdateConfiguration(ObjectId unitIdParsed, UnitConfiguration unitConfiguration);
    Task<bool> DeleteUnitById(Unit unit);
    Task<Unit?> UpdateUnitInfo(ObjectId unitId, string name, string title, string? configObsId = null);
    Task<PaginationResponse<Unit>> GetPaginatedUnits(PaginationFilter filter, bool withPoCs);
}