LCFS - Correct Date Range Logic for Lines 12, 13, and 14
- Dominant language
- Python
- Stars
- 6
- Forks
- 6
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 87
Description
**Describe the Task**
Update the date range logic for the following compliance report summary lines so that values are correctly calculated based on the effective date of transactions within the reporting period:
- Line 12: Compliance units transferred away
- Line 13: Compliance units received through transfers
- Line 14: Compliance units issued under Initiative Agreements
The correct reporting window must be:
- From April 1 of the reporting year
- To March 31 of the following calendar year
Examples:
- 2024 compliance report → April 1, 2024 to March 31, 2025
- 2025 compliance report → April 1, 2025 to March 31, 2026
All transactions (credit transfers and Initiative Agreement issuances) must be filtered using the **effective date** within this range.
**Purpose**
Ensure compliance report accuracy and alignment with the intended reporting period for credit movements and Initiative Agreement issuances.
**Acceptance Criteria**
1. Identification of impacted reports
- All 2024 and 2025 compliance reports containing incorrect values for Lines 12, 13, and 14 are identified.
- Identification is based on current logic using an incorrect date range or filtering criteria.
2. Correct calculation logic
- Line 12 includes all compliance units transferred away with effective dates between April 1 (reporting year) and March 31 (following year).
- Line 13 includes all compliance units received through transfers within the same date range.
- Line 14 includes all compliance units issued under Initiative Agreements within the same date range.
- Effective date is consistently used as the filtering field for all three lines.
3. Data correction and patching
- All impacted 2024 and 2025 compliance reports are recalculated using the corrected date range logic.
- Updated values are patched into the system.
- Patching is tested in a non-production environment prior to deployment.
4. Data integrity checks
- No category assignment issues result in exclusion of valid transactions.
- Transactions with valid values are not suppressed due to category filters.
- $0 values do not incorrectly override or mask valid totals.
- All applicable transactions appear in the correct summary line.
5. Validation and testing
- Test cases confirm correct inclusion/exclusion of transactions at boundary dates (April 1 and March 31).
- Cross-check results against source transaction tables.
- Confirm no regression impacts to other summary lines or reporting logic.
**Additional context**
- This issue may impact compliance outcomes and auditability of submitted reports.
- Care must be taken to ensure transparency in any corrected values.
Contributor guide
Assessment
This issue has not been assessed yet.