refactor(event-subscriber): drop the hoofdObject fallback (refs #153)
CI / build (pull_request) Successful in 1m11s
CI / lint (pull_request) Successful in 1m25s
CI / unit (pull_request) Successful in 1m27s
CI / frontend (pull_request) Successful in 3m5s
CI / mutation (pull_request) Successful in 6m7s
CI / verify-stack (pull_request) Failing after 11m42s
CI / build (pull_request) Successful in 1m11s
CI / lint (pull_request) Successful in 1m25s
CI / unit (pull_request) Successful in 1m27s
CI / frontend (pull_request) Successful in 3m5s
CI / mutation (pull_request) Successful in 6m7s
CI / verify-stack (pull_request) Failing after 11m42s
For a `resource: object` notification Objecten sends the object as both hoofdObject and resourceUrl — the object *is* the main resource — so `HoofdObject ?? ResourceUrl` was a branch that can never take its left side and that no test could distinguish. It came across from the zaken path, where hoofdObject genuinely differed (the zaak behind a status). Tests unchanged and green.
This commit is contained in:
@@ -16,15 +16,15 @@ public sealed record Notification(
|
||||
string Kanaal,
|
||||
string Resource,
|
||||
string Actie,
|
||||
Uri ResourceUrl,
|
||||
Uri? HoofdObject = null)
|
||||
Uri ResourceUrl)
|
||||
{
|
||||
/// <summary>A register record written to Objecten — <c>create</c> on submit, <c>update</c> on
|
||||
/// approval, since the ACL upserts the same object for a registration (§8.6).</summary>
|
||||
public bool IsRegisterRecordWritten =>
|
||||
Kanaal == "objecten" && Resource == "object" && Actie is "create" or "update";
|
||||
|
||||
/// <summary>The object holding the register record. Objecten sets both fields to the object;
|
||||
/// <c>hoofdObject</c> is the main resource by definition, so prefer it.</summary>
|
||||
public Uri ObjectUrl => HoofdObject ?? ResourceUrl;
|
||||
/// <summary>The object holding the register record. For a <c>resource: object</c> notification
|
||||
/// Objecten sends the object as both <c>hoofdObject</c> and <c>resourceUrl</c> — the object is
|
||||
/// the main resource — so the notification's own <c>hoofdObject</c> is not modelled.</summary>
|
||||
public Uri ObjectUrl => ResourceUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user