using adas_core.Domain.Models; using adas_core.Domain.Models.DTO; using adas_core.Domain.Models.MongoModels; using MongoDB.Bson; namespace adas_core.Application.Services.Interfaces; public interface IAdminPanelService { /// /// Asynchronously deletes a unit identified by its unique identifier from the data store. /// Returns a result indicating whether the deletion was successful (e.g., true if the unit was found and removed, false otherwise). /// /// The unique identifier of the unit to delete. /// A task that represents the asynchronous operation. The task result is true if the unit was successfully deleted; otherwise, false if the unit was not found. Task DeleteUnitById(ObjectId unitId); /// /// Inserts a new into the data store and returns the inserted entity. /// /// The to insert. /// A that resolves to the inserted , or if the insert could not be completed. Task InsertUnit(Unit unit); #region Patient /// /// Creates a new patient based on the provided admin panel request. /// /// The admin panel request containing the data needed to create the patient. /// A task that represents the asynchronous operation. The task result contains the created , or null if no patient was created. Task CreatePatient(AdmPanelRequest apiRequest); /// /// Asynchronously retrieves the patient associated with the specified location. /// /// The location used to look up the associated patient. /// A task that resolves to the found at the given location, or null if no patient is associated with that location. Task FindPatientByLocation(PatientLocation location); /// /// Asynchronously retrieves a by their unique patient number. /// /// The unique identifier of the patient to look up. /// A that yields the matching , or null if no patient is found with the specified number. Task FindPatientByPatientNumber(string patientNumber); /// /// Asynchronously retrieves a patient from the data store using the specified unique identifier. /// Returns null when no patient matches the provided identifier. /// /// The unique identifier of the patient to retrieve. /// A task that represents the asynchronous operation. The task result contains the patient if found; otherwise, null. Task FindPatientById(ObjectId id); //List FindAllPatient(); /// /// Asynchronously finds and returns a based on the criteria provided in the admission panel request. /// Returns null when no matching patient is found. /// /// The admission panel request containing the search criteria used to locate the patient. /// A that yields the matching if found, or null otherwise. Task FindPatient(AdmPanelRequest request); /// /// Asynchronously retrieves the dependency information DTO for the specified . /// Returns null when no dependency information is available for the unit. /// /// The unit for which to retrieve dependency information. /// A that yields the unit dependency DTO, or null if none is found. Task GetUnitDependencyDto(Unit unit); /// /// Updates the patient location based on the provided admission panel request. /// /// The admission panel request containing the patient location details to update. /// A task that represents the asynchronous operation. The task result is true if the update was successful; otherwise, false. Task UpdatePatientLocation(AdmPanelRequest request); /// /// Updates the patient data based on the provided admission panel request, using the existing patient record as a reference. /// /// The admission panel request containing the updated patient data. /// The existing patient record to be updated. /// A task that represents the asynchronous operation. The task result is true if the patient data was successfully updated; otherwise, false. Task UpdatePatientData(AdmPanelRequest request, Patient oldPatient); /// /// Archives the specified patient, marking them as inactive while preserving their record. /// /// The patient to be archived. /// A task that represents the asynchronous operation. The task result contains true if the patient was successfully archived; otherwise, false. Task ArchivePatient(Patient patient); #endregion #region ConfigObservations /// /// Asynchronously creates a configuration based on the specified observation. /// /// The observation data used to create the configuration. /// A task that represents the asynchronous create operation, containing a value indicating whether the configuration was created successfully. Task CreateConfig(ConfigObservation configObservation); /// /// Asynchronously updates the configuration based on the provided , applying any required changes derived from the observation data. /// /// The observation data used to determine and apply configuration updates. /// A that represents the asynchronous update operation, containing a value indicating whether the configuration was successfully updated. Task UpdateConfig(ConfigObservation configObservation); /// /// Deletes the configuration observation item identified by the specified identifier. /// /// The unique identifier of the configuration observation item to delete. /// A task that represents the asynchronous operation. The task result is true if the item was successfully deleted; otherwise, false. Task DeleteConfigObservationItem(ObjectId id); #endregion #region Medicienes /// /// Retrieves a entity by its unique identifier from the data store. /// Returns null when no medicine matches the provided identifier. /// /// The unique of the medicine to look up. /// A that resolves to the matching , or null if not found. Task GetMedicineById(ObjectId medicineId); /// /// Asynchronously creates and persists a new medicine record. /// /// The medicine entity to be created and posted. /// A task that represents the asynchronous operation, containing the newly created , or null if the operation fails. Task PostMedicine(Medicine medicine); /// /// Updates an existing medicine record in the system. /// /// The medicine entity containing the updated information to be persisted. /// A task that represents the asynchronous operation. The task result contains the updated if found, or null if the medicine does not exist. Task UpdateMedicine(Medicine medicine); /// /// Deletes a medicine identified by its unique identifier. /// /// The unique identifier of the medicine to delete. /// A task that represents the asynchronous operation. The task result contains true if the medicine was successfully deleted; otherwise, false. Task DeleteMedicineById(string medicineId); #endregion }