using adas_core.Domain.Models;
using adas_core.Domain.Models.MongoModels;
using MongoDB.Bson;
using MongoDB.Driver;
namespace adas_core.Application.Services.Interfaces;
public interface IAppointmentService : IApiRequestService
{
///
/// Asynchronously retrieves the list of patient appointments associated with the specified location.
///
/// The patient location used to filter and locate the relevant appointments.
/// A task that represents the asynchronous operation, containing a list of items matching the given location.
Task> FindByLocation(PatientLocation location);
///
/// Retrieves all appointments associated with the specified patient asynchronously.
///
/// The identifier of the patient whose appointments are being retrieved.
/// A task that represents the asynchronous operation, containing a list of entries for the patient.
Task> GetByPatient(ObjectId patientId);
///
/// Retrieves the list of patient appointments scheduled for today for the specified patient.
///
/// The unique identifier of the patient whose appointments are being queried.
/// A cancellation token to observe while waiting for the task to complete.
/// A task that represents the asynchronous operation, containing a list of entries for the given patient for the current day.
Task> GetTodayByPatient(ObjectId patientId, CancellationToken ct = default);
///
/// Retrieves the list of patient appointments scheduled for today at the specified point of care.
///
/// The identifier of the point of care whose appointments will be returned.
/// The cancellation token used to cancel the asynchronous operation.
/// A task that represents the asynchronous operation, containing a list of today's patient appointments for the specified point of care.
Task> GetTodayByPoc(ObjectId pocId, CancellationToken ct = default);
///
/// Asynchronously finds all records associated with the specified patient identifier.
///
/// The unique identifier of the patient whose appointments are being retrieved.
/// A task that represents the asynchronous operation, containing an for iterating over the matching documents.
Task> FindByPatientIdAsync(ObjectId patientId);
///
/// Asynchronously archives the specified patient, marking the record as archived in the system.
///
/// The patient whose record should be archived.
Task Archive(Patient patient);
///
/// Asynchronously archives records associated with the specified patient identifier.
///
/// The of the patient whose related records should be archived.
Task ArchiveByPatientId(ObjectId id);
///
/// Deletes a record associated with the specified patient identifier.
///
/// The of the patient whose related record should be removed.
Task DeleteByPatientId(ObjectId id);
///
/// Processes an incoming API request in the context of the specified patient, handling the required business logic and returning when the processing completes.
///
/// The API request to be processed.
/// The patient associated with the API request.
Task ProcessApiRequest(ApiRequest apiRequest, Patient patient);
///
/// Updates multiple records by replacing the old with the new one for the field identified by .
///
/// The name of the field whose value should be updated.
/// The new value to set on matching records.
/// The existing value to be replaced.
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
}