Skip to content

Commit

Permalink
chore: implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
shon-button committed Jan 6, 2025
1 parent 9f8617d commit 5deb39e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
11 changes: 6 additions & 5 deletions bc_obps/reporting/service/report_verification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ def get_report_needs_verification(version_id: int) -> bool:
Operation.Purposes.NEW_ENTRANT_OPERATION,
}
ATTRIBUTABLE_EMISSION_THRESHOLD = Decimal("25000000")
registration_purpose = ReportAdditionalDataService.get_registration_purpose_by_version_id(version_id)

# Registration Purpose: verification data is required if the registration purpose is in REGULATED_OPERATION_PURPOSES
registration_purpose_value = registration_purpose.get("registration_purpose", {})
# Fetch registration purpose
registration_purpose = ReportAdditionalDataService.get_registration_purpose_by_version_id(version_id)

if registration_purpose in REGULATED_OPERATION_PURPOSES:
return True
# Compare the enum value
if isinstance(registration_purpose, Operation.Purposes):
if registration_purpose in REGULATED_OPERATION_PURPOSES:
return True

# Emission threshold: verification data is required if the registration purpose is Reporting Operation, and total TCo₂e >= 25,000
if registration_purpose == Operation.Purposes.REPORTING_OPERATION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@


class TestReportVerificationService(TestCase):
REGULATED_OPERATION_PURPOSES = {
Operation.Purposes.OBPS_REGULATED_OPERATION,
Operation.Purposes.OPTED_IN_OPERATION,
Operation.Purposes.NEW_ENTRANT_OPERATION,
}
ATTRIBUTABLE_EMISSION_THRESHOLD = Decimal('25000000')

def setUp(self):
# Arrange: Create a report version
self.report_version = make_recipe('reporting.tests.utils.report_version')
Expand Down

0 comments on commit 5deb39e

Please sign in to comment.