feat: read projection sourced from the register in Objecten (closes #153) #155
@@ -38,13 +38,17 @@ public sealed class NotificationProjectorTests
|
|||||||
Assert.Equal("REG-2026-0001", entry.Reference);
|
Assert.Equal("REG-2026-0001", entry.Reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
// The ACL PATCHes the same object on approval. DRF routes a PATCH through `update()` but reports
|
||||||
public async Task approval_updates_the_same_row_from_ingediend_to_ingeschreven()
|
// the action as `partial_update`, which is what Objecten puts in the notification — so accepting
|
||||||
|
// only `create`/`update` silently drops every approval.
|
||||||
|
[Theory]
|
||||||
|
[InlineData("partial_update")]
|
||||||
|
[InlineData("update")]
|
||||||
|
public async Task approval_updates_the_same_row_from_ingediend_to_ingeschreven(string actie)
|
||||||
{
|
{
|
||||||
var projector = Projector();
|
var projector = Projector();
|
||||||
await projector.HandleAsync(RecordWritten());
|
await projector.HandleAsync(RecordWritten());
|
||||||
// The ACL PATCHes the same object on approval, so Objecten publishes an `update`.
|
await projector.HandleAsync(RecordWritten(actie, status: RegistrationStatus.Ingeschreven));
|
||||||
await projector.HandleAsync(RecordWritten("update", status: RegistrationStatus.Ingeschreven));
|
|
||||||
|
|
||||||
var entry = Assert.Single(await _store.AllAsync());
|
var entry = Assert.Single(await _store.AllAsync());
|
||||||
Assert.Equal(ZaakId, entry.Id);
|
Assert.Equal(ZaakId, entry.Id);
|
||||||
@@ -112,7 +116,7 @@ public sealed class NotificationProjectorTests
|
|||||||
{
|
{
|
||||||
var projector = Projector();
|
var projector = Projector();
|
||||||
await projector.HandleAsync(RecordWritten());
|
await projector.HandleAsync(RecordWritten());
|
||||||
await projector.HandleAsync(RecordWritten("update", status: RegistrationStatus.Ingeschreven));
|
await projector.HandleAsync(RecordWritten("partial_update", status: RegistrationStatus.Ingeschreven));
|
||||||
var callsAfterProjection = _acl.CallCount;
|
var callsAfterProjection = _acl.CallCount;
|
||||||
|
|
||||||
await projector.RebuildAsync();
|
await projector.RebuildAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user