Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Int b 22633 #14929

Open
wants to merge 33 commits into
base: integrationTesting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
93499f5
initial merge of main with new migration process
MInthavongsay Feb 21, 2025
4e72bd7
Merge branch 'main' into B-21423-Prime-Int-SIT-Service-Item
MInthavongsay Feb 21, 2025
a7b9925
Merge branch 'main' into B-21423-Prime-Int-SIT-Service-Item
r-mettler Feb 24, 2025
ca78918
Merge branch 'main' into B-21322-MAIN
traskowskycaci Feb 25, 2025
2fdfda4
MAIN rebase
MInthavongsay Feb 25, 2025
016ceea
Merge branch 'B-21423-Prime-Int-SIT-Service-Item' of github.com:trans…
MInthavongsay Feb 25, 2025
305b80e
Merge branch 'main' into B-21322-MAIN
traskowskycaci Feb 26, 2025
9389f9a
Merge branch 'main' into MAIN-B-21669-doc_viewer_file_upload_status_p…
samaysofo Feb 26, 2025
2cee433
Merge branch 'main' into B-21322-MAIN
traskowskycaci Feb 27, 2025
e65617d
Merge pull request #14233 from transcom/B-21322-MAIN
deandreJones Feb 27, 2025
45f5ba1
Merge branch 'main' into MAIN-B-21669-doc_viewer_file_upload_status_p…
samaysofo Feb 27, 2025
92c6140
Merge pull request #14909 from transcom/MAIN-B-21669-doc_viewer_file_…
brianmanley-caci Feb 28, 2025
34a4c24
Merge branch 'main' into MAIN-B-22653
danieljordan-caci Feb 28, 2025
18ec23f
Merge branch 'main' into MAIN-B-22769
danieljordan-caci Feb 28, 2025
e33868a
Merge remote-tracking branch 'origin/main' into MAIN-B-22660
danieljordan-caci Feb 28, 2025
6d24c0c
Merge pull request #14880 from transcom/MAIN-B-22660
deandreJones Feb 28, 2025
bc75feb
MAIN rebase
MInthavongsay Feb 28, 2025
ee87859
Merge branch 'main' into B-21423-Prime-Int-SIT-Service-Item
MInthavongsay Feb 28, 2025
20ef47d
Merge branch 'main' into MAIN-B-22769
danieljordan-caci Feb 28, 2025
e6e80e5
Merge pull request #14672 from transcom/B-21423-Prime-Int-SIT-Service…
r-mettler Feb 28, 2025
069057c
Merge branch 'main' into MAIN-B-22769
danieljordan-caci Feb 28, 2025
df502ed
Merge pull request #14874 from transcom/MAIN-B-22769
deandreJones Feb 28, 2025
3863d37
Merge branch 'main' into MAIN-B-22653
danieljordan-caci Feb 28, 2025
8ea5f45
Merge pull request #14889 from transcom/MAIN-B-22653
deandreJones Feb 28, 2025
26f8d3a
Feature and testing
antgmann Mar 2, 2025
b541e41
Merge main
antgmann Mar 2, 2025
88145ad
Additional test fixes
antgmann Mar 2, 2025
770ad75
Merge in feature
antgmann Mar 3, 2025
a85950b
Comment removal and testing
antgmann Mar 3, 2025
ffbdd62
Merge branch 'B-22633-SC-PPM' into INT-B-22633
antgmann Mar 3, 2025
85ef24b
Backend PPM test
antgmann Mar 3, 2025
b928e54
Merge branch 'B-22633-SC-PPM' into INT-B-22633
antgmann Mar 3, 2025
a5674ac
Merge branch 'integrationTesting' into INT-B-22633
antgmann Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 52 additions & 4 deletions pkg/handlers/ghcapi/mto_shipment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import (
"github.com/stretchr/testify/mock"

"github.com/transcom/mymove/pkg/apperror"
"github.com/transcom/mymove/pkg/auth"
"github.com/transcom/mymove/pkg/etag"
"github.com/transcom/mymove/pkg/factory"
mtoshipmentops "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_shipment"
shipmentops "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/shipment"
"github.com/transcom/mymove/pkg/gen/ghcmessages"
"github.com/transcom/mymove/pkg/handlers"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/models/roles"
roles "github.com/transcom/mymove/pkg/models/roles"
routemocks "github.com/transcom/mymove/pkg/route/mocks"
"github.com/transcom/mymove/pkg/services"
"github.com/transcom/mymove/pkg/services/address"
Expand Down Expand Up @@ -4085,8 +4086,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() {
StreetAddress3: expectedSecondaryDestinationAddress.StreetAddress3,
}

// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &ghcmessages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: &shipmentType,
Expand Down Expand Up @@ -4252,9 +4269,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() {
}

req := httptest.NewRequest("POST", "/mto-shipments", nil)
// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &ghcmessages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: &shipmentType,
Expand Down Expand Up @@ -4403,8 +4435,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandlerUsingPPM() {

req := httptest.NewRequest("POST", "/mto-shipments", nil)

// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &ghcmessages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: &shipmentType,
Expand Down
20 changes: 19 additions & 1 deletion pkg/handlers/primeapiv2/mto_shipment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import (
"github.com/stretchr/testify/mock"

"github.com/transcom/mymove/pkg/apperror"
"github.com/transcom/mymove/pkg/auth"
"github.com/transcom/mymove/pkg/factory"
mtoshipmentops "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/mto_shipment"
"github.com/transcom/mymove/pkg/gen/primev2messages"
"github.com/transcom/mymove/pkg/handlers"
"github.com/transcom/mymove/pkg/handlers/primeapiv2/payloads"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/models/roles"
routemocks "github.com/transcom/mymove/pkg/route/mocks"
"github.com/transcom/mymove/pkg/services"
"github.com/transcom/mymove/pkg/services/address"
Expand Down Expand Up @@ -276,8 +278,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() {
estimatedIncentive := 123456
sitEstimatedCost := 67500

// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &primev2messages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: primev2messages.NewMTOShipmentType(primev2messages.MTOShipmentTypePPM),
Expand Down
38 changes: 36 additions & 2 deletions pkg/handlers/primeapiv3/mto_shipment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import (
"go.uber.org/zap"

"github.com/transcom/mymove/pkg/apperror"
"github.com/transcom/mymove/pkg/auth"
"github.com/transcom/mymove/pkg/etag"
"github.com/transcom/mymove/pkg/factory"
mtoshipmentops "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/mto_shipment"
"github.com/transcom/mymove/pkg/gen/primev3messages"
"github.com/transcom/mymove/pkg/handlers"
"github.com/transcom/mymove/pkg/handlers/primeapiv3/payloads"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/models/roles"
routemocks "github.com/transcom/mymove/pkg/route/mocks"
"github.com/transcom/mymove/pkg/services"
"github.com/transcom/mymove/pkg/services/address"
Expand Down Expand Up @@ -469,8 +471,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() {
StreetAddress3: expectedTertiaryDestinationAddress.StreetAddress3,
}

// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &primev3messages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: primev3messages.NewMTOShipmentType(primev3messages.MTOShipmentTypePPM),
Expand Down Expand Up @@ -778,8 +796,24 @@ func (suite *HandlerSuite) TestCreateMTOShipmentHandler() {
StreetAddress3: addressWithEmptyStreet1.StreetAddress3,
}

// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}
ctx := auth.SetSessionInRequestContext(req, session)

params := mtoshipmentops.CreateMTOShipmentParams{
HTTPRequest: req,
HTTPRequest: req.WithContext(ctx),
Body: &primev3messages.CreateMTOShipment{
MoveTaskOrderID: handlers.FmtUUID(move.ID),
ShipmentType: primev3messages.NewMTOShipmentType(primev3messages.MTOShipmentTypePPM),
Expand Down
2 changes: 1 addition & 1 deletion pkg/models/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type Move struct {
TOODestinationAssignedUser *OfficeUser `json:"too_destination_assigned" belongs_to:"office_users" fk_id:"too_destination_assigned_id"`
CounselingOfficeID *uuid.UUID `json:"counseling_transportation_office_id" db:"counseling_transportation_office_id"`
CounselingOffice *TransportationOffice `json:"counseling_transportation_office" belongs_to:"transportation_offices" fk_id:"counseling_transportation_office_id"`
PrimeAcknowledgedAt *time.Time `db:"prime_acknowledged_at"`
PrimeAcknowledgedAt *time.Time `db:"prime_acknowledged_at"`
}

type MoveWithEarliestDate struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/models/mto_shipments.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ type MTOShipment struct {
DestinationSITAuthEndDate *time.Time `json:"destination_sit_auth_end_date" db:"dest_sit_auth_end_date"`
MobileHome *MobileHome `json:"mobile_home" has_one:"mobile_home" fk_id:"shipment_id"`
MarketCode MarketCode `json:"market_code" db:"market_code"`
PrimeAcknowledgedAt *time.Time `db:"prime_acknowledged_at"`
PrimeAcknowledgedAt *time.Time `db:"prime_acknowledged_at"`
}

// TableName overrides the table name used by Pop.
Expand Down
18 changes: 18 additions & 0 deletions pkg/services/mocks/MoveTaskOrderUpdater.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/services/move_task_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type MoveTaskOrderUpdater interface {
ShowHide(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, show *bool) (*models.Move, error)
UpdatePPMType(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, error)
MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, bool, error)
SignCertificationPPMCounselingCompleted(appCtx appcontext.AppContext, moveID uuid.UUID, ppmShipmentID uuid.UUID) error
}

// MoveTaskOrderChecker is the service object interface for checking if a MoveTaskOrder is in a certain state
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/move_task_order/move_task_order_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (o moveTaskOrderUpdater) UpdateStatusServiceCounselingCompleted(appCtx appc
return err
}

err = o.signCertificationPPMCounselingCompleted(appCtx, move.ID, move.MTOShipments[i].PPMShipment.ID)
err = o.SignCertificationPPMCounselingCompleted(appCtx, move.ID, move.MTOShipments[i].PPMShipment.ID)
if err != nil {
return err
}
Expand Down Expand Up @@ -527,7 +527,7 @@ func (o moveTaskOrderUpdater) UpdatePPMType(appCtx appcontext.AppContext, moveTa
return updatedMove, nil
}

func (o moveTaskOrderUpdater) signCertificationPPMCounselingCompleted(appCtx appcontext.AppContext, moveID uuid.UUID, ppmShipmentID uuid.UUID) error {
func (o moveTaskOrderUpdater) SignCertificationPPMCounselingCompleted(appCtx appcontext.AppContext, moveID uuid.UUID, ppmShipmentID uuid.UUID) error {
// Retrieve if PPM has certificate
signedCertifications, err := models.FetchSignedCertificationPPMByType(appCtx.DB(), appCtx.Session(), moveID, ppmShipmentID, models.SignedCertificationTypePreCloseoutReviewedPPMPAYMENT)
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions pkg/services/orchestrators/shipment/shipment_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/transcom/mymove/pkg/appcontext"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/models/roles"
"github.com/transcom/mymove/pkg/services"
)

Expand Down Expand Up @@ -89,6 +90,13 @@ func (s *shipmentCreator) CreateShipment(appCtx appcontext.AppContext, shipment
return err
}

if txnAppCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) {
err = s.moveTaskOrderUpdater.SignCertificationPPMCounselingCompleted(txnAppCtx, mtoShipment.MoveTaskOrderID, mtoShipment.PPMShipment.ID)
if err != nil {
return err
}
}

// Update PPMType once shipment gets created.
_, err = s.moveTaskOrderUpdater.UpdatePPMType(txnAppCtx, mtoShipment.MoveTaskOrderID)
if err != nil {
Expand Down
52 changes: 49 additions & 3 deletions pkg/services/orchestrators/shipment/shipment_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (

"github.com/transcom/mymove/pkg/appcontext"
"github.com/transcom/mymove/pkg/apperror"
"github.com/transcom/mymove/pkg/auth"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/models/roles"
"github.com/transcom/mymove/pkg/services"
"github.com/transcom/mymove/pkg/services/mocks"
mtoshipment "github.com/transcom/mymove/pkg/services/mto_shipment"
Expand Down Expand Up @@ -174,8 +176,22 @@ func (suite *ShipmentSuite) TestCreateShipment() {

suite.Run(fmt.Sprintf("Sets status as expected: %s", name), func() {
subtestData := makeSubtestData(false, false)
// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}

mtoShipment, err := subtestData.shipmentCreatorOrchestrator.CreateShipment(suite.AppContextForTest(), &tc.shipment)
mtoShipment, err := subtestData.shipmentCreatorOrchestrator.CreateShipment(suite.AppContextWithSessionForTest(session), &tc.shipment)

suite.Nil(err)

Expand Down Expand Up @@ -203,7 +219,22 @@ func (suite *ShipmentSuite) TestCreateShipment() {
shipment := shipment

suite.Run(fmt.Sprintf("Calls necessary service objects for %s shipments", shipment.ShipmentType), func() {
appCtx := suite.AppContextForTest()
// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}

appCtx := suite.AppContextWithSessionForTest(session)

subtestData := makeSubtestData(false, false)

Expand Down Expand Up @@ -252,7 +283,22 @@ func (suite *ShipmentSuite) TestCreateShipment() {
PPMShipment: &models.PPMShipment{},
}

mtoShipment, err := subtestData.shipmentCreatorOrchestrator.CreateShipment(suite.AppContextForTest(), shipment)
// Need a logged in user
lgu := uuid.Must(uuid.NewV4()).String()
user := models.User{
OktaID: lgu,
OktaEmail: "email@example.com",
}
suite.MustSave(&user)

session := &auth.Session{
ApplicationName: auth.OfficeApp,
UserID: user.ID,
IDToken: "fake token",
Roles: roles.Roles{},
}

mtoShipment, err := subtestData.shipmentCreatorOrchestrator.CreateShipment(suite.AppContextWithSessionForTest(session), shipment)

suite.NoError(err)

Expand Down
Loading