namespace Heimdall.Contracts;
///
/// Message published by the Central to request an analysis job from an agent.
/// The agent consumes this message and runs the AI pipeline (YOLO/ONNX) on the
/// provided frame data, then publishes or
/// .
///
public sealed record AnalysisJobRequested
{
/// Unique identifier for this analysis job.
public Guid Id { get; init; } = Guid.NewGuid();
/// Identifier of the camera whose frame is to be analysed.
public required Guid CameraId { get; init; }
/// Identifier of the site the camera belongs to.
public required Guid SiteId { get; init; }
/// Identifier of the target agent that should run the analysis.
public required Guid AgentId { get; init; }
///
/// Base64-encoded JPEG frame data to analyse.
/// Agents behind NAT receive the frame through AMQP rather than pulling it
/// via HTTPS — avoids requiring inbound connectivity to the Central.
///
public required string FrameData { get; init; }
/// Optional metadata (model override, confidence threshold, etc.).
public Dictionary? Metadata { get; init; }
/// Timestamp when the job was created (UTC).
public DateTime RequestedAtUtc { get; init; } = DateTime.UtcNow;
}