-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: develop
Are you sure you want to change the base?
Conversation
97fb490
to
9a138b5
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.
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
bc_obps/reporting/migrations/0073_not_applicable_methodology.py
Outdated
Show resolved
Hide resolved
) | ||
|
||
|
||
class ReportEmissionAllocationNoProduct(TimeStampedModel): |
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.
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 toReportEmissionAllocation
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") |
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.
The refactor as suggested will make schemas easier too
bciers/apps/reporting/src/app/components/products/ProductionDataForm.tsx
Show resolved
Hide resolved
9a138b5
to
bcd648b
Compare
This reverts commit 69d9ce9.
… 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
…small or medium by passing type to backend and form builder
… IF small or medium facility + tests
…roduction data page
…duction data page methodology fixed
…o allocation of emissions page when no product saved
… remove default methodology + requirement of products
bcd648b
to
d1e090b
Compare
522
Changes in this commit:
Deselect all buttonwhile Large and Single facilities now NEED a product and disable save buttons without itnewrefactored table of ReportEmissionAllocation to handle if there is no product