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

namespace adas_core.Application.Repositories.Interfaces;

public interface INoticeRepository : IMongoRepository<Notice>
{
    /// <summary>
    /// 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 updates an existing notice with the provided information.
    /// </summary>
    /// <param name="notice">The notice entity containing the updated data to be persisted.</param>
    Task Update(Notice notice);
    /// <summary>
    /// Asynchronously retrieves all notices.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of all <see cref="Notice"/> objects.</returns>
    Task<IEnumerable<Notice>> FindAll();
    /// <summary>
    /// Retrieves a <see cref="Notice"/> by its unique identifier. Returns <c>null</c> when no matching notice is found.
    /// </summary>
    /// <param name="id">The identifier of the notice to look up.</param>
    /// <returns>A task that yields the matching <see cref="Notice"/>, or <c>null</c> if no notice exists for the specified <paramref name="id"/>.</returns>
    Task<Notice?> FindById(ObjectId id);
    /// <summary>
    /// Asynchronously retrieves the collection of notices that match the specified date.
    /// </summary>
    /// <param name="date">The date used to filter the notices to be retrieved.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains a collection of <see cref="Notice"/> objects for the specified date, or <c>null</c> if no matching notices are found.</returns>
    Task<IEnumerable<Notice>?> FindByDate(DateTime date);
    /// <summary>
    /// Asynchronously retrieves the <see cref="Notice"/> entries that match the specified type.
    /// </summary>
    /// <param name="type">The notice type used to filter the lookup.</param>
    /// <returns>A task containing the matching <see cref="Notice"/> items, or <c>null</c> when no results are available.</returns>
    Task<IEnumerable<Notice>?> FindByType(string type);
    /// <summary>
    /// Asynchronously retrieves the <see cref="Notice"/> entities associated with the specified display identifier.
    /// </summary>
    /// <param name="displayId">The display identifier used to locate the matching notices.</param>
    /// <returns>A task that yields the collection of matching <see cref="Notice"/> items, or <c>null</c> if no notices are found.</returns>
    Task<IEnumerable<Notice>?> FindByDisplayId(ObjectId displayId);
}