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

feat: Add RequestedFiles (v2) #107

Closed
wants to merge 3 commits into from
Closed

feat: Add RequestedFiles (v2) #107

wants to merge 3 commits into from

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Feb 2, 2024

What does this PR do?

  • Adds a list of requested files in service.metadata.files

@DafyddLlyr DafyddLlyr changed the title feat: Add ServiceFiles to schema feat: Add RequestedFiles to schema Feb 5, 2024
* @id #RequestedFileType
* @description Types of planning documents and drawings, with an attached condition as presented to the applicant
*/
export type RequestedFileType = FileType & {condition: FileCondition};
Copy link
Contributor Author

@DafyddLlyr DafyddLlyr Feb 7, 2024

Choose a reason for hiding this comment

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

As we're relying on the enum FileTypes to dynamically generate the FileType type, we can't extend this interface -

image

This means that the schema repeats the file list (have a look at the diff in schema.json).

I spent a fair bit of time trying to work around this to no success. The closest would be something like the below which works as as JSON schema "allOf" and does not repeat the FileType definition -

export type RequestedFileType = {file: FileType} & {condition: FileCondition};

Both have some compromises - I think the current version (enum duplication, but a more useful data shape) is probably the least worst option here.

I think we're fine to proceed as-is, we can maybe re-evaluate how we handle these enum types at some point (see #51)

@DafyddLlyr DafyddLlyr marked this pull request as ready for review February 7, 2024 16:56
@DafyddLlyr DafyddLlyr changed the title feat: Add RequestedFiles to schema feat: Add RequestedFiles (v2) Feb 7, 2024
@DafyddLlyr
Copy link
Contributor Author

Closed in favour of #110

@DafyddLlyr DafyddLlyr closed this Feb 8, 2024
@DafyddLlyr DafyddLlyr deleted the dp/service-files branch February 8, 2024 11:39
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