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

/// <summary>
/// Sent by a NativeAlarmActor (via the DCL manager) to subscribe an instance to
/// native alarms for a source binding. The DataConnectionActor opens one alarm
/// feed per connection and routes transitions by source-object reference.
/// </summary>
public record SubscribeAlarmsRequest(
    string CorrelationId,
    string InstanceUniqueName,
    string ConnectionName,
    string SourceReference,
    string? ConditionFilter,
    DateTimeOffset Timestamp);

/// <summary>Reply to a <see cref="SubscribeAlarmsRequest"/>.</summary>
public record SubscribeAlarmsResponse(
    string CorrelationId,
    string InstanceUniqueName,
    bool Success,
    string? ErrorMessage,
    DateTimeOffset Timestamp);

/// <summary>Cancels a native alarm subscription for an instance + source.</summary>
public record UnsubscribeAlarmsRequest(
    string CorrelationId,
    string InstanceUniqueName,
    string ConnectionName,
    string SourceReference,
    DateTimeOffset Timestamp);
