namespace KArtSell.Modules.SignalEngine.Domain;

public enum SellAction
{
    Hold = 0,
    PartialSell = 1,
    FullSell = 2
}

public sealed record SellDecision(
    SellAction Action,
    decimal SellRatioOfLot,
    decimal TargetSecurityPortfolioWeightAfter,
    string PolicyId,
    int Priority,
    string ReasonCode,
    string EvidenceId,
    string DatasetId,
    string ModelVersion,
    string ConfigVersion,
    string CodeSha,
    bool ReentryEligible,
    IReadOnlyList<PolicyTraceEntry> PolicyTrace)
{
    public static SellDecision Hold(SellDecisionInput input, IReadOnlyList<PolicyTraceEntry> trace)
        => new(
            SellAction.Hold,
            0m,
            input.CurrentSecurityPortfolioWeight,
            "ALG-HOLD-001",
            0,
            "NO_SELL_CONDITION",
            input.EvidenceId,
            input.DatasetId,
            input.ModelVersion,
            input.ConfigVersion,
            input.CodeSha,
            false,
            trace);
}
