using adas_core.Domain.Enums;
using adas_core.Domain.Models.Pumps;
using MongoDB.Bson;

namespace adas_core.Application.Repositories.Interfaces;

public interface IPumpAlarmStateRepository
{
    Task<PumpAlarmState?> FindActiveAsync(
        string deviceId,
        PumpEnum.AlarmType? alarmType,
        string? alarmCodeMdc = null);

    Task<IEnumerable<PumpAlarmState>> FindAllActiveByDeviceAsync(string deviceId);

    Task UpsertActiveAsync(PumpAlarmState state);

    Task RemoveAsync(
        string deviceId,
        PumpEnum.AlarmType? alarmType,
        string? alarmCodeMdc = null);

    //cleanup
    Task DeleteByPatientId(ObjectId patientId);
    
    Task<long> UpdateManyObjectIdByFieldNameAsync(string fieldName, ObjectId newId, ObjectId oldId);
}