From 9abf38ed834a1c4328d02d60704513505f764bbb Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 21 May 2024 08:40:47 -0500 Subject: [PATCH 01/14] Initial Commit --- pkg/services/ppmshipment/ppm_estimator.go | 20 ++++++------ .../ppmshipment/ppm_estimator_test.go | 31 ++++++++++++------- .../EstimatedIncentiveDetails.jsx | 18 ++++++----- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 94d84738963..d4e50e4483f 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -50,8 +50,8 @@ func (f *estimatePPM) FinalIncentiveWithDefaultChecks(appCtx appcontext.AppConte func shouldSkipEstimatingIncentive(newPPMShipment *models.PPMShipment, oldPPMShipment *models.PPMShipment) bool { return oldPPMShipment.ExpectedDepartureDate.Equal(newPPMShipment.ExpectedDepartureDate) && - newPPMShipment.PickupPostalCode == oldPPMShipment.PickupPostalCode && - newPPMShipment.DestinationPostalCode == oldPPMShipment.DestinationPostalCode && + newPPMShipment.PickupAddress.PostalCode == oldPPMShipment.PickupAddress.PostalCode && + newPPMShipment.DestinationAddress.PostalCode == oldPPMShipment.DestinationAddress.PostalCode && ((newPPMShipment.EstimatedWeight == nil && oldPPMShipment.EstimatedWeight == nil) || (oldPPMShipment.EstimatedWeight != nil && newPPMShipment.EstimatedWeight.Int() == oldPPMShipment.EstimatedWeight.Int())) } @@ -97,8 +97,8 @@ func shouldCalculateSITCost(newPPMShipment *models.PPMShipment, oldPPMShipment * *newPPMShipment.SITEstimatedWeight != *oldPPMShipment.SITEstimatedWeight || *newPPMShipment.SITEstimatedEntryDate != *oldPPMShipment.SITEstimatedEntryDate || *newPPMShipment.SITEstimatedDepartureDate != *oldPPMShipment.SITEstimatedDepartureDate || - newPPMShipment.PickupPostalCode != oldPPMShipment.PickupPostalCode || - newPPMShipment.DestinationPostalCode != oldPPMShipment.DestinationPostalCode || + newPPMShipment.PickupAddress.PostalCode != oldPPMShipment.PickupAddress.PostalCode || + newPPMShipment.DestinationAddress.PostalCode != oldPPMShipment.DestinationAddress.PostalCode || newPPMShipment.ExpectedDepartureDate != oldPPMShipment.ExpectedDepartureDate } @@ -369,9 +369,9 @@ func priceFirstDaySIT(appCtx appcontext.AppContext, pricer services.ParamsPricer return nil, errors.New("ppm estimate pricer for SIT service item does not implement the first day pricer interface") } - serviceAreaPostalCode := ppmShipment.PickupPostalCode + serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode if serviceItem.ReService.Code == models.ReServiceCodeDDFSIT { - serviceAreaPostalCode = ppmShipment.DestinationPostalCode + serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode } serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ @@ -408,9 +408,9 @@ func priceAdditionalDaySIT(appCtx appcontext.AppContext, pricer services.ParamsP return nil, errors.New("ppm estimate pricer for SIT service item does not implement the additional days pricer interface") } - serviceAreaPostalCode := ppmShipment.PickupPostalCode + serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode if serviceItem.ReService.Code == models.ReServiceCodeDDASIT { - serviceAreaPostalCode = ppmShipment.DestinationPostalCode + serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode } serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ Address: models.Address{PostalCode: serviceAreaPostalCode}, @@ -437,8 +437,8 @@ func MapPPMShipmentEstimatedFields(ppmShipment models.PPMShipment) models.MTOShi ppmShipment.Shipment.ActualPickupDate = &ppmShipment.ExpectedDepartureDate ppmShipment.Shipment.RequestedPickupDate = &ppmShipment.ExpectedDepartureDate - ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: ppmShipment.PickupPostalCode} - ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: ppmShipment.DestinationPostalCode} + ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode} + ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode} ppmShipment.Shipment.PrimeActualWeight = ppmShipment.EstimatedWeight return ppmShipment.Shipment diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index 1689846417e..fb0ef21ec2b 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -497,7 +497,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { "90210", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) - suite.Equal(oldPPMShipment.PickupPostalCode, newPPM.PickupPostalCode) + suite.Equal(oldPPMShipment.PickupAddress.PostalCode, newPPM.PickupAddress.PostalCode) suite.Equal(unit.Pound(5000), *newPPM.EstimatedWeight) suite.Equal(unit.Cents(70064364), *ppmEstimate) }) @@ -547,9 +547,9 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { estimatedIncentive, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) - suite.Equal(oldPPMShipment.PickupPostalCode, newPPM.PickupPostalCode) + suite.Equal(oldPPMShipment.PickupAddress.PostalCode, newPPM.PickupAddress.PostalCode) suite.Equal(*oldPPMShipment.EstimatedWeight, *newPPM.EstimatedWeight) - suite.Equal(oldPPMShipment.DestinationPostalCode, newPPM.DestinationPostalCode) + suite.Equal(oldPPMShipment.DestinationAddress.PostalCode, newPPM.DestinationAddress.PostalCode) suite.True(oldPPMShipment.ExpectedDepartureDate.Equal(newPPM.ExpectedDepartureDate)) suite.Equal(*oldPPMShipment.EstimatedIncentive, *estimatedIncentive) suite.Equal(models.BoolPointer(true), newPPM.HasRequestedAdvance) @@ -564,13 +564,16 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) + + pickupAddress := models.Address{PostalCode: oldPPMShipment.PickupAddress.PostalCode} + destinationAddress := models.Address{PostalCode: "94040"} newPPM := models.PPMShipment{ ID: uuid.FromStringOrNil("575c25aa-b4eb-4024-9597-43483003c773"), ShipmentID: oldPPMShipment.ShipmentID, Status: models.PPMShipmentStatusPaymentApproved, ExpectedDepartureDate: oldPPMShipment.ExpectedDepartureDate, - PickupPostalCode: oldPPMShipment.PickupPostalCode, - DestinationPostalCode: "94040", + PickupAddress: &pickupAddress, + DestinationAddress: &destinationAddress, EstimatedWeight: oldPPMShipment.EstimatedWeight, SITExpected: oldPPMShipment.SITExpected, EstimatedIncentive: models.CentPointer(unit.Cents(600000)), @@ -585,7 +588,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildMinimalPPMShipment(suite.DB(), nil, nil) newPPM := oldPPMShipment - newPPM.DestinationPostalCode = "94040" + newPPM.DestinationAddress.PostalCode = "94040" _, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NoError(err) suite.Nil(newPPM.EstimatedIncentive) @@ -1349,10 +1352,12 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) + + destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", + DestinationAddress: &destinationAddress, SITExpected: models.BoolPointer(true), SITLocation: &originLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1388,10 +1393,12 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) + + destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", + DestinationAddress: &destinationAddress, SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1427,10 +1434,12 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) + + destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationPostalCode: "30813", + DestinationAddress: &destinationAddress, SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1591,10 +1600,10 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, nil) // PPM base shipment field changes will affect SIT pricing shipmentDifferentPickup := originalShipment - shipmentDifferentPickup.PickupPostalCode = "90211" + shipmentDifferentPickup.PickupAddress.PostalCode = "90211" shipmentDifferentDestination := originalShipment - shipmentDifferentDestination.DestinationPostalCode = "30814" + shipmentDifferentDestination.DestinationAddress.PostalCode = "30814" shipmentDifferentDeparture := originalShipment // original date was Mar 15th so adding 3 months should affect the date peak period pricing diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx index d41008125a1..53cf6a2ea8a 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx @@ -7,10 +7,12 @@ import { formatCentsTruncateWhole, formatCustomerDate, formatWeight } from 'util const EstimatedIncentiveDetails = ({ shipment }) => { const { estimatedWeight, - pickupPostalCode, - secondaryPickupPostalCode, - destinationPostalCode, - secondaryDestinationPostalCode, + pickupAddress, + hasSecondaryPickupAddress, + secondaryPickupAddress, + destinationAddress, + hasSecondaryDestinationAddress, + secondaryDestinationAddress, expectedDepartureDate, estimatedIncentive, } = shipment?.ppmShipment || {}; @@ -23,10 +25,10 @@ const EstimatedIncentiveDetails = ({ shipment }) => {

