using adas_core.Domain.Models;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;
namespace adas_core.Application.Services.Interfaces;
public interface IMedicineService
{
///
/// Asynchronously retrieves a entity by its unique code identifier.
/// Returns null when no matching medicine is found.
///
/// The unique code used to look up the medicine.
/// A task that represents the asynchronous operation, containing the matching or null if not found.
Task GetByCode(string code);
///
/// Retrieves a list of medicines that match the provided codes or notes.
///
/// A list of strings representing the codes or notes used to look up medicines.
/// A task that represents the asynchronous operation. The task result contains a list of objects matching the provided codes or notes.
Task> GetByCodeOrNote(List codeNote);
///
/// Retrieves a medicine by its name, returning null if no matching medicine is found.
///
/// The name of the medicine to look up.
/// A task that represents the asynchronous operation, containing the matching or null if not found.
Task GetByName(string name);
///
/// Retrieves the medicines associated with the specified patient treatments.
///
/// The collection of patient treatments, which may include null entries, whose medicines are to be obtained.
/// A task that represents the asynchronous operation, containing the collection of medicines linked to the provided treatments.
Task> GetMedicinesOfTreatments(IEnumerable treatments);
///
/// Asynchronously retrieves the collection of active medicines associated with the specified patient.
///
/// The unique identifier of the patient whose active medicines are being queried.
/// A task that represents the asynchronous operation, containing an enumerable collection of active records for the patient.
Task> GetActiveMedicinesByPatient(ObjectId patientId);
///
/// Retrieves a paginated list of medicines based on the provided filter criteria.
///
/// The pagination filter containing page size, page number, and optional search criteria.
/// A task that represents the asynchronous operation, containing a with the requested items and pagination metadata.
Task> GetPaginatedMedicines(PaginationFilter filter);
///
/// Asynchronously retrieves all medicines from the data store.
///
/// A task that represents the asynchronous operation, containing a list of all entities.
Task> GetAll();
///
/// Retrieves a medicine by its unique identifier.
///
/// The unique identifier of the medicine to retrieve.
/// A task that represents the asynchronous operation, containing the if found; otherwise, null.
Task GetMedicineById(ObjectId medicineId);
///
/// Asynchronously posts a new medicine and returns the created medicine, or null if the operation fails.
///
/// The medicine entity to be posted.
/// A task that represents the asynchronous operation. The task result contains the posted , or null if the medicine could not be posted.
Task PostMedicine(Medicine medicine);
///
/// Updates an existing medicine in the data store and returns the updated entity, or null if no matching medicine was found.
///
/// The medicine entity containing the updated values to be persisted.
/// A task that represents the asynchronous update operation. The result is the updated when the update succeeds, or null when the medicine does not exist.
Task UpdateMedicine(Medicine medicine);
///
/// Deletes a medicine record identified by the specified identifier.
///
/// The unique identifier of the medicine to delete.
Task DeleteMedicineById(ObjectId medicineId);
///
/// Asynchronously retrieves all available types as a list of string identifiers.
///
/// A task representing the asynchronous operation, containing a list of type identifiers.
Task> GetAllTypes();
///
/// Asynchronously retrieves all available groups, returning their identifiers or names as a list of strings.
///
/// A task that represents the asynchronous operation. The task result contains a list of strings representing all groups.
Task> GetAllGroups();
///
/// Asynchronously retrieves all available names.
///
/// A task that represents the asynchronous operation. The task result contains a list of all names.
Task> GetAllNames();
///
/// Asynchronously retrieves the complete list of available codes from the data source.
///
/// A task representing the asynchronous operation, containing a list of code strings.
Task> GetAllCodes();
}