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

namespace adas_core.Application.Repositories.Interfaces;

public interface ITreatmentArchiveRepository
{
    /// <summary>
    /// Asynchronously inserts a new patient treatment record into the underlying data store.
    /// </summary>
    /// <param name="patientTreatment">The patient treatment entity to insert.</param>
    Task InsertOneAsync(PatientTreatment patientTreatment);
    /// <summary>
    /// Asynchronously deletes items whose associated date is earlier than the specified cutoff date.
    /// </summary>
    /// <param name="date">The cutoff date; items dated before this value are removed.</param>
    Task DeleteBeforeDate(DateTime date);
    /// <summary>
    /// Asynchronously inserts a batch of <see cref="PatientTreatment"/> records.
    /// </summary>
    /// <param name="treatments">The collection of patient treatment entities to be inserted.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains a <see cref="long"/> value associated with the batch insertion.</returns>
    Task<long> InsertBatch(IEnumerable<PatientTreatment> treatments);

    /// <summary>
    /// Asynchronously retrieves all patient treatment records associated with the specified patient identifier.
    /// </summary>
    /// <param name="patientId">The unique identifier of the patient whose treatments are being queried.</param>
    /// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientTreatment"/> records for the given patient.</returns>
    Task<List<PatientTreatment>> FindAllFromPatient(ObjectId patientId);
}