// 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.IoTag;

namespace FloraMultiPlatformFrontend.Data.Repositories.Interfaces;

/// <summary>
/// Repository interface for accessing IO tag data from the FeedOPC_{Machine_Code}_IO table.
/// </summary>
public interface IIoTagDataRepository
{
    /// <summary>
    /// Gets IO tag 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 IO tag data.</returns>
    Task<IEnumerable<IoTagData>> GetIoTagDataAsync(
        IEnumerable<int> tagIds,
        string machineCode,
        CancellationToken cancellationToken = default
    );

    /// <summary>
    /// Gets IO tag 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 IO tag data for the specified tag, or null if not found.</returns>
    Task<IoTagData?> GetIoTagDataByIdAsync(
        int tagId,
        string machineCode,
        CancellationToken cancellationToken = default
    );

    /// <summary>
    /// Gets all IO tag 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 IO tag data for the machine.</returns>
    Task<IEnumerable<IoTagData>> GetAllIoTagDataAsync(
        string machineCode,
        CancellationToken cancellationToken = default
    );
}
