LCFS - Create missing supplemental report #3 for compliance report chain
Open
@AlexZorkin is already working on this.
Since Aug 1, 2025.
Medium
- Dominant language
- Python
- Stars
- 7
- Forks
- 7
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 87
Description
Description
A supplemental report #3 exists in the legacy TFRS system but was not created in LCFS during migration. This report needs to be created with its associated adjustment transaction and proper history records to complete the compliance report chain.
Acceptance Criteria
- Supplemental Report #3 is created and linked to the existing report chain
- Adjustment transaction is created and linked to the report
- Compliance report history records reflect the correct workflow (Draft → Submitted → Recommended → Assessed)
- Legacy ID is preserved for traceability
Technical Details
- Create SQL migration script that:
- Inserts adjustment transactions with proper effective dates
- Creates compliance reports with correct version numbers
- Links reports to existing report chains via
compliance_report_group_uuid - Preserves legacy system IDs for audit trail
- Creates history records with appropriate user IDs and timestamps
- Updates compliance report summaries with adjustment impacts
Example Structure
-- 1. Create adjustment transaction
INSERT INTO transaction (compliance_units, organization_id, transaction_action, ...)
-- 2. Create compliance report
INSERT INTO compliance_report (version, legacy_id, transaction_id, ...)
-- 3. Create organization snapshot
INSERT INTO compliance_report_organization_snapshot (...)
-- 4. Create compliance report summary
INSERT INTO compliance_report_summary (line_20_surplus_deficit_units, ...)
-- 5. Create history records
INSERT INTO compliance_report_history (user_profile_id, compliance_report_status_id, ...)
Testing
- Verify report chain integrity
- Confirm transaction balances are correct
- Validate history records show proper workflow
- Check legacy ID mapping
Notes
- Ensure all timestamps use the original dates from TFRS
- User profile IDs must match the actual users who performed actions
- Transaction amounts may be negative for adjustments/reductions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.