Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into B-22129-INT-Closeout-Data
Browse files Browse the repository at this point in the history
  • Loading branch information
loganwc authored Jan 15, 2025
2 parents ef57fc3 + e27f09a commit f2baf1e
Show file tree
Hide file tree
Showing 112 changed files with 511 additions and 339 deletions.
1 change: 1 addition & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1071,4 +1071,5 @@
20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql
20250103130619_revert_data_change_for_gbloc_for_ak.up.sql
20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql
20250110001339_update_nts_release_enum_name.up.sql
20250110153428_add_shipment_address_updates_to_move_history.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Rename the existing enum value 'HHG_OUTOF_NTS_DOMESTIC' to 'HHG_OUTOF_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_OUTOF_NTS_DOMESTIC'
) THEN
ALTER TYPE mto_shipment_type
RENAME VALUE 'HHG_OUTOF_NTS_DOMESTIC' TO 'HHG_OUTOF_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)
5. Mobile home (MOBILE_HOME)
6. Boat haul away (BOAT_HAUL_AWAY)
7. Boat tow away (BOAT_TOW_AWAY)
8. Unaccompanied baggage (UNACCOMPANIED_BAGGAGE)';
12 changes: 6 additions & 6 deletions pkg/factory/mto_shipment_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization,
setupPickupAndDelivery := true
hasStorageFacilityCustom := findValidCustomization(customs, StorageFacility) != nil
buildStorageFacility :=
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom ||
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTS ||
cMtoShipment.ShipmentType == models.MTOShipmentTypeHHGIntoNTS
shipmentHasPickupDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGOutOfNTSDom && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
shipmentHasPickupDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGOutOfNTS && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
shipmentHasDeliveryDetails := cMtoShipment.ShipmentType != models.MTOShipmentTypeHHGIntoNTS && cMtoShipment.ShipmentType != models.MTOShipmentTypePPM
addPrimeActualWeight := true
switch buildType {
Expand All @@ -59,7 +59,7 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization,
shipmentHasPickupDetails = true
shipmentHasDeliveryDetails = true
case mtoShipmentNTSR:
defaultShipmentType = models.MTOShipmentTypeHHGOutOfNTSDom
defaultShipmentType = models.MTOShipmentTypeHHGOutOfNTS
defaultStatus = models.MTOShipmentStatusDraft
buildStorageFacility = hasStorageFacilityCustom
addPrimeActualWeight = false
Expand Down Expand Up @@ -229,9 +229,9 @@ func BuildBaseMTOShipment(db *pop.Connection, customs []Customization, traits []

// BuildMTOShipment creates a single MTOShipment and associated set relationships
// It will make a move record, if one is not provided.
// It will make pickup addresses if the shipment type is not one of (HHGOutOfNTSDom, PPM)
// It will make delivery addresses if the shipment type is not one of (HHGIntoNTSDom, PPM)
// It will make a storage facility if the shipment type is HHGOutOfNTSDom
// It will make pickup addresses if the shipment type is not one of (HHGOutOfNTS, PPM)
// It will make delivery addresses if the shipment type is not one of (HHGIntoNTS, PPM)
// It will make a storage facility if the shipment type is HHGOutOfNTS
func BuildMTOShipment(db *pop.Connection, customs []Customization, traits []Trait) models.MTOShipment {
return buildMTOShipmentWithBuildType(db, customs, traits, mtoShipmentBuild)
}
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 @@ -298,7 +298,7 @@ func (suite *FactorySuite) TestBuildMTOShipment() {
ID: uuid.FromStringOrNil("acf7b357-5cad-40e2-baa7-dedc1d4cf04c"),
PrimeEstimatedWeight: &estimatedWeight,
PrimeActualWeight: &actualWeight,
ShipmentType: models.MTOShipmentTypeHHGOutOfNTSDom,
ShipmentType: models.MTOShipmentTypeHHGOutOfNTS,
ApprovedDate: models.TimePointer(time.Now()),
Status: models.MTOShipmentStatusApproved,
}
Expand Down Expand Up @@ -470,7 +470,7 @@ func (suite *FactorySuite) TestBuildMTOShipment() {
suite.Run("Successful creation of NTSRShipment", func() {
ntsrShipment := BuildNTSRShipment(suite.DB(), nil, nil)

suite.Equal(models.MTOShipmentTypeHHGOutOfNTSDom, ntsrShipment.ShipmentType)
suite.Equal(models.MTOShipmentTypeHHGOutOfNTS, ntsrShipment.ShipmentType)
suite.False(ntsrShipment.MoveTaskOrderID.IsNil())
suite.False(ntsrShipment.MoveTaskOrder.ID.IsNil())
suite.NotNil(ntsrShipment.DestinationAddressID)
Expand Down
30 changes: 24 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.

71 changes: 71 additions & 0 deletions pkg/gen/ghcmessages/move.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.

Loading

0 comments on commit f2baf1e

Please sign in to comment.