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

namespace adas_core.Application.Services.Interfaces;

public interface INoticeService
{
    /// <summary>
    /// Asynchronously deletes the specified notice.
    /// </summary>
    /// <param name="notice">The notice to delete.</param>
    /// <returns>A task that represents the asynchronous delete operation.</returns>
    /// <!-- aidoc:v1 sig=d29db0d -->
    Task DeleteNoticeAsync(Notice notice);
    /// <summary>
    /// Asynchronously deletes a notice identified by the specified identifier.
    /// </summary>
    /// <param name="noticeId">The unique identifier of the notice to delete.</param>
    /// <!-- aidoc:v1 sig=d491033 -->
    Task DeleteNoticeByIdAsync(ObjectId noticeId);
    /// <summary>
    /// Asynchronously retrieves a <see cref="Notice"/> entity by its unique identifier from the data store.
    /// Returns <see langword="null"/> when no notice matches the provided identifier.
    /// </summary>
    /// <param name="noticeId">The <see cref="ObjectId"/> that uniquely identifies the notice to retrieve.</param>
    /// <returns>A <see cref="Task{T}"/> containing the matching <see cref="Notice"/>, or <see langword="null"/> if no notice is found.</returns>
    /// <!-- aidoc:v1 sig=ed98d3c -->
    Task<Notice?> GetNoticeByIdAsync(ObjectId noticeId);
    /// <summary>
    /// Asynchronously retrieves a collection of notices filtered by the specified notice type.
    /// The task result may be null when no notices match the given type.
    /// </summary>
    /// <param name="noticeType">The type of notice to filter by.</param>
    /// <returns>A task containing an enumerable of matching <see cref="Notice"/> objects, or null if none are found.</returns>
    /// <!-- aidoc:v1 sig=532654c -->
    Task<IEnumerable<Notice>?> GetNoticeByTypeAsync(string noticeType);
    /// <summary>
    /// Asynchronously retrieves a collection of notices.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of <see cref="Notice"/> objects.</returns>
    /// <!-- aidoc:v1 sig=d3b0c51 -->
    Task<IEnumerable<Notice>> GetNoticesAsync();
    /// <summary>
    /// Inserts a new notice into the data store.
    /// </summary>
    /// <param name="notice">The notice entity to insert.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains the inserted <see cref="Notice"/>, or <c>null</c> if the notice could not be inserted.</returns>
    /// <!-- aidoc:v1 sig=9bc91b1 -->
    Task<Notice?> InsertNotice(Notice notice);
    /// <summary>
    /// Asynchronously updates an existing notice in the system.
    /// </summary>
    /// <param name="notice">The notice entity containing the updated information to be persisted.</param>
    /// <!-- aidoc:v1 sig=a1ae02b -->
    Task UpdateNoticeAsync(Notice notice);
    /// <summary>
    /// Persists the provided API request to the data store.
    /// </summary>
    /// <param name="apiRequest">The API request to be saved.</param>
    /// <!-- aidoc:v1 sig=274a023 -->
    Task SaveRequest(ApiRequest apiRequest);
    /// <summary>
    /// Asynchronously persists the specified API request.
    /// </summary>
    /// <param name="apiRequest">The API request to save.</param>
    /// <!-- aidoc:v1 sig=24f178e -->
    Task SaveRequestAsync(ApiRequest apiRequest);
    /// <summary>
    /// Asynchronously retrieves the collection of notices associated with the specified display identifier.
    /// </summary>
    /// <param name="displayId">The identifier of the display whose notices should be retrieved.</param>
    /// <returns>A task that returns the notices for the display, or <c>null</c> when no notices are found for the given display.</returns>
    /// <!-- aidoc:v1 sig=9e0ab44 -->
    Task<IEnumerable<Notice>?> GetNoticesByDisplayId(ObjectId displayId);
}