using CommunityToolkit.Mvvm.Messaging.Messages;

namespace OTSSignsOrchestrator.Desktop.Services;

/// <summary>SignalR push messages republished via WeakReferenceMessenger for ViewModel consumption.</summary>

public sealed class JobCreatedMessage : ValueChangedMessage<JobCreatedMessage.Payload>
{
    public JobCreatedMessage(Payload value) : base(value) { }
    public record Payload(string JobId, string Abbrev, string JobType);
}

public sealed class JobProgressUpdateMessage : ValueChangedMessage<JobProgressUpdateMessage.Payload>
{
    public JobProgressUpdateMessage(Payload value) : base(value) { }
    public record Payload(string JobId, string StepName, int Pct, string LogLine);
}

public sealed class JobCompletedMessage : ValueChangedMessage<JobCompletedMessage.Payload>
{
    public JobCompletedMessage(Payload value) : base(value) { }
    public record Payload(string JobId, bool Success, string Summary);
}

public sealed class InstanceStatusChangedMessage : ValueChangedMessage<InstanceStatusChangedMessage.Payload>
{
    public InstanceStatusChangedMessage(Payload value) : base(value) { }
    public record Payload(string CustomerId, string Status);
}

public sealed class AlertRaisedMessage : ValueChangedMessage<AlertRaisedMessage.Payload>
{
    public AlertRaisedMessage(Payload value) : base(value) { }
    public record Payload(string Severity, string Message);
}
