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

Add Hedgerow schema #308

Merged
merged 10 commits into from
Feb 20, 2025
Merged

Add Hedgerow schema #308

merged 10 commits into from
Feb 20, 2025

Conversation

christinelangston
Copy link
Collaborator

@christinelangston christinelangston commented Feb 17, 2025

Several edits to add data schema for Hedgerow Removal Notice: Added HedgerowRemovalNotice Applicant, Application Data, Proposal, and Property.
Additional edits made to allow for this:

  • Made type optional in BaseApplicant (Applicant.ts file)
  • Refactor Proposal by redefining ProposalBase

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Looks great, two minor comments !

reason: string;
hedgerowLength: {metres: number};
hedgerowAgeLessThanThirty: boolean;
}
Copy link
Member

Choose a reason for hiding this comment

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

If we actually want to fully omit description, I think we can alternatively do something like this:

export type HedgerowRemovalNoticeProposal = Pick<ProposalBase, "boundary"> & { 
  reason: string; 
  hedgerowLength: { metres: number };
  hedgerowAgeLessThanThirty: boolean;
}

Which rather than extending the whole ProposalBase will just pick the single optional boundary field and add it to the rest of our custom proposal definition !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense to me! I would defer to you, do you want to omit description here?

Copy link
Member

Choose a reason for hiding this comment

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

Let's omit if never actually appears in the service itself as August was clarifying !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made these suggested edits to Proposal.ts

},
area: {
squareMetres: 2526.36,
},
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think our proposal.boundary.area always expects both squareMetres and hectares properties?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yes, just confirmed hectares are optional. Which makes sense, it passed the tests I ran locally. Would you prefer to have them included?

@christinelangston christinelangston merged commit 40d5591 into main Feb 20, 2025
3 checks passed
@christinelangston christinelangston deleted the hedgerow_schema branch February 20, 2025 17:05
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