Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCFS - Migrate Exclusion Report Records from TFRS to Allocation Agreement in LCFS with Version Chaining #1642

Open
13 tasks
airinggov opened this issue Jan 9, 2025 · 1 comment
Labels
Medium Medium priority Task Work that does not directly impact the user

Comments

@airinggov
Copy link
Collaborator

airinggov commented Jan 9, 2025

Description:
Develop a Groovy ETL script to migrate Exclusion Report data from the exclusion_agreement table in TFRS to the allocation_agreement table in LCFS. The script will transform and map specific fields while ensuring compatibility with LCFS table requirements, including handling overrides for mandatory fields.

Key tasks include:

Purpose and Benefit to User:

Acceptance Criteria:

Development Checklist:

  1. Data Extraction:

    • Query TFRS exclusion_agreement table to extract Exclusion Report data.
  2. Mapping and Transformation:

    • Map TFRS transaction_type to LCFS responsibility:
      • PurchasedAllocated from
      • SoldAllocated to
    • Map TFRS fields to LCFS fields:
      • fuel_typefuel_type
      • legal_name_of_transaction_partner legal_name_of_transaction_partner
      • address_of_transaction_partner address_for_service
      • quantityquantity
      • units_1units
    • Add and populate new fields in LCFS:
      • quantity_not_sold_or_supplied_within_compliance_period
      • units_2
  3. Field Overrides:

    • Override mandatory field validations in LCFS for the following:
      • email → allow null
      • phone → allow null
      • fuel_type_other → allow null
      • fuel_category → allow null
      • determining_carbon_intensity → allow null
      • fuel_code → allow null
      • ci_of_fuel → allow null
  4. Data Insertion:

    • Insert transformed records into the allocation_agreement table in LCFS.
  5. Error Handling and Logging:

    • Implement error handling to log issues without halting the process.
    • Log field mapping transformations and overrides for transparency.
  6. Testing and Validation:

    • Verify that all records are migrated accurately, including field mappings and null overrides.
    • Validate that new fields are added and populated correctly in LCFS.
    • Test edge cases, such as missing fields or invalid data in TFRS.
  7. Documentation:

    • Document the script’s purpose, logic, and field mappings for future reference.
    • Provide guidance for running and verifying the ETL process.

Notes:

  • Overrides for mandatory fields are crucial to align with LCFS requirements while handling incomplete data from TFRS.
  • New fields (quantity_not_sold_or_supplied_within_compliance_period, units_2) need proper handling for insertion in LCFS.
  • Use existing ETL scripts for reference to maintain consistency in implementation.
@airinggov airinggov changed the title LCFS - LCFS - Migrate Exclusion Report Records from TFRS to Allocation Agreement in LCFS with Version Chaining Jan 9, 2025
@airinggov airinggov added Medium Medium priority Task Work that does not directly impact the user labels Jan 9, 2025
@airinggov
Copy link
Collaborator Author

@airinggov Create new card to display quantity_not_sold_or_supplied_within_compliance_period, units_2 in legacy reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Medium priority Task Work that does not directly impact the user
Projects
None yet
Development

No branches or pull requests

1 participant