namespace Hc900Crawler.Core.Application.Feedforward;

// WP3: Feed Ramp Advisor DTO (read-only 계산 결과). 컨트롤러에서 camelCase 익명객체로 매핑.
public sealed record Bound(double Value, string Binding);

public sealed record SteamTarget(double? Fiq6115From, double? Fiq6115To, double? StartOpPct);

/// <summary>계산기 부가 입력(부가 태그값 + flooding 파라미터). null=미가용.</summary>
public sealed record RampExtraInputs(
    double? Pica = null,
    double? Pi6111b = null,
    double? Ti6103 = null,
    double? Fiq6115 = null,
    double? Op = null,
    double FloodLimit = double.NaN,
    double FloodExponentN = 1.8);

public sealed record FeedRampAdvisory(
    int ColumnId,
    double CurrentFeed,
    double TargetFeed,
    double ClampedTarget,
    Bound Ceiling,
    Bound RampRate,
    double RampTimeMin,
    SteamTarget Steam,
    bool SimOverrideActive,
    bool Hold,
    string[] Warnings);

// WP5 3단계: 조성 분율 수동입력(랩/원료분석). key=(columnId,streamKey) → 분율. 미설정 시 config K 사용.
public interface ICompositionStore
{
    void Set(int columnId, string streamKey, double fraction);
    void Clear(int columnId, string streamKey);
    bool TryGet(int columnId, string streamKey, out double fraction);
    IReadOnlyDictionary<string, double> Snapshot();
}

// WP0: Sim Override Layer — advisor가 읽는 입력값을 in-memory로 치환(제어 쓰기 아님).
public interface ISimOverrideStore
{
    bool Enabled { get; }
    void SetMany(bool enabled, IReadOnlyDictionary<string, double> values);
    void Clear();
    bool TryGet(string tag, out double value);
    IReadOnlyDictionary<string, double> Snapshot();
}
