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

namespace adas_core.Application.Repositories.Interfaces;

public interface IDisplayDetailConfigRepository : IMongoRepository<CardDetailsConfig>
{
    /// <summary>
    /// Asynchronously retrieves all card details configurations from the data source.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="CardDetailsConfig"/> entries.</returns>
    Task<List<CardDetailsConfig>> GetAll();
    /// <summary>
    /// Retrieves a <see cref="CardDetailsConfig"/> by its unique identifier.
    /// Returns <see langword="null"/> when no matching configuration is found.
    /// </summary>
    /// <param name="configId">The identifier of the card details configuration to retrieve.</param>
    /// <returns>A task that represents the asynchronous operation, containing the matching <see cref="CardDetailsConfig"/> or <see langword="null"/> if not found.</returns>
    Task<CardDetailsConfig?> GetById(ObjectId configId);
    /// <summary>
    /// Asynchronously inserts a new card details configuration and returns the inserted entity.
    /// </summary>
    /// <param name="config">The card details configuration to insert.</param>
    /// <returns>A task representing the asynchronous operation, containing the inserted <see cref="CardDetailsConfig"/>, or <c>null</c> if no entity was returned.</returns>
    Task<CardDetailsConfig?> InsertOneAsyncAndReturn(CardDetailsConfig config);
    /// <summary>
    /// Updates a single card details configuration record asynchronously.
    /// </summary>
    /// <param name="config">The card details configuration to update. May be <see langword="null"/>.</param>
    /// <returns>A task that represents the asynchronous operation, containing the update response with the updated <see cref="CardDetailsConfig"/> or <see langword="null"/> when no configuration is found.</returns>
    Task<UpdateResponse<CardDetailsConfig?>> UpdateOne(CardDetailsConfig? config);
    /// <summary>
    /// Deletes a single <see cref="CardDetailsConfig"/> identified by its unique identifier.
    /// </summary>
    /// <param name="configId">The unique identifier of the <see cref="CardDetailsConfig"/> to delete.</param>
    /// <returns>A task that represents the asynchronous operation, containing the deleted <see cref="CardDetailsConfig"/>, or <c>null</c> if no matching configuration was found.</returns>
    Task<CardDetailsConfig?> DeleteOne(ObjectId configId);
}