using KArtSell.Modules.SignalEngine.Domain;

namespace KArtSell.Modules.SignalEngine.Application;

public sealed record GenerateSellDecisionCommand(
    Guid PositionLotId,
    DateTimeOffset AsOf,
    string IdempotencyKey,
    string CorrelationId);

public sealed record GeneratedSellDecision(
    Guid DecisionId,
    string Action,
    decimal SellRatioOfLot,
    decimal TargetSecurityPortfolioWeightAfter,
    string PolicyId,
    string ReasonCode,
    string EvidenceId,
    string DatasetId,
    string ModelVersion,
    string ConfigVersion,
    string CodeSha,
    string DecisionContractVersion,
    int PolicyTraceSchemaVersion,
    bool ReentryEligible,
    IReadOnlyList<PolicyTraceEntry> PolicyTrace,
    DateTimeOffset CreatedAt,
    bool Replayed);

public interface ISellDecisionService
{
    Task<GeneratedSellDecision?> GenerateAsync(
        GenerateSellDecisionCommand command,
        CancellationToken cancellationToken);
}
