Skip to content

Commit

Permalink
chore(api): refactoring tbv gebruik Brp.Shared.DtoMappers
Browse files Browse the repository at this point in the history
  • Loading branch information
MelvLee committed Nov 19, 2024
1 parent 0bed0ef commit ba0b8e0
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 127 deletions.
32 changes: 16 additions & 16 deletions specificatie/data-service/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,20 @@ components:
example: '6030'
omschrijving:
type: string
pattern: ^[a-zA-Z0-9À-ž \'\,\(\)\.\-]{1,200}$
pattern: ^[a-zA-Z0-9À-ž \'\.\-\(\),]{1,200}$
example: Nederland
Geslachtsaanduiding:
allOf:
- $ref: '#/components/schemas/Waardetabel'
- example:
code: M
omschrijving: man
Voornamen:
description: |
De verzameling namen voor de geslachtsnaam, gescheiden door spaties.
type: string
pattern: ^[a-zA-Z0-9À-ž \.\-\']{1,200}$
maxLength: 200
description: |
De verzameling namen voor de geslachtsnaam, gescheiden door spaties.
example: Pieter Jan
AdellijkeTitelPredicaatSoort:
type: string
enum:
Expand All @@ -247,8 +252,8 @@ components:
soort:
$ref: '#/components/schemas/AdellijkeTitelPredicaatSoort'
example:
code: JH
omschrijving: jonkheer
code: JV
omschrijving: jonkvrouw
soort: predicaat
Voorvoegsel:
type: string
Expand All @@ -261,7 +266,7 @@ components:
description: |
De achternaam van een persoon.
example: Vries
GbaNaamBasis:
NaamBasis:
type: object
properties:
voornamen:
Expand All @@ -272,16 +277,11 @@ components:
$ref: '#/components/schemas/Voorvoegsel'
geslachtsnaam:
$ref: '#/components/schemas/Geslachtsnaam'
GbaNaam:
allOf:
- $ref: '#/components/schemas/GbaNaamBasis'
GbaGeboorte:
GeboorteBasis:
type: object
properties:
datum:
$ref: '#/components/schemas/GbaDatum'
description: |
Datum waarop de persoon is geboren.
GbaBewoner:
type: object
properties:
Expand All @@ -292,11 +292,11 @@ components:
verblijfplaatsInOnderzoek:
$ref: '#/components/schemas/GbaInOnderzoek'
geslacht:
$ref: '#/components/schemas/Waardetabel'
$ref: '#/components/schemas/Geslachtsaanduiding'
naam:
$ref: '#/components/schemas/GbaNaam'
$ref: '#/components/schemas/NaamBasis'
geboorte:
$ref: '#/components/schemas/GbaGeboorte'
$ref: '#/components/schemas/GeboorteBasis'
GbaBewoning:
description: |
Een bewoning geeft aan welke personen in een periode (mogelijk) op een adresseerbaar object staan ingeschreven.
Expand Down
41 changes: 22 additions & 19 deletions specificatie/informatie-service/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ components:
$ref: '#/components/schemas/VolledigeNaam'
AbstractDatum:
type: object
required:
- type
- langFormaat
properties:
type:
type: string
Expand All @@ -256,6 +259,10 @@ components:
DatumOnbekend: '#/components/schemas/DatumOnbekend'
JaarDatum: '#/components/schemas/JaarDatum'
JaarMaandDatum: '#/components/schemas/JaarMaandDatum'
example:
type: Datum
datum: '2018-07-01'
langFormaat: 1 juli 2018
VolledigeDatum:
description: Datum conform iso8601
allOf:
Expand All @@ -265,11 +272,12 @@ components:
datum:
type: string
format: date
required:
- datum
example:
value:
type: Datum
datum: '2018-07-01'
langFormaat: 1 juli 2018
type: Datum
datum: '2018-07-01'
langFormaat: 1 juli 2018
DatumOnbekend:
description: representatie voor een volledig onbekend datum
allOf:
Expand All @@ -282,10 +290,9 @@ components:
required:
- onbekend
example:
value:
type: DatumOnbekend
onbekend: true
langFormaat: onbekend
type: DatumOnbekend
onbekend: true
langFormaat: onbekend
Jaar:
type: integer
format: int32
Expand All @@ -302,10 +309,9 @@ components:
required:
- jaar
example:
value:
type: JaarDatum
jaar: 2018
langFormaat: 2018
type: JaarDatum
jaar: 2018
langFormaat: 2018
Maand:
type: integer
format: int32
Expand All @@ -325,18 +331,15 @@ components:
- jaar
- maand
example:
value:
type: JaarMaandDatum
jaar: 2018
maand: 7
langFormaat: juli 2018
type: JaarMaandDatum
jaar: 2018
maand: 7
langFormaat: juli 2018
GeboorteBasis:
type: object
properties:
datum:
$ref: '#/components/schemas/AbstractDatum'
description: |
Datum waarop de persoon is geboren.
Bewoner:
type: object
properties:
Expand Down
20 changes: 11 additions & 9 deletions src/Bewoning.Data.Mock/Generated/Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Geslachtsaanduiding : Waardetabel
{

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum AdellijkeTitelPredicaatSoort
{
Expand All @@ -219,7 +225,7 @@ public partial class AdellijkeTitelPredicaatType : Waardetabel
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class GbaNaamBasis
public partial class NaamBasis
{
[Newtonsoft.Json.JsonProperty("voornamen", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Voornamen { get; set; }
Expand All @@ -245,12 +251,8 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class GbaGeboorte
public partial class GeboorteBasis
{
/// <summary>
/// Datum waarop de persoon is geboren.
/// <br/>
/// </summary>
[Newtonsoft.Json.JsonProperty("datum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Datum { get; set; }

Expand Down Expand Up @@ -278,13 +280,13 @@ public partial class GbaBewoner
public GbaInOnderzoek VerblijfplaatsInOnderzoek { get; set; }

[Newtonsoft.Json.JsonProperty("geslacht", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Waardetabel Geslacht { get; set; }
public Geslachtsaanduiding Geslacht { get; set; }

[Newtonsoft.Json.JsonProperty("naam", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public GbaNaamBasis Naam { get; set; }
public NaamBasis Naam { get; set; }

[Newtonsoft.Json.JsonProperty("geboorte", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public GbaGeboorte Geboorte { get; set; }
public GeboorteBasis Geboorte { get; set; }

private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

Expand Down
19 changes: 19 additions & 0 deletions src/Bewoning.Informatie.Service/DataTransferObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// </auto-generated>
//----------------------

using Brp.Shared.DtoMappers.BrpApiDtos;

#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
Expand Down Expand Up @@ -98,6 +100,23 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class GeboorteBasis
{
[Newtonsoft.Json.JsonProperty("datum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public AbstractDatum Datum { get; set; }

private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

[Newtonsoft.Json.JsonExtensionData]
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
{
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
set { _additionalProperties = value; }
}

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Bewoner
{
Expand Down
17 changes: 9 additions & 8 deletions src/Bewoning.Informatie.Service/DataTransferObjects.nswag
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"clientBaseClass": null,
"configurationClass": null,
"generateClientClasses": false,
"suppressClientClassesOutput": false,
"generateClientInterfaces": false,
"suppressClientInterfacesOutput": false,
"clientBaseInterface": null,
"injectHttpClient": true,
"disposeHttpClient": true,
Expand All @@ -31,6 +33,8 @@
"exposeJsonSerializerSettings": false,
"clientClassAccessModifier": "public",
"typeAccessModifier": "public",
"propertySetterAccessModifier": "",
"generateNativeRecords": false,
"generateContractsOutput": false,
"contractsNamespace": null,
"contractsOutputFilePath": null,
Expand All @@ -42,7 +46,9 @@
"queryNullValue": "",
"className": "{controller}Client",
"operationGenerationMode": "MultipleClientsFromOperationId",
"additionalNamespaceUsages": [],
"additionalNamespaceUsages": [
"Brp.Shared.DtoMappers.BrpApiDtos"
],
"additionalContractNamespaceUsages": [],
"generateOptionalParameters": false,
"generateJsonMethods": false,
Expand Down Expand Up @@ -79,14 +85,12 @@
"BadRequestFoutbericht",
"BewoningMetPeildatum",
"BewoningMetPeriode",
"Geslachtsaanduiding",
"VolledigeNaam",
"VolledigeDatum",
"AbstractDatum",
"VolledigeDatum",
"DatumOnbekend",
"JaarDatum",
"JaarMaandDatum",
"GeboorteBasis"
"AdellijkeTitelPredicaatType"
],
"excludedParameterNames": [],
"handleReferences": false,
Expand All @@ -101,9 +105,6 @@
"generateOptionalPropertiesAsNullable": true,
"generateNullableReferenceTypes": false,
"templateDirectory": null,
"typeNameGeneratorType": null,
"propertyNameGeneratorType": null,
"enumNameGeneratorType": null,
"serviceHost": null,
"serviceSchemes": null,
"output": "DataTransferObjects.cs",
Expand Down
Loading

0 comments on commit ba0b8e0

Please sign in to comment.