Skip to content

Commit

Permalink
add test case that was lost in merge
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstonebraker committed Feb 24, 2025
1 parent 0e3e1c1 commit c0b23e9
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions pkg/services/move/move_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,90 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentSC() {
suite.Equal(1, len(moves))
suite.NotEqual(marinePPM.ID, moves[0].ID)
})

suite.Run("Closeout returns non Navy/USCG/USMC ppms in needs closeout status", func() {
moveFetcher := NewMoveFetcherBulkAssignment()
transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil)
officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{
{
Model: transportationOffice,
LinkOnly: true,
Type: &factory.TransportationOffices.CloseoutOffice,
},
}, []roles.RoleType{roles.RoleTypeServicesCounselor})

submittedAt := time.Now()

// create non USMC/USCG/NAVY ppm in need closeout status
factory.BuildMoveWithPPMShipment(suite.DB(), []factory.Customization{
{
Model: transportationOffice,
LinkOnly: true,
Type: &factory.TransportationOffices.CloseoutOffice,
},
{
Model: models.PPMShipment{
Status: models.PPMShipmentStatusNeedsCloseout,
SubmittedAt: &submittedAt,
},
},
{
Model: models.Move{
Status: models.MoveStatusAPPROVED,
},
},
}, nil)

// create non closeout needed ppm
factory.BuildMoveWithPPMShipment(suite.DB(), []factory.Customization{
{
Model: transportationOffice,
LinkOnly: true,
Type: &factory.TransportationOffices.CloseoutOffice,
},
{
Model: models.PPMShipment{
Status: models.PPMShipmentStatusWaitingOnCustomer,
SubmittedAt: &submittedAt,
},
},
{
Model: models.Move{
Status: models.MoveStatusAPPROVED,
},
},
}, nil)

marine := models.AffiliationMARINES
marinePPM := factory.BuildPPMShipment(suite.DB(), []factory.Customization{
{
Model: models.Move{
Status: models.MoveStatusAPPROVED,
},
},
{
Model: models.MTOShipment{
ShipmentType: models.MTOShipmentTypePPM,
},
},
{
Model: models.PPMShipment{
Status: models.PPMShipmentStatusNeedsCloseout,
SubmittedAt: &submittedAt,
},
},
{
Model: models.ServiceMember{
Affiliation: &marine,
},
},
}, nil)

moves, err := moveFetcher.FetchMovesForBulkAssignmentCloseout(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID)
suite.FatalNoError(err)
suite.Equal(1, len(moves))
suite.NotEqual(marinePPM.ID, moves[0].ID)
})
}

func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentTOO() {
Expand Down

0 comments on commit c0b23e9

Please sign in to comment.