From b8e343b60f99142a82944b8c57bb0508e6092a07 Mon Sep 17 00:00:00 2001 From: Arturo Reyes Lopez Date: Sat, 4 Jan 2025 10:20:04 -0700 Subject: [PATCH 1/2] Reconfigure provision of the act for other fuel diesel --- .../versions/2025-01-03-13-24_bfa7bbb1eea3.py | 37 +++++++++++++++++++ .../locales/en/allocationAgreement.json | 2 +- .../views/AllocationAgreements/_schema.jsx | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py diff --git a/backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py b/backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py new file mode 100644 index 000000000..225cf0d87 --- /dev/null +++ b/backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py @@ -0,0 +1,37 @@ +"""Update fuel type name + +Revision ID: bfa7bbb1eea3 +Revises: 9329e38396e1 +Create Date: 2025-01-03 13:24:19.525006 + +""" + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "bfa7bbb1eea3" +down_revision = "9329e38396e1" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # Update fuel type name + op.execute(""" + UPDATE fuel_type + SET fuel_type = 'Other diesel fuel', + provision_1_id = 3 -- Change from prescribed (1) to default (3) + WHERE fuel_type = 'Other diesel'; + """) + + +def downgrade() -> None: + # Revert fuel type name update + op.execute(""" + UPDATE fuel_type + SET fuel_type = 'Other diesel', + provision_1_id = 1 -- Change from default (3) to prescribed (1) + WHERE fuel_type = 'Other diesel fuel'; + """) + diff --git a/frontend/src/assets/locales/en/allocationAgreement.json b/frontend/src/assets/locales/en/allocationAgreement.json index f120b7ebe..554b3fbe6 100644 --- a/frontend/src/assets/locales/en/allocationAgreement.json +++ b/frontend/src/assets/locales/en/allocationAgreement.json @@ -5,7 +5,7 @@ "allocationAgreementSubtitle": "Enter allocation agreement details below", "fuelCodeFieldRequiredError": "Error updating row: Fuel code field required", "allocationAgreementColLabels": { - "transaction": "Responsibility", + "allocationTransactionType": "Responsibility", "transactionPartner": "Legal name of transaction partner", "postalAddress": "Address for service", "transactionPartnerEmail": "Email", diff --git a/frontend/src/views/AllocationAgreements/_schema.jsx b/frontend/src/views/AllocationAgreements/_schema.jsx index 26ef36700..1d275cd06 100644 --- a/frontend/src/views/AllocationAgreements/_schema.jsx +++ b/frontend/src/views/AllocationAgreements/_schema.jsx @@ -55,7 +55,7 @@ export const allocationAgreementColDefs = (optionsData, errors, currentUser) => field: 'allocationTransactionType', headerComponent: RequiredHeader, headerName: i18n.t( - 'allocationAgreement:allocationAgreementColLabels.transaction' + 'allocationAgreement:allocationAgreementColLabels.allocationTransactionType' ), cellEditor: AutocompleteCellEditor, cellEditorParams: { From 97194f38d7fa151b109bdeb44e9c19da813da9f9 Mon Sep 17 00:00:00 2001 From: Arturo Reyes Lopez Date: Mon, 6 Jan 2025 11:27:12 -0700 Subject: [PATCH 2/2] updated down_revision --- ...3-13-24_bfa7bbb1eea3.py => 2025-01-04-13-24_bfa7bbb1eea3.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename backend/lcfs/db/migrations/versions/{2025-01-03-13-24_bfa7bbb1eea3.py => 2025-01-04-13-24_bfa7bbb1eea3.py} (96%) diff --git a/backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py b/backend/lcfs/db/migrations/versions/2025-01-04-13-24_bfa7bbb1eea3.py similarity index 96% rename from backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py rename to backend/lcfs/db/migrations/versions/2025-01-04-13-24_bfa7bbb1eea3.py index 225cf0d87..1ce35a7a0 100644 --- a/backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.py +++ b/backend/lcfs/db/migrations/versions/2025-01-04-13-24_bfa7bbb1eea3.py @@ -11,7 +11,7 @@ # revision identifiers, used by Alembic. revision = "bfa7bbb1eea3" -down_revision = "9329e38396e1" +down_revision = "e883ad1f0f60" branch_labels = None depends_on = None