Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into INT-B-19226-onboarding-require…
Browse files Browse the repository at this point in the history
…d-fields
  • Loading branch information
brooklyn-welsh authored Aug 28, 2024
2 parents 54f4090 + bbb310a commit 4f09407
Show file tree
Hide file tree
Showing 232 changed files with 15,116 additions and 7,568 deletions.
8 changes: 4 additions & 4 deletions cmd/pptas-api-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ func main() {
}
initRootFlags(root.PersistentFlags())

listMovesCommand := &cobra.Command{
PPTASReportsCommand := &cobra.Command{
Use: "list-moves",
Short: "An optimized fetch for all moves available to Prime",
Long: "Fetches moves that are available to Prime quickly, without all the data for nested objects.",
RunE: pptas.ListMoves,
RunE: pptas.PPTASReports,
SilenceUsage: true,
}
pptas.InitListMovesFlags(listMovesCommand.Flags())
root.AddCommand(listMovesCommand)
pptas.InitPPTASReportsFlags(PPTASReportsCommand.Flags())
root.AddCommand(PPTASReportsCommand)

if err := root.Execute(); err != nil {
panic(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"github.com/transcom/mymove/pkg/gen/pptasmessages"
)

// InitListMovesFlags declares which flags are enabled
func InitListMovesFlags(flag *pflag.FlagSet) {
// InitPPTASReportsFlags declares which flags are enabled
func InitPPTASReportsFlags(flag *pflag.FlagSet) {
flag.String(utils.SinceFlag, "", "Timestamp for filtering moves. Returns moves updated since this time.")
flag.SortFlags = false
}

func checkListMovesConfig(v *viper.Viper, logger *log.Logger) error {
func checkPPTASReportsConfig(v *viper.Viper, logger *log.Logger) error {
err := utils.CheckRootConfig(v)
if err != nil {
logger.Fatal(err)
Expand All @@ -32,8 +32,8 @@ func checkListMovesConfig(v *viper.Viper, logger *log.Logger) error {
return nil
}

// ListMoves creates a gateway and sends the request to the endpoint
func ListMoves(cmd *cobra.Command, args []string) error {
// PPTASReports creates a gateway and sends the request to the endpoint
func PPTASReports(cmd *cobra.Command, args []string) error {
v := viper.New()

//Create the logger
Expand All @@ -46,13 +46,13 @@ func ListMoves(cmd *cobra.Command, args []string) error {
}

// Check the config before talking to the CAC
err := checkListMovesConfig(v, logger)
err := checkPPTASReportsConfig(v, logger)
if err != nil {
logger.Fatal(err)
}

// Get the since param, if any
var params moves.ListMovesParams
var params moves.PptasReportsParams
since := v.GetString(utils.SinceFlag)
if since != "" {
sinceDateTime, sinceErr := strfmt.ParseDateTime(since)
Expand Down Expand Up @@ -81,10 +81,10 @@ func ListMoves(cmd *cobra.Command, args []string) error {
// commands, so start with list moves for now
wait := v.GetDuration(utils.WaitFlag)
params.SetTimeout(wait)
var payload pptasmessages.ListMoves
var payload pptasmessages.PPTASReports
// loop until we either time out or get a successful response
for {
resp, err := primeGateway.Moves.ListMoves(&params)
resp, err := primeGateway.Moves.PptasReports(&params)
if err != nil {
currentTime := time.Now()
if currentTime.Sub(startTime) > wait {
Expand Down
41 changes: 0 additions & 41 deletions cmd/prime-api-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,47 +110,6 @@ func main() {
support.InitCreateMTOFlags(createMTOCommand.Flags())
root.AddCommand(createMTOCommand)

createMTOShipmentCommand := &cobra.Command{
Use: "create-mto-shipment",
Short: "Create MTO shipment",
Long: `
This command creates a MTO shipment.
It requires the caller to pass in a file using the --filename arg.
The file should contain a body defining the MTOShipment object.
Endpoint path: /mto-shipments
The file should contain json as follows:
{
"body": <MTOShipment>,
}
Please see API documentation for full details on the endpoint definition.`,
RunE: prime.CreateMTOShipment,
SilenceUsage: true,
}
prime.InitCreateMTOShipmentFlags(createMTOShipmentCommand.Flags())
root.AddCommand(createMTOShipmentCommand)

updateMTOShipmentCommand := &cobra.Command{
Use: "update-mto-shipment",
Short: "Update MTO shipment",
Long: `
This command updates an MTO shipment.
It requires the caller to pass in a file using the --filename arg.
The file should contain path parameters, headers and a body for the payload.
Endpoint path: /mto-shipments/{mtoShipmentID}
The file should contain json as follows:
{
"mtoShipmentID": <uuid string>,
"ifMatch": <eTag>,
"body": <MTOShipment>
}
Please see API documentation for full details on the endpoint definition.`,
RunE: prime.UpdateMTOShipment,
SilenceUsage: true,
}
prime.InitUpdateMTOShipmentFlags(updateMTOShipmentCommand.Flags())
root.AddCommand(updateMTOShipmentCommand)

updateMTOShipmentStatusCommand := &cobra.Command{
Use: "update-mto-shipment-status",
Short: "Update MTO shipment status",
Expand Down
98 changes: 0 additions & 98 deletions cmd/prime-api-client/prime/create_mto_shipment.go

This file was deleted.

98 changes: 0 additions & 98 deletions cmd/prime-api-client/prime/update_mto_shipment.go

This file was deleted.

5 changes: 5 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ module.exports = {
}
});

config.output = {
...config.output,
publicPath: '/',
};

return config;
},
jest: (config) => {
Expand Down
1 change: 1 addition & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@
20240801135811_create_mobile_home.up.sql
20240801135833_alter_mto_shipment_type_motorhome.up.sql
20240802161708_tpps_paid_invoice_table.up.sql
20240805234231_update_us_post_region_cities_state.up.sql
20240806151051_update_pws_violations.up.sql
20240806230447_add_rotation_to_uploads.up.sql
20240807140736_add_locked_price_cents_to_mto_service_items.up.sql
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPDATE us_post_region_cities SET state = '' WHERE state IS null;
ALTER TABLE public.us_post_region_cities ALTER COLUMN state SET NOT NULL;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@opentelemetry/core": "^1.15.1",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-query-devtools": "^5.17.12",
"@transcom/react-file-viewer": "git+https://github.com/transcom/react-file-viewer#v1.2.2",
"@transcom/react-file-viewer": "git+https://github.com/transcom/react-file-viewer#v1.2.4",
"@trussworks/react-uswds": "3.2.0",
"axe-playwright": "^1.2.3",
"bytes": "^3.1.2",
Expand Down
1 change: 1 addition & 0 deletions pkg/edi/tpps_paid_invoice_report/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func ParseTPPSReportEntryForOneRow(row []string, columnIndexes map[string]int, h
}
}
processedEntry = strings.TrimSpace(processedEntry)
processedEntry = strings.TrimLeft(processedEntry, "�")
// After we have fully processed an entry and have built a string, store it
processedTPPSReportEntryForOnePaymentRequest = append(processedTPPSReportEntryForOnePaymentRequest, processedEntry)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/factory/us_post_region_city_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func BuildUsPostRegionCity(db *pop.Connection, customs []Customization, traits [
UsprcPrfdLstLineCtystNm: "MacDill",
UsprcCountyNm: "Hillsborough",
CtryGencDgphCd: "US",
State: "FL",
}

testdatagen.MergeModels(&usPostRegionCity, cUsPostRegionCity)
Expand Down
1 change: 1 addition & 0 deletions pkg/factory/us_post_region_city_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func (suite *FactorySuite) TestBuildUsPostRegionCity() {
UsprcPrfdLstLineCtystNm: "MacDill",
UsprcCountyNm: "Hillsborough",
CtryGencDgphCd: "US",
State: "FL",
}

suite.Run("Successful creation of default UsPostRegionCity", func() {
Expand Down
Loading

0 comments on commit 4f09407

Please sign in to comment.