Skip to content

Commit

Permalink
Merge pull request #1369 from bcgov/fix/daniel-data-fixes-1321
Browse files Browse the repository at this point in the history
fix: Data and Label Fixes
  • Loading branch information
dhaselhan authored Dec 5, 2024
2 parents 39ceef0 + bddf45d commit ff07dac
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""Data Fixes
Revision ID: 8491890dd688
Revises: aeaa26f5cdd5
Create Date: 2024-12-04 23:00:10.708533
"""

from alembic import op
from sqlalchemy import update

from lcfs.db.models import FuelType, AllocationTransactionType
from lcfs.db.models.fuel.FuelType import QuantityUnitsEnum

# revision identifiers, used by Alembic.
revision = "8491890dd688"
down_revision = "aeaa26f5cdd5"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute(
update(FuelType)
.where(FuelType.fuel_type_id == 6)
.values(units=QuantityUnitsEnum.Kilograms)
)

op.execute(
update(FuelType).where(FuelType.fuel_type_id == 20).values(fossil_derived=False)
)

# Update 'type' and 'description' in allocation_transaction_type where allocation_transaction_type_id = 2
op.execute(
update(AllocationTransactionType)
.where(AllocationTransactionType.allocation_transaction_type_id == 2)
.values(
type="Allocated to",
description="Fuel allocated to another supplier under an allocation agreement",
)
)

# Update 'type' and 'description' in allocation_transaction_type where allocation_transaction_type_id = 1
op.execute(
update(AllocationTransactionType)
.where(AllocationTransactionType.allocation_transaction_type_id == 1)
.values(
type="Allocated from",
description="Fuel allocated from another supplier under an allocation agreement",
)
)
# ### end Alembic commands ###


def downgrade() -> None:
pass
8 changes: 4 additions & 4 deletions backend/lcfs/db/seeders/common/allocation_agreement_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ async def seed_allocation_transaction_types(session):
allocation_transaction_types_to_seed = [
{
"allocation_transaction_type_id": 1,
"type": "Purchased",
"description": "Fuel purchased under an allocation agreement",
"type": "Allocated from",
"description": "Fuel allocated from another supplier under an allocation agreement",
"display_order": 1,
"effective_date": datetime.strptime("2012-01-01", "%Y-%m-%d").date(),
},
{
"allocation_transaction_type_id": 2,
"type": "Sold",
"description": "Fuel sold under an allocation agreement",
"type": "Allocated to",
"description": "Fuel allocated to another supplier under an allocation agreement",
"display_order": 2,
"effective_date": datetime.strptime("2012-01-01", "%Y-%m-%d").date(),
},
Expand Down
2 changes: 1 addition & 1 deletion backend/lcfs/db/seeders/common/seed_fuel_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"provision_1_id": 2,
"provision_2_id": 3,
"default_carbon_intensity": 123.96,
"units": "kWh",
"units": "kg",
"unrecognized": false
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/locales/en/allocationAgreement.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"addAllocationAgreementRowsTitle": "Allocation agreements (e.g., allocating responsibility for fuel)",
"allocationAgreementSubtitle": "Enter allocation agreement details below",
"allocationAgreementColLabels": {
"transaction": "Transaction",
"transaction": "Responsibility",
"transactionPartner": "Legal name of transaction partner",
"postalAddress": "Address for service",
"transactionPartnerEmail": "Email",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/locales/en/transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"loadingText": "Loading transfer...",
"processingText": "Processing transfer...",
"detailsLabel": "Transfer Details (required)",
"fairMarketText": "The fair market value of any consideration, in CAD",
"fairMarketText": "The fair market value of any consideration, in $CAD",
"totalValueText": " per compliance unit for a total value of ",
"saLabel": "Signing Authority Declaration",
"saConfirmation": "I confirm that records evidencing each matter reported under section 18 of the Low Carbon Fuel (General) Regulation are available on request.",
Expand Down

0 comments on commit ff07dac

Please sign in to comment.