bcgov / bcgov/lcfs

LCFS - Investigate Compliance Envelope Year and Compliance Report Balance Discrepancies

Open
#4,953 0 comments 0 reactions 0 assignees View on GitHub
Compliance Reporting Credit Transfers & Transactions High Task
Dominant language
Python
Stars
6
Forks
6
Avg merge
2d 4h
Merged PRs (30d)
87

Description

**Describe the Task**
Investigate and resolve inconsistencies between credit transfer recorded dates, compliance envelope year assignment, and compliance report balance calculations.

A specific example has been identified with Credit Transfer CT5319. The transfer is displayed within the application as having a recorded date of March 30, 2026, but appears in the transaction download with a recorded date of March 31, 2026. Despite this discrepancy, the transfer appears correctly in the organization's credit ledger but is not being reflected in Line 17 (Available Balance) of the 2025 Compliance Report Summary as expected.

This suggests there may be two separate but related issues:
1. Credit transfer recorded/effective dates are not being stored or displayed consistently across application components.
2. Report summary calculations for Line 17 may not be including the correct set of transactions when determining available balance amounts.

**Purpose**
Ensure that credit transfer dates are consistently recorded and displayed across the application and that compliance report balance calculations accurately reflect all eligible transactions within the appropriate compliance envelope year.

**Acceptance Criteria**
- Investigate and document how recorded dates and effective dates are stored and displayed across:
- Credit transfer details
- Transaction download exports
- Credit ledger views
- Compliance report calculations
- Confirm whether CT5319 contains differing recorded dates at the database, API, or UI layers.
- Determine which date field is intended to govern compliance envelope year assignment and report inclusion.
- Verify whether timezone handling, date conversion, or date truncation is causing inconsistencies.
- Investigate how Line 17 available balance calculations identify and include qualifying transactions.
- Confirm whether CT5319 should be included in the 2025 Compliance Report Summary and identify why it is currently excluded.
- Resolve any logic defects related to transaction date assignment, compliance envelope year determination, or report summary calculations.
- Verify that transaction downloads, credit ledgers, and compliance report summaries display consistent results after the fix.
- Regression test historical and newly created transfers occurring near compliance year boundaries.

**Additional Context**
Example transaction:
- CT5319
- Application recorded date: March 30, 2026
- Transaction download recorded date: March 31, 2026
- Appears correctly in Credit Ledger
- Does not appear to be contributing to Line 17 (Available Balance) in the 2025 Compliance Report Summary

**Implications**
Incorrect date handling or compliance envelope year assignment may result in credit transfers being included in some areas of the application while being excluded from compliance report calculations, leading to inaccurate available balance reporting and potential compliance concerns.

Contributor guide

Open the contributing guide

Research direction

Start by tracing CT5319 through the credit transfer details, transaction download, credit ledger, and 2025 Compliance Report Summary Line 17. Compare recorded and effective dates across the database, API, and UI layers, including timezone or truncation behavior. Done means the governing date and year assignment are consistent, CT5319 is correctly handled, and boundary-date transfers have regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.