diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 79c46d780fd..ab76de035db 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2294,6 +2294,8 @@ func SearchMoves(appCtx appcontext.AppContext, moves models.Moves) *ghcmessages. if err != nil { destinationGBLOC = *ghcmessages.NewGBLOC("") + } else if customer.Affiliation.String() == "MARINES" { + destinationGBLOC = ghcmessages.GBLOC("USMC/" + PostalCodeToGBLOC.GBLOC) } else { destinationGBLOC = ghcmessages.GBLOC(PostalCodeToGBLOC.GBLOC) } diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index 071e410967f..5bb3db594b5 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -6,6 +6,7 @@ import ( "github.com/gofrs/uuid" + "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/gen/ghcmessages" "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/models" @@ -350,3 +351,24 @@ func (suite *PayloadsSuite) TestCreateCustomer() { suite.IsType(returnedShipmentAddressUpdate, &ghcmessages.CreatedCustomer{}) }) } + +func (suite *PayloadsSuite) TestSearchMoves() { + appCtx := suite.AppContextForTest() + + marines := models.AffiliationMARINES + moveUSMC := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: models.ServiceMember{ + Affiliation: &marines, + }, + }, + }, nil) + + moves := models.Moves{moveUSMC} + suite.Run("Success - Returns a ghcmessages Upload payload from Upload Struct", func() { + payload := SearchMoves(appCtx, moves) + + suite.IsType(payload, &ghcmessages.SearchMoves{}) + suite.NotNil(payload) + }) +} diff --git a/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx b/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx index e181bcc952e..635932cf4f1 100644 --- a/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx +++ b/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx @@ -1,6 +1,6 @@ import React from 'react'; import * as PropTypes from 'prop-types'; -import { generatePath } from 'react-router-dom'; +import { generatePath, useParams, useNavigate } from 'react-router-dom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import styles from './RequestedShipments.module.scss'; @@ -14,6 +14,10 @@ import shipmentCardsStyles from 'styles/shipmentCards.module.scss'; import { MTOServiceItemShape, OrdersInfoShape } from 'types/order'; import { ShipmentShape } from 'types/shipment'; import { formatDateFromIso } from 'utils/formatters'; +import ButtonDropdown from 'components/ButtonDropdown/ButtonDropdown'; +import { SHIPMENT_OPTIONS_URL } from 'shared/constants'; +import Restricted from 'components/Restricted/Restricted'; +import { permissionTypes } from 'constants/permissions'; // nts defaults show preferred pickup date and pickup address, flagged items when collapsed // ntsr defaults shows preferred delivery date, storage facility address, destination address, flagged items when collapsed @@ -66,11 +70,54 @@ const ApprovedRequestedShipments = ({ }; }; + const { moveCode } = useParams(); + const navigate = useNavigate(); + const handleButtonDropdownChange = (e) => { + const selectedOption = e.target.value; + + const addShipmentPath = `${generatePath(tooRoutes.SHIPMENT_ADD_PATH, { + moveCode, + shipmentType: selectedOption, + })}`; + + navigate(addShipmentPath); + }; + const dutyLocationPostal = { postalCode: ordersInfo.newDutyLocation?.address?.postalCode }; return (