bcgov / bcgov/lcfs

LCFS (TFRS Shutdown) - Validate Fuel Supply (Schedule B) Migration from TFRS to LCFS

Open
#2,986 0 comments 0 reactions 1 assignee Claimed by @AlexZorkin View on GitHub
Medium Task
Dominant language
Python
Stars
6
Forks
6
Avg merge
2d 4h
Merged PRs (30d)
87

Description

**Describe the task**
Validate the complete migration of fuel supply records (Schedule B) from TFRS to LCFS, ensuring accurate data transfer, proper group_uuid ordering, and correct delta handling for supplemental reports.

**Purpose**
Fuel supply records represent the core of compliance reporting data. This validation ensures all Schedule B records are accurately migrated while properly handling the architectural differences between TFRS (full copies) and LCFS (delta-only) for supplemental reports.

**Acceptance Criteria**
- [ ] All fuel supply records from TFRS are present in LCFS
- [ ] Group UUID ordering matches exactly between systems
- [ ] Supplemental reports contain only deltas, not full record copies
- [ ] All fuel types and fuel codes are correctly mapped
- [ ] Quantities, densities, and carbon intensities match precisely
- [ ] Expected/actual use flags are preserved
- [ ] Compliance units calculations are consistent
- [ ] All foreign key relationships maintained (reports, fuel types, fuel codes)
- [ ] Validation script reports zero discrepancies
- [ ] Performance: Handles 50,000+ fuel supply records efficiently

**Validation Steps**
1. Execute `validate_fuel_supply.py` with production data
2. Compare total record counts and compliance units between systems
3. Verify delta-only storage in LCFS supplemental reports
4. Sample validation of 10% of records for field accuracy
5. Validate group_uuid ordering across all report versions
6. Check for data integrity issues or orphaned records
7. Cross-reference with compliance summary totals

**Additional context**
- Schedule B is the largest data set in compliance reports
- Critical for compliance unit calculations
- TFRS duplicates all records in supplemental reports
- LCFS stores only changes in supplemental reports
- Group UUID ordering is critical for maintaining report chains
- Reference files: `migrate_fuel_supply.py`, `validate_fuel_supply.py`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.