using Intentor.Models;

namespace Intentor.Data;

public interface IIntentRepository
{
    Task<List<Intent>> GetAllAsync(CancellationToken ct = default);
    Task<Intent?> GetByIdAsync(int id, CancellationToken ct = default);

    /// <summary>
    /// Returns an intent including Requirements/RequiredBy graph.
    /// </summary>
    Task<Intent?> GetByIdWithDependenciesAsync(int id, CancellationToken ct = default);

    Task<Intent> AddAsync(Intent intent, CancellationToken ct = default);
    Task UpdateAsync(Intent intent, CancellationToken ct = default);
    Task DeleteAsync(int id, CancellationToken ct = default);

    /// <summary>
    /// Sets "intent requires [requiredIntentIds]" (replaces existing requirements).
    /// </summary>
    Task SetRequirementsAsync(int intentId, IEnumerable<int> requiredIntentIds, CancellationToken ct = default);
}
