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 IDischargeRepository : IMongoRepository<Discharge>
{
    Task Delete(ObjectId id);

    Task Update(Discharge discharge);

    Task UpdateUnit(ObjectId id, string unit);

    Task UpdatePatient(ObjectId id, Patient patient);

    Task<IEnumerable<Discharge>> FindAll();

    Task<Discharge?> FindById(ObjectId id);

    Task<IEnumerable<Discharge>?> FindByUnit(string unit);

    Task<long> CountByUnitId(ObjectId unitId);

    Task<IEnumerable<Discharge>?> FindByDestination(string destination);

    Task<IEnumerable<Discharge>?> FindByService(string service);
    Task<IEnumerable<Discharge>?> GetDischargesByUnitIds(IEnumerable<ObjectId>? unitIds);


    Task<Discharge?> GetDischargeByLocation(PatientLocation location);
    Task<Discharge?> GetByPatientId(ObjectId patientId);

    Task<IEnumerable<Discharge>?> FindByPoCId(ObjectId pocId);
    Task<Discharge?> GetDischargeByPointOfCareId(ObjectId poc);

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

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