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

B 21934 int #14629

Merged
merged 26 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9db96ef
Merge remote-tracking branch 'origin/b-21938-entitlement-refactor-mai…
deandreJones Jan 16, 2025
4e79c09
B-21934
deandreJones Jan 7, 2025
13764bc
B-21934
deandreJones Jan 17, 2025
6204fed
B-21934
deandreJones Jan 21, 2025
5dbc184
Merge branch 'integrationTesting' into B-21934-int
deandreJones Jan 21, 2025
62a3b44
merge conflict fixes
deandreJones Jan 21, 2025
f88c16a
Merge branch 'integrationTesting' into B-21934-int
deandreJones Jan 21, 2025
6f96ae7
add tests
deandreJones Jan 22, 2025
c1c37b5
Merge remote-tracking branch 'origin/B-21934-main' into B-21934-int2
deandreJones Jan 22, 2025
0cc7a3a
fix test
deandreJones Jan 22, 2025
9070c36
fix test
deandreJones Jan 22, 2025
b4a649f
fix test add to create orders payload
deandreJones Jan 22, 2025
0e728d4
Merge branch 'integrationTesting' into B-21934-int
deandreJones Jan 22, 2025
2bd35bd
test fix
deandreJones Jan 22, 2025
c3a23c4
test fix
deandreJones Jan 22, 2025
a25402d
missing in payload for v2 and 3
deandreJones Jan 22, 2025
c17a897
Merge remote-tracking branch 'origin/B-21934-main' into B-21934-int2
deandreJones Jan 22, 2025
5f26682
refactored
deandreJones Jan 23, 2025
6061c7b
Merge remote-tracking branch 'origin/B-21934-main' into B-21934-int2
deandreJones Jan 23, 2025
3853b1c
fix dup id
deandreJones Jan 23, 2025
5b9f7ec
Merge remote-tracking branch 'origin/B-21934-main' into B-21934-int2
deandreJones Jan 23, 2025
637cdab
add logging to ecs deploy script
traskowskycaci Jan 23, 2025
cf6ac4c
Revert "add logging to ecs deploy script"
traskowskycaci Jan 23, 2025
3200c4e
add max, fix standards
deandreJones Jan 23, 2025
21612c9
Merge remote-tracking branch 'origin/B-21934-main' into B-21934-int2
deandreJones Jan 23, 2025
07cb5cf
Merge branch 'B-21934-int' of https://github.com/transcom/mymove into…
deandreJones Jan 23, 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
46 changes: 40 additions & 6 deletions pkg/gen/ghcapi/embedded_spec.go

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

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

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

4 changes: 4 additions & 0 deletions pkg/gen/ghcmessages/counseling_update_allowance_payload.go

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

4 changes: 4 additions & 0 deletions pkg/gen/ghcmessages/entitlements.go

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

4 changes: 4 additions & 0 deletions pkg/gen/ghcmessages/update_allowance_payload.go

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

12 changes: 12 additions & 0 deletions pkg/gen/primeapi/embedded_spec.go

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

4 changes: 4 additions & 0 deletions pkg/gen/primemessages/entitlements.go

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

12 changes: 12 additions & 0 deletions pkg/gen/primev2api/embedded_spec.go

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

4 changes: 4 additions & 0 deletions pkg/gen/primev2messages/entitlements.go

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

12 changes: 12 additions & 0 deletions pkg/gen/primev3api/embedded_spec.go

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

4 changes: 4 additions & 0 deletions pkg/gen/primev3messages/entitlements.go

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

10 changes: 10 additions & 0 deletions pkg/gen/supportapi/embedded_spec.go

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

4 changes: 4 additions & 0 deletions pkg/gen/supportmessages/entitlement.go

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

10 changes: 8 additions & 2 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,11 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements {
if entitlement.UBAllowance != nil {
ubAllowance = models.Int64Pointer(int64(*entitlement.UBAllowance))
}
var weightRestriction *int64
if entitlement.WeightRestriction != nil {
weightRestriction = models.Int64Pointer(int64(*entitlement.WeightRestriction))
}

return &ghcmessages.Entitlements{
ID: strfmt.UUID(entitlement.ID.String()),
AuthorizedWeight: authorizedWeight,
Expand All @@ -764,8 +769,9 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements {
AccompaniedTour: accompaniedTour,
UnaccompaniedBaggageAllowance: ubAllowance,
OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment,
GunSafe: gunSafe,
ETag: etag.GenerateEtag(entitlement.UpdatedAt),
GunSafe: gunSafe,
WeightRestriction: weightRestriction,
ETag: etag.GenerateEtag(entitlement.UpdatedAt),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ func (suite *PayloadsSuite) TestEntitlement() {
dependentsTwelveAndOver := 1
authorizedWeight := 8000
ubAllowance := 300
weightRestriction := 1000

entitlement := &models.Entitlement{
ID: entitlementID,
Expand All @@ -658,6 +659,7 @@ func (suite *PayloadsSuite) TestEntitlement() {
DependentsTwelveAndOver: &dependentsTwelveAndOver,
UpdatedAt: time.Now(),
UBAllowance: &ubAllowance,
WeightRestriction: &weightRestriction,
}

returnedEntitlement := Entitlement(entitlement)
Expand All @@ -679,6 +681,7 @@ func (suite *PayloadsSuite) TestEntitlement() {
suite.Equal(models.BoolPointer(accompaniedTour), returnedEntitlement.AccompaniedTour)
suite.Equal(dependentsUnderTwelve, int(*returnedEntitlement.DependentsUnderTwelve))
suite.Equal(dependentsTwelveAndOver, int(*returnedEntitlement.DependentsTwelveAndOver))
suite.Equal(weightRestriction, int(*returnedEntitlement.WeightRestriction))
}

func (suite *PayloadsSuite) TestCreateCustomer() {
Expand Down
2 changes: 2 additions & 0 deletions pkg/handlers/ghcapi/orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (h CreateOrderHandler) Handle(params orderop.CreateOrderParams) middleware.
weightAllotment.UnaccompaniedBaggageAllowance = unaccompaniedBaggageAllowance
}

var weightRestriction *int
entitlement := models.Entitlement{
DependentsAuthorized: payload.HasDependents,
DBAuthorizedWeight: models.IntPointer(weight),
Expand All @@ -275,6 +276,7 @@ func (h CreateOrderHandler) Handle(params orderop.CreateOrderParams) middleware.
DependentsUnderTwelve: dependentsUnderTwelve,
DependentsTwelveAndOver: dependentsTwelveAndOver,
UBAllowance: &weightAllotment.UnaccompaniedBaggageAllowance,
WeightRestriction: weightRestriction,
}

if saveEntitlementErr := appCtx.DB().Save(&entitlement); saveEntitlementErr != nil {
Expand Down
Loading
Loading