using MessagePack;
using SHH.CameraDashboard;
using SHH.CameraDashboard.Services;
using SHH.Contracts;

public class StatusBatchProcessor : IProtocolProcessor
{
    public string ProtocolType => "STATUS_BATCH";
    private readonly CommandBusClient _bus;
    public StatusBatchProcessor(CommandBusClient bus) => _bus = bus;

    public void Process(byte[] identity, byte[] payloadBytes)
    {
        var p = MessagePackSerializer.Deserialize<StatusBatchPayload>(payloadBytes);
        if (p?.Items != null) _bus.RaiseDeviceStatusReport(p.Items);
    }
}