namespace StellaOps.Excititor.Core; public sealed record VexConsensusHold { public VexConsensusHold( string vulnerabilityId, string productKey, VexConsensus candidate, DateTimeOffset requestedAt, DateTimeOffset eligibleAt, string reason) { if (string.IsNullOrWhiteSpace(vulnerabilityId)) { throw new ArgumentException("Vulnerability id must be provided.", nameof(vulnerabilityId)); } if (string.IsNullOrWhiteSpace(productKey)) { throw new ArgumentException("Product key must be provided.", nameof(productKey)); } if (eligibleAt < requestedAt) { throw new ArgumentOutOfRangeException(nameof(eligibleAt), "EligibleAt cannot be earlier than RequestedAt."); } VulnerabilityId = vulnerabilityId.Trim(); ProductKey = productKey.Trim(); Candidate = candidate ?? throw new ArgumentNullException(nameof(candidate)); RequestedAt = requestedAt; EligibleAt = eligibleAt; Reason = string.IsNullOrWhiteSpace(reason) ? "unspecified" : reason.Trim(); } public string VulnerabilityId { get; } public string ProductKey { get; } public VexConsensus Candidate { get; } public DateTimeOffset RequestedAt { get; } public DateTimeOffset EligibleAt { get; } public string Reason { get; } }