Skip to content

Commit

Permalink
fix: or-2334 remove dubbel properties on publiek detail
Browse files Browse the repository at this point in the history
  • Loading branch information
emalfroy committed Dec 12, 2024
1 parent 4d05c2d commit 9d24a2c
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public static PubliekVerenigingDetailResponse Map(
Sleutels = document.Sleutels.Select(Map).ToArray(),
Relaties = document.Relaties.Select(r => Map(appSettings, r)).ToArray(),
Lidmaatschappen = document.Lidmaatschappen.Select(l => Map(l, lidmaatschapMapper)).ToArray(),
IsDubbelVan = document.IsDubbelVan,
CorresponderendeVCodes = document.CorresponderendeVCodes,
},
Metadata = new Metadata { DatumLaatsteAanpassing = document.DatumLaatsteAanpassing },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ public PubliekVerenigingDetailResponse GetExamples()
AndereVereniging = "V0001111",
},
],
IsDubbelVan = "V0001002",
CorresponderendeVCodes = [],
},
Metadata = new Metadata { DatumLaatsteAanpassing = "2023-05-15" },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,4 @@ public class Vereniging
/// <summary>De lidmaatschappen van deze vereniging</summary>
[DataMember(Name = "Lidmaatschappen")]
public Lidmaatschap[] Lidmaatschappen { get; init; } = [];

/// <summary>De VCode van de vereniging waarvan deze vereniging een dubbel is</summary>
[DataMember(Name = "IsDubbelVan")]
public string IsDubbelVan { get; set; }

// <summary>De unieke identificatie codes van de corresponderende verenigingen</summary>
[DataMember(Name = "CorresponderendeVCodes")]
public string[] CorresponderendeVCodes { get; init; } = [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ public async Task Project(IEvent<LidmaatschapWerdGewijzigd> @event, IDocumentOpe
public async Task Project(IEvent<LidmaatschapWerdVerwijderd> @event, IDocumentOperations ops)
=> await Update(@event, ops, PubliekVerenigingDetailProjector.Apply);

public async Task Project(IEvent<VerenigingWerdGermarkeerdAlsDubbelVan> @event, IDocumentOperations ops)
=> await Update(@event, ops, PubliekVerenigingDetailProjector.Apply);

public async Task Project(IEvent<VerenigingAanvaardeDubbeleVereniging> @event, IDocumentOperations ops)
=> await Update(@event, ops, PubliekVerenigingDetailProjector.Apply);

private static async Task Update<T>(
IEvent<T> @event,
IDocumentOperations ops,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public static PubliekVerenigingDetailDocument Create(
CodeerSysteem = CodeerSysteem.VR,
},
],
IsDubbelVan = "",
CorresponderendeVCodes = [],
};

public static PubliekVerenigingDetailDocument Create(
Expand Down Expand Up @@ -156,8 +154,6 @@ public static PubliekVerenigingDetailDocument Create(
CodeerSysteem = CodeerSysteem.KBO,
},
],
IsDubbelVan = "",
CorresponderendeVCodes = [],
};

private static PubliekVerenigingDetailDocument.HoofdactiviteitVerenigingsloket MapHoofdactiviteit(
Expand Down Expand Up @@ -779,18 +775,4 @@ public static void Apply(IEvent<LidmaatschapWerdVerwijderd> lidmaatschapWerdVerw
.OrderBy(l => l.LidmaatschapId)
.ToArray();
}

public static void Apply(IEvent<VerenigingWerdGermarkeerdAlsDubbelVan> verenigingWerdGemarkeerdAlsDubbel, PubliekVerenigingDetailDocument document)
{
document.Status = VerenigingStatus.Dubbel;
document.IsDubbelVan = verenigingWerdGemarkeerdAlsDubbel.Data.VCodeAuthentiekeVereniging;
}

public static void Apply(IEvent<VerenigingAanvaardeDubbeleVereniging> verenigingAanvaardeDubbeleVereniging, PubliekVerenigingDetailDocument document)
{
document.CorresponderendeVCodes =
document.CorresponderendeVCodes
.Append(verenigingAanvaardeDubbeleVereniging.Data.VCodeDubbeleVereniging)
.ToArray();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ public class Adres

public bool Deleted { get; set; }
public DateTimeOffset? DeletedAt { get; set; }
public string IsDubbelVan { get; set; } = string.Empty;
public string[] CorresponderendeVCodes { get; set; } = [];
}

public class JsonLdMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ namespace AssociationRegistry.Test.E2E.Framework.AlbaHost;
using Public.Api.Verenigingen.Detail.ResponseModels;
using Public.Api.Verenigingen.Search.ResponseModels;
using Public.Api.Werkingsgebieden.ResponseModels;
using System.Net;

public static class PublicApiEndpoints
{
public static PubliekVerenigingDetailResponse GetPubliekDetail(this IAlbaHost source, string vCode)
=> source.GetAsJson<PubliekVerenigingDetailResponse>($"/v1/verenigingen/{vCode}").GetAwaiter().GetResult()!;

public static HttpStatusCode GetPubliekDetailStatusCode(this IAlbaHost source, string vCode)
{
var client = source.Server.CreateClient();
var response = client.GetAsync($"/v1/verenigingen/{vCode}").GetAwaiter().GetResult();

return response.StatusCode;
}

public static SearchVerenigingenResponse GetPubliekZoeken(this IAlbaHost source, string query)
=> source.GetAsJson<SearchVerenigingenResponse>($"/v1/verenigingen/zoeken?q={query}").GetAwaiter().GetResult()!;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
namespace AssociationRegistry.Test.E2E.When_Markeer_Als_Dubbel_Van.Publiek.Detail;

using FluentAssertions;
using Framework.AlbaHost;
using global::OpenTelemetry.Trace;
using Public.Api.Verenigingen.Detail.ResponseModels;
using Public.Schema.Constants;
using System.Net;
using Xunit;

[Collection(FullBlownApiCollection.Name)]
public class Returns_Vereniging_Not_Found : IClassFixture<MarkeerAlsDubbelVanContext>, IAsyncLifetime
{
private readonly MarkeerAlsDubbelVanContext _context;

public Returns_Vereniging_Not_Found(MarkeerAlsDubbelVanContext context)
{
_context = context;
}

[Fact]
public void Status_Code_Is_NotFound()
{
Response.Should().Be(HttpStatusCode.NotFound);
}

public HttpStatusCode Response { get; set; }

public async Task InitializeAsync()
{
Response = _context.ApiSetup.PublicApiHost.GetPubliekDetailStatusCode(_context.VCode);
}

public async Task DisposeAsync()
{
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public async Task WithFeitelijkeVereniging()
Locaties = MapLocaties(Request.Locaties, _testContext.VCode),
Relaties = MapRelaties([], _testContext.VCode),
Sleutels = MapSleutels(Request, _testContext.VCode),
IsDubbelVan = string.Empty,
CorresponderendeVCodes = [],
}, compareConfig: AdminDetailComparisonConfig.Instance);

private static Sleutel[] MapSleutels(RegistreerFeitelijkeVerenigingRequest request, string vCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public async Task WithFeitelijkeVereniging()
Locaties = PubliekDetailResponseMapper.MapLocaties(_testContext.RegistratieData.Locaties, _testContext.VCode),
Relaties = PubliekDetailResponseMapper.MapRelaties([], _testContext.VCode),
Sleutels = PubliekDetailResponseMapper.MapSleutels(Request, _testContext.VCode),
IsDubbelVan = string.Empty,
CorresponderendeVCodes = [],
}, compareConfig: AdminDetailComparisonConfig.Instance);

public override Func<IApiSetup, PubliekVerenigingDetailResponse> GetResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public async Task WithVerenigingMetRechtspersoonlijkheid()
Locaties = [],
Relaties = [],
Sleutels = PubliekDetailResponseMapper.MapSleutels(_testContext.VCode, _testContext.RegistratieData.KboNummer),
IsDubbelVan = string.Empty,
CorresponderendeVCodes = [],
}, compareConfig: AdminDetailComparisonConfig.Instance);

public override Func<IApiSetup, PubliekVerenigingDetailResponse> GetResponse
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@
},
{{end}}
],
"lidmaatschappen": [],
"isDubbelVan": "",
"corresponderendeVCodes": []
"lidmaatschappen": []
},
"metadata": {
"datumLaatsteAanpassing": "{{datumlaatsteaanpassing}}"
Expand Down

0 comments on commit 9d24a2c

Please sign in to comment.