From c7f2726a0c81ae7203141764894ae0382c042043 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 1 Oct 2024 14:54:32 +0000 Subject: [PATCH 1/4] Added migration to update boat tow away and haul away factors --- migrations/app/migrations_manifest.txt | 1 + migrations/app/schema/20241001144741_update_boat_factor.up.sql | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 migrations/app/schema/20241001144741_update_boat_factor.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index ce59fde436f..4ad09433fb3 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -999,3 +999,4 @@ 20240910021542_populating_locked_price_cents_from_pricing_estimate_for_ms_and_cs_service_items.up.sql 20240917132411_update_provides_ppm_closeout_transportation_offices.up.sql 20240917165710_update_duty_locations_provides_services_counseling.up.sql +20241001144741_update_boat_factor.up.sql diff --git a/migrations/app/schema/20241001144741_update_boat_factor.up.sql b/migrations/app/schema/20241001144741_update_boat_factor.up.sql new file mode 100644 index 00000000000..55a893f140f --- /dev/null +++ b/migrations/app/schema/20241001144741_update_boat_factor.up.sql @@ -0,0 +1,3 @@ +-- Update shipment factor for boat tow away and haul away shipments +UPDATE re_shipment_type_prices AS rstp SET factor = 35.33 FROM re_services AS rs WHERE rs.id = rstp.service_id AND rs.code = 'DBTF'; +UPDATE re_shipment_type_prices AS rstp SET factor = 45.77 FROM re_services AS rs WHERE rs.id = rstp.service_id AND rs.code = 'DBHF'; \ No newline at end of file From 0e0355bed3effa1b4bdb860af2bee599be1e7389 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 2 Oct 2024 18:31:35 +0000 Subject: [PATCH 2/4] Added service_item_param_key and service_params records for both boat factors. --- .../20241001144741_update_boat_factor.up.sql | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/migrations/app/schema/20241001144741_update_boat_factor.up.sql b/migrations/app/schema/20241001144741_update_boat_factor.up.sql index 55a893f140f..2dc1de75dff 100644 --- a/migrations/app/schema/20241001144741_update_boat_factor.up.sql +++ b/migrations/app/schema/20241001144741_update_boat_factor.up.sql @@ -1,3 +1,26 @@ -- Update shipment factor for boat tow away and haul away shipments UPDATE re_shipment_type_prices AS rstp SET factor = 35.33 FROM re_services AS rs WHERE rs.id = rstp.service_id AND rs.code = 'DBTF'; -UPDATE re_shipment_type_prices AS rstp SET factor = 45.77 FROM re_services AS rs WHERE rs.id = rstp.service_id AND rs.code = 'DBHF'; \ No newline at end of file +UPDATE re_shipment_type_prices AS rstp SET factor = 45.77 FROM re_services AS rs WHERE rs.id = rstp.service_id AND rs.code = 'DBHF'; + +-- Add service item param so that the frontend can show the mobile home factor in pricing calculations +INSERT INTO service_item_param_keys +(id, key,description,type,origin,created_at,updated_at) +VALUES +('b03af5dc-7701-4e22-a986-d1889a2a8f27', 'DomesticBoatTowAwayFactor', 'Domestic Boat Tow-Away Factor applied to calculation (if applicable)', 'DECIMAL', 'PRICER', now(), now()); +('add5114b-2a23-4e23-92b3-6dd0778dfc33', 'DomesticBoatHaulAwayFactor', 'Domestic Boat Haul-Away Factor applied to calculation (if applicable)', 'DECIMAL', 'PRICER', now(), now()); + +-- Map to service item +INSERT INTO service_params +(id,service_id,service_item_param_key_id,created_at,updated_at, is_optional) +VALUES +('d2b25479-e2eb-42bc-974f-054942fa7f8f', (SELECT id FROM re_services WHERE code='DLH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), +('705b3733-838f-4187-bd6a-c959fa746c35', (SELECT id FROM re_services WHERE code='DSH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), +('3b99ff81-9d32-4835-89ee-13758085fc28', (SELECT id FROM re_services WHERE code='DPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), +('572fb69e-3499-43b9-a43b-c0e1578a5711', (SELECT id FROM re_services WHERE code='DUPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), +('d6030866-99a8-4d3f-a710-7e7bf3a366b5', (SELECT id FROM re_services WHERE code='DOP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), +('65112ef3-4193-45aa-a883-0f17e2a5224d', (SELECT id FROM re_services WHERE code='DDP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE); +('d5c0e434-03eb-4839-9c31-4ecc26342728', (SELECT id FROM re_services WHERE code='DLH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), +('32c1366b-d3e0-4d95-93fe-ddc4acb665f1', (SELECT id FROM re_services WHERE code='DSH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), +('e4ea110b-30cd-468c-a938-1e47f47e6a9c', (SELECT id FROM re_services WHERE code='DPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), +('daf3b4d4-9d1d-4338-94c4-2afc2500d716', (SELECT id FROM re_services WHERE code='DOP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), +('f6fd74ef-df9a-4b2d-b16d-028ab10bb8ea', (SELECT id FROM re_services WHERE code='DDP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE); \ No newline at end of file From 52306b411672dd384c14c5c04088b68bf86021f2 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 3 Oct 2024 16:55:15 -0400 Subject: [PATCH 3/4] Fixed typo in SQL migration. --- migrations/app/schema/20241001144741_update_boat_factor.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/app/schema/20241001144741_update_boat_factor.up.sql b/migrations/app/schema/20241001144741_update_boat_factor.up.sql index 2dc1de75dff..99165672afe 100644 --- a/migrations/app/schema/20241001144741_update_boat_factor.up.sql +++ b/migrations/app/schema/20241001144741_update_boat_factor.up.sql @@ -6,7 +6,7 @@ UPDATE re_shipment_type_prices AS rstp SET factor = 45.77 FROM re_services AS rs INSERT INTO service_item_param_keys (id, key,description,type,origin,created_at,updated_at) VALUES -('b03af5dc-7701-4e22-a986-d1889a2a8f27', 'DomesticBoatTowAwayFactor', 'Domestic Boat Tow-Away Factor applied to calculation (if applicable)', 'DECIMAL', 'PRICER', now(), now()); +('b03af5dc-7701-4e22-a986-d1889a2a8f27', 'DomesticBoatTowAwayFactor', 'Domestic Boat Tow-Away Factor applied to calculation (if applicable)', 'DECIMAL', 'PRICER', now(), now()), ('add5114b-2a23-4e23-92b3-6dd0778dfc33', 'DomesticBoatHaulAwayFactor', 'Domestic Boat Haul-Away Factor applied to calculation (if applicable)', 'DECIMAL', 'PRICER', now(), now()); -- Map to service item From a62f17f0e59eba323f53c9a8e4a8f3d77349237e Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 4 Oct 2024 14:25:30 +0000 Subject: [PATCH 4/4] Fixed another semi-colon typo. --- migrations/app/schema/20241001144741_update_boat_factor.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/app/schema/20241001144741_update_boat_factor.up.sql b/migrations/app/schema/20241001144741_update_boat_factor.up.sql index 99165672afe..3fa1b215419 100644 --- a/migrations/app/schema/20241001144741_update_boat_factor.up.sql +++ b/migrations/app/schema/20241001144741_update_boat_factor.up.sql @@ -18,7 +18,7 @@ VALUES ('3b99ff81-9d32-4835-89ee-13758085fc28', (SELECT id FROM re_services WHERE code='DPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), ('572fb69e-3499-43b9-a43b-c0e1578a5711', (SELECT id FROM re_services WHERE code='DUPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), ('d6030866-99a8-4d3f-a710-7e7bf3a366b5', (SELECT id FROM re_services WHERE code='DOP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), -('65112ef3-4193-45aa-a883-0f17e2a5224d', (SELECT id FROM re_services WHERE code='DDP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE); +('65112ef3-4193-45aa-a883-0f17e2a5224d', (SELECT id FROM re_services WHERE code='DDP'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatTowAwayFactor'), now(), now(), TRUE), ('d5c0e434-03eb-4839-9c31-4ecc26342728', (SELECT id FROM re_services WHERE code='DLH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), ('32c1366b-d3e0-4d95-93fe-ddc4acb665f1', (SELECT id FROM re_services WHERE code='DSH'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE), ('e4ea110b-30cd-468c-a938-1e47f47e6a9c', (SELECT id FROM re_services WHERE code='DPK'), (SELECT id FROM service_item_param_keys WHERE key='DomesticBoatHaulAwayFactor'), now(), now(), TRUE),