using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit;

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

/// <summary>
/// Akka message sent to the central <c>SiteCallAuditActor</c> carrying one <see cref="SiteCall"/> row to
/// be persisted via <c>ISiteCallAuditRepository.UpsertAsync</c>. The repository
/// performs an insert-if-not-exists then monotonic update — duplicate gRPC
/// packets and reconciliation pulls can both feed the actor without rolling
/// state back.
/// </summary>
/// <remarks>
/// Lives in <c>ZB.MOM.WW.ScadaBridge.Commons</c> rather than <c>ZB.MOM.WW.ScadaBridge.SiteCallAudit</c>
/// so the gRPC server in <c>ZB.MOM.WW.ScadaBridge.Communication</c> can construct it
/// without taking a project reference on the actor's host project — needed
/// once the IngestCachedTelemetry RPC that will Tell this command is added.
/// </remarks>
public sealed record UpsertSiteCallCommand(SiteCall SiteCall);
