Phase 0 WP-0.2–0.9: Implement Commons (types, entities, interfaces, messages, protocol, tests)
- WP-0.2: Namespace/folder skeleton (26 directories) - WP-0.3: Shared data types (6 enums, RetryPolicy, Result<T>) - WP-0.4: 24 domain entity POCOs across 10 domain areas - WP-0.5: 7 repository interfaces with full CRUD signatures - WP-0.6: IAuditService cross-cutting interface - WP-0.7: 26 message contract records across 8 concern areas - WP-0.8: IDataConnection protocol abstraction with batch ops - WP-0.9: 8 architectural constraint enforcement tests All 40 tests pass, zero warnings.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record ArtifactDeploymentResponse(
|
||||
string DeploymentId,
|
||||
string SiteId,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record DatabaseConnectionArtifact(
|
||||
string Name,
|
||||
string ConnectionString,
|
||||
int MaxRetries,
|
||||
TimeSpan RetryDelay);
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record DeployArtifactsCommand(
|
||||
string DeploymentId,
|
||||
IReadOnlyList<SharedScriptArtifact>? SharedScripts,
|
||||
IReadOnlyList<ExternalSystemArtifact>? ExternalSystems,
|
||||
IReadOnlyList<DatabaseConnectionArtifact>? DatabaseConnections,
|
||||
IReadOnlyList<NotificationListArtifact>? NotificationLists,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record ExternalSystemArtifact(
|
||||
string Name,
|
||||
string EndpointUrl,
|
||||
string AuthType,
|
||||
string? AuthConfiguration,
|
||||
string? MethodDefinitionsJson);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record NotificationListArtifact(
|
||||
string Name,
|
||||
IReadOnlyList<string> RecipientEmails);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.Artifacts;
|
||||
|
||||
public record SharedScriptArtifact(
|
||||
string Name,
|
||||
string Code,
|
||||
string? ParameterDefinitions,
|
||||
string? ReturnDefinition);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Communication;
|
||||
|
||||
public record ConnectionStateChanged(
|
||||
string SiteId,
|
||||
bool IsConnected,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Communication;
|
||||
|
||||
public record RoutingMetadata(
|
||||
string TargetSiteId,
|
||||
string? TargetInstanceUniqueName,
|
||||
string CorrelationId);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Communication;
|
||||
|
||||
public record SiteIdentity(
|
||||
string SiteId,
|
||||
string NodeHostname,
|
||||
bool IsActive);
|
||||
@@ -0,0 +1,9 @@
|
||||
using ScadaLink.Commons.Messages.Streaming;
|
||||
|
||||
namespace ScadaLink.Commons.Messages.DebugView;
|
||||
|
||||
public record DebugViewSnapshot(
|
||||
string InstanceUniqueName,
|
||||
IReadOnlyList<AttributeValueChanged> AttributeValues,
|
||||
IReadOnlyList<AlarmStateChanged> AlarmStates,
|
||||
DateTimeOffset SnapshotTimestamp);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace ScadaLink.Commons.Messages.DebugView;
|
||||
|
||||
public record SubscribeDebugViewRequest(
|
||||
string InstanceUniqueName,
|
||||
string CorrelationId);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace ScadaLink.Commons.Messages.DebugView;
|
||||
|
||||
public record UnsubscribeDebugViewRequest(
|
||||
string InstanceUniqueName,
|
||||
string CorrelationId);
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ScadaLink.Commons.Messages.Deployment;
|
||||
|
||||
public record DeployInstanceCommand(
|
||||
string DeploymentId,
|
||||
string InstanceUniqueName,
|
||||
string RevisionHash,
|
||||
string FlattenedConfigurationJson,
|
||||
string DeployedBy,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,10 @@
|
||||
using ScadaLink.Commons.Types.Enums;
|
||||
|
||||
namespace ScadaLink.Commons.Messages.Deployment;
|
||||
|
||||
public record DeploymentStatusResponse(
|
||||
string DeploymentId,
|
||||
string InstanceUniqueName,
|
||||
DeploymentStatus Status,
|
||||
string? ErrorMessage,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Deployment;
|
||||
|
||||
public record DeploymentValidationResult(
|
||||
bool IsValid,
|
||||
IReadOnlyList<string> Errors,
|
||||
IReadOnlyList<string> Warnings);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.Deployment;
|
||||
|
||||
public record FlattenedConfigurationSnapshot(
|
||||
string InstanceUniqueName,
|
||||
string RevisionHash,
|
||||
string ConfigurationJson,
|
||||
DateTimeOffset GeneratedAt);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.Health;
|
||||
|
||||
public record HeartbeatMessage(
|
||||
string SiteId,
|
||||
string NodeHostname,
|
||||
bool IsActive,
|
||||
DateTimeOffset Timestamp);
|
||||
14
src/ScadaLink.Commons/Messages/Health/SiteHealthReport.cs
Normal file
14
src/ScadaLink.Commons/Messages/Health/SiteHealthReport.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using ScadaLink.Commons.Types.Enums;
|
||||
|
||||
namespace ScadaLink.Commons.Messages.Health;
|
||||
|
||||
public record SiteHealthReport(
|
||||
string SiteId,
|
||||
long SequenceNumber,
|
||||
DateTimeOffset ReportTimestamp,
|
||||
IReadOnlyDictionary<string, ConnectionHealth> DataConnectionStatuses,
|
||||
IReadOnlyDictionary<string, TagResolutionStatus> TagResolutionCounts,
|
||||
int ScriptErrorCount,
|
||||
int AlarmEvaluationErrorCount,
|
||||
IReadOnlyDictionary<string, int> StoreAndForwardBufferDepths,
|
||||
int DeadLetterCount);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace ScadaLink.Commons.Messages.Health;
|
||||
|
||||
public record TagResolutionStatus(int TotalSubscribed, int SuccessfullyResolved);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Lifecycle;
|
||||
|
||||
public record DeleteInstanceCommand(
|
||||
string CommandId,
|
||||
string InstanceUniqueName,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Lifecycle;
|
||||
|
||||
public record DisableInstanceCommand(
|
||||
string CommandId,
|
||||
string InstanceUniqueName,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScadaLink.Commons.Messages.Lifecycle;
|
||||
|
||||
public record EnableInstanceCommand(
|
||||
string CommandId,
|
||||
string InstanceUniqueName,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ScadaLink.Commons.Messages.Lifecycle;
|
||||
|
||||
public record InstanceLifecycleResponse(
|
||||
string CommandId,
|
||||
string InstanceUniqueName,
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.ScriptExecution;
|
||||
|
||||
public record ScriptCallRequest(
|
||||
string ScriptName,
|
||||
IReadOnlyDictionary<string, object?>? Parameters,
|
||||
int CurrentCallDepth,
|
||||
string CorrelationId);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScadaLink.Commons.Messages.ScriptExecution;
|
||||
|
||||
public record ScriptCallResult(
|
||||
string CorrelationId,
|
||||
bool Success,
|
||||
object? ReturnValue,
|
||||
string? ErrorMessage);
|
||||
@@ -0,0 +1,10 @@
|
||||
using ScadaLink.Commons.Types.Enums;
|
||||
|
||||
namespace ScadaLink.Commons.Messages.Streaming;
|
||||
|
||||
public record AlarmStateChanged(
|
||||
string InstanceUniqueName,
|
||||
string AlarmName,
|
||||
AlarmState State,
|
||||
int Priority,
|
||||
DateTimeOffset Timestamp);
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ScadaLink.Commons.Messages.Streaming;
|
||||
|
||||
public record AttributeValueChanged(
|
||||
string InstanceUniqueName,
|
||||
string AttributePath,
|
||||
string AttributeName,
|
||||
object? Value,
|
||||
string Quality,
|
||||
DateTimeOffset Timestamp);
|
||||
Reference in New Issue
Block a user