LCFS - Insert Legacy Fuel Types and Related Data #1551
Labels
Added Banana 4 Scale
Label for tickets added mid-sprint
Medium
Medium priority
Task
Work that does not directly impact the user
Description:
Add new entries for legacy fuel types derived from TFRS-approved fuels. For each legacy variant, insert a
fuel_type
record withis_legacy = true
and all related defaults (energy density, energy effectiveness ratios, carbon intensities, and associated units of measure), ensuring legacy data remains distinct from current records. This migration will transfer real values from the production TFRS lookup tables into the LCFS system through Alembic migrations, maintaining data integrity and consistency.Purpose and benefit to user:
Allows the system to accurately represent historical or legacy fuels, enabling comparisons and analysis across multiple time periods or regulatory regimes. Users can perform comprehensive historical reporting and ensure consistency between TFRS and LCFS datasets without data duplication issues.
Acceptance Criteria:
fuel_type
table withis_legacy = true
.energy_density
andenergy_effectiveness_ratio
tables, then corresponding legacy entries exist and correctly link to their respective legacyfuel_type
IDs.fuel_type
table, then duplicates are correctly identified and distinguished by theis_legacy
flag.Development Checklist:
Preparation:
approved_fuel_type
table.is_legacy = true
.energy_density
,energy_effectiveness_ratio
,carbon_intensity
, andunit_of_measure
.Alembic Migration Script Creation:
fuel_type
table withis_legacy = true
for each legacy fuel type.energy_density
,energy_effectiveness_ratio
, etc.) linked to the newly inserted legacyfuel_type
IDs.Example Alembic Migration Script:
Notes:
fuel_type_id
values for legacy entries (101
,102
,103
, etc.). In a real-world scenario, retrieve these IDs dynamically after insertion usingRETURNING
or other database-specific features.energy_density
,energy_effectiveness_ratio
, etc.) are correctly referenced with the appropriatefuel_type_id
.bulk_insert
lists with all necessary legacy fuel types and their associated default values as per the production TFRS data.units
field corresponds to the correctQuantityUnitsEnum
values defined in the ORM model.Data Transfer Validation and Analysis:
is_legacy = true
.energy_density
andenergy_effectiveness_ratio
records against the production TFRS lookup tables to ensure accuracy.Notes:
is_legacy
flag distinguishes them.unit_of_measure
references align with theQuantityUnitsEnum
defined in the ORM models.The text was updated successfully, but these errors were encountered: