Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Or 2560 lidmaatschap jsonldmapping #1003

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ INamenVoorLidmaatschapMapper namenVoorLidmaatschapMapper
)
=> new()
{
id = lidmaatschap.JsonLdMetadata.Id,
type = lidmaatschap.JsonLdMetadata.Type,
AndereVereniging = lidmaatschap.AndereVereniging,
Beschrijving = lidmaatschap.Beschrijving,
Identificatie = lidmaatschap.Identificatie,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace AssociationRegistry.Admin.Api.Verenigingen.Detail.Examples;

using Formats;
using Hosts.Configuration.ConfigurationBindings;
using JsonLdContext;
using NodaTime;
Expand Down Expand Up @@ -178,6 +179,8 @@ public IEnumerable<SwaggerExample<DetailVerenigingResponse>> GetExamples()
[
new Lidmaatschap
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
LidmaatschapId = 1,
Beschrijving = "Een lidmaatschap",
Naam = "De andere vereniging",
Expand Down Expand Up @@ -348,6 +351,33 @@ public IEnumerable<SwaggerExample<DetailVerenigingResponse>> GetExamples()
},
},
Relaties = Array.Empty<Relatie>(),
Lidmaatschappen = new []
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
LidmaatschapId = 1,
AndereVereniging = "V0001002",
Naam = "De andere vereniging",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Beschrijving = "Gewoon een lid",
Identificatie = "L1234",
},
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "2"),
type = JsonLdType.Lidmaatschap.Type,
LidmaatschapId = 2,
Naam = "Samen sterk",
AndereVereniging = "V0001003",
Van = DateOnly.FromDateTime(DateTime.Today.AddMonths(-5)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today.AddDays(-5)).ToString(WellknownFormats.DateOnly),
Beschrijving = "Tijdelijk lidmaatschap",
Identificatie = "L4321",
},
},
Bron = Bron.KBO.Waarde,
},
Metadata = new Metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
[DataContract]
public class Lidmaatschap
{
/// <summary>De json-ld id</summary>
[DataMember(Name = "@id")]
public string id { get; init; }

/// <summary>Het json-ld type</summary>
[DataMember(Name = "@type")]
public string type { get; set; }

/// <summary>
/// De unieke identificatie code van dit lidmaatschap binnen de vereniging
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public SearchVerenigingenResponse GetExamples()
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Expand Down Expand Up @@ -176,6 +178,8 @@ public SearchVerenigingenResponse GetExamples()
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Expand All @@ -184,6 +188,8 @@ public SearchVerenigingenResponse GetExamples()
},
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "2"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001003",
Van = DateOnly.FromDateTime(DateTime.Today.AddMonths(-5)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today.AddDays(-5)).ToString(WellknownFormats.DateOnly),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
[DataContract]
public class Lidmaatschap
{
// /// <summary>De json-ld id</summary>
// [DataMember(Name = "@id")]
// public string id { get; init; }
//
// /// <summary>Het json-ld type</summary>
// [DataMember(Name = "@type")]
// public string type { get; set; }
/// <summary>De json-ld id</summary>
[DataMember(Name = "@id")]
public string id { get; init; }

/// <summary>Het json-ld type</summary>
[DataMember(Name = "@type")]
public string type { get; set; }

/// <summary>
/// De vCode van de andere vereniging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ private static Vereniging Map(
private static Lidmaatschap Map(VerenigingZoekDocument.Lidmaatschap l)
=> new()
{
// id = l.JsonLdMetadata.Id,
// type = l.JsonLdMetadata.Type,
id = l.JsonLdMetadata.Id,
type = l.JsonLdMetadata.Type,
AndereVereniging = l.AndereVereniging,
Van = l.DatumVan,
Tot = l.DatumTot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace AssociationRegistry.Admin.ProjectionHost.Projections.Detail;
public class BeheerVerenigingDetailMapper
{
public static Lidmaatschap MapLidmaatschap(Registratiedata.Lidmaatschap lid, string vCode)
=> new(CreateJsonLdMetadata(JsonLdType.Locatie, vCode, lid.LidmaatschapId.ToString()),
=> new(CreateJsonLdMetadata(JsonLdType.Lidmaatschap, vCode, lid.LidmaatschapId.ToString()),
lid.LidmaatschapId,
lid.AndereVereniging,
lid.DatumVan,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"hoofdactiviteitenVerenigingsloket": "regorg:orgActivity",
"werkingsgebieden": "dc:spatial",
"wg": "http://data.vlaanderen.be/id/concept/werkingsgebied/",
"lidmaatschappen": "org:memberof",
"lidmaatschap": "org:Memberschip",
"regorg": "http://www.w3.org/ns/regorg#",
"cont": "http://data.lblod.info/id/contact-punten/",
"org": "http://www.w3.org/ns/org#",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ public static PubliekVerenigingDetailResponse MapDetailAll(PubliekVerenigingDeta
private static Lidmaatschap Map(PubliekVerenigingDetailDocument.Lidmaatschap l, INamenVoorLidmaatschapMapper namenVoorLidmaatschapMapper)
=> new()
{
id = l.JsonLdMetadata.Id,
type = l.JsonLdMetadata.Type,
Beschrijving = l.Beschrijving,
Naam = namenVoorLidmaatschapMapper.MapNaamVoorLidmaatschap(l.AndereVereniging),
AndereVereniging = l.AndereVereniging,
Identificatie = l.Identificatie,
Van = l.Van.FormatAsBelgianDate(),
Tot = l.Tot.FormatAsBelgianDate(),
LidmaatschapId = l.LidmaatschapId,
//LidmaatschapId = l.LidmaatschapId,
};

private static Relatie Map(AppSettings appSettings, PubliekVerenigingDetailDocument.Relatie r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using AssociationRegistry.Public.Api.Verenigingen.Detail.ResponseModels;
using AssociationRegistry.Public.Schema.Constants;
using AssociationRegistry.Vereniging;
using Formats;
using Swashbuckle.AspNetCore.Filters;
using Adres = ResponseModels.Adres;
using AdresId = ResponseModels.AdresId;
Expand Down Expand Up @@ -139,7 +140,8 @@ public PubliekVerenigingDetailResponse GetExamples()
[
new Lidmaatschap
{
LidmaatschapId = 1,
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
Beschrijving = "Een lidmaatschap",
Naam = "De andere vereniging",
Van = "2002-11-15",
Expand Down Expand Up @@ -264,7 +266,20 @@ public PubliekVerenigingDetailResponse[] GetExamples()
},
},
Relaties = Array.Empty<Relatie>(),
Lidmaatschappen = Array.Empty<Lidmaatschap>(),
Lidmaatschappen = new []
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Naam = "De andere vereniging",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Beschrijving = "Gewoon een lid",
Identificatie = "L1234",
},
},
},
Metadata = new Metadata { DatumLaatsteAanpassing = "2023-05-15" },
},
Expand Down Expand Up @@ -367,7 +382,31 @@ public PubliekVerenigingDetailResponse[] GetExamples()
},
},
Relaties = Array.Empty<Relatie>(),
Lidmaatschappen = Array.Empty<Lidmaatschap>(),
Lidmaatschappen = new []
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Naam = "De andere vereniging",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Beschrijving = "Gewoon een lid",
Identificatie = "L1234",
},
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "2"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001003",
Naam = "Samen sterk",
Van = DateOnly.FromDateTime(DateTime.Today.AddMonths(-5)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today.AddDays(-5)).ToString(WellknownFormats.DateOnly),
Beschrijving = "Tijdelijk lidmaatschap",
Identificatie = "L4321",
},
},
},
Metadata = new Metadata { DatumLaatsteAanpassing = "2024-09-09" },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
[DataContract]
public class Lidmaatschap
{
/// <summary>
/// De unieke identificatie code van dit lidmaatschap binnen de vereniging
/// </summary>
[DataMember(Name = "LidmaatschapId")]
public int LidmaatschapId { get; set; }
/// <summary>De json-ld id</summary>
[DataMember(Name = "@id")]
public string id { get; init; }

/// <summary>Het json-ld type</summary>
[DataMember(Name = "@type")]
public string type { get; set; }

// /// <summary>
// /// De unieke identificatie code van dit lidmaatschap binnen de vereniging
// /// </summary>
// [DataMember(Name = "LidmaatschapId")]
// public int LidmaatschapId { get; set; }

/// <summary>
/// De unieke identificator van de vereniging waarvan deze vereniging lid werd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public SearchVerenigingenResponse GetExamples()
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Expand Down Expand Up @@ -164,6 +166,8 @@ public SearchVerenigingenResponse GetExamples()
{
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "1"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001002",
Van = DateOnly.FromDateTime(DateTime.Today.AddYears(-1)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today).ToString(WellknownFormats.DateOnly),
Expand All @@ -172,6 +176,8 @@ public SearchVerenigingenResponse GetExamples()
},
new Lidmaatschap()
{
id = JsonLdType.Lidmaatschap.CreateWithIdValues("V0001001", "2"),
type = JsonLdType.Lidmaatschap.Type,
AndereVereniging = "V0001003",
Van = DateOnly.FromDateTime(DateTime.Today.AddMonths(-5)).ToString(WellknownFormats.DateOnly),
Tot = DateOnly.FromDateTime(DateTime.Today.AddDays(-5)).ToString(WellknownFormats.DateOnly),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
[DataContract]
public class Lidmaatschap
{
// /// <summary>De json-ld id</summary>
// [DataMember(Name = "@id")]
// public string id { get; init; }
//
// /// <summary>Het json-ld type</summary>
// [DataMember(Name = "@type")]
// public string type { get; set; }
/// <summary>De json-ld id</summary>
[DataMember(Name = "@id")]
public string id { get; init; }

/// <summary>Het json-ld type</summary>
[DataMember(Name = "@type")]
public string type { get; set; }

/// <summary>
/// De vCode van de andere vereniging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ private static string CalculateHoofdactiviteiten(IEnumerable<string> originalHoo
private static Lidmaatschap Map(VerenigingZoekDocument.Lidmaatschap l)
=> new()
{
// id = l.JsonLdMetadata.Id,
// type = l.JsonLdMetadata.Type,
id = l.JsonLdMetadata.Id,
type = l.JsonLdMetadata.Type,
AndereVereniging = l.AndereVereniging,
Van = l.DatumVan,
Tot = l.DatumTot,
Expand Down
Loading
Loading