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 #14553

Closed
wants to merge 19 commits into from
Closed
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
3 changes: 3 additions & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1071,4 +1071,7 @@
20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql
20250103130619_revert_data_change_for_gbloc_for_ak.up.sql
20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql
20250106153750_admin_weight_restriction.up.sql
20250106190758_admin_weight_restriction_convert_bool.up.sql
20250107184554_add_weight_restriction.up.sql
20250110153428_add_shipment_address_updates_to_move_history.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE entitlements
ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN;
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the bool, ref'ing the other file at migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql with #14525 (comment)

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE entitlements
ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)),
ALTER COLUMN admin_restricted_weight_location SET DEFAULT false,
ALTER COLUMN admin_restricted_weight_location SET NOT NULL;
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there, so this ticket was missing an upstream (Minimal impact), but in the db it was decided that the boolean value is not needed if we have a not null weight_restriction amount

See #14525 (comment)

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE entitlements
ADD column IF NOT EXISTS weight_restriction int;

COMMENT ON COLUMN entitlements.weight_restriction IS 'The weight restricted on the move to a particular location';
4 changes: 4 additions & 0 deletions pkg/factory/entitlement_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai
proGearWeight := 2000
proGearWeightSpouse := 500
ordersType := internalmessages.OrdersTypePERMANENTCHANGEOFSTATION
weightRestriction := 0

// Create default Entitlement
entitlement := models.Entitlement{
Expand All @@ -59,6 +60,8 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
OrganizationalClothingAndIndividualEquipment: ocie,
AdminRestrictedWeightLocation: setBoolPtr(cEntitlement.AdminRestrictedWeightLocation, false),
WeightRestriction: &weightRestriction,
Comment on lines +63 to +64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If weight restriction doesn't exist, this would probably be better off left as nil instead of set to 0

}
// Set default calculated values
entitlement.SetWeightAllotment(string(*grade), ordersType)
Expand All @@ -73,4 +76,5 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai
}

return entitlement

}
60 changes: 60 additions & 0 deletions pkg/gen/ghcapi/embedded_spec.go

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

7 changes: 7 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.

8 changes: 8 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.

7 changes: 7 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.

18 changes: 18 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.

8 changes: 8 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.

18 changes: 18 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.

8 changes: 8 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.

Loading
Loading