Skip to content

Commit

Permalink
fix: extract + integration addresses with count
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Jun 13, 2024
1 parent 45b2e6e commit 157b99e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace ParcelRegistry.Projections.Extract.ParcelLinkExtract
using Be.Vlaanderen.Basisregisters.GrAr.Extracts;
using Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector;
using Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore;
using Microsoft.EntityFrameworkCore;
using ParcelRegistry.Parcel.Events;

[ConnectedProjectionName("Extract perceelkoppelingen met adres")]
Expand Down Expand Up @@ -106,7 +107,7 @@ await context
.ParcelLinkExtract
.FindAsync(new object?[] { message.Message.ParcelId, message.Message.NewAddressPersistentLocalId }, ct);

if (newAddress is null)
if (newAddress is null || context.Entry(newAddress).State == EntityState.Deleted)
{
await context
.ParcelLinkExtract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore;
using Converters;
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using NodaTime;
using Parcel;
Expand Down Expand Up @@ -122,7 +123,7 @@ await context
.ParcelLatestItemAddresses
.FindAsync([message.Message.ParcelId, message.Message.NewAddressPersistentLocalId], cancellationToken: ct);

if (newAddress is null)
if (newAddress is null || context.Entry(newAddress).State == EntityState.Deleted)
{
await context
.ParcelLatestItemAddresses
Expand Down

0 comments on commit 157b99e

Please sign in to comment.