diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 111597a6ea9..5f49076d209 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -8072,7 +8072,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, @@ -24555,7 +24555,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 9cd42e9b246..2ee15f3d03a 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -89,7 +89,7 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 - UbAllowance *int64 `json:"ubAllowance,omitempty"` + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index eafb712633b..4968eb31f2f 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1791,7 +1791,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, @@ -6621,7 +6621,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index f1aaf7e957f..c51ada24273 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -78,7 +78,7 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 - UbAllowance *int64 `json:"ubAllowance,omitempty"` + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 712745eb1d9..b8386d10e79 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -1027,7 +1027,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, @@ -4624,7 +4624,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index 14f77a0d3e2..e29d3f733e3 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -78,7 +78,7 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 - UbAllowance *int64 `json:"ubAllowance,omitempty"` + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index 5c74db9c476..12fc6d6316a 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1189,7 +1189,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, @@ -5307,7 +5307,7 @@ func init() { "x-formatting": "weight", "example": 500 }, - "ubAllowance": { + "unaccompaniedBaggageAllowance": { "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", "type": "integer", "x-nullable": true, diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index 3941d353caf..1e228c6350f 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -78,7 +78,7 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 - UbAllowance *int64 `json:"ubAllowance,omitempty"` + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 73ec4c2a19f..11683bc1e34 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1177,6 +1177,12 @@ func init() { "type": "integer", "x-formatting": "weight", "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 } } }, @@ -4034,6 +4040,12 @@ func init() { "type": "integer", "x-formatting": "weight", "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 } } }, diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index ead88e4d83f..434ad8aeed3 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -77,6 +77,10 @@ type Entitlement struct { // total weight // Example: 500 TotalWeight int64 `json:"totalWeight,omitempty"` + + // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. + // Example: 3 + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` } // Validate validates this entitlement diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index c6157c0377e..ebfbf27c303 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -748,7 +748,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { DependentsUnderTwelve: dependentsUnderTwelve, DependentsTwelveAndOver: dependentsTwelveAndOver, AccompaniedTour: accompaniedTour, - UbAllowance: ubAllowance, + UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, GunSafe: gunSafe, ETag: etag.GenerateEtag(entitlement.UpdatedAt), diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index c86e3d7d24b..b46c271c85b 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -476,7 +476,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(entitlement.DependentsAuthorized, returnedEntitlement.DependentsAuthorized) suite.Equal(entitlement.NonTemporaryStorage, returnedEntitlement.NonTemporaryStorage) suite.Equal(entitlement.PrivatelyOwnedVehicle, returnedEntitlement.PrivatelyOwnedVehicle) - suite.Equal(int(*returnedUBAllowance), int(*returnedEntitlement.UbAllowance)) + suite.Equal(int(*returnedUBAllowance), int(*returnedEntitlement.UnaccompaniedBaggageAllowance)) suite.Equal(int64(proGearWeight), returnedEntitlement.ProGearWeight) suite.Equal(int64(proGearWeightSpouse), returnedEntitlement.ProGearWeightSpouse) suite.Equal(storageInTransit, int(*returnedEntitlement.StorageInTransit)) diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 32fbcde6cec..eaa673ae460 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -207,9 +207,14 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { if entitlement.TotalDependents != nil { totalDependents = int64(*entitlement.TotalDependents) } + var ubAllowance int64 + if entitlement.UBAllowance != nil { + ubAllowance = int64(*entitlement.UBAllowance) + } return &primemessages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, + UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, NonTemporaryStorage: entitlement.NonTemporaryStorage, diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go index 74e90a5ee3c..5782c851928 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go @@ -278,6 +278,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: nil, PrivatelyOwnedVehicle: nil, DBAuthorizedWeight: nil, + UBAllowance: nil, StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, @@ -306,6 +307,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.StorageInTransit) suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) + suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { @@ -316,6 +318,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -337,6 +340,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) suite.Equal(int64(9000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) @@ -355,6 +359,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -376,6 +381,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) suite.Equal(int64(7000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index e7350548dd9..43225630d05 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -152,9 +152,14 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements if entitlement.TotalDependents != nil { totalDependents = int64(*entitlement.TotalDependents) } + var ubAllowance int64 + if entitlement.UBAllowance != nil { + ubAllowance = int64(*entitlement.UBAllowance) + } return &primev2messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, + UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, NonTemporaryStorage: entitlement.NonTemporaryStorage, diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go index ba3a804b267..36365746b9a 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go @@ -224,6 +224,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: nil, PrivatelyOwnedVehicle: nil, DBAuthorizedWeight: nil, + UBAllowance: nil, StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, @@ -252,6 +253,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.StorageInTransit) suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) + suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { @@ -262,6 +264,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -283,6 +286,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) suite.Equal(int64(9000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) @@ -301,6 +305,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -322,6 +327,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) suite.Equal(int64(7000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index ab2655b1bd8..d6835dd3856 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -152,9 +152,14 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements if entitlement.TotalDependents != nil { totalDependents = int64(*entitlement.TotalDependents) } + var ubAllowance int64 + if entitlement.UBAllowance != nil { + ubAllowance = int64(*entitlement.UBAllowance) + } return &primev3messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, + UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index c22dea1582d..b70750d9069 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -240,6 +240,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: nil, PrivatelyOwnedVehicle: nil, DBAuthorizedWeight: nil, + UBAllowance: nil, StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, @@ -268,6 +269,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.StorageInTransit) suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) + suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { @@ -278,6 +280,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -299,6 +302,8 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(int64(9000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) @@ -317,6 +322,7 @@ func (suite *PayloadsSuite) TestEntitlement() { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -338,6 +344,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.True(*payload.NonTemporaryStorage) suite.True(*payload.PrivatelyOwnedVehicle) suite.Equal(int64(10000), *payload.AuthorizedWeight) + suite.Equal(int64(400), *payload.UnaccompaniedBaggageAllowance) suite.Equal(int64(7000), payload.TotalWeight) suite.Equal(int64(45), payload.StorageInTransit) suite.Equal(int64(500), payload.RequiredMedicalEquipmentWeight) diff --git a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go index 6f234e1321b..c760d556825 100644 --- a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go @@ -147,9 +147,14 @@ func Entitlement(entitlement *models.Entitlement) *supportmessages.Entitlement { if entitlement.TotalDependents != nil { totalDependents = int64(*entitlement.TotalDependents) } + var ubAllowance int64 + if entitlement.UBAllowance != nil { + ubAllowance = int64(*entitlement.UBAllowance) + } return &supportmessages.Entitlement{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, + UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, diff --git a/pkg/handlers/supportapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/supportapi/internal/payloads/model_to_payload_test.go index 21ab990bce2..c518eeedc70 100644 --- a/pkg/handlers/supportapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/supportapi/internal/payloads/model_to_payload_test.go @@ -28,6 +28,7 @@ func TestEntitlement(t *testing.T) { NonTemporaryStorage: nil, PrivatelyOwnedVehicle: nil, DBAuthorizedWeight: nil, + UBAllowance: nil, StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, @@ -56,6 +57,7 @@ func TestEntitlement(t *testing.T) { assert.Equal(t, int64(0), payload.StorageInTransit) assert.Equal(t, int64(0), payload.TotalDependents) assert.Equal(t, int64(0), payload.TotalWeight) + assert.Equal(t, int64(0), *payload.UnaccompaniedBaggageAllowance) }) t.Run("Success - Returns the entitlement payload with all optional fields populated", func(t *testing.T) { @@ -66,6 +68,7 @@ func TestEntitlement(t *testing.T) { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -87,6 +90,7 @@ func TestEntitlement(t *testing.T) { assert.True(t, *payload.NonTemporaryStorage) assert.True(t, *payload.PrivatelyOwnedVehicle) assert.Equal(t, int64(10000), *payload.AuthorizedWeight) + assert.Equal(t, int64(400), *payload.UnaccompaniedBaggageAllowance) assert.Equal(t, int64(9000), payload.TotalWeight) assert.Equal(t, int64(45), payload.StorageInTransit) assert.Equal(t, int64(500), payload.RequiredMedicalEquipmentWeight) @@ -105,6 +109,7 @@ func TestEntitlement(t *testing.T) { NonTemporaryStorage: handlers.FmtBool(true), PrivatelyOwnedVehicle: handlers.FmtBool(true), DBAuthorizedWeight: handlers.FmtInt(10000), + UBAllowance: handlers.FmtInt(400), StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, @@ -126,6 +131,7 @@ func TestEntitlement(t *testing.T) { assert.True(t, *payload.NonTemporaryStorage) assert.True(t, *payload.PrivatelyOwnedVehicle) assert.Equal(t, int64(10000), *payload.AuthorizedWeight) + assert.Equal(t, int64(400), *payload.UnaccompaniedBaggageAllowance) assert.Equal(t, int64(7000), payload.TotalWeight) assert.Equal(t, int64(45), payload.StorageInTransit) assert.Equal(t, int64(500), payload.RequiredMedicalEquipmentWeight) diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 2785f3e0540..3d5c1e850cc 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -13,7 +13,6 @@ import { ORDERS_BRANCH_OPTIONS } from 'constants/orders'; const AllowancesList = ({ info, showVisualCues }) => { const [enableUB, setEnableUB] = useState(false); - const visualCuesStyle = classNames(descriptionListStyles.row, { [`${descriptionListStyles.rowWithVisualCue}`]: showVisualCues, }); @@ -51,27 +50,36 @@ const AllowancesList = ({ info, showVisualCues }) => { {/* As these fields are grouped together and only apply to OCONUS orders They will all be NULL for CONUS orders. If one of these fields are present, it will be safe to assume it is an OCONUS order. With this, if one field is present - we show all three. Otherwise, we show none */} + we show all four. Otherwise, we show none */} {/* Wrap in FF */} - {enableUB && (info?.accompaniedTour || info?.dependentsTwelveAndOver || info?.dependentsUnderTwelve) && ( - <> -
-
Accompanied tour
-
{info.accompaniedTour ? 'Yes' : 'No'}
-
-
-
Dependents under age 12
-
- {info.dependentsUnderTwelve ? info.dependentsUnderTwelve : DEFAULT_EMPTY_VALUE} -
-
-
-
Dependents over age 12
-
- {info.dependentsTwelveAndOver ? info.dependentsTwelveAndOver : DEFAULT_EMPTY_VALUE} -
-
- + {enableUB && + (info?.accompaniedTour || info?.dependentsTwelveAndOver > 0 || info?.dependentsUnderTwelve > 0) && ( + <> +
+
Accompanied tour
+
{info.accompaniedTour ? 'Yes' : 'No'}
+
+
+
Dependents under age 12
+
+ {info.dependentsUnderTwelve ? info.dependentsUnderTwelve : DEFAULT_EMPTY_VALUE} +
+
+
+
Dependents over age 12
+
+ {info.dependentsTwelveAndOver ? info.dependentsTwelveAndOver : DEFAULT_EMPTY_VALUE} +
+
+ + )} + {enableUB && info?.ubAllowance >= 0 && ( +
+
Unaccompanied baggage allowance
+
+ {info.ubAllowance ? formatWeight(info.ubAllowance) : DEFAULT_EMPTY_VALUE} +
+
)} {/* End OCONUS fields */}
@@ -112,6 +120,7 @@ AllowancesList.propTypes = { dependents: PropTypes.bool, requiredMedicalEquipmentWeight: PropTypes.number, organizationalClothingAndIndividualEquipment: PropTypes.bool, + ubAllowance: PropTypes.number, }).isRequired, showVisualCues: PropTypes.bool, }; diff --git a/src/components/Office/DefinitionLists/AllowancesList.stories.jsx b/src/components/Office/DefinitionLists/AllowancesList.stories.jsx index 6ee3694d760..44e3eda03e8 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.stories.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.stories.jsx @@ -24,6 +24,7 @@ const info = { dependents: true, requiredMedicalEquipmentWeight: 1000, organizationalClothingAndIndividualEquipment: true, + ubAllowance: 400, }; export const Basic = () => ; diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 2be3b6551bb..45c2e97f246 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -18,18 +18,21 @@ const info = { dependents: true, requiredMedicalEquipmentWeight: 1000, organizationalClothingAndIndividualEquipment: true, + ubAllowance: 400, }; const initialValuesOconusAdditions = { accompaniedTour: true, dependentsTwelveAndOver: '2', dependentsUnderTwelve: '4', + ubAllowance: 400, }; const oconusInfo = { accompaniedTour: true, dependentsTwelveAndOver: 2, dependentsUnderTwelve: 4, + ubAllowance: 400, }; jest.mock('formik', () => ({ @@ -39,6 +42,7 @@ jest.mock('formik', () => ({ accompaniedTour: true, dependentsTwelveAndOver: '2', dependentsUnderTwelve: '4', + ubAllowance: '400', }; switch (field.type) { @@ -152,6 +156,7 @@ describe('AllowancesList', () => { expect(screen.queryByText('Accompanied tour')).not.toBeInTheDocument(); expect(screen.queryByLabelText(/Number of dependents under the age of 12/)).not.toBeInTheDocument(); expect(screen.queryByLabelText(/Number of dependents of the age 12 or over/)).not.toBeInTheDocument(); + expect(screen.queryByText('Unaccompanied baggage allowance')).not.toBeInTheDocument(); }); it('does render oconus fields when present', async () => { @@ -167,5 +172,7 @@ describe('AllowancesList', () => { await waitFor(() => expect(screen.getByTestId('ordersAccompaniedTour')).toBeInTheDocument()); expect(screen.getByTestId('ordersDependentsUnderTwelve')).toBeInTheDocument(); expect(screen.getByTestId('ordersDependentsTwelveAndOver')).toBeInTheDocument(); + expect(screen.getByTestId('unaccompaniedBaggageAllowance')).toBeInTheDocument(); + expect(screen.getByTestId('unaccompaniedBaggageAllowance').textContent).toEqual('400 lbs'); }); }); diff --git a/src/components/Office/ShipmentForm/ShipmentForm.jsx b/src/components/Office/ShipmentForm/ShipmentForm.jsx index ddef94dd6e4..62c73213119 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.jsx @@ -270,6 +270,7 @@ const ShipmentForm = (props) => { shipmentType === SHIPMENT_OPTIONS.BOAT || shipmentType === SHIPMENT_TYPES.BOAT_HAUL_AWAY || shipmentType === SHIPMENT_TYPES.BOAT_TOW_AWAY; + const isUB = shipmentType === SHIPMENT_OPTIONS.UNACCOMPANIED_BAGGAGE; const showAccountingCodes = isNTS || isNTSR; @@ -875,10 +876,17 @@ const ShipmentForm = (props) => {
-

- Weight allowance: - {formatWeight(serviceMember.weightAllotment.totalWeightSelf)} -

+ {isUB ? ( +

+ UB Weight allowance: + {formatWeight(serviceMember.weightAllotment.unaccompaniedBaggageAllowance)} +

+ ) : ( +

+ Weight allowance: + {formatWeight(serviceMember.weightAllotment.totalWeightSelf)} +

+ )}
@@ -1666,6 +1674,7 @@ ShipmentForm.propTypes = { serviceMember: shape({ weightAllotment: shape({ totalWeightSelf: number, + ubAllowance: number, }), agency: string.isRequired, }).isRequired, diff --git a/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx b/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx index eff75a6ed33..25462c82309 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.stories.jsx @@ -36,6 +36,7 @@ const defaultProps = { serviceMember: { weightAllotment: { totalWeightSelf: 5000, + ubAllowance: 400, }, }, isCreatePage: true, diff --git a/src/components/Office/ShipmentForm/ShipmentForm.test.jsx b/src/components/Office/ShipmentForm/ShipmentForm.test.jsx index 6cbfe8e866f..6c00f05cdd0 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.test.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.test.jsx @@ -44,8 +44,6 @@ const mockMtoShipment = { counselorRemarks: 'mock counselor remarks', requestedPickupDate: '2020-03-01', requestedDeliveryDate: '2020-03-30', - // requestedPickupDate: '2021-06-07', - // requestedDeliveryDate: '2021-06-14', hasSecondaryDeliveryAddress: false, hasSecondaryPickupAddress: false, pickupAddress: { @@ -170,6 +168,24 @@ const mockMtoShipment = { ], }; +const mockUBShipment = { + id: 'shipment123', + moveTaskOrderId: 'mock move id', + customerRemarks: 'mock customer remarks', + counselorRemarks: 'mock counselor remarks', + requestedPickupDate: '2020-03-01', + requestedDeliveryDate: '2020-03-30', + hasSecondaryDeliveryAddress: false, + hasSecondaryPickupAddress: false, + pickupAddress: { + streetAddress1: '812 S 129th St', + city: 'San Antonio', + state: 'TX', + postalCode: '78234', + }, + shipmentType: SHIPMENT_OPTIONS.UNACCOMPANIED_BAGGAGE, +}; + const defaultProps = { isCreatePage: true, submitHandler: jest.fn(), @@ -196,6 +212,7 @@ const defaultProps = { serviceMember: { weightAllotment: { totalWeightSelf: 5000, + ubAllowance: 400, }, agency: '', }, @@ -613,6 +630,40 @@ describe('ShipmentForm component', () => { }); }); + describe('weight allowance appears at the top of the page', () => { + it('renders the UB weight allowance for UB shipment form', async () => { + renderWithRouter( + , + ); + + expect(screen.getByTestId('ubWeightAllowance')).toBeInTheDocument(); + }); + + it('renders the weight allowance for shipment form', async () => { + renderWithRouter( + , + ); + + expect(screen.getByTestId('weightAllowance')).toBeInTheDocument(); + }); + }); + describe('editing an already existing HHG shipment for retiree/separatee', () => { it('renders the HHG shipment form with pre-filled values', async () => { renderWithRouter( diff --git a/src/content/shipments.js b/src/content/shipments.js index 2cabf052de4..5a2e0ab840b 100644 --- a/src/content/shipments.js +++ b/src/content/shipments.js @@ -23,7 +23,12 @@ export const shipmentForm = { export const shipmentSectionLabels = { HHG: 'HHG shipment', + PPM: 'PPM shipment', + BOAT: 'Boat shipment', + BOAT_HAUL_AWAY: 'Boat Haul Away shipment', + BOAT_TOW_AWAY: 'Boat Tow Away shipment', MOBILE_HOME: 'Mobile Home shipment', HHG_INTO_NTS_DOMESTIC: 'NTS shipment', HHG_OUTOF_NTS_DOMESTIC: 'NTS-release shipment', + UNACCOMPANIED_BAGGAGE: 'UB shipment', }; diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index 60de4e6fa41..fa89eda96fd 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -375,6 +375,7 @@ const MoveDetails = ({ dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, + ubAllowance: allowances.unaccompaniedBaggageAllowance, }; const customerInfo = { diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 4ce4a528046..9ba42961d5e 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -374,6 +374,7 @@ const ServicesCounselingMoveDetails = ({ dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, + ubAllowance: allowances.unaccompaniedBaggageAllowance, }; const ordersInfo = { diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 481543d2d0c..5722870f9d7 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -9,7 +9,7 @@ properties: type: integer x-formatting: weight x-nullable: true - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 57488fd4278..a0e8923ec1a 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -4952,7 +4952,7 @@ definitions: example: true x-nullable: true description: Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 1f43ca2d177..9875d69bcaa 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -866,6 +866,11 @@ definitions: type: integer x-formatting: weight x-nullable: true + unaccompaniedBaggageAllowance: + type: integer + example: 3 + x-nullable: true + description: The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. dependentsAuthorized: example: true type: boolean diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 466469e47f4..531f91964c6 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5161,7 +5161,7 @@ definitions: Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger/prime.yaml b/swagger/prime.yaml index afc8f3ec906..78db47a9a65 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -2934,7 +2934,7 @@ definitions: type: integer x-formatting: weight x-nullable: true - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 10ec1a6dc83..c4f328dea9d 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1616,7 +1616,7 @@ definitions: type: integer x-formatting: weight x-nullable: true - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index a88107d16e6..3ee820d24ed 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1700,7 +1700,7 @@ definitions: type: integer x-formatting: weight x-nullable: true - ubAllowance: + unaccompaniedBaggageAllowance: type: integer example: 3 x-nullable: true diff --git a/swagger/support.yaml b/swagger/support.yaml index 3746dcae0cc..4dbe72985b0 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -939,6 +939,13 @@ definitions: type: integer x-formatting: weight x-nullable: true + unaccompaniedBaggageAllowance: + type: integer + example: 3 + x-nullable: true + description: >- + The amount of weight in pounds that the move is entitled for shipment + types of Unaccompanied Baggage. dependentsAuthorized: example: true type: boolean