-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add Residential Unit types captured via List component #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - one minor language question that can be addressed here, or discussed later.
Co-locating enums and types seems like a good call 👍
*/ | ||
type IntersectingPlanningDesignation = { | ||
intersects: true; | ||
entities: Entity[] | []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason this isn't strictly an Entity[]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a weird relic.
You'll find it in existing examples like this (constraint values which don't map to a single Planning Data dataset etc):
{
value: 'designated',
description: 'Designated land',
intersects: true,
entities: [],
},
I think it was a strategy to require entity
when intersects is true
. But we could also make entity optional, then enforce entities: Entity[]
. I'll revisit this one in another PR as a number of other examples will have to be updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation 👍
@@ -69,6 +71,14 @@ export interface UKProperty { | |||
lastUseEndDate: Date; | |||
}; | |||
}; | |||
units?: { | |||
residential: { | |||
tenure: UKTenureType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick naming question - do we want to have "UK" / "National" just to be implicit in all these types, with subcategories based on them?
SoTenureType
is always assumed to be national unless prefixes/suffixed by a region? e.g. GLATenureType
or TenureTypeGLA
Main reason to flag this would be if something is currently national (e.g. Materials
), but later becomes more distinct for a region it would mean changing the definition of the original type + adding a new one (e.g. MaterialsUK
+ MaterialsScotland
- a breaking change) vs just adding a new type (MaterialsScotland
- a minor change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good question. In my mind, I'm using the UK prefix for specific cases when the GLA & UK categories have no overlap, which feels a little different than cases where the GLA categories extend national categories.
But you're right that this could very well create unnecessary breaking changes later. I'll open a follow-up re-naming PR before we do a proper release to remove the UK prefixes and make all of this consistent (it's going to touch a lot of files)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this seems like the best approach here 👍
Based on:
Changes:
data.property.units.residential
and/ordata.proposal.units.residential
data.proposal.units.residential
with possible childrennew
,rebuilt
,removed
,retained
schema.json
, changes there only reflect newly introduced typesNext:
units.residential
types to minor, major and other applicable examples