Skip to content

Commit

Permalink
chore: extend SiteAddress type to account for ranges (#3670)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Sep 16, 2024
1 parent 94391e5 commit a43cdc8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,37 @@ export default function PickOSAddress(props: PickOSAddressProps): FCReturn {
latitude: selectedAddress.LAT,
longitude: selectedAddress.LNG,
organisation: selectedAddress.ORGANISATION || null,
sao: selectedAddress.SAO_TEXT,
sao: [
selectedAddress.SAO_START_NUMBER,
selectedAddress.SAO_START_SUFFIX,
selectedAddress.SAO_TEXT, // populated in cases of building name only, no street number
]
.filter(Boolean)
.join(""),
saoEnd: [
selectedAddress.SAO_END_NUMBER,
selectedAddress.SAO_END_SUFFIX,
]
.filter(Boolean)
.join(""),
pao: [
selectedAddress.PAO_START_NUMBER,
selectedAddress.PAO_START_SUFFIX,
selectedAddress.PAO_TEXT, // populated in cases of building name only, no street number
]
.filter(Boolean)
.join(""),
paoEnd: [
selectedAddress.PAO_END_NUMBER,
selectedAddress.PAO_END_SUFFIX,
]
.filter(Boolean)
.join(""),
street: selectedAddress.STREET_DESCRIPTION,
town: selectedAddress.TOWN_NAME,
postcode: selectedAddress.POSTCODE_LOCATOR,
parish: selectedAddress.PARISH__CODE,
ward: selectedAddress.WARD_CODE,
x: selectedAddress.X_COORDINATE,
y: selectedAddress.Y_COORDINATE,
planx_description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const osAddressProps = {
planx_value: "residential.HMO.parent",
administrative_area: "SOUTHWARK",
local_custodian_code: "SOUTHWARK",
ward: "E05011109",
source: "os",
},
"property.type": ["residential.HMO.parent"],
Expand Down
4 changes: 4 additions & 0 deletions editor.planx.uk/src/@planx/components/FindProperty/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ export interface SiteAddress extends MinimumSiteAddress {
blpu_code?: string;
organisation?: string | null;
sao?: string | null;
saoEnd?: string | null;
pao?: string;
paoEnd?: string;
street?: string;
town?: string;
postcode?: string;
ward?: string;
parish?: string;
single_line_address?: string;
planx_description?: string; // joined via table blpu_codes
planx_value?: string; // joined via table blpu_codes
Expand Down

0 comments on commit a43cdc8

Please sign in to comment.