namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; // Skip/Take are additive offset paging (arch-review P2), applied AFTER in-memory // site-scope filtering. Take = null preserves the historical unpaged behaviour. public record ListInstancesCommand(int? SiteId = null, int? TemplateId = null, string? SearchTerm = null, int Skip = 0, int? Take = null); public record GetInstanceCommand(int InstanceId); public record CreateInstanceCommand(string UniqueName, int TemplateId, int SiteId, int? AreaId = null); public record MgmtDeployInstanceCommand(int InstanceId); public record MgmtEnableInstanceCommand(int InstanceId); public record MgmtDisableInstanceCommand(int InstanceId); public record MgmtDeleteInstanceCommand(int InstanceId); /// /// A single attribute-to-data-connection binding carried by /// . This is a named record (not a /// ValueTuple) so it serializes with stable, named JSON properties and can /// evolve additively per REQ-COM-5a. /// /// DataSourceReferenceOverride is an optional per-instance override of /// the OPC UA node id (or other protocol address) for the bound attribute. /// When non-null it replaces the template's DataSourceReference at /// flattening time; when null the template default is used. /// /// public record ConnectionBinding( string AttributeName, int DataConnectionId, string? DataSourceReferenceOverride = null); public record SetConnectionBindingsCommand(int InstanceId, IReadOnlyList Bindings); public record SetInstanceOverridesCommand(int InstanceId, IReadOnlyDictionary Overrides); public record SetInstanceAreaCommand(int InstanceId, int? AreaId); /// /// Sets (or upserts) a per-instance alarm override. For HiLo trigger types the /// TriggerConfigurationOverride JSON is merged setpoint-by-setpoint with /// the inherited config; for binary trigger types it replaces the whole config. /// Each override field is optional — null means the instance inherits the template value /// for that field (the row is replaced whole on every call, not merged). /// /// ID of the instance the override applies to. /// Canonical (path-qualified for composed members) alarm name. /// Trigger configuration JSON override, or null. /// Priority level override, or null. /// /// Per-instance override of the template alarm's MES-reportable flag. Additive trailing /// optional; null (the default) inherits the template value, true/false forces it. /// public record SetInstanceAlarmOverrideCommand( int InstanceId, string AlarmCanonicalName, string? TriggerConfigurationOverride, int? PriorityLevelOverride, bool? IsMesReportableOverride = null); public record DeleteInstanceAlarmOverrideCommand( int InstanceId, string AlarmCanonicalName); public record ListInstanceAlarmOverridesCommand(int InstanceId); // Native alarm source overrides (per-instance retarget of an inherited source binding; // null fields keep the inherited value). public record SetInstanceNativeAlarmSourceOverrideCommand( int InstanceId, string SourceCanonicalName, string? ConnectionNameOverride, string? SourceReferenceOverride, string? ConditionFilterOverride); public record DeleteInstanceNativeAlarmSourceOverrideCommand( int InstanceId, string SourceCanonicalName); public record ListInstanceNativeAlarmSourceOverridesCommand(int InstanceId); /// /// One entry in a bulk native-alarm-source-override apply: the source binding's /// canonical name plus the three optional retarget fields (null keeps the inherited /// value). Mirrors 's fields /// for a single source. /// public record NativeAlarmSourceOverrideEntry( string SourceCanonicalName, string? ConnectionNameOverride, string? SourceReferenceOverride, string? ConditionFilterOverride); /// /// Bulk, all-or-nothing apply of per-instance native-alarm-source overrides — the /// native-source parity analogue of . Backs /// the CLI instance native-alarm-source import --file CSV path. Every entry's /// source must resolve for the instance and be unlocked; if any entry is invalid the /// whole batch is rejected before any write. /// public record SetInstanceNativeAlarmSourceOverridesCommand( int InstanceId, IReadOnlyList Overrides); /// Removes an attribute override so the inherited value is used again. public record DeleteInstanceAttributeOverrideCommand(int InstanceId, string AttributeName);