Files
KArtSell.Aegis/src/KArtSell.Modules.SignalEngine/Domain/SellPolicyResult.cs
T
kjh2064 dcd1322d41
ci / backend (push) Failing after 12s
ci / frontend (push) Failing after 19s
ci / static (push) Failing after 45s
Initial commit: Add project files
2026-08-02 05:15:36 +09:00

53 lines
1.5 KiB
C#

namespace KArtSell.Modules.SignalEngine.Domain;
public enum PolicyDisposition
{
NotApplicable = 0,
Blocked = 1,
Applied = 2
}
public sealed record PolicyTraceEntry(
string PolicyId,
int Priority,
PolicyDisposition Disposition,
string ReasonCode,
decimal RequestedSellRatioOfLot,
decimal AppliedSellRatioOfLot,
bool StrategicCoreClampApplied);
public sealed record SellPolicyResult(
PolicyTraceEntry Trace,
SellDecision? Decision)
{
public static SellPolicyResult NotApplicable(string policyId, int priority, string reasonCode)
=> new(new PolicyTraceEntry(policyId, priority, PolicyDisposition.NotApplicable, reasonCode, 0m, 0m, false), null);
public static SellPolicyResult Blocked(
string policyId,
int priority,
string reasonCode,
decimal requestedSellRatioOfLot = 0m)
=> new(new PolicyTraceEntry(
policyId,
priority,
PolicyDisposition.Blocked,
reasonCode,
requestedSellRatioOfLot,
0m,
false), null);
public static SellPolicyResult Applied(
SellDecision decision,
decimal requestedSellRatioOfLot,
bool strategicCoreClampApplied)
=> new(new PolicyTraceEntry(
decision.PolicyId,
decision.Priority,
PolicyDisposition.Applied,
decision.ReasonCode,
requestedSellRatioOfLot,
decision.SellRatioOfLot,
strategicCoreClampApplied), decision);
}