namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Management;

public record ListDataConnectionsCommand(int? SiteId = null);
public record GetDataConnectionCommand(int DataConnectionId);
public record CreateDataConnectionCommand(int SiteId, string Name, string Protocol, string? PrimaryConfiguration, string? BackupConfiguration = null, int FailoverRetryCount = 3);
public record UpdateDataConnectionCommand(int DataConnectionId, string Name, string Protocol, string? PrimaryConfiguration, string? BackupConfiguration = null, int FailoverRetryCount = 3);
public record DeleteDataConnectionCommand(int DataConnectionId);

/// <summary>
/// Moves a data connection from its current site to <paramref name="TargetSiteId"/>.
/// Designer-gated and heavily guarded (see the handler): the target site must
/// exist, the target site must not already own a connection with the same name,
/// and NO <see cref="Entities.Instances.InstanceConnectionBinding"/> may reference
/// the connection (instances are site-scoped, so a bound connection cannot leave
/// its site without orphaning the binding). Name-based native-alarm-source
/// references (template <c>ConnectionName</c> / instance
/// <c>ConnectionNameOverride</c>) are also checked and the move is blocked rather
/// than silently creating an ambiguous/orphaned state. No auto-rewrite is performed.
/// </summary>
/// <param name="DataConnectionId">Primary key of the connection to move.</param>
/// <param name="TargetSiteId">Primary key of the destination site.</param>
public record MoveDataConnectionCommand(int DataConnectionId, int TargetSiteId);
