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

422 lfo conditions small medium #2982

Open
wants to merge 96 commits into
base: develop
Choose a base branch
from

Conversation

gdalcengio
Copy link
Contributor

@gdalcengio gdalcengio commented Mar 10, 2025

522

Changes in this commit:

  • Adding facility type through multiple props and the getFacilityDetails() function to check for Small or Medium facilities
  • Activities for Small/Medium facilities have dynamically added 'Not Applicable'
  • Production data page for Small/Medium facilities now have:
    • Deselect all button
    • 'Not Applicable' methodology dynamically added to each product
    • The ability to continue w/o a product while Large and Single facilities now NEED a product and disable save buttons without it
  • Allocation of Emissions page for Small/Medium facilities now has a new refactored table of ReportEmissionAllocation to handle if there is no product
    • Note: this is since methodology is pulled from products which only Small/Medium facilities may not have now, so we bring the methodology to the parent table

@gdalcengio gdalcengio force-pushed the 422-lfo-conditions-small-medium branch 3 times, most recently from 97fb490 to 9a138b5 Compare March 12, 2025 21:43
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

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

Great work! I think there's a few changes we can make to simplify the data model, and remove some frontend changes.
The button to deselect products can probably be moved to another PR or piece of work since it's not part of the AC here, and not in the UX wireframes. I think the wording was ambiguous with "Allow to deselect", which people can already do by clicking the products

)


class ReportEmissionAllocationNoProduct(TimeStampedModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

Creating this model breaks our database normalization rules (2NF; https://en.wikipedia.org/wiki/Database_normalization#Satisfying_2NF if you're interested in DB design) by having redundant fields on both report_emission_allocation_no_product and report_product_emission_allocation.

I think what we want to refactor here is to have

  • one parent model ReportEmissionAllocation, containing the methodology, the details, and the fkey to facility_report
  • optional child models ReportEmissionAllocationProduct with an FKEY to ReportEmissionAllocation containing the allocation data

@@ -26,7 +26,7 @@ class ReportProductSchemaIn(ReportProductSchema):
class ReportProductSchemaOut(ReportProductSchema):
product_id: int = Field(..., alias="product.id")
product_name: str = Field(..., alias="product.name")
unit: str = Field(..., alias="product.unit")
unit: Optional[str] = Field(..., alias="product.unit")
Copy link
Contributor

Choose a reason for hiding this comment

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

The refactor as suggested will make schemas easier too

@gdalcengio gdalcengio force-pushed the 422-lfo-conditions-small-medium branch from 9a138b5 to bcd648b Compare March 24, 2025 16:05
ayeshmcg and others added 13 commits March 24, 2025 10:10
… to refresh activity form and emission summary page on navigation
chore: supplementary report version api

chore: cleanup

chore:cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: add tests

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup
chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup

chore: cleanup
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.

8 participants