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

fix: more granular Applicant, Proposal & Property types #40

Merged
merged 12 commits into from
Sep 29, 2023

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Sep 25, 2023

Summary of key changes:

  • data.applicant
    • add type
    • add interest
    • add ownership
    • agent contact info is cleaned up to not repeat sameAsSiteAddress as that never applies to an agent
  • data.property
    • move localAuthorityDistrict & region to outer level rather than inside address
    • adds titleNumber & EPC (conditional on region = London)
    • update constraints type (adds PlanningConstraint enum, but not referencing yet)
  • data.proposal
    • repeat boundary with redline info
    • add date & retro.date
    • add details catchall (also conditional on region = London, still a lot of questions here but this feels like a decent start)
    • add VehicleParking enum
    • update projectType enum values with more granularity (i've covered most popular project types, but likely still missing a lot here which will need to eventually be added in-full)

Still a few more ? overall than I'd like, hoping those get tightened up as we work through specific questions here: https://docs.google.com/spreadsheets/d/1sBJ48u_BKg5_i2VjEjGORFxlBJVlXdUyFJpiliZw2-s/edit#gid=0

@jessicamcinchak jessicamcinchak changed the title wip: more granular Proposal & Property types wip: more granular Applicant, Proposal & Property types Sep 29, 2023
@jessicamcinchak jessicamcinchak changed the title wip: more granular Applicant, Proposal & Property types fix: more granular Applicant, Proposal & Property types Sep 29, 2023
@jessicamcinchak jessicamcinchak marked this pull request as ready for review September 29, 2023 09:35
Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions, a few comments. Pretty much all can be fixed forward I think if you'd rather 👍

*/
export interface LondonProperty extends UKProperty {
titleNumber: {
known: 'Yes' | 'No';
Copy link
Contributor

@DafyddLlyr DafyddLlyr Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually probably redundant - it looks like a way that Editors get an optional value for number.

Could we just have titleNumber?: string or titleNumber?: { value: string } to represent this block?

number?: string;
};
EPC: {
known:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this could be modelled as -

EPC?: {
  value: string;
  onlyAppliesToSomeProperties: boolean;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial thinking here was that an optional value alone loses the distinction between "[I know] The property does not have one" and "No [I don't know if my property has one]" ?

This one is definitely still WIP in the spreadsheet, so going to fix-forward here as needed.

@@ -8,12 +9,156 @@ import {DateTime} from '../../utils';
export interface Proposal {
projectType: ProjectType[];
description: string;
boundary?: {
site: Record<string, any>; // @todo use GeoJSON from utils here, but ajv tests failing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it looks like the plugin doesn't natively support a GeoJSON format which is a shame https://github.com/ajv-validator/ajv-formats

Elsewhere we've used this package to type GeoJSON - https://www.npmjs.com/package/@types/geojson

We could import this and just use this type? It will probably bloat the schema a fair bit but as it's machine-readable only maybe it's not a big issue? (it's would be nice if we could split up the schema files automatically).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking at the raw type it's a fair bit simpler than I anticipated - maybe not a bad way to go? https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/geojson/index.d.ts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tried both of these and got a flurry of build issues, so transferred to an issue instead for now: #41

finish: DateTime;
completion?: DateTime;
};
retro?: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Just as this is a shorthand key, could we add an @decription above this line also?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know what it's shorthand for yet, will revisit !

types/schema/data/Proposal.ts Outdated Show resolved Hide resolved
types/schema/data/Proposal.ts Outdated Show resolved Hide resolved
@jessicamcinchak jessicamcinchak merged commit 297e217 into main Sep 29, 2023
1 check passed
@jessicamcinchak jessicamcinchak deleted the jess/more-granular-proposal-and-property branch September 29, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants