using MongoDB.Bson;
using adas_core.Domain.Models;
using adas_core.Domain.Models.Pumps;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;

namespace adas_core.Application.Services.Interfaces;

public interface IPumpService: IApiRequestService
{
    // Insert manual 
    Task InsertPumpObservation(PumpObservation obs);

    // Mapping
    Task<PumpObservation?> MapPumpObservation(PumpObservation obs);

    // Consultas por paciente 
    Task<List<PumpObservation>> FindLastPumpObservations(ObjectId patientId, int num = 1);
    Task<Dictionary<ObjectId, DateTime>> FindAllLastPatientObservationTime();

    // Gestión de configuración
    Task<List<ConfigPumpItem>?> GetItemsById(string id);
    Task<List<ConfigPumps>?> GetAllPumpConfig();
    Task<ConfigPumps?> GetPumpConfigsById(string id);
    Task<ConfigPumps?> UpdatePumpConfig(ConfigPumps config);
    Task<ConfigPumps?> InsertPumpConfig(ConfigPumps config);
    Task<bool> DeletePumpConfig(ConfigPumps config);

    // Paginación 
    Task<PaginationResponse<PumpObservation>?> GetPaginatedPump(PaginationFilter filter);

    // Archivado / limpieza
    Task DeleteByPatientId(ObjectId id);
    Task Archive(Patient patient);
    Task ArchiveByPatientId(ObjectId id);

    // Mantenimiento ids
    Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
}