shoc-backend/SeaHaven.Services/Configuration/ServiceOptions.cs
2026-08-11 08:58:19 -03:00

50 lines
1.8 KiB
C#

namespace SeaHaven.Services.Configuration;
public sealed class FrontendOptions
{
public string FrontendBaseUrl { get; set; } = string.Empty;
}
public sealed class JwtOptions
{
public const string SectionName = "JWT";
public string Secret { get; set; } = string.Empty;
public string? ValidIssuer { get; set; }
public string? ValidAudience { get; set; }
}
public sealed class ApprovalsOptions
{
public const string SectionName = "Approvals";
public decimal? UpliftTier1MaxUsd { get; set; }
public string[] Tier1Roles { get; set; } = Array.Empty<string>();
public string[] Tier2Roles { get; set; } = Array.Empty<string>();
// SH-101 uplift lifecycle configuration. Defaults preserve a safe behavior.
public int? ExpirationHours { get; set; } = 72;
public int? EscalationAfterHours { get; set; } = 48;
public int SweepIntervalSeconds { get; set; } = 300;
public string[] Tier1NotificationRecipients { get; set; } = Array.Empty<string>();
public string[] Tier2NotificationRecipients { get; set; } = Array.Empty<string>();
public string[] EscalationRecipients { get; set; } = Array.Empty<string>();
public TimeSpan EffectiveExpiration => TimeSpan.FromHours(ExpirationHours is > 0 ? ExpirationHours.Value : 72);
public TimeSpan EffectiveEscalation => TimeSpan.FromHours(EscalationAfterHours is > 0 ? EscalationAfterHours.Value : 48);
public TimeSpan EffectiveSweepInterval => TimeSpan.FromSeconds(SweepIntervalSeconds is > 0 ? SweepIntervalSeconds : 300);
}
public sealed class VendorPortalOptions
{
public const string SectionName = "VendorPortal";
public int? TokenLifetimeDays { get; set; }
}
public sealed class VendorDocumentsOptions
{
public const string SectionName = "VendorDocuments";
public long MaxSizeBytes { get; set; } = 10 * 1024 * 1024;
}