-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2570 from Amsterdam/bugfix/116361-change-bag-api
Bugfix/116361 change bag api
- Loading branch information
Showing
26 changed files
with
239 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
declare type BAGBenkAggResponse = { | ||
page: { | ||
number: number | ||
size: number | ||
} | ||
_embedded: { | ||
adresseerbareobjecten: Array<BAGBenkAggAddress> | ||
} | ||
} | ||
|
||
declare type BAGBenkAggAddress = { | ||
openbareruimteNaam: string | ||
huisnummer: number | ||
huisletter: string | ||
huisnummertoevoeging: string | ||
postcode: string | ||
verblijfsobjectOppervlakte: number | ||
verblijfsobjectAantalBouwlagen: number | ||
verblijfsobjectAantalKamers: number | ||
typeAdres: string | ||
gebiedenStadsdeelNaam: string | ||
gebruiksdoelOmschrijvingen: Array<string> | ||
toegangOmschrijvingen: Array<string> | ||
wozSoortObjectOmschrijving: Array<string> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare type BAGPdokResponse = { | ||
response: { | ||
numFound: number | ||
docs: Array<BAGPdokAddress> | ||
} | ||
} | ||
|
||
declare type BAGPdokAddress = { | ||
woonplaatsnaam: string | ||
weergavenaam: string | ||
adrestype: string | ||
gemeentenaam: string | ||
postcode: string | ||
centroide_ll: string | ||
nummeraanduiding_id: string | ||
adresseerbaarobject_id: string | ||
straatnaam: string | ||
huisnummer: integer | ||
huisletter: string | ||
huisnummertoevoeging: string | ||
score: float | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 5 additions & 12 deletions
17
src/app/components/addresses/ObjectDetails/ObjectDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
src/app/components/addresses/ObjectDetails/hooks/useValues.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
export default (BAGAddress?: BAGAddressResponse["results"][number], BAGObjectResponse?: BAGObjectResponse) => { | ||
|
||
if (BAGAddress === undefined || BAGObjectResponse === undefined) return | ||
export default (benkAggAddress?: BAGBenkAggAddress) => { | ||
if (!benkAggAddress) return | ||
|
||
const { | ||
gebruiksdoelOmschrijvingen, verblijfsobjectOppervlakte, verblijfsobjectAantalBouwlagen, | ||
toegangOmschrijvingen, verblijfsobjectAantalKamers | ||
} = benkAggAddress | ||
|
||
const values = [ | ||
["Bestemming", BAGAddress?.type ?? "-"], | ||
["Oppervlakte", BAGObjectResponse.oppervlakte ? `${ BAGObjectResponse.oppervlakte }m²` : "-"], | ||
["Bouwlagen", BAGObjectResponse.bouwlagen], | ||
["Aantal kamers", BAGObjectResponse.aantal_kamers] | ||
["Gebruiksdoel", gebruiksdoelOmschrijvingen ? gebruiksdoelOmschrijvingen.join(", ") : undefined], | ||
["Oppervlakte", verblijfsobjectOppervlakte ? `${ verblijfsobjectOppervlakte }m²` : undefined], | ||
["Bouwlagen", verblijfsobjectAantalBouwlagen], | ||
["Toegang", toegangOmschrijvingen ? toegangOmschrijvingen.join(", ") : undefined], | ||
["Aantal kamers", verblijfsobjectAantalKamers ] | ||
] | ||
|
||
return Object.fromEntries(values) | ||
} |
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
src/app/components/addresses/utils/getAddressFromBagPdokResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const getAddressFromBagPdokResponse = (data?: BAGPdokResponse): BAGPdokAddress | undefined => { | ||
const docs = data?.response?.docs | ||
return docs && docs[0] ? docs[0] : undefined | ||
} |
5 changes: 0 additions & 5 deletions
5
src/app/components/addresses/utils/getAddressFromBagResults.ts
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
src/app/components/addresses/utils/getAddressFromBenkAggResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const getAddressFromBenkAggResponse = (data?: BAGBenkAggResponse): BAGBenkAggAddress | undefined => { | ||
const adresseerbareobjecten = data?._embedded?.adresseerbareobjecten ?? [] | ||
return adresseerbareobjecten?.length > 0 ? adresseerbareobjecten[0] : undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./getAddressFromBagPdokResponse" | ||
export * from "./getAddressFromBenkAggResponse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 19 additions & 37 deletions
56
src/app/components/search/SearchResults/SearchResults.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.