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

Remove mock data endpoint #575

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Remove mock data endpoint #575

merged 2 commits into from
Dec 8, 2023

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4057

To make the work on two-part tariff and other areas of the service easier in the future we have been undergoing a large-scale refactor of our models. We have realised we can make it seem to the project that we have just one schema, and that everything sits in public by using updatable views for any legacy table we have to deal with.

This has led to a whole refactor of the models based on these new views rather than the legacy tables. During Refactor to use new view-based WATER models, the last stage in refactoring, we hit the point where we'd have to make a whole series of changes to the services that support generating mock data. For context, we created this to help support the re-design of the view bill pages. Our design team needed to prototype and test a page that replicated the scenario we were trying to fix; a bill with more than 150 licences linked to it.

We created the mock endpoint to generate data that could be copied & pasted by the design team into the prototype. The thought was this would be 'a thing' we'd be repeatedly asked for in the future. In reality, we've only had 1 additional request, and that was to generate returns review data based on how the old engine does it. But this was needed to have something to design the new pages around. We've never got around to merging it because it will require a lot of unit testing, for something that will never be used again.

We've come to the conclusion generating mock data at best is only ever going to be a one-off exercise. There will be times we need code to generate complex 'data' (bill runs, charge versions, returns etc) in enough quantity to make tests in the prototype realistic. However once we've generated the data, there will be no additional requests. There is no point in maintaining these endpoints and increasing our workload.

So, this change removes the existing mock endpoint and functionality.

https://eaflood.atlassian.net/browse/WATER-4057

To make the work on two-part tariff and other areas of the service easier in the future we have been undergoing a large scale refactor of our models. We have realised we can make it seem to the project that we have just one schema, and that everything sits in `public` by using [updatable views](https://www.postgresql.org/docs/current/sql-createview.html) for any legacy table we have to deal with.

This has led to a whole refactor of the models so they are based on these new views rather than the legacy tables. During [Refactor to use new view based WATER models](#569), the last stage in refactoring, we hit the point we'd have to make a whole series of changes to the services that support generating mock data. For context, we created this to help support the [re-design of the view bill pages](https://eaflood.atlassian.net/browse/WATER-4131). Our design team needed to prototype and test a page that replicated the scenario we were trying to fix; a bill with more than 150 licences linked to it.

We created the mock endpoint to generate data that could be copied & pasted by the design team into the prototype. The thought was this would be 'a thing' we'd be asked again and again for in the future. In reality, we've only had 1 additional request, and that was to [generate returns review data based on how the old engine does it](#447). But this was needed to have something to design the new pages around. We've never got round to merging it because it will require a lot of unit testing, for something that will never be used again.

We've come to the conclusion generating mock data at best is only ever going to be a one-off exercise. There will be times we need code to generate complex 'data' (bill runs, charge versions, returns etc) in enough quantity to make tests in the prototype realistic. But once we've generated the data there will never be any additional requests. There is no point maintaining these endpoints and increasing our workload.

So, this change removes the existing mock endpoint and functionality.
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Dec 8, 2023
@Cruikshanks Cruikshanks self-assigned this Dec 8, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review December 8, 2023 16:40
@Cruikshanks Cruikshanks merged commit fc24326 into main Dec 8, 2023
6 checks passed
@Cruikshanks Cruikshanks deleted the remove-mock-data-function branch December 8, 2023 16:40
Beckyrose200 pushed a commit that referenced this pull request Dec 14, 2023
https://eaflood.atlassian.net/browse/WATER-4057

To make the work on two-part tariff and other areas of the service easier in the future we have been undergoing a large-scale refactor of our models. We have realised we can make it seem to the project that we have just one schema, and that everything sits in `public` by using [updatable views](https://www.postgresql.org/docs/current/sql-createview.html) for any legacy table we have to deal with.

This has led to a whole refactor of the models based on these new views rather than the legacy tables. During [Refactor to use new view-based WATER models](#569), the last stage in refactoring, we hit the point where we'd have to make a whole series of changes to the services that support generating mock data. For context, we created this to help support the [re-design of the view bill pages](https://eaflood.atlassian.net/browse/WATER-4131). Our design team needed to prototype and test a page that replicated the scenario we were trying to fix; a bill with more than 150 licences linked to it.

We created the mock endpoint to generate data that could be copied & pasted by the design team into the prototype. The thought was this would be 'a thing' we'd be repeatedly asked for in the future. In reality, we've only had 1 additional request, and that was to [generate returns review data based on how the old engine does it](#447). But this was needed to have something to design the new pages around. We've never got around to merging it because it will require a lot of unit testing, for something that will never be used again.

We've come to the conclusion generating mock data at best is only ever going to be a one-off exercise. There will be times we need code to generate complex 'data' (bill runs, charge versions, returns etc) in enough quantity to make tests in the prototype realistic. However once we've generated the data, there will be no additional requests. There is no point in maintaining these endpoints and increasing our workload.

So, this change removes the existing mock endpoint and functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant