// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using FloraMultiPlatformFrontend.Presentation.Models.Diagnosis;

namespace FloraMultiPlatformFrontend.Data.Repositories.Interfaces;

/// <summary>
/// Repository interface for accessing release data from the FeedOPC_{Machine_Code}_Release_TBM table.
/// </summary>
public interface IReleaseDataRepository
{
    /// <summary>
    /// Gets release data for the specified tag IDs and machine code.
    /// </summary>
    /// <param name="tagIds">The collection of tag IDs to retrieve data for.</param>
    /// <param name="machineCode">The machine code to use for table selection.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns>A collection of release data.</returns>
    Task<IEnumerable<ReleaseData>> GetReleaseDataAsync(
        IEnumerable<int> tagIds,
        string machineCode,
        CancellationToken cancellationToken = default
    );

    /// <summary>
    /// Gets release data for a specific tag ID and machine code.
    /// </summary>
    /// <param name="tagId">The tag ID to retrieve data for.</param>
    /// <param name="machineCode">The machine code to use for table selection.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns>The release data for the specified tag, or null if not found.</returns>
    Task<ReleaseData?> GetReleaseDataByTagIdAsync(
        int tagId,
        string machineCode,
        CancellationToken cancellationToken = default
    );

    /// <summary>
    /// Gets all release data for the specified machine code.
    /// </summary>
    /// <param name="machineCode">The machine code to use for table selection.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns>A collection of all release data for the machine.</returns>
    Task<IEnumerable<ReleaseData>> GetAllReleaseDataAsync(
        string machineCode,
        CancellationToken cancellationToken = default
    );

    /// <summary>
    /// Resets the WasInactive flags of all Releases
    /// </summary>
    /// <returns></returns>
    Task ResetReleaseFlagsAsync();
}
