|
| 1 | +namespace sigtran.net.Core.Utilities; |
| 2 | + |
| 3 | +/// <summary> |
| 4 | +/// Describes Phase 6 interoperability tooling readiness. |
| 5 | +/// </summary> |
| 6 | +public sealed class SigtranInteroperabilityReadinessReport |
| 7 | +{ |
| 8 | + /// <summary>Creates an interoperability tooling readiness report.</summary> |
| 9 | + /// <param name="hasTraceFormatter">Whether trace formatting is available.</param> |
| 10 | + /// <param name="hasConformanceRegistry">Whether a conformance vector registry is available.</param> |
| 11 | + /// <param name="hasBuiltInVectors">Whether built-in vectors are available.</param> |
| 12 | + /// <param name="hasSimulatorScripts">Whether simulator scripts are available.</param> |
| 13 | + /// <param name="hasMapSmsFlows">Whether MAP SMS simulator flows are available.</param> |
| 14 | + /// <param name="hasTransportSamples">Whether local transport sample scenarios are available.</param> |
| 15 | + /// <param name="hasSampleCatalog">Whether the sample catalog is available.</param> |
| 16 | + /// <param name="hasCiProfile">Whether the CI verification profile is available.</param> |
| 17 | + /// <param name="hasExternalInteroperabilityLab">Whether external interoperability lab evidence is available.</param> |
| 18 | + public SigtranInteroperabilityReadinessReport( |
| 19 | + bool hasTraceFormatter, |
| 20 | + bool hasConformanceRegistry, |
| 21 | + bool hasBuiltInVectors, |
| 22 | + bool hasSimulatorScripts, |
| 23 | + bool hasMapSmsFlows, |
| 24 | + bool hasTransportSamples, |
| 25 | + bool hasSampleCatalog, |
| 26 | + bool hasCiProfile, |
| 27 | + bool hasExternalInteroperabilityLab) |
| 28 | + { |
| 29 | + HasTraceFormatter = hasTraceFormatter; |
| 30 | + HasConformanceRegistry = hasConformanceRegistry; |
| 31 | + HasBuiltInVectors = hasBuiltInVectors; |
| 32 | + HasSimulatorScripts = hasSimulatorScripts; |
| 33 | + HasMapSmsFlows = hasMapSmsFlows; |
| 34 | + HasTransportSamples = hasTransportSamples; |
| 35 | + HasSampleCatalog = hasSampleCatalog; |
| 36 | + HasCiProfile = hasCiProfile; |
| 37 | + HasExternalInteroperabilityLab = hasExternalInteroperabilityLab; |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary>Whether trace formatting is available.</summary> |
| 41 | + public bool HasTraceFormatter { get; } |
| 42 | + |
| 43 | + /// <summary>Whether a conformance vector registry is available.</summary> |
| 44 | + public bool HasConformanceRegistry { get; } |
| 45 | + |
| 46 | + /// <summary>Whether built-in vectors are available.</summary> |
| 47 | + public bool HasBuiltInVectors { get; } |
| 48 | + |
| 49 | + /// <summary>Whether simulator scripts are available.</summary> |
| 50 | + public bool HasSimulatorScripts { get; } |
| 51 | + |
| 52 | + /// <summary>Whether MAP SMS simulator flows are available.</summary> |
| 53 | + public bool HasMapSmsFlows { get; } |
| 54 | + |
| 55 | + /// <summary>Whether local transport sample scenarios are available.</summary> |
| 56 | + public bool HasTransportSamples { get; } |
| 57 | + |
| 58 | + /// <summary>Whether the sample catalog is available.</summary> |
| 59 | + public bool HasSampleCatalog { get; } |
| 60 | + |
| 61 | + /// <summary>Whether the CI verification profile is available.</summary> |
| 62 | + public bool HasCiProfile { get; } |
| 63 | + |
| 64 | + /// <summary>Whether external interoperability lab evidence is available.</summary> |
| 65 | + public bool HasExternalInteroperabilityLab { get; } |
| 66 | + |
| 67 | + /// <summary>Whether all Phase 6 foundation capabilities are available.</summary> |
| 68 | + public bool FoundationReady => FoundationCapabilityCount == SigtranInteroperabilityReadiness.RequiredFoundationCapabilityCount; |
| 69 | + |
| 70 | + /// <summary>Whether the interoperability tooling can be treated as production-ready.</summary> |
| 71 | + public bool IsProductionReady => FoundationReady && HasExternalInteroperabilityLab; |
| 72 | + |
| 73 | + /// <summary>The implemented foundation capability count.</summary> |
| 74 | + public int FoundationCapabilityCount => |
| 75 | + Count(HasTraceFormatter) |
| 76 | + + Count(HasConformanceRegistry) |
| 77 | + + Count(HasBuiltInVectors) |
| 78 | + + Count(HasSimulatorScripts) |
| 79 | + + Count(HasMapSmsFlows) |
| 80 | + + Count(HasTransportSamples) |
| 81 | + + Count(HasSampleCatalog) |
| 82 | + + Count(HasCiProfile); |
| 83 | + |
| 84 | + /// <summary>Formats a compact readiness summary.</summary> |
| 85 | + /// <returns>The readiness summary.</returns> |
| 86 | + public string Describe() |
| 87 | + { |
| 88 | + return $"interopFoundationReady={FoundationReady} interopProductionReady={IsProductionReady} foundationCapabilities={FoundationCapabilityCount}/{SigtranInteroperabilityReadiness.RequiredFoundationCapabilityCount} trace={HasTraceFormatter} vectors={HasConformanceRegistry} builtInVectors={HasBuiltInVectors} simulators={HasSimulatorScripts} mapSmsFlows={HasMapSmsFlows} transportSamples={HasTransportSamples} sampleCatalog={HasSampleCatalog} ci={HasCiProfile} externalLab={HasExternalInteroperabilityLab}"; |
| 89 | + } |
| 90 | + |
| 91 | + private static int Count(bool value) |
| 92 | + { |
| 93 | + return value ? 1 : 0; |
| 94 | + } |
| 95 | +} |
| 96 | + |
| 97 | +/// <summary> |
| 98 | +/// Provides the Phase 6 interoperability tooling readiness report. |
| 99 | +/// </summary> |
| 100 | +public static class SigtranInteroperabilityReadiness |
| 101 | +{ |
| 102 | + /// <summary>The required foundation capability count.</summary> |
| 103 | + public const int RequiredFoundationCapabilityCount = 8; |
| 104 | + |
| 105 | + /// <summary>Returns the current interoperability tooling readiness report.</summary> |
| 106 | + /// <returns>The current readiness report.</returns> |
| 107 | + public static SigtranInteroperabilityReadinessReport GetReport() |
| 108 | + { |
| 109 | + return new( |
| 110 | + hasTraceFormatter: true, |
| 111 | + hasConformanceRegistry: true, |
| 112 | + hasBuiltInVectors: true, |
| 113 | + hasSimulatorScripts: true, |
| 114 | + hasMapSmsFlows: true, |
| 115 | + hasTransportSamples: true, |
| 116 | + hasSampleCatalog: true, |
| 117 | + hasCiProfile: true, |
| 118 | + hasExternalInteroperabilityLab: false); |
| 119 | + } |
| 120 | +} |
0 commit comments