stabilizaiton work - projects rework for maintenanceability and ui livening

This commit is contained in:
master
2026-02-03 23:40:04 +02:00
parent 074ce117ba
commit 557feefdc3
3305 changed files with 186813 additions and 107843 deletions

View File

@@ -0,0 +1,42 @@
using System.Text.Json.Serialization;
namespace StellaOps.PolicyAuthoritySignals.Contracts;
public sealed record PolicyContract
{
private string _policyId = string.Empty;
[JsonPropertyName("policyId")]
public string PolicyId
{
get => _policyId;
init => _policyId = RequireNonEmpty(value, nameof(PolicyId));
}
[JsonPropertyName("version")]
public string Version { get; init; } = "0.1-draft";
[JsonPropertyName("rulesHash")]
public string? RulesHash { get; init; }
public PolicyContract(string policyId, string? version = null, string? rulesHash = null)
{
PolicyId = policyId;
if (!string.IsNullOrWhiteSpace(version))
{
Version = version;
}
RulesHash = rulesHash;
}
private static string RequireNonEmpty(string value, string paramName)
{
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException("Value cannot be null or whitespace.", paramName);
}
return value;
}
}