using adas_core.Domain.Models;
using adas_core.Domain.Models.DTO;
using adas_core.Domain.Models.Masters;
using adas_core.Domain.Models.MongoModels;
using MongoDB.Bson;

namespace adas_core.Application.Repositories.Interfaces;

public interface IAdmissionRepository : IMongoRepository<Admission>
{
    Task Delete(ObjectId id);

    Task Update(Admission admission);

    Task UpdateLocation(ObjectId id, ObjectId newLocation);

    Task UpdatePatient(ObjectId id, Person patient);

    Task<IEnumerable<Admission>> FindAll();

    Task<Admission?> FindById(ObjectId id);

    Task<Admission?> FindByNhc(string nhc);

    //Task<IEnumerable<Admission>?> FindByUnit(string unit);

    Task<List<Admission>> FindByLocation(PatientLocation location);

    Task<IEnumerable<Admission>?> FindByOrigin(string origin);
    Task<Admission?> InsertOneAsyncAndReturn(Admission origin);
    Task<Admission?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
    Task<List<Admission>> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId);
    Task<List<Admission>> FindByPointOfCareId(ObjectId pocId);
    Task<List<Admission>> FindByUnitIds(List<ObjectId> unitIds);
    Task<long> CountByUnitId(ObjectId unitId);

    Task<IEnumerable<Admission>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt,
        string typeName);

    Task<IEnumerable<Admission>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName);
    Task<bool> DeleteAdmissionsByUnitId(ObjectId unitId);
}