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

namespace adas_core.Application.Repositories.Interfaces;

public interface IPoCSettingsRepository : IMongoRepository<PoCSettings>
{
    /// <summary>
    /// Asynchronously deletes the entity identified by the specified <see cref="ObjectId"/>.
    /// </summary>
    /// <param name="id">The <see cref="ObjectId"/> of the entity to delete.</param>
    Task Delete(ObjectId id);

    /// <summary>
    /// Asynchronously retrieves the Point of Care (PoC) settings associated with the specified patient location.
    /// </summary>
    /// <param name="location">The patient location used to look up the corresponding PoC settings.</param>
    /// <returns>A task that returns the matching <see cref="PoCSettings"/> if found; otherwise, <c>null</c>.</returns>
    Task<PoCSettings?> FindByLocation(PatientLocation location);

    /// <summary>
    /// Retrieves the PoC (Proof of Concept) settings associated with the specified identifier.
    /// </summary>
    /// <param name="id">The unique identifier of the PoC settings to retrieve.</param>
    /// <returns>A task that represents the asynchronous operation. The result contains the matching <see cref="PoCSettings"/> if found, or <c>null</c> when no settings exist for the given identifier.</returns>
    Task<PoCSettings?> FindById(ObjectId id);

    /// <summary>
    /// Updates the PoC (Proof of Concept) settings with the provided values.
    /// </summary>
    /// <param name="pocSettings">The PoC settings to be applied.</param>
    /// <returns>A task that represents the asynchronous update operation.</returns>
    Task Update(PoCSettings pocSettings);

    /// <summary>
    /// Asynchronously retrieves all <see cref="PoCSettings"/> records.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="PoCSettings"/> entries.</returns>
    Task<List<PoCSettings>> FindAll();
}