This is an estimate of how much you could earn by moving your PPM, based on what you have entered:

From 006f1d80919d8244bd62f6b281f4f6fd339e2787 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 22 May 2024 10:16:25 -0500 Subject: [PATCH 02/14] updating tests --- .../ppmshipment/ppm_estimator_test.go | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index fb0ef21ec2b..d124d86056c 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -180,6 +180,15 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }) + testdatagen.FetchOrMakeReZip3(suite.DB(), testdatagen.Assertions{ + ReZip3: models.ReZip3{ + Contract: originDomesticServiceArea.Contract, + ContractID: originDomesticServiceArea.ContractID, + DomesticServiceArea: originDomesticServiceArea, + Zip3: "503", + }, + }) + testdatagen.FetchOrMakeReZip3(suite.DB(), testdatagen.Assertions{ ReZip3: models.ReZip3{ Contract: originDomesticServiceArea.Contract, @@ -488,13 +497,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) suite.Equal(oldPPMShipment.PickupAddress.PostalCode, newPPM.PickupAddress.PostalCode) @@ -524,7 +533,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil).Once() + "50309", "30813").Return(2294, nil).Once() ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) @@ -603,7 +612,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(actualMoveDate), Status: models.PPMShipmentStatusWaitingOnCustomer, @@ -632,13 +641,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmFinal, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) suite.Equal(oldPPMShipment.ActualPickupPostalCode, newPPM.ActualPickupPostalCode) @@ -655,7 +664,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(moveDate), Status: models.PPMShipmentStatusWaitingOnCustomer, @@ -686,13 +695,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmFinal, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) suite.Equal(oldPPMShipment.ActualPickupPostalCode, newPPM.ActualPickupPostalCode) @@ -711,7 +720,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { oldPPMShipment := factory.BuildPPMShipmentThatNeedsPaymentApproval(suite.DB(), nil, []factory.Customization{ { Model: models.PPMShipment{ - ActualPickupPostalCode: models.StringPointer("90210"), + ActualPickupPostalCode: models.StringPointer("50309"), ActualDestinationPostalCode: models.StringPointer("30813"), ActualMoveDate: models.TimePointer(moveDate), }, @@ -743,13 +752,13 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { // DTOD distance is going to be less than the HHG Rand McNally distance of 2361 miles mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) ppmFinal, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), oldPPMShipment, &newPPM) suite.NilOrNoVerrs(err) mockedPlanner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813") + "50309", "30813") mockedPaymentRequestHelper.AssertCalled(suite.T(), "FetchServiceParamsForServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]models.MTOServiceItem")) originalWeight, newWeight := SumWeightTickets(oldPPMShipment, newPPM) @@ -1372,7 +1381,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), models.PPMShipment{}, &shipmentOriginSIT) @@ -1413,7 +1422,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), models.PPMShipment{}, &shipmentOriginSIT) @@ -1453,7 +1462,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), models.PPMShipment{}, &shipmentOriginSIT) @@ -1610,10 +1619,10 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentDifferentDeparture.ExpectedDepartureDate = originalShipment.ExpectedDepartureDate.Add(time.Hour * 24 * 70) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90211", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30814").Return(2290, nil) + "50309", "30814").Return(2290, nil) // SIT specific field changes will likely cause the price to change, although adjusting dates may not change // the total number of days in SIT. From bb1d70a721001661087153acefd28cb264c64546 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 22 May 2024 11:05:43 -0500 Subject: [PATCH 03/14] updating tests --- .../ppmshipment/ppm_estimator_test.go | 8 ++--- .../EstimatedIncentiveDetails.test.jsx | 34 ++++++++++++++++--- .../EstimatedIncentive.test.jsx | 16 +++++++-- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index d124d86056c..51be29058b7 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -1362,11 +1362,10 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, nil) - destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationAddress: &destinationAddress, + DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &originLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1444,11 +1443,10 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, nil) - destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationAddress: &destinationAddress, + DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1619,7 +1617,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentDifferentDeparture.ExpectedDepartureDate = originalShipment.ExpectedDepartureDate.Add(time.Hour * 24 * 70) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "50309", "30813").Return(2294, nil) + "90211", "30813").Return(2294, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), "50309", "30814").Return(2290, nil) diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx index b3e7d48355b..ec7e593b2c4 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx @@ -22,10 +22,36 @@ const optionalSecondaryProps = { shipment: { id: '1234', ppmShipment: { - pickupPostalCode: '10001', - destinationPostalCode: '10002', - secondaryPickupPostalCode: '10003', - secondaryDestinationPostalCode: '10004', + pickupAddress: { + streetAddress1: '812 S 129th St', + streetAddress2: '#123', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + destinationAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#124', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, + secondaryPickupAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#125', + city: 'San Antonio', + state: 'TX', + postalCode: '10003', + }, + secondaryDestinationAddress: { + streetAddress1: '814 S 129th St', + streetAddress2: '#126', + city: 'San Antonio', + state: 'TX', + postalCode: '10004', + }, + hasSecondaryPickupAddress: true, + hasSecondaryDestinationAddress: true, expectedDepartureDate: '2022-07-04', estimatedWeight: 3456, proGearWeight: 1333, diff --git a/src/pages/MyMove/PPM/Booking/EstimatedIncentive/EstimatedIncentive.test.jsx b/src/pages/MyMove/PPM/Booking/EstimatedIncentive/EstimatedIncentive.test.jsx index 52f1e54ae8d..d4424c99b90 100644 --- a/src/pages/MyMove/PPM/Booking/EstimatedIncentive/EstimatedIncentive.test.jsx +++ b/src/pages/MyMove/PPM/Booking/EstimatedIncentive/EstimatedIncentive.test.jsx @@ -36,8 +36,20 @@ beforeEach(() => { const shipmentEntity = { id: 'shipment123', ppmShipment: { - pickupPostalCode: '10001', - destinationPostalCode: '10002', + pickupAddress: { + streetAddress1: '812 S 129th St', + streetAddress2: '#123', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + destinationAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#124', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, expectedDepartureDate: '2022-04-01', estimatedWeight: 4567, estimatedIncentive: 789000, From db68d2733c35cfb54c762ab251e70b73f9204d53 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 22 May 2024 11:29:11 -0500 Subject: [PATCH 04/14] updating tests --- pkg/services/ppmshipment/ppm_estimator_test.go | 6 ++---- .../EstimatedIncentiveDetails.test.jsx | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index 51be29058b7..f25875b103c 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -1401,12 +1401,10 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) - - destinationAddress := models.Address{PostalCode: "30813"} shipmentOriginSIT := factory.BuildPPMShipment(nil, []factory.Customization{ { Model: models.PPMShipment{ - DestinationAddress: &destinationAddress, + DestinationPostalCode: "30813", SITExpected: models.BoolPointer(true), SITLocation: &destinationLocation, SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), @@ -1617,7 +1615,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentDifferentDeparture.ExpectedDepartureDate = originalShipment.ExpectedDepartureDate.Add(time.Hour * 24 * 70) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90211", "30813").Return(2294, nil) + "90211", "30814").Return(2294, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), "50309", "30814").Return(2290, nil) diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx index ec7e593b2c4..797e8d5f8e4 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx @@ -7,8 +7,20 @@ const defaultProps = { shipment: { id: '1234', ppmShipment: { - pickupPostalCode: '10001', - destinationPostalCode: '10002', + pickupAddress: { + streetAddress1: '812 S 129th St', + streetAddress2: '#123', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + destinationAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#124', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, expectedDepartureDate: '2022-07-04', estimatedWeight: 3456, proGearWeight: 1333, From 3c226893f9d01d44d5d96c82800494947cdbaddc Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 22 May 2024 11:55:03 -0500 Subject: [PATCH 05/14] updating tests --- pkg/services/ppmshipment/ppm_estimator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index f25875b103c..fb930b3b157 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -1608,14 +1608,14 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentDifferentPickup.PickupAddress.PostalCode = "90211" shipmentDifferentDestination := originalShipment - shipmentDifferentDestination.DestinationAddress.PostalCode = "30814" + shipmentDifferentDestination.DestinationAddress.PostalCode = "30813" shipmentDifferentDeparture := originalShipment // original date was Mar 15th so adding 3 months should affect the date peak period pricing shipmentDifferentDeparture.ExpectedDepartureDate = originalShipment.ExpectedDepartureDate.Add(time.Hour * 24 * 70) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90211", "30814").Return(2294, nil) + "90211", "30813").Return(2294, nil) mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), "50309", "30814").Return(2290, nil) From 276b957b2f6c6a3aa6e90f807d2b176abde2f870 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 22 May 2024 12:19:14 -0500 Subject: [PATCH 06/14] Updating tests --- pkg/services/ppmshipment/ppm_estimator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index fb930b3b157..e9d57064b01 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -1608,7 +1608,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { shipmentDifferentPickup.PickupAddress.PostalCode = "90211" shipmentDifferentDestination := originalShipment - shipmentDifferentDestination.DestinationAddress.PostalCode = "30813" + shipmentDifferentDestination.DestinationAddress.PostalCode = "30814" shipmentDifferentDeparture := originalShipment // original date was Mar 15th so adding 3 months should affect the date peak period pricing From a01d80a17a8840f86238c990a59599b9eef42832 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 23 May 2024 16:42:35 +0000 Subject: [PATCH 07/14] Updating Tests --- .../ppmshipment/ppm_estimator_test.go | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index e9d57064b01..8687c9339cc 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -1605,10 +1605,26 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, nil) // PPM base shipment field changes will affect SIT pricing shipmentDifferentPickup := originalShipment - shipmentDifferentPickup.PickupAddress.PostalCode = "90211" + pickupAddress := models.Address{ + StreetAddress1: originalShipment.PickupAddress.StreetAddress1, + StreetAddress2: originalShipment.PickupAddress.StreetAddress2, + StreetAddress3: originalShipment.PickupAddress.StreetAddress3, + City: originalShipment.PickupAddress.City, + State: originalShipment.PickupAddress.State, + PostalCode: "90211", + } + shipmentDifferentPickup.PickupAddress = &pickupAddress shipmentDifferentDestination := originalShipment - shipmentDifferentDestination.DestinationAddress.PostalCode = "30814" + destinationAddress := models.Address{ + StreetAddress1: originalShipment.PickupAddress.StreetAddress1, + StreetAddress2: originalShipment.PickupAddress.StreetAddress2, + StreetAddress3: originalShipment.PickupAddress.StreetAddress3, + City: originalShipment.PickupAddress.City, + State: originalShipment.PickupAddress.State, + PostalCode: "30814", + } + shipmentDifferentDestination.DestinationAddress = &destinationAddress shipmentDifferentDeparture := originalShipment // original date was Mar 15th so adding 3 months should affect the date peak period pricing From 0d72d7422a9dd56c2f75763815a91b41972efa78 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 23 May 2024 17:53:00 +0000 Subject: [PATCH 08/14] Updating tests --- pkg/services/ppm_closeout/ppm_closeout_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/services/ppm_closeout/ppm_closeout_test.go b/pkg/services/ppm_closeout/ppm_closeout_test.go index c0cb4af43a8..eefded05143 100644 --- a/pkg/services/ppm_closeout/ppm_closeout_test.go +++ b/pkg/services/ppm_closeout/ppm_closeout_test.go @@ -71,6 +71,15 @@ func (suite *PPMCloseoutSuite) TestPPMShipmentCreator() { }, }) + testdatagen.FetchOrMakeReZip3(suite.AppContextForTest().DB(), testdatagen.Assertions{ + ReZip3: models.ReZip3{ + Contract: originDomesticServiceArea.Contract, + ContractID: originDomesticServiceArea.ContractID, + DomesticServiceArea: originDomesticServiceArea, + Zip3: "503", + }, + }) + testdatagen.FetchOrMakeReDomesticLinehaulPrice(suite.AppContextForTest().DB(), testdatagen.Assertions{ ReDomesticLinehaulPrice: models.ReDomesticLinehaulPrice{ Contract: originDomesticServiceArea.Contract, @@ -337,7 +346,7 @@ func (suite *PPMCloseoutSuite) TestPPMShipmentCreator() { appCtx := suite.AppContextForTest() mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "90210", "30813").Return(2294, nil) + "50309", "30813").Return(2294, nil) mockedPaymentRequestHelper.On( "FetchServiceParamsForServiceItems", From d7d21a27eb5d339c45dfb9709deaebb5adf200af Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 23 May 2024 18:11:37 +0000 Subject: [PATCH 09/14] Updating tests --- pkg/services/ppm_closeout/ppm_closeout_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/ppm_closeout/ppm_closeout_test.go b/pkg/services/ppm_closeout/ppm_closeout_test.go index eefded05143..828ab746fec 100644 --- a/pkg/services/ppm_closeout/ppm_closeout_test.go +++ b/pkg/services/ppm_closeout/ppm_closeout_test.go @@ -346,7 +346,7 @@ func (suite *PPMCloseoutSuite) TestPPMShipmentCreator() { appCtx := suite.AppContextForTest() mockedPlanner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "50309", "30813").Return(2294, nil) + "90210", "30813").Return(2294, nil) mockedPaymentRequestHelper.On( "FetchServiceParamsForServiceItems", From 959ceae01c53f44b52ecacf76acb2a3e16836400 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 23 May 2024 19:54:34 +0000 Subject: [PATCH 10/14] Updating test data --- pkg/services/ppm_closeout/ppm_closeout.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/services/ppm_closeout/ppm_closeout.go b/pkg/services/ppm_closeout/ppm_closeout.go index 3e9af1e9824..c372ffd4e6a 100644 --- a/pkg/services/ppm_closeout/ppm_closeout.go +++ b/pkg/services/ppm_closeout/ppm_closeout.go @@ -210,6 +210,8 @@ func (p *ppmCloseoutFetcher) GetPPMShipment(appCtx appcontext.AppContext, ppmShi "FinalIncentive", "AdvanceAmountReceived", "Shipment.Distance", + "PickupAddress", + "DestinationAddress", ). Find(&ppmShipment, ppmShipmentID) From b07834f1f7d86b09f7fbfb0d45cc6d210a8e8164 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 4 Jun 2024 20:22:12 +0000 Subject: [PATCH 11/14] Updating Address display --- .../EstimatedIncentiveDetails.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx index 53cf6a2ea8a..d6cc958aef0 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx @@ -2,6 +2,7 @@ import React from 'react'; import styles from 'components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.module.scss'; import { ShipmentShape } from 'types/shipment'; +import { formatAddress } from 'utils/shipmentDisplay'; import { formatCentsTruncateWhole, formatCustomerDate, formatWeight } from 'utils/formatters'; const EstimatedIncentiveDetails = ({ shipment }) => { @@ -25,10 +26,12 @@ const EstimatedIncentiveDetails = ({ shipment }) => {

This is an estimate of how much you could earn by moving your PPM, based on what you have entered:

  • {formatWeight(estimatedWeight)} estimated weight
  • -
  • Starting from {pickupAddress.postalCode}
  • - {hasSecondaryPickupAddress &&
  • Picking up things in {secondaryPickupAddress.postalCode}
  • } - {hasSecondaryDestinationAddress &&
  • Dropping off things in {secondaryDestinationAddress.postalCode}
  • } -
  • Ending in {destinationAddress.postalCode}
  • +
  • Starting from {formatAddress(pickupAddress)}
  • + {hasSecondaryPickupAddress &&
  • Picking up things at {formatAddress(secondaryPickupAddress)}
  • } + {hasSecondaryDestinationAddress && ( +
  • Dropping off things at {formatAddress(secondaryDestinationAddress)}
  • + )} +
  • Ending in {formatAddress(destinationAddress)}
  • Starting your PPM on {formatCustomerDate(expectedDepartureDate)}
From 5f73d8af89c8a77ea8297ebd57b4706929e724f7 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 4 Jun 2024 21:00:40 +0000 Subject: [PATCH 12/14] Updating Estimated Incentive Details tests --- .../EstimatedIncentiveDetails.test.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx index 797e8d5f8e4..5f925427b3e 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx @@ -87,8 +87,8 @@ describe('EstimatedIncentiveDetails component', () => { const incentiveListItems = screen.getAllByRole('listitem'); expect(incentiveListItems).toHaveLength(4); expect(incentiveListItems[0]).toHaveTextContent('3,456 lbs estimated weight'); - expect(incentiveListItems[1]).toHaveTextContent('Starting from 10001'); - expect(incentiveListItems[2]).toHaveTextContent('Ending in 10002'); + expect(incentiveListItems[1]).toHaveTextContent('Starting from 812 S 129th St, #123, San Antonio, TX 10001'); + expect(incentiveListItems[2]).toHaveTextContent('Starting from 813 S 129th St, #124, San Antonio, TX 10002'); expect(incentiveListItems[3]).toHaveTextContent('Starting your PPM on 04 Jul 2022'); expect(screen.getByRole('heading', { level: 3 })).toHaveTextContent('Your actual incentive amount will vary'); @@ -112,10 +112,10 @@ describe('EstimatedIncentiveDetails component', () => { const incentiveListItems = screen.getAllByRole('listitem'); expect(incentiveListItems).toHaveLength(6); expect(incentiveListItems[0]).toHaveTextContent('3,456 lbs estimated weight'); - expect(incentiveListItems[1]).toHaveTextContent('Starting from 10001'); - expect(incentiveListItems[2]).toHaveTextContent('Picking up things in 10003'); - expect(incentiveListItems[3]).toHaveTextContent('Dropping off things in 10004'); - expect(incentiveListItems[4]).toHaveTextContent('Ending in 10002'); + expect(incentiveListItems[1]).toHaveTextContent('Starting from 812 S 129th St, #123, San Antonio, TX 10001'); + expect(incentiveListItems[2]).toHaveTextContent('Starting from 813 S 129th St, #125, San Antonio, TX 10003'); + expect(incentiveListItems[3]).toHaveTextContent('Starting from 814 S 129th St, #126, San Antonio, TX 10004'); + expect(incentiveListItems[4]).toHaveTextContent('Starting from 813 S 129th St, #124, San Antonio, TX 10002'); expect(incentiveListItems[5]).toHaveTextContent('Starting your PPM on 04 Jul 2022'); }); }); From 9083fec768478df58cd75609e4864192069199ae Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 4 Jun 2024 21:17:05 +0000 Subject: [PATCH 13/14] Updating estimated incentive tests --- .../EstimatedIncentiveDetails.jsx | 2 +- .../EstimatedIncentiveDetails.test.jsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx index d6cc958aef0..25d4960bcf5 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.jsx @@ -31,7 +31,7 @@ const EstimatedIncentiveDetails = ({ shipment }) => { {hasSecondaryDestinationAddress && (
  • Dropping off things at {formatAddress(secondaryDestinationAddress)}
  • )} -
  • Ending in {formatAddress(destinationAddress)}
  • +
  • Ending at {formatAddress(destinationAddress)}
  • Starting your PPM on {formatCustomerDate(expectedDepartureDate)}
  • diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx index 5f925427b3e..cf95a1de63a 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.test.jsx @@ -88,7 +88,7 @@ describe('EstimatedIncentiveDetails component', () => { expect(incentiveListItems).toHaveLength(4); expect(incentiveListItems[0]).toHaveTextContent('3,456 lbs estimated weight'); expect(incentiveListItems[1]).toHaveTextContent('Starting from 812 S 129th St, #123, San Antonio, TX 10001'); - expect(incentiveListItems[2]).toHaveTextContent('Starting from 813 S 129th St, #124, San Antonio, TX 10002'); + expect(incentiveListItems[2]).toHaveTextContent('Ending at 813 S 129th St, #124, San Antonio, TX 10002'); expect(incentiveListItems[3]).toHaveTextContent('Starting your PPM on 04 Jul 2022'); expect(screen.getByRole('heading', { level: 3 })).toHaveTextContent('Your actual incentive amount will vary'); @@ -113,9 +113,11 @@ describe('EstimatedIncentiveDetails component', () => { expect(incentiveListItems).toHaveLength(6); expect(incentiveListItems[0]).toHaveTextContent('3,456 lbs estimated weight'); expect(incentiveListItems[1]).toHaveTextContent('Starting from 812 S 129th St, #123, San Antonio, TX 10001'); - expect(incentiveListItems[2]).toHaveTextContent('Starting from 813 S 129th St, #125, San Antonio, TX 10003'); - expect(incentiveListItems[3]).toHaveTextContent('Starting from 814 S 129th St, #126, San Antonio, TX 10004'); - expect(incentiveListItems[4]).toHaveTextContent('Starting from 813 S 129th St, #124, San Antonio, TX 10002'); + expect(incentiveListItems[2]).toHaveTextContent('Picking up things at 813 S 129th St, #125, San Antonio, TX 10003'); + expect(incentiveListItems[3]).toHaveTextContent( + 'Dropping off things at 814 S 129th St, #126, San Antonio, TX 10004', + ); + expect(incentiveListItems[4]).toHaveTextContent('Ending at 813 S 129th St, #124, San Antonio, TX 10002'); expect(incentiveListItems[5]).toHaveTextContent('Starting your PPM on 04 Jul 2022'); }); }); From 063ed8470e207500e1f6e028b4e3fd35e2998946 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Fri, 7 Jun 2024 19:53:58 +0000 Subject: [PATCH 14/14] Updating stories for happo --- migrations/app/migrations_manifest.txt | 2 +- .../EstimatedIncentiveDetails.stories.jsx | 50 ++++++++++++++++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index fb2a94600a3..0e3df3c2b78 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -938,10 +938,10 @@ 20240515164336_ignore_locked_columns_in_moves_table_for_history_log.up.sql 20240516143952_add_pricing_estimate_to_mto_service_items.up.sql 20240516184021_import_pricing_data_ghc.up.sql -20240524214247_add_sit_location_moving_expenses.up.sql 20240521160335_backfill_LOA_FY_TX.up.sql 20240521184834_add_standalone_field_to_service_items.up.sql 20240522124339_add_csr_to_roles.up.sql +20240524214247_add_sit_location_moving_expenses.up.sql 20240530020648_adding_standalone_crate_service_param.up.sql 20240531050324_adding_standalone_crate_cap.up.sql 20240531152430_migrate_data_to_new_ppm_statuses.up.sql diff --git a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.stories.jsx b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.stories.jsx index d37026f5269..e5d8bb22861 100644 --- a/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.stories.jsx +++ b/src/components/Customer/PPM/Booking/EstimatedIncentiveDetails/EstimatedIncentiveDetails.stories.jsx @@ -25,8 +25,20 @@ export const WithoutSecondaryPostalCodes = Template.bind({}); WithoutSecondaryPostalCodes.args = { shipment: { ppmShipment: { - pickupPostalCode: '10001', - destinationPostalCode: '10002', + pickupAddress: { + streetAddress1: '812 S 129th St', + streetAddress2: '#123', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + destinationAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#124', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, expectedDepartureDate: '2022-07-04', estimatedWeight: 4999, estimatedIncentive: 123499, @@ -38,10 +50,36 @@ export const WithSecondaryPostalCodes = Template.bind({}); WithSecondaryPostalCodes.args = { shipment: { ppmShipment: { - pickupPostalCode: '10001', - secondaryPickupPostalCode: '10003', - destinationPostalCode: '10002', - secondaryDestinationPostalCode: '10004', + pickupAddress: { + streetAddress1: '812 S 129th St', + streetAddress2: '#123', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + destinationAddress: { + streetAddress1: '813 S 129th St', + streetAddress2: '#124', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, + secondaryPickupAddress: { + streetAddress1: '814 S 129th St', + streetAddress2: '#125', + city: 'San Antonio', + state: 'TX', + postalCode: '10001', + }, + secondaryDestinationAddress: { + streetAddress1: '815 S 129th St', + streetAddress2: '#126', + city: 'San Antonio', + state: 'TX', + postalCode: '10002', + }, + hasSecondaryDestinationAddress: true, + hasSecondaryPickupAddress: true, expectedDepartureDate: '2022-07-04', estimatedWeight: 4999, estimatedIncentive: 123499,