namespace EventSubscriber.Application; /// /// An inbound NRC (Open Notificaties) notification, as Open Notificaties POSTs it to an /// abonnement callback. Only the fields the projection needs are modelled. /// /// /// Since S-19b-2 the subscriber listens on the objecten kanaal, not zaken: the /// register record in Objecten is what the projection is derived from (ADR-0030), so the /// projection is a cache of the register rather than a re-derivation of the case system. An /// Objecten notification carries no record data โ€” only the object URL (as both /// hoofdObject and resourceUrl) and the objecttype as a kenmerk โ€” so the record /// itself is read back through the ACL. /// public sealed record Notification( string Kanaal, string Resource, string Actie, Uri ResourceUrl, Uri? HoofdObject = null) { /// A register record written to Objecten โ€” create on submit, update on /// approval, since the ACL upserts the same object for a registration (ยง8.6). public bool IsRegisterRecordWritten => Kanaal == "objecten" && Resource == "object" && Actie is "create" or "update"; /// The object holding the register record. Objecten sets both fields to the object; /// hoofdObject is the main resource by definition, so prefer it. public Uri ObjectUrl => HoofdObject ?? ResourceUrl; }