Skip to content

Commit

Permalink
Merge branch 'main' into B19774-MAIN-20240627
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHawks224 authored Jul 3, 2024
2 parents 8cf7688 + 27226c8 commit b07a7d2
Show file tree
Hide file tree
Showing 119 changed files with 1,017 additions and 3,405 deletions.
27 changes: 14 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/DATA-DOG/go-txdb v0.1.7
github.com/XSAM/otelsql v0.23.0
github.com/alexedwards/scs/redisstore v0.0.0-20221223131519-238b052508b6
github.com/alexedwards/scs/v2 v2.5.1
github.com/alexedwards/scs/v2 v2.8.0
github.com/aws/aws-sdk-go-v2 v1.27.2
github.com/aws/aws-sdk-go-v2/config v1.27.14
github.com/aws/aws-sdk-go-v2/credentials v1.17.14
Expand Down Expand Up @@ -91,19 +91,20 @@ require (
go.opentelemetry.io/otel/sdk/metric v0.40.0
go.opentelemetry.io/otel/trace v1.18.0
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.21.0
golang.org/x/net v0.23.0
golang.org/x/crypto v0.23.0
golang.org/x/net v0.25.0
golang.org/x/oauth2 v0.20.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.13.0
golang.org/x/text v0.16.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
google.golang.org/grpc v1.62.0
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
gotest.tools/gotestsum v1.10.1
gotest.tools/gotestsum v1.12.0
pault.ag/go/pksigner v1.0.2
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
Expand Down Expand Up @@ -154,7 +155,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down Expand Up @@ -216,7 +217,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
Expand Down Expand Up @@ -255,11 +256,11 @@ require (
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/image v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
Expand Down
89 changes: 55 additions & 34 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@
20240521184834_add_standalone_field_to_service_items.up.sql
20240522124339_add_csr_to_roles.up.sql
20240524214247_add_sit_location_moving_expenses.up.sql
20240528154043_drop_not_null_from_ppm_postal_codes.up.sql
20240529181303_add_additional_documents_id_col_to_moves.up.sql
20240530020648_adding_standalone_crate_service_param.up.sql
20240530084720_rename_qae_csr_to_just_qae.up.sql
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE ppm_shipments
ALTER COLUMN pickup_postal_code DROP NOT NULL,
ALTER COLUMN destination_postal_code DROP NOT NULL;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
Expand All @@ -16,7 +16,7 @@
"bytes": "^3.1.2",
"classnames": "^2.5.1",
"connected-react-router": "^6.9.3",
"core-js": "^3.37.0",
"core-js": "^3.37.1",
"customize-cra": "^1.0.0",
"deep-object-diff": "^1.1.9",
"eslint-plugin-react": "^7.34",
Expand Down Expand Up @@ -128,7 +128,7 @@
"version": "0.1.0",
"devDependencies": {
"@babel/core": "~7.22.8",
"@babel/helper-builder-react-jsx": "^7.22.5",
"@babel/helper-builder-react-jsx": "^7.24.7",
"@babel/helper-builder-react-jsx-experimental": "^7.12.11",
"@faker-js/faker": "^8.4.1",
"@jackfranklin/test-data-bot": "^2.1.0",
Expand Down
14 changes: 4 additions & 10 deletions pkg/factory/ppm_shipment_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,11 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization,
Shipment: shipment,
Status: models.PPMShipmentStatusDraft,
ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC),
PickupPostalCode: serviceMember.ResidentialAddress.PostalCode,
DestinationPostalCode: shipment.MoveTaskOrder.Orders.NewDutyLocation.Address.PostalCode,
SITExpected: models.BoolPointer(false),
}

if buildType == ppmBuildStandard {
ppmShipment.Status = models.PPMShipmentStatusSubmitted
ppmShipment.SecondaryPickupPostalCode = models.StringPointer("90211")
ppmShipment.SecondaryDestinationPostalCode = models.StringPointer("30814")
ppmShipment.EstimatedWeight = models.PoundPointer(unit.Pound(4000))
ppmShipment.HasProGear = models.BoolPointer(true)
ppmShipment.ProGearWeight = models.PoundPointer(unit.Pound(1987))
Expand Down Expand Up @@ -141,12 +137,10 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization,
}, nil)
ppmShipment.SecondaryPickupAddressID = &secondaryPickupAddress.ID
ppmShipment.SecondaryPickupAddress = &secondaryPickupAddress
ppmShipment.SecondaryPickupPostalCode = &secondaryPickupAddress.PostalCode
ppmShipment.HasSecondaryPickupAddress = models.BoolPointer(true)

ppmShipment.SecondaryDestinationAddressID = &secondaryDestinationAddress.ID
ppmShipment.SecondaryDestinationAddress = &secondaryDestinationAddress
ppmShipment.SecondaryDestinationPostalCode = &secondaryDestinationAddress.PostalCode
ppmShipment.HasSecondaryDestinationAddress = models.BoolPointer(true)
}

Expand Down Expand Up @@ -238,8 +232,8 @@ func buildApprovedPPMShipmentWithActualInfo(db *pop.Connection, userUploader *up
ppmShipment := buildApprovedPPMShipmentWaitingOnCustomer(db, userUploader, customs)

ppmShipment.ActualMoveDate = models.TimePointer(ppmShipment.ExpectedDepartureDate.AddDate(0, 0, 1))
ppmShipment.ActualPickupPostalCode = &ppmShipment.PickupPostalCode
ppmShipment.ActualDestinationPostalCode = &ppmShipment.DestinationPostalCode
ppmShipment.ActualPickupPostalCode = &ppmShipment.PickupAddress.PostalCode
ppmShipment.ActualDestinationPostalCode = &ppmShipment.DestinationAddress.PostalCode

if ppmShipment.HasRequestedAdvance != nil && *ppmShipment.HasRequestedAdvance {
ppmShipment.HasReceivedAdvance = models.BoolPointer(true)
Expand Down Expand Up @@ -786,11 +780,11 @@ func BuildPPMShipmentWithAllDocTypesApproved(db *pop.Connection, userUploader *u
//
// This function does not accept customizations to reduce the
// complexity of supporting different variations for tests
func BuildPPMShipmentThatNeedsToBeResubmitted(db *pop.Connection, userUploader *uploader.UserUploader) models.PPMShipment {
func BuildPPMShipmentThatNeedsToBeResubmitted(db *pop.Connection, userUploader *uploader.UserUploader, customs []Customization) models.PPMShipment {
// It's easier to use some of the data from other downstream
// functions if we have them go first and then make our changes on
// top of those changes.
ppmShipment := BuildPPMShipmentThatNeedsCloseout(db, userUploader, nil)
ppmShipment := BuildPPMShipmentThatNeedsCloseout(db, userUploader, customs)

// Document that got rejected. This would normally already exist
// and would just need to be updated to change the status, but for
Expand Down
114 changes: 55 additions & 59 deletions pkg/factory/ppm_shipment_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,57 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
// Set up: Create a PPM shipment with no customizations or traits
// Expected outcome:PPMShipment should be created with default values
defaultPPM := models.PPMShipment{
ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC),
PickupPostalCode: "90210",
DestinationPostalCode: "30813",
SITExpected: models.BoolPointer(false),
Status: models.PPMShipmentStatusSubmitted,
SecondaryPickupPostalCode: models.StringPointer("90211"),
SecondaryDestinationPostalCode: models.StringPointer("30814"),
EstimatedWeight: models.PoundPointer(unit.Pound(4000)),
HasProGear: models.BoolPointer(true),
ProGearWeight: models.PoundPointer(unit.Pound(1987)),
SpouseProGearWeight: models.PoundPointer(unit.Pound(498)),
EstimatedIncentive: models.CentPointer(unit.Cents(1000000)),
HasRequestedAdvance: models.BoolPointer(true),
AdvanceAmountRequested: models.CentPointer(unit.Cents(598700)),
ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC),
SITExpected: models.BoolPointer(false),
Status: models.PPMShipmentStatusSubmitted,
EstimatedWeight: models.PoundPointer(unit.Pound(4000)),
HasProGear: models.BoolPointer(true),
ProGearWeight: models.PoundPointer(unit.Pound(1987)),
SpouseProGearWeight: models.PoundPointer(unit.Pound(498)),
EstimatedIncentive: models.CentPointer(unit.Cents(1000000)),
HasRequestedAdvance: models.BoolPointer(true),
AdvanceAmountRequested: models.CentPointer(unit.Cents(598700)),
PickupAddress: &models.Address{
StreetAddress1: "987 New Street",
City: "Des Moines",
State: "IA",
PostalCode: "50309",
},
SecondaryPickupAddress: &models.Address{
StreetAddress1: "123 Main Street",
City: "Des Moines",
State: "IA",
PostalCode: "50309",
},
DestinationAddress: &models.Address{
StreetAddress1: "123 New Street",
City: "Fort Eisenhower",
State: "GA",
PostalCode: "30813",
},
SecondaryDestinationAddress: &models.Address{
StreetAddress1: "1234 Main Street",
City: "Fort Eisenhower",
State: "GA",
PostalCode: "30813",
},
}

// SETUP
ppmShipment := BuildPPMShipment(suite.DB(), nil, nil)

// VALIDATE RESULTS
suite.Equal(defaultPPM.PickupAddress.StreetAddress1, ppmShipment.PickupAddress.StreetAddress1)
suite.Equal(defaultPPM.DestinationAddress.StreetAddress1, ppmShipment.DestinationAddress.StreetAddress1)
suite.Equal(defaultPPM.PickupAddress.City, ppmShipment.PickupAddress.City)
suite.Equal(defaultPPM.DestinationAddress.City, ppmShipment.DestinationAddress.City)
suite.Equal(defaultPPM.PickupAddress.State, ppmShipment.PickupAddress.State)
suite.Equal(defaultPPM.DestinationAddress.State, ppmShipment.DestinationAddress.State)
suite.Equal(defaultPPM.PickupAddress.PostalCode, ppmShipment.PickupAddress.PostalCode)
suite.Equal(defaultPPM.DestinationAddress.PostalCode, ppmShipment.DestinationAddress.PostalCode)
suite.Equal(defaultPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate)
suite.Equal(defaultPPM.PickupPostalCode, ppmShipment.PickupPostalCode)
suite.Equal(defaultPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode)
suite.Equal(defaultPPM.SITExpected, ppmShipment.SITExpected)
suite.Equal(defaultPPM.Status, ppmShipment.Status)
suite.Equal(defaultPPM.SecondaryPickupPostalCode, ppmShipment.SecondaryPickupPostalCode)
suite.Equal(defaultPPM.SecondaryDestinationPostalCode, ppmShipment.SecondaryDestinationPostalCode)
suite.Equal(defaultPPM.EstimatedWeight, ppmShipment.EstimatedWeight)
suite.Equal(defaultPPM.HasProGear, ppmShipment.HasProGear)
suite.Equal(defaultPPM.ProGearWeight, ppmShipment.ProGearWeight)
Expand All @@ -60,8 +84,6 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
defaultPPM := models.PPMShipment{
Status: models.PPMShipmentStatusDraft,
ExpectedDepartureDate: time.Date(GHCTestYear, time.March, 15, 0, 0, 0, 0, time.UTC),
PickupPostalCode: "90210",
DestinationPostalCode: "30813",
SITExpected: models.BoolPointer(false),
}

Expand All @@ -71,10 +93,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
// VALIDATE RESULTS
suite.Equal(defaultPPM.Status, ppmShipment.Status)
suite.Equal(defaultPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate)
suite.Equal(defaultPPM.PickupPostalCode, ppmShipment.PickupPostalCode)
suite.Equal(defaultPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode)
suite.Equal(defaultPPM.SITExpected, ppmShipment.SITExpected)
suite.Nil(ppmShipment.SecondaryDestinationPostalCode)
suite.Nil(ppmShipment.EstimatedWeight)
suite.Nil(ppmShipment.HasProGear)
suite.Nil(ppmShipment.ProGearWeight)
Expand All @@ -91,23 +110,19 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
// SETUP
sitLocation := models.SITLocationTypeDestination
customPPM := models.PPMShipment{
ID: uuid.Must(uuid.NewV4()),
Status: models.PPMShipmentStatusWaitingOnCustomer,
ExpectedDepartureDate: time.Now(),
PickupPostalCode: "79329",
SecondaryPickupPostalCode: models.StringPointer("80238"),
DestinationPostalCode: "90210",
SecondaryDestinationPostalCode: models.StringPointer("83126"),
HasProGear: models.BoolPointer(true),
ProGearWeight: models.PoundPointer(unit.Pound(1989)),
EstimatedWeight: models.PoundPointer(unit.Pound(3000)),
SpouseProGearWeight: models.PoundPointer(unit.Pound(123)),
EstimatedIncentive: models.CentPointer(unit.Cents(1005000)),
HasRequestedAdvance: models.BoolPointer(true),
AdvanceAmountRequested: models.CentPointer(unit.Cents(600000)),
SITExpected: models.BoolPointer(true),
SITLocation: &sitLocation,
SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)),
ID: uuid.Must(uuid.NewV4()),
Status: models.PPMShipmentStatusWaitingOnCustomer,
ExpectedDepartureDate: time.Now(),
HasProGear: models.BoolPointer(true),
ProGearWeight: models.PoundPointer(unit.Pound(1989)),
EstimatedWeight: models.PoundPointer(unit.Pound(3000)),
SpouseProGearWeight: models.PoundPointer(unit.Pound(123)),
EstimatedIncentive: models.CentPointer(unit.Cents(1005000)),
HasRequestedAdvance: models.BoolPointer(true),
AdvanceAmountRequested: models.CentPointer(unit.Cents(600000)),
SITExpected: models.BoolPointer(true),
SITLocation: &sitLocation,
SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)),
}
customAddress := models.Address{
StreetAddress1: "123 Any Street",
Expand All @@ -124,12 +139,8 @@ func (suite *FactorySuite) TestBuildPPMShipment() {

// VALIDATE RESULTS
suite.Equal(customPPM.ExpectedDepartureDate, ppmShipment.ExpectedDepartureDate)
suite.Equal(customPPM.PickupPostalCode, ppmShipment.PickupPostalCode)
suite.Equal(customPPM.DestinationPostalCode, ppmShipment.DestinationPostalCode)
suite.Equal(customPPM.SITExpected, ppmShipment.SITExpected)
suite.Equal(customPPM.Status, ppmShipment.Status)
suite.Equal(customPPM.SecondaryPickupPostalCode, ppmShipment.SecondaryPickupPostalCode)
suite.Equal(customPPM.SecondaryDestinationPostalCode, ppmShipment.SecondaryDestinationPostalCode)
suite.Equal(customPPM.EstimatedWeight, ppmShipment.EstimatedWeight)
suite.Equal(customPPM.HasProGear, ppmShipment.HasProGear)
suite.Equal(customPPM.ProGearWeight, ppmShipment.ProGearWeight)
Expand Down Expand Up @@ -235,10 +246,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
ppmShipment := BuildPPMShipmentReadyForFinalCustomerCloseOut(suite.DB(), nil, nil)

suite.NotNil(ppmShipment.ActualPickupPostalCode)
suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode)
suite.NotNil(ppmShipment.ActualDestinationPostalCode)
suite.Equal(ppmShipment.DestinationPostalCode,
*ppmShipment.ActualDestinationPostalCode)
suite.NotNil(ppmShipment.AOAPacket)
suite.NotNil(ppmShipment.AOAPacketID)
suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status)
Expand All @@ -259,10 +267,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {

suite.False(ppmShipment.ID.IsNil())
suite.NotNil(ppmShipment.ActualPickupPostalCode)
suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode)
suite.NotNil(ppmShipment.ActualDestinationPostalCode)
suite.Equal(ppmShipment.DestinationPostalCode,
*ppmShipment.ActualDestinationPostalCode)
suite.NotNil(ppmShipment.AOAPacket)
suite.NotNil(ppmShipment.AOAPacketID)
suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status)
Expand All @@ -281,10 +286,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
ppmShipment := BuildPPMShipmentReadyForFinalCustomerCloseOutWithAllDocTypes(suite.DB(), nil)

suite.NotNil(ppmShipment.ActualPickupPostalCode)
suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode)
suite.NotNil(ppmShipment.ActualDestinationPostalCode)
suite.Equal(ppmShipment.DestinationPostalCode,
*ppmShipment.ActualDestinationPostalCode)
suite.NotNil(ppmShipment.AOAPacket)
suite.NotNil(ppmShipment.AOAPacketID)
suite.Equal(models.PPMShipmentStatusWaitingOnCustomer, ppmShipment.Status)
Expand Down Expand Up @@ -314,10 +316,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
ppmShipment := BuildPPMShipmentThatNeedsCloseoutWithAllDocTypes(suite.DB(), nil)

suite.NotNil(ppmShipment.ActualPickupPostalCode)
suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode)
suite.NotNil(ppmShipment.ActualDestinationPostalCode)
suite.Equal(ppmShipment.DestinationPostalCode,
*ppmShipment.ActualDestinationPostalCode)
suite.NotNil(ppmShipment.AOAPacket)
suite.NotNil(ppmShipment.AOAPacketID)
suite.Equal(models.PPMShipmentStatusNeedsCloseout, ppmShipment.Status)
Expand Down Expand Up @@ -347,10 +346,7 @@ func (suite *FactorySuite) TestBuildPPMShipment() {
ppmShipment := BuildPPMShipmentWithApprovedDocumentsMissingPaymentPacket(suite.DB(), nil, nil)

suite.NotNil(ppmShipment.ActualPickupPostalCode)
suite.Equal(ppmShipment.PickupPostalCode, *ppmShipment.ActualPickupPostalCode)
suite.NotNil(ppmShipment.ActualDestinationPostalCode)
suite.Equal(ppmShipment.DestinationPostalCode,
*ppmShipment.ActualDestinationPostalCode)
suite.NotNil(ppmShipment.AOAPacket)
suite.NotNil(ppmShipment.AOAPacketID)
suite.Equal(models.PPMShipmentStatusCloseoutComplete, ppmShipment.Status)
Expand Down
Loading

0 comments on commit b07a7d2

Please sign in to comment.