using ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts;
using ZB.MOM.WW.ScadaBridge.StoreAndForward;
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Messages;
// Outbound messages — sent by local DeploymentManagerActor/S&F service
// to the local SiteReplicationActor for forwarding to the peer node.
/// Outbound: replicate a deployed instance config (create or update) to the peer node.
public record ReplicateConfigDeploy(
string InstanceName, string ConfigJson, string DeploymentId, string RevisionHash, bool IsEnabled);
/// Outbound: replicate removal of a deployed instance config to the peer node.
public record ReplicateConfigRemove(string InstanceName);
/// Outbound: replicate an instance enabled/disabled flag change to the peer node.
public record ReplicateConfigSetEnabled(string InstanceName, bool IsEnabled);
/// Outbound: replicate a system-wide artifact deployment (shared scripts, external systems, etc.) to the peer node.
public record ReplicateArtifacts(DeployArtifactsCommand Command);
/// Outbound: replicate a store-and-forward buffer mutation (enqueue/dequeue/park/etc.) to the peer node.
public record ReplicateStoreAndForward(ReplicationOperation Operation);
// Inbound messages — received from the peer's SiteReplicationActor
// and applied to local SQLite storage.
/// Inbound: apply a peer-replicated instance config (create or update) to local SQLite.
public record ApplyConfigDeploy(
string InstanceName, string ConfigJson, string DeploymentId, string RevisionHash, bool IsEnabled);
/// Inbound: apply peer-replicated removal of a deployed instance config to local SQLite.
public record ApplyConfigRemove(string InstanceName);
/// Inbound: apply a peer-replicated instance enabled/disabled flag change to local SQLite.
public record ApplyConfigSetEnabled(string InstanceName, bool IsEnabled);
/// Inbound: apply a peer-replicated system-wide artifact deployment to local SQLite.
public record ApplyArtifacts(DeployArtifactsCommand Command);
/// Inbound: apply a peer-replicated store-and-forward buffer mutation to the local buffer.
public record ApplyStoreAndForward(ReplicationOperation Operation);