-
Notifications
You must be signed in to change notification settings - Fork 3
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: Filter between legacy and not legacy fuel types #1599
Conversation
dhaselhan
commented
Jan 3, 2025
- Pass compliance period for get other use table options
- Add filter on compliance period < 2024 to enable the is_legacy filter.
- Add new is_legacy to FuelTypes and default to false
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.
Looking good, just one minor suggestion. Thannks.
"""Get all table options""" | ||
fuel_categories = await self.fuel_code_repo.get_fuel_categories() | ||
fuel_types = await self.fuel_code_repo.get_formatted_fuel_types() | ||
fuel_types = await self.fuel_code_repo.get_formatted_fuel_types( | ||
include_legacy=compliance_period < "2024" |
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.
Let's create a constant for "2024" and call it LEGISLATION_TRANSITION_YEAR or something like that. Add a comment to the constant explaining what its for and then use this throughout the backend wherever we need to differentiate on this cutoff.
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.
Done!
@@ -164,6 +164,10 @@ async def get_fuel_export_table_options(self, compliancePeriod: str): | |||
) | |||
) | |||
|
|||
include_legacy = compliance_period < "2024" |
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.
use constant as suggested above, and do the same for any other uses of the year.
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.
Done!
57021b8
to
fe52b18
Compare
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.
Looks good ty
* Pass compliance period for get other use table options * Add filter on compliance period < 2024 to enable the is_legacy filter. * Add new is_legacy to FuelTypes and default to false
* Use constant for 2024
b9260b5
to
d641a93
Compare