-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor controllers out of folders #368
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://eaflood.atlassian.net/browse/WATER-4092 This change is not directly related to WATER-4092 . This is more a technical debt exercise. We were about to embark on a spike of seeing if we could replicate what the legacy update billing account address code is doing. Repeating what we already have would mean creating a new folder to put the a single controller file in. This seems to be needlessly complicating the controllers folder. It's not something we have done in other areas which highlights we are pre-empting future needs. Certainly, when a routes controller file becomes to unwieldy we will most likely break it down into separate controllers grouped in a folder. But lets wait until we need to do that! 😁
Cruikshanks
added
the
housekeeping
Refactoring, tidying up or other work which supports the project
label
Aug 18, 2023
The `DataController` is an example of what we are currently doing. Most of `/health` was migrated from another project. Based on how we have built `DataController` and what we have just done with the other controllers it makes sense to refactor 'health'.
Jozzey
approved these changes
Aug 18, 2023
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.
Cruikshanks
added a commit
that referenced
this pull request
Aug 29, 2023
https://eaflood.atlassian.net/browse/WATER-4092 WATER-4092 will require us to add a new 'validator'. These are the modules that contain [Joi](https://joi.dev/) schemas we use to check inbound request payloads. Whilst working on [Add new billing account change address validator](#383) we spotted a few things we wanted to change on the existing validator. As we only have the one, now seemed a good time to make the changes. - fix the test filename (we'd omitted `.test`) - move it out of the `/bill-runs` folder On that last one, similar to [Refactor controllers out of folders](#368) if we find we have lots of validators in the future we'll likely move them into folders. But right now it feels pre-emptive.
Cruikshanks
added a commit
that referenced
this pull request
Aug 29, 2023
https://eaflood.atlassian.net/browse/WATER-4092 WATER-4092 will require us to add a new 'validator'. These modules contain [Joi](https://joi.dev/) schemas we use to check inbound request payloads. Whilst working on [Add new billing account change address validator](#383) we spotted a few things we wanted to change on the existing validator. As we only have one, now seemed a good time to make the changes. - fix the test filename (we'd omitted `.test`) - move it out of the `/bill-runs` folder On that last one, similar to [Refactor controllers out of folders](#368) if we find we have lots of validators in the future we'll likely move them into folders. But right now it feels pre-emptive.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4092
This change is not directly related to WATER-4092. This is more of a technical debt exercise. We were about to embark on a spike of seeing if we could replicate what the legacy update billing account address code is doing. Repeating what we already have would mean creating a new folder to put the single controller file in.
This seems to be needlessly complicating the controllers' folder. It's not something we have done in other areas which highlights we are pre-empting future needs. Certainly, when a routes controller file becomes too unwieldy we will most likely break it down into separate controllers grouped in a folder.
But let's wait until we need to do that! 😁