using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Abstractions;

public interface IAbsenceRepository
{
    Task<Absence?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
    Task<(IReadOnlyList<Absence> Items, int TotalCount)> GetPagedAsync(
        string? status,
        string? type,
        Guid? employeeId,
        int page,
        int pageSize,
        CancellationToken cancellationToken = default,
        Guid? restrictToEmployeeId = null);
    /// <summary>
    /// Prüft, ob eine nicht gelöschte Abwesenheit der Mitarbeiterin mit einem Status aus
    /// <paramref name="blockingStatusValues"/> (siehe ValueListItem.BlocksAssignment) den Zeitraum
    /// [startDate, endDate] überlappt - Basis der Abwesenheitsprüfung in FR-EM-3.
    /// </summary>
    Task<bool> HasOverlappingAbsenceAsync(
        Guid employeeId,
        DateOnly startDate,
        DateOnly endDate,
        IReadOnlyCollection<string> blockingStatusValues,
        CancellationToken cancellationToken = default);

    Task AddAsync(Absence absence, CancellationToken cancellationToken = default);
    Task UpdateAsync(Absence absence, CancellationToken cancellationToken = default);
    Task<bool> SoftDeleteAsync(Guid id, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<Absence>> GetDeletedAsync(string? search, CancellationToken cancellationToken = default);
    Task<bool> RestoreAsync(Guid id, CancellationToken cancellationToken = default);
    Task SaveChangesAsync(CancellationToken cancellationToken = default);
}
