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

MAIN - B-21905 - Rename NTS shipment type #14418

Merged
merged 8 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,10 @@
20241203024453_add_ppm_max_incentive_column.up.sql
20241204155919_update_ordering_proc.up.sql
20241204210208_retroactive_update_of_ppm_max_and_estimated_incentives_prd.up.sql
20241218201833_add_PPPO_BASE_ELIZABETH.up.sql
20241216170325_update_nts_enum_name.up.sql
20241217163231_update_duty_locations_bad_zips.up.sql
20241217180136_add_AK_zips_to_zip3_distances.up.sql
20241218201833_add_PPPO_BASE_ELIZABETH.up.sql
20241220171035_add_additional_AK_zips_to_zip3_distances.up.sql
20241227153723_remove_empty_string_emplid_values.up.sql
20241230190638_remove_AK_zips_from_zip3.up.sql
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Rename the existing enum value 'HHG_INTO_NTS_DOMESTIC' to 'HHG_INTO_NTS'
DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM pg_type t
JOIN pg_enum e ON t.oid = e.enumtypid
WHERE t.typname = 'mto_shipment_type'
AND e.enumlabel = 'HHG_INTO_NTS_DOMESTIC'
) THEN
ALTER TYPE mto_shipment_type
RENAME VALUE 'HHG_INTO_NTS_DOMESTIC' TO 'HHG_INTO_NTS';
END IF;
END $$;

-- Update column comments to include all current shipment types
COMMENT ON COLUMN mto_shipments.shipment_type IS 'The type of shipment. The list includes:
1. Personally procured move (PPM)
2. Household goods move (HHG)
3. Non-temporary storage (HHG_INTO_NTS)
4. Non-temporary storage-release (HHG_OUTOF_NTS_DOMESTIC)
5. Mobile home (MOBILE_HOME)
6. Boat haul away (BOAT_HAUL_AWAY)
7. Boat tow away (BOAT_TOW_AWAY)
8. Unaccompanied baggage (UNACCOMPANIED_BAGGAGE)';
6 changes: 3 additions & 3 deletions pkg/factory/mto_shipment_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization,
hasStorageFacilityCustom := findValidCustomization(customs, StorageFacility) != nil
buildStorageFacility :=
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom ||
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGIntoNTSDom
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGIntoNTS
shipmentHasPickupDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGOutOfNTSDom && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
shipmentHasDeliveryDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGIntoNTSDom && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
shipmentHasDeliveryDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGIntoNTS && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
addPrimeActualWeight := true
switch buildType {
case mtoShipmentNTS:
defaultShipmentType = models.MTOShipmentTypeHHGIntoNTSDom
defaultShipmentType = models.MTOShipmentTypeHHGIntoNTS
defaultStatus = models.MTOShipmentStatusDraft
buildStorageFacility = hasStorageFacilityCustom
shipmentHasPickupDetails = true
Expand Down
4 changes: 2 additions & 2 deletions pkg/factory/mto_shipment_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (suite *FactorySuite) TestBuildMTOShipment() {
ID: uuid.FromStringOrNil("acf7b357-5cad-40e2-baa7-dedc1d4cf04c"),
PrimeEstimatedWeight: &estimatedWeight,
PrimeActualWeight: &actualWeight,
ShipmentType: models.MTOShipmentTypeHHGIntoNTSDom,
ShipmentType: models.MTOShipmentTypeHHGIntoNTS,
ApprovedDate: models.TimePointer(time.Now()),
Status: models.MTOShipmentStatusApproved,
}
Expand Down Expand Up @@ -421,7 +421,7 @@ func (suite *FactorySuite) TestBuildMTOShipment() {
suite.Run("Successful creation of NTSShipment", func() {
ntsShipment := BuildNTSShipment(suite.DB(), nil, nil)

suite.Equal(models.MTOShipmentTypeHHGIntoNTSDom, ntsShipment.ShipmentType)
suite.Equal(models.MTOShipmentTypeHHGIntoNTS, ntsShipment.ShipmentType)
suite.False(ntsShipment.MoveTaskOrderID.IsNil())
suite.False(ntsShipment.MoveTaskOrder.ID.IsNil())

Expand Down
12 changes: 6 additions & 6 deletions pkg/gen/ghcapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/gen/ghcmessages/m_t_o_shipment_type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/gen/ghcmessages/re_service_item.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/gen/internalapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/gen/internalmessages/m_t_o_shipment_type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pkg/gen/primeapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/gen/primemessages/m_t_o_shipment_type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading