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

namespace adas_core.Application.Repositories.Interfaces;

public interface IPatientCarePlanRepository : IMongoRepository<PatientCarePlan>
{
    /// <summary>
    /// Retrieves the list of care plans associated with the specified patient identifier.
    /// </summary>
    /// <param name="patientId">The unique identifier of the patient whose care plans are being requested.</param>
    /// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> records for the patient, or an empty list if no care plans are found.</returns>
    Task<List<PatientCarePlan>> FindByPatientId(ObjectId patientId);
    /// <summary>
    /// Asynchronously retrieves the list of patient care plans associated with the specified user identifier.
    /// </summary>
    /// <param name="userId">The unique identifier of the user whose patient care plans are being requested.</param>
    /// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> objects linked to the specified user.</returns>
    Task<List<PatientCarePlan>> FindByUserId(ObjectId userId);
    /// <summary>
    /// Asynchronously retrieves all patient care plans from the data store.
    /// </summary>
    /// <returns>A task representing the asynchronous operation, containing a list of all <see cref="PatientCarePlan"/> records.</returns>
    Task<List<PatientCarePlan>> FindAll();
    /// <summary>
    /// Updates all records that reference the specified old ObjectId so they are associated with the new patient ObjectId.
    /// </summary>
    /// <param name="patientid">The string identifier of the patient whose related records will be updated.</param>
    /// <param name="patientId">The new ObjectId that will replace the previous identifier in the matching records.</param>
    /// <param name="oldId">The previous ObjectId whose references should be replaced across the matching records.</param>
    Task UpdateManyObjectId(string patientid, ObjectId patientId, ObjectId oldId);
}