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-21577 Limit UB weight allowance based on Student Travel order type. #14285

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion pkg/models/entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,12 @@ func GetUBWeightAllowance(appCtx appcontext.AppContext, originDutyLocationIsOcon
const dependents12AndOverUBAllowance = 350
const depedentsUnder12UBAllowance = 175
const maxWholeFamilyCivilianUBAllowance = 2000
const studentTravelMaxAllowance = 350
ubAllowance := 0

if orderPayGrade == string(internalmessages.OrderPayGradeCIVILIANEMPLOYEE) && dependentsAreAuthorized && underTwelveDependents == 0 && twelveAndOverDependents == 0 {
if *orderType == internalmessages.OrdersTypeSTUDENTTRAVEL {
traskowskycaci marked this conversation as resolved.
Show resolved Hide resolved
ubAllowance = studentTravelMaxAllowance
} else if orderPayGrade == string(internalmessages.OrderPayGradeCIVILIANEMPLOYEE) && dependentsAreAuthorized && underTwelveDependents == 0 && twelveAndOverDependents == 0 {
ubAllowance = civilianBaseUBAllowance
} else if orderPayGrade == string(internalmessages.OrderPayGradeCIVILIANEMPLOYEE) && dependentsAreAuthorized && (underTwelveDependents > 0 || twelveAndOverDependents > 0) {
ubAllowance = civilianBaseUBAllowance
Expand Down
8 changes: 8 additions & 0 deletions pkg/models/entitlements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ func (suite *ModelSuite) TestGetUBWeightAllowanceCivilians() {
suite.Assertions.NotEqual(civilianPlusDependentsTotalBaggageAllowance, ubAllowance)
suite.Assertions.Equal(maxWholeFamilyCivilianUBAllowanceTestConstant, ubAllowance)
})

orderType = internalmessages.OrdersTypeSTUDENTTRAVEL
// This should limit the ub allowance to 350 lbs because it is a Student Travel order type
suite.Run("UB allowance is set to 350 for Student Travel orders", func() {
ubAllowance, err := models.GetUBWeightAllowance(appCtx, &originDutyLocationIsOconus, &newDutyLocationIsOconus, &branch, &grade, &orderType, &dependentsAuthorized, &isAccompaniedTour, &dependentsUnderTwelve, &dependentsTwelveAndOver)
suite.NoError(err)
suite.Assertions.Equal(350, ubAllowance)
})
}

func (suite *ModelSuite) TestGetUBWeightAllowanceEdgeCases() {
Expand Down