From 73667815d471b5ddac3aec812518c010d68dc166 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 4 Feb 2025 15:18:40 +0000 Subject: [PATCH 1/7] Adding TIO flow test updates --- pkg/testdatagen/testharness/make_move.go | 42 +++++++++++++++++ .../office/txo/tioFlowsInternational.spec.js | 15 +++++- .../Office/ServiceItemCalculations/helpers.js | 46 +++++++++++++++++++ src/constants/serviceItems.js | 4 ++ 4 files changed, 105 insertions(+), 2 deletions(-) diff --git a/pkg/testdatagen/testharness/make_move.go b/pkg/testdatagen/testharness/make_move.go index 6a846830c6a..dd5a82b3618 100644 --- a/pkg/testdatagen/testharness/make_move.go +++ b/pkg/testdatagen/testharness/make_move.go @@ -9107,6 +9107,7 @@ func MakeBasicInternationalHHGMoveWithServiceItemsandPaymentRequestsForTIO(appCt ihpkCost := unit.Cents(298800) ihupkCost := unit.Cents(33280) poefscCost := unit.Cents(25000) + idshutCost := unit.Cents(623) // Create Customer userInfo := newUserInfo("customer") @@ -9441,6 +9442,47 @@ func MakeBasicInternationalHHGMoveWithServiceItemsandPaymentRequestsForTIO(appCt }, }, nil) + // Shuttling service item + approvedAtTime := time.Now() + idshut := factory.BuildMTOServiceItem(appCtx.DB(), []factory.Customization{ + { + Model: models.MTOServiceItem{ + Status: models.MTOServiceItemStatusApproved, + ApprovedAt: &approvedAtTime, + EstimatedWeight: &estimatedWeight, + ActualWeight: &actualWeight, + }, + }, + { + Model: mto, + LinkOnly: true, + }, + { + Model: mtoShipmentHHG, + LinkOnly: true, + }, + { + Model: models.ReService{ + ID: uuid.FromStringOrNil("22fc07ed-be15-4f50-b941-cbd38153b378"), // IDSHUT - International Destination Shuttle + }, + }, + }, nil) + + factory.BuildPaymentServiceItemWithParams(appCtx.DB(), models.ReServiceCodeIDSHUT, + basicPaymentServiceItemParams, []factory.Customization{ + { + Model: models.PaymentServiceItem{ + PriceCents: &idshutCost, + }, + }, { + Model: paymentRequestHHG, + LinkOnly: true, + }, { + Model: idshut, + LinkOnly: true, + }, + }, nil) + basicPortFuelSurchargePaymentServiceItemParams := []factory.CreatePaymentServiceItemParams{ { Key: models.ServiceItemParamNameContractCode, diff --git a/playwright/tests/office/txo/tioFlowsInternational.spec.js b/playwright/tests/office/txo/tioFlowsInternational.spec.js index 2b97f19078b..9b09a053729 100644 --- a/playwright/tests/office/txo/tioFlowsInternational.spec.js +++ b/playwright/tests/office/txo/tioFlowsInternational.spec.js @@ -143,6 +143,17 @@ test.describe('TIO user', () => { await page.getByText('Next').click(); await tioFlowPage.slowDown(); + await expect(page.getByText('International destination shuttle service')).toBeVisible(); + await page.getByText('Show calculations').click(); + await expect(page.locator('[data-testid="ServiceItemCalculations"]')).toContainText('Calculations'); + await expect(page.locator('[data-testid="ServiceItemCalculations"]')).toContainText('Billable weight (cwt)'); + await expect(page.locator('[data-testid="ServiceItemCalculations"]')).toContainText('Destination price'); + await expect(page.locator('[data-testid="ServiceItemCalculations"]')).toContainText('Price escalation factor'); + // approve + await tioFlowPage.approveServiceItem(); + await page.getByText('Next').click(); + await tioFlowPage.slowDown(); + await expect(page.getByText('International POE Fuel Surcharge')).toBeVisible(); await page.getByText('Show calculations').click(); await expect(page.locator('[data-testid="ServiceItemCalculations"]')).toContainText('Calculations'); @@ -159,8 +170,8 @@ test.describe('TIO user', () => { await expect(page.getByText('needs your review')).toHaveCount(0, { timeout: 10000 }); await page.getByText('Complete request').click(); - await expect(page.locator('[data-testid="requested"]')).toContainText('$4,281.48'); - await expect(page.locator('[data-testid="accepted"]')).toContainText('$4,281.48'); + await expect(page.locator('[data-testid="requested"]')).toContainText('$4,287.71'); + await expect(page.locator('[data-testid="accepted"]')).toContainText('$4,287.71'); await expect(page.locator('[data-testid="rejected"]')).toContainText('$0.00'); await page.getByText('Authorize payment').click(); diff --git a/src/components/Office/ServiceItemCalculations/helpers.js b/src/components/Office/ServiceItemCalculations/helpers.js index c5d26d73e75..638127266e4 100644 --- a/src/components/Office/ServiceItemCalculations/helpers.js +++ b/src/components/Office/ServiceItemCalculations/helpers.js @@ -368,6 +368,20 @@ const shuttleOriginPriceDomestic = (params) => { ); }; +const shuttleOriginPriceInternational = (params) => { + const value = getPriceRateOrFactor(params); + const label = SERVICE_ITEM_CALCULATION_LABELS.OriginPrice; + + const pickupDate = `${SERVICE_ITEM_CALCULATION_LABELS.PickupDate}: ${formatDateWithUTC( + getParamValue(SERVICE_ITEM_PARAM_KEYS.ReferenceDate, params), + 'DD MMM YYYY', + )}`; + + const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'Oconus' : 'Conus'; + + return calculation(value, label, formatDetail(pickupDate), formatDetail(market)); +}; + // There is no param representing the destination price as available in the re_domestic_service_area_prices table // A param to return the service schedule is also not being created const destinationPrice = (params, shipmentType) => { @@ -406,6 +420,20 @@ const shuttleDestinationPriceDomestic = (params) => { ); }; +const shuttleDestinationPriceInternational = (params) => { + const value = getPriceRateOrFactor(params); + const label = SERVICE_ITEM_CALCULATION_LABELS.DestinationPrice; + + const deliveryDate = `${SERVICE_ITEM_CALCULATION_LABELS.DeliveryDate}: ${formatDateWithUTC( + getParamValue(SERVICE_ITEM_PARAM_KEYS.ReferenceDate, params), + 'DD MMM YYYY', + )}`; + + const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'Oconus' : 'Conus'; + + return calculation(value, label, formatDetail(deliveryDate), formatDetail(market)); +}; + const priceEscalationFactor = (params) => { const value = getParamValue(SERVICE_ITEM_PARAM_KEYS.EscalationCompounded, params) ? getParamValue(SERVICE_ITEM_PARAM_KEYS.EscalationCompounded, params) @@ -851,6 +879,15 @@ export default function makeCalculations(itemCode, totalAmount, params, mtoParam totalAmountRequested(totalAmount), ]; break; + // International origin shuttle service + case SERVICE_ITEM_CODES.IOSHUT: + result = [ + shuttleBillableWeight(params), + shuttleOriginPriceInternational(params), + priceEscalationFactorWithoutContractYear(params), + totalAmountRequested(totalAmount), + ]; + break; // Domestic Destination Additional Days SIT case SERVICE_ITEM_CODES.DDASIT: result = [ @@ -879,6 +916,15 @@ export default function makeCalculations(itemCode, totalAmount, params, mtoParam totalAmountRequested(totalAmount), ]; break; + // International destination shuttle service + case SERVICE_ITEM_CODES.IDSHUT: + result = [ + shuttleBillableWeight(params), + shuttleDestinationPriceInternational(params), + priceEscalationFactorWithoutContractYear(params), + totalAmountRequested(totalAmount), + ]; + break; // Domestic crating case SERVICE_ITEM_CODES.DCRT: result = [ diff --git a/src/constants/serviceItems.js b/src/constants/serviceItems.js index 213afb45f38..06045545394 100644 --- a/src/constants/serviceItems.js +++ b/src/constants/serviceItems.js @@ -54,6 +54,8 @@ const SERVICE_ITEM_PARAM_KEYS = { StandaloneCrate: 'StandaloneCrate', StandaloneCrateCap: 'StandaloneCrateCap', UncappedRequestTotal: 'UncappedRequestTotal', + MarketOrigin: 'MarketOrigin', + MarketDest: 'MarketDest', }; const SERVICE_ITEM_CALCULATION_LABELS = { @@ -219,12 +221,14 @@ const allowedServiceItemCalculations = [ SERVICE_ITEM_CODES.DOP, SERVICE_ITEM_CODES.DOPSIT, SERVICE_ITEM_CODES.DOSHUT, + SERVICE_ITEM_CODES.IOSHUT, SERVICE_ITEM_CODES.DPK, SERVICE_ITEM_CODES.DNPK, SERVICE_ITEM_CODES.DSH, SERVICE_ITEM_CODES.DUPK, SERVICE_ITEM_CODES.FSC, SERVICE_ITEM_CODES.DDSHUT, + SERVICE_ITEM_CODES.IDSHUT, SERVICE_ITEM_CODES.DCRT, SERVICE_ITEM_CODES.DUCRT, SERVICE_ITEM_CODES.DOSFSC, From ed43d63f0da51405a8dbd9fced1b27a1a81f30e2 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 13 Feb 2025 21:13:19 +0000 Subject: [PATCH 2/7] Updating Oconus to OConus --- src/components/Office/ServiceItemCalculations/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/ServiceItemCalculations/helpers.js b/src/components/Office/ServiceItemCalculations/helpers.js index 638127266e4..86d3c1a8d9b 100644 --- a/src/components/Office/ServiceItemCalculations/helpers.js +++ b/src/components/Office/ServiceItemCalculations/helpers.js @@ -429,7 +429,7 @@ const shuttleDestinationPriceInternational = (params) => { 'DD MMM YYYY', )}`; - const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'Oconus' : 'Conus'; + const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'OConus' : 'Conus'; return calculation(value, label, formatDetail(deliveryDate), formatDetail(market)); }; From 1c73dd5fb2d3f68a2ac6e1278fbcebf5bea852ba Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Fri, 14 Feb 2025 02:41:31 +0000 Subject: [PATCH 3/7] Updating location --- pkg/gen/supportapi/embedded_spec.go | 4 ++-- pkg/gen/supportmessages/m_t_o_service_item_model_type.go | 2 +- swagger-def/support.yaml | 2 +- swagger/support.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 01ca7c6479c..2a386568f72 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1631,7 +1631,7 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", @@ -4599,7 +4599,7 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", diff --git a/pkg/gen/supportmessages/m_t_o_service_item_model_type.go b/pkg/gen/supportmessages/m_t_o_service_item_model_type.go index d2c9e324a24..52f3729cdab 100644 --- a/pkg/gen/supportmessages/m_t_o_service_item_model_type.go +++ b/pkg/gen/supportmessages/m_t_o_service_item_model_type.go @@ -20,8 +20,8 @@ import ( // - DOFSIT, DOASIT - MTOServiceItemOriginSIT // - DDFSIT, DDASIT - MTOServiceItemDestSIT // - DOSHUT, DDSHUT - MTOServiceItemShuttle -// - IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle // - DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle +// - IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle // - DCRT, DUCRT - MTOServiceItemDomesticCrating // - ICRT, IUCRT - MTOServiceItemInternationalCrating // diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index fb6cfda2ec8..fd9fe041f37 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -1288,8 +1288,8 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle - * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle + * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating diff --git a/swagger/support.yaml b/swagger/support.yaml index 3940b8f5fdf..17d69eb2d31 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -1395,8 +1395,8 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle - * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle + * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating From d2ebe231541338a280ca8b684801ee5770c15ce4 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Fri, 14 Feb 2025 16:51:54 +0000 Subject: [PATCH 4/7] Updating oconus --- src/components/Office/ServiceItemCalculations/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/ServiceItemCalculations/helpers.js b/src/components/Office/ServiceItemCalculations/helpers.js index 86d3c1a8d9b..56df8d29fd3 100644 --- a/src/components/Office/ServiceItemCalculations/helpers.js +++ b/src/components/Office/ServiceItemCalculations/helpers.js @@ -429,7 +429,7 @@ const shuttleDestinationPriceInternational = (params) => { 'DD MMM YYYY', )}`; - const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'OConus' : 'Conus'; + const market = getParamValue(SERVICE_ITEM_PARAM_KEYS.MarketDest, params) === 'O' ? 'OCONUS' : 'CONUS'; return calculation(value, label, formatDetail(deliveryDate), formatDetail(market)); }; From 14e3e19f8890cbd310257190bdbd2bf93d3d75cb Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 21 Feb 2025 10:12:31 -0600 Subject: [PATCH 5/7] add blank files to generate the folders --- migrations/app/ddl_migrations/ddl_functions/README.md | 0 migrations/app/ddl_migrations/ddl_functions/test.sql | 8 ++++++++ migrations/app/ddl_migrations/ddl_tables/README.md | 0 migrations/app/ddl_migrations/ddl_types/README.md | 0 migrations/app/ddl_migrations/ddl_views/README.md | 0 5 files changed, 8 insertions(+) create mode 100644 migrations/app/ddl_migrations/ddl_functions/README.md create mode 100644 migrations/app/ddl_migrations/ddl_functions/test.sql create mode 100644 migrations/app/ddl_migrations/ddl_tables/README.md create mode 100644 migrations/app/ddl_migrations/ddl_types/README.md create mode 100644 migrations/app/ddl_migrations/ddl_views/README.md diff --git a/migrations/app/ddl_migrations/ddl_functions/README.md b/migrations/app/ddl_migrations/ddl_functions/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/migrations/app/ddl_migrations/ddl_functions/test.sql b/migrations/app/ddl_migrations/ddl_functions/test.sql new file mode 100644 index 00000000000..5e3b5832591 --- /dev/null +++ b/migrations/app/ddl_migrations/ddl_functions/test.sql @@ -0,0 +1,8 @@ +UPDATE moves m +SET m.cancel_reason = 'Terminated for Cause (TCN-0001)', + mto.status = 'CANCELED' +FROM mto_shipments mto +WHERE m.id = mto.move_id +and moves.locator in ( + +); \ No newline at end of file diff --git a/migrations/app/ddl_migrations/ddl_tables/README.md b/migrations/app/ddl_migrations/ddl_tables/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/migrations/app/ddl_migrations/ddl_types/README.md b/migrations/app/ddl_migrations/ddl_types/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/migrations/app/ddl_migrations/ddl_views/README.md b/migrations/app/ddl_migrations/ddl_views/README.md new file mode 100644 index 00000000000..e69de29bb2d From 288f207963e307cedeac86d8ceca71260dee611d Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 21 Feb 2025 10:13:37 -0600 Subject: [PATCH 6/7] nope --- migrations/app/ddl_migrations/ddl_functions/test.sql | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 migrations/app/ddl_migrations/ddl_functions/test.sql diff --git a/migrations/app/ddl_migrations/ddl_functions/test.sql b/migrations/app/ddl_migrations/ddl_functions/test.sql deleted file mode 100644 index 5e3b5832591..00000000000 --- a/migrations/app/ddl_migrations/ddl_functions/test.sql +++ /dev/null @@ -1,8 +0,0 @@ -UPDATE moves m -SET m.cancel_reason = 'Terminated for Cause (TCN-0001)', - mto.status = 'CANCELED' -FROM mto_shipments mto -WHERE m.id = mto.move_id -and moves.locator in ( - -); \ No newline at end of file From eada48546ca71a9b30ed9d8fc111b5d735745109 Mon Sep 17 00:00:00 2001 From: josiahzimmerman-caci Date: Fri, 21 Feb 2025 16:51:59 +0000 Subject: [PATCH 7/7] clean up whitespace --- .../20250106202424_update_duty_locs.up.sql | 8 ++-- ...20250121184450_upd_duty_loc_B-22242.up.sql | 46 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql index d3bc09560e5..2ecfaf6a399 100644 --- a/migrations/app/schema/20250106202424_update_duty_locs.up.sql +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -24,11 +24,11 @@ BEGIN SELECT '8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid, 'n/a', NULL, 'NAS NORTH ISLAND', 'CA', '39125', now(), now(), NULL, 'SAN DIEGO', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, '191165db-d30a-414d-862b-54afdfc7aeb9'::uuid WHERE NOT EXISTS (select * from addresses where id = '8d613f71-b80e-4ad4-95e7-00781b084c7c'); - INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) + INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) SELECT '56255626-bbbe-4834-8324-1c08f011f2f6'::uuid,'NAS N Island, CA 92135',NULL,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,now(),now(),null,true WHERE NOT EXISTS (select * from duty_locations where id = '56255626-bbbe-4834-8324-1c08f011f2f6'); - - INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) + + INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) SELECT '7156098f-13cf-4455-bcd5-eb829d57c714'::uuid,'NAS North Island, CA 92135',NULL,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,now(),now(),null,true WHERE NOT EXISTS (select * from duty_locations where id = '7156098f-13cf-4455-bcd5-eb829d57c714'); END $$; @@ -42,7 +42,7 @@ BEGIN SELECT 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid, 'n/a', NULL, 'CANNON AFB', 'NM', '88101', now(), now(), NULL, 'CURRY', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, '68393e10-1aed-4a51-85a0-559a0a5b0e3f'::uuid WHERE NOT EXISTS (select * from addresses where id = 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'); - INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) + INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) SELECT '98beab3c-f8ce-4e3c-b78e-8db614721621'::uuid, 'Cannon AFB, NM 88101',null, 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid,now(),now(),'80796bc4-e494-4b19-bb16-cdcdba187829',true WHERE NOT EXISTS (select * from duty_locations where id = '98beab3c-f8ce-4e3c-b78e-8db614721621'); END $$; diff --git a/migrations/app/schema/20250121184450_upd_duty_loc_B-22242.up.sql b/migrations/app/schema/20250121184450_upd_duty_loc_B-22242.up.sql index c21c04f6a81..70928fff219 100644 --- a/migrations/app/schema/20250121184450_upd_duty_loc_B-22242.up.sql +++ b/migrations/app/schema/20250121184450_upd_duty_loc_B-22242.up.sql @@ -1,30 +1,30 @@ DO $$ BEGIN - + --remove duty loc Johnston City, TN 37602 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = 'd3a1be10-dcd7-4720-bcbe-7ba76d243687') THEN - - + + update orders set origin_duty_location_id = 'cd0c7325-15bb-45c7-a690-26c56c903ed7' where origin_duty_location_id = 'd3a1be10-dcd7-4720-bcbe-7ba76d243687'; update orders set new_duty_location_id = 'cd0c7325-15bb-45c7-a690-26c56c903ed7' where new_duty_location_id = 'd3a1be10-dcd7-4720-bcbe-7ba76d243687'; - + delete from duty_locations where id = 'd3a1be10-dcd7-4720-bcbe-7ba76d243687'; - + END IF; END $$; DO $$ BEGIN - + --remove duty loc Oceanside, CA 92052 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = '54ca99b7-3c2a-42b0-aa1a-ad071ac580de') THEN - + update orders set origin_duty_location_id = 'a6993e7b-4600-44b9-b288-04ca011143f0' where origin_duty_location_id = '54ca99b7-3c2a-42b0-aa1a-ad071ac580de'; update orders set new_duty_location_id = 'a6993e7b-4600-44b9-b288-04ca011143f0' where new_duty_location_id = '54ca99b7-3c2a-42b0-aa1a-ad071ac580de'; - + delete from duty_locations where id = '54ca99b7-3c2a-42b0-aa1a-ad071ac580de'; - + END IF; END $$; @@ -34,9 +34,9 @@ BEGIN --remove duty loc Albuquerque, NM 87103 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = '2cc57072-19fa-438b-a44b-e349dff11763') THEN - + update orders set new_duty_location_id = '54acfb0e-222b-49eb-b94b-ccb00c6f529c' where new_duty_location_id = '2cc57072-19fa-438b-a44b-e349dff11763'; - + delete from duty_locations where id = '2cc57072-19fa-438b-a44b-e349dff11763'; END IF; @@ -45,45 +45,45 @@ END $$; DO $$ BEGIN - + --remove duty loc August, GA 30917 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = '109ac405-47fb-4e1e-9efb-58290453ac09') THEN - + update orders set origin_duty_location_id = '595363c2-14ee-48e0-b318-e76ab0016453' where origin_duty_location_id = '109ac405-47fb-4e1e-9efb-58290453ac09'; update orders set new_duty_location_id = '595363c2-14ee-48e0-b318-e76ab0016453' where new_duty_location_id = '109ac405-47fb-4e1e-9efb-58290453ac09'; - + delete from duty_locations where id = '109ac405-47fb-4e1e-9efb-58290453ac09'; - + END IF; END $$; DO $$ BEGIN - + --remove duty loc Frankfort, KY 40602 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = 'c7fadaa2-902f-4302-a7cd-108c525b96d4') THEN - + update orders set origin_duty_location_id = '1a973257-cd15-42a9-86be-a14796c014bc' where origin_duty_location_id = 'c7fadaa2-902f-4302-a7cd-108c525b96d4'; update orders set new_duty_location_id = '1a973257-cd15-42a9-86be-a14796c014bc' where new_duty_location_id = 'c7fadaa2-902f-4302-a7cd-108c525b96d4'; - + delete from duty_locations where id = 'c7fadaa2-902f-4302-a7cd-108c525b96d4'; - + END IF; END $$; DO $$ BEGIN - + --remove duty loc Seattle, WA 98111 IF EXISTS (SELECT 1 FROM duty_locations WHERE id = '2fb3e898-d6de-4be7-8576-7c7b10c2a706') THEN - + update orders set origin_duty_location_id = 'e7fdae4f-6be7-4264-99f8-03ee8541499c' where origin_duty_location_id = '2fb3e898-d6de-4be7-8576-7c7b10c2a706'; update orders set new_duty_location_id = 'e7fdae4f-6be7-4264-99f8-03ee8541499c' where new_duty_location_id = '2fb3e898-d6de-4be7-8576-7c7b10c2a706'; - + delete from duty_locations where id = '2fb3e898-d6de-4be7-8576-7c7b10c2a706'; - + END IF; END $$;