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

Implement TwoPartService 'friendly' response #359

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

Cruikshanks
Copy link
Member

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

We have our TwoPartService which is our spike on coming up with a working two-part tariff matching algorithm. But the data it matches has issues

  • there is lots of it. The records have numerous fields and many are JSONB which means when presented they expand out even more
  • for 'reasons' few of the tables and hence the entity names match what you see in the UI

Reducing the amount of data output to just the key elements will help when assessing whether a match is right. And as you'll generally have the UI open and the relevant record up it would really help if the response matched what you saw on screen.

So, we have created a FriendlyResponseService. We fully intend to delete it once we have confirmation the matching algorithm is good. This is our excuse for why it looks horrendous and has no tests!

But it means the default response from our /check endpoint will make it a lot easier to assess the critical bit; the matching algorithm.

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

We have our `TwoPartService` which is our spike on coming up with a working two-part tariff matching algorithm. But the data its matching has issues

- there is _lots_ of it. The records have numerous fields and many are JSONB which means when presented they expand out even more
- for 'reasons' few of the tables and hence the entity names match what you see in the UI

Reducing the amount of data output to just the key elements will help when assessing a match is right. And as you'll generally have the UI open and the relevant record up it would _really_ help if the response matched what you saw on screen.

So, we have created a `FriendlyResponseService`. We fully intend to delete it once we have confirmation the matching algorithm is good. This is our excuse for why it looks horrendous and has no tests!

But it means the default response from our `/check` endpoint will make it a lot easier to assess the critical bit; the matching algorithm.
@Cruikshanks Cruikshanks added the enhancement New feature or request label Aug 16, 2023
@Cruikshanks Cruikshanks self-assigned this Aug 16, 2023
@Cruikshanks
Copy link
Member Author

SonarCloud is perfectly right to call out the lack of unit tests for this one. But as I stated, I hand on heart promise this will be deleted before two-part tariff billing goes live! 😁

@Cruikshanks Cruikshanks requested a review from Jozzey August 16, 2023 12:02
@Cruikshanks Cruikshanks marked this pull request as ready for review August 16, 2023 12:04
@Cruikshanks Cruikshanks removed the request for review from Jozzey August 16, 2023 12:04
@Cruikshanks Cruikshanks merged commit 5cf40c0 into main Aug 16, 2023
@Cruikshanks Cruikshanks deleted the implement-friendly-2pt-matching-response branch August 16, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant