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

namespace adas_core.Application.Repositories.Interfaces;

public interface IPatientArchiveRepository : IMongoRepository<Patient>
{
    /// <summary>
    /// Retrieves a <see cref="Patient"/> matching the specified patient number, returning <see langword="null"/> if no matching patient is found.
    /// </summary>
    /// <param name="patientNumber">The unique patient number used to look up the patient.</param>
    /// <returns>A <see cref="Patient"/> instance if a match is found; otherwise, <see langword="null"/>.</returns>
    Task<Patient?> FindByPatientNumber(string patientNumber);

    /// <summary>
    /// Retrieves all patients from the data source.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation, containing a list of all <see cref="Patient"/> entities.</returns>
    Task<List<Patient>> FindAll();
    /// <summary>
    /// Searches for a patient by patient number within a specific distinct unit.
    /// </summary>
    /// <param name="patientNumber">The patient number used to locate the patient.</param>
    /// <param name="unitId">The identifier of the distinct unit in which to perform the search.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Patient"/> if found; otherwise, <c>null</c>.</returns>
    Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
}