using Nexus.Api.Services;

namespace Nexus.Api.Tests;

internal sealed class StubOpenClawWriteGate(
    OpenClawWriteGateDecision? decision = null) : IOpenClawWriteGate
{
    public OpenClawWriteGateDecision Decision { get; set; } =
        decision ?? OpenClawWriteGateDecision.Permit();

    public List<(string Method, string Scope)> Evaluations { get; } = [];

    public Task<OpenClawWriteGateDecision> EvaluateAsync(
        string method,
        string requiredScope = "operator.admin",
        CancellationToken cancellationToken = default)
    {
        Evaluations.Add((method, requiredScope));
        return Task.FromResult(Decision);
    }
}
