diff --git a/pkg/assets/notifications/templates/move_counseled_template.html b/pkg/assets/notifications/templates/move_counseled_template.html index cf60b2410de..bb3330c7fb7 100644 --- a/pkg/assets/notifications/templates/move_counseled_template.html +++ b/pkg/assets/notifications/templates/move_counseled_template.html @@ -2,8 +2,17 @@

This is a confirmation that your counselor has approved move details for the assigned move code{{if .Locator}} {{.Locator}}{{end}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system.

-{{if .WeightRestriction}} -

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs.

+{{if and .UbWeightRestriction .WeightRestriction}} +

Your move has been identified as going to an administratively restricted weight location. Your HHG weight restriction + is {{.WeightRestriction}} lbs and UB weight restriction is {{.UbWeightRestriction}} lbs.

+

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{else if .WeightRestriction}} +

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction + is {{.WeightRestriction}} lbs.

+

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{else if .UbWeightRestriction}} +

Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction + is {{.UbWeightRestriction}} lbs.

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

{{end}}

What this means to you:
diff --git a/pkg/assets/notifications/templates/move_counseled_template.txt b/pkg/assets/notifications/templates/move_counseled_template.txt index 535c27f66e9..a83d46efd57 100644 --- a/pkg/assets/notifications/templates/move_counseled_template.txt +++ b/pkg/assets/notifications/templates/move_counseled_template.txt @@ -1,8 +1,12 @@ *** DO NOT REPLY directly to this email *** This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system. -{{if .WeightRestriction}} -

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{if and .UbWeightRestriction .WeightRestriction}} +

Your move has been identified as going to an administratively restricted weight location. Your HHG weight restriction is {{.WeightRestriction}} lbs and UB weight restriction is {{.UbWeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{else if .WeightRestriction}} +

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{else if .UbWeightRestriction}} +

Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction is {{.UbWeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

{{end}} What this means to you: If you are doing a Personally Procured Move (PPM), you can start moving your personal property. diff --git a/pkg/assets/notifications/templates/move_submitted_template.html b/pkg/assets/notifications/templates/move_submitted_template.html index a2a408af88d..5926ad985fc 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.html +++ b/pkg/assets/notifications/templates/move_submitted_template.html @@ -23,7 +23,7 @@ Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.

-

Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

+

Be advised, if you are moving to an administratively restricted weight location this amount could be less.

diff --git a/pkg/assets/notifications/templates/move_submitted_template.txt b/pkg/assets/notifications/templates/move_submitted_template.txt index 85516ead51f..5f1143844bb 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.txt +++ b/pkg/assets/notifications/templates/move_submitted_template.txt @@ -6,7 +6,7 @@ We have assigned you a move code: {{.Locator}}. You can use this code when talki {{ if .OriginDutyLocationPhoneLine -}} To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office ({{.OneSourceTransportationOfficeLink}}) . {{- end }} {{- if not .OriginDutyLocationPhoneLine }} To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts ({{.OneSourceTransportationOfficeLink}}) . {{- end }} -Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less. +Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted weight location this amount could be less. If you move more than {{.WeightAllowance}} pounds or ship to/from an other than authorized location, you may owe the government the difference in cost between what you are authorized and what you decide to move. diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index 7fe513dece1..ed60226b151 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4487,6 +4487,12 @@ func init() { "x-nullable": true, "example": 3 }, + "ub_weight_restriction": { + "description": "Indicates the UB weight restricted to a specific location.", + "type": "integer", + "x-nullable": true, + "example": 1100 + }, "weight_restriction": { "description": "Indicates the weight restricted to a specific location.", "type": "integer", @@ -6029,6 +6035,10 @@ func init() { "x-nullable": true, "example": "F8J1" }, + "ubWeightRestriction": { + "type": "integer", + "x-nullable": true + }, "updated_at": { "type": "string", "format": "date-time" @@ -13640,6 +13650,12 @@ func init() { "x-nullable": true, "example": 3 }, + "ub_weight_restriction": { + "description": "Indicates the UB weight restricted to a specific location.", + "type": "integer", + "x-nullable": true, + "example": 1100 + }, "weight_restriction": { "description": "Indicates the weight restricted to a specific location.", "type": "integer", @@ -15184,6 +15200,10 @@ func init() { "x-nullable": true, "example": "F8J1" }, + "ubWeightRestriction": { + "type": "integer", + "x-nullable": true + }, "updated_at": { "type": "string", "format": "date-time" diff --git a/pkg/gen/internalmessages/entitlement.go b/pkg/gen/internalmessages/entitlement.go index 083ea350085..059594ce240 100644 --- a/pkg/gen/internalmessages/entitlement.go +++ b/pkg/gen/internalmessages/entitlement.go @@ -43,6 +43,10 @@ type Entitlement struct { // Example: 3 UbAllowance *int64 `json:"ub_allowance,omitempty"` + // Indicates the UB weight restricted to a specific location. + // Example: 1100 + UbWeightRestriction *int64 `json:"ub_weight_restriction,omitempty"` + // Indicates the weight restricted to a specific location. // Example: 1500 WeightRestriction *int64 `json:"weight_restriction,omitempty"` diff --git a/pkg/gen/internalmessages/orders.go b/pkg/gen/internalmessages/orders.go index f36800d8445..969c3c7e369 100644 --- a/pkg/gen/internalmessages/orders.go +++ b/pkg/gen/internalmessages/orders.go @@ -111,6 +111,9 @@ type Orders struct { // Example: F8J1 Tac *string `json:"tac,omitempty"` + // ub weight restriction + UbWeightRestriction *int64 `json:"ubWeightRestriction,omitempty"` + // updated at // Required: true // Format: date-time diff --git a/pkg/notifications/move_counseled.go b/pkg/notifications/move_counseled.go index 76b4728bb14..529e944384f 100644 --- a/pkg/notifications/move_counseled.go +++ b/pkg/notifications/move_counseled.go @@ -100,6 +100,14 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err weightRestrictionFormatted = humanize.Comma(int64(*weightRestriction)) } + var ubWeightRestriction *int64 + var ubWeightRestrictionFormatted string + if orders.Entitlement != nil && orders.Entitlement.UBWeightRestriction != nil { + ubWeightRestrictionInt64 := int64(*orders.Entitlement.UBWeightRestriction) + ubWeightRestriction = &ubWeightRestrictionInt64 + ubWeightRestrictionFormatted = humanize.Comma(int64(*ubWeightRestriction)) + } + htmlBody, textBody, err := m.renderTemplates(appCtx, MoveCounseledEmailData{ OriginDutyLocation: originDutyLocationName, DestinationLocation: destinationAddress, @@ -107,6 +115,7 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err MyMoveLink: MyMoveLink, ActualExpenseReimbursement: actualExpenseReimbursement, WeightRestriction: weightRestrictionFormatted, + UbWeightRestriction: ubWeightRestrictionFormatted, }) if err != nil { @@ -146,6 +155,7 @@ type MoveCounseledEmailData struct { MyMoveLink string ActualExpenseReimbursement bool WeightRestriction string + UbWeightRestriction string } // RenderHTML renders the html for the email diff --git a/pkg/notifications/move_counseled_test.go b/pkg/notifications/move_counseled_test.go index e477302cb1a..1ee9631bdbc 100644 --- a/pkg/notifications/move_counseled_test.go +++ b/pkg/notifications/move_counseled_test.go @@ -302,7 +302,114 @@ func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRes } expectedHTMLContent := `

*** DO NOT REPLY directly to this email ***

-

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is 1500lbs.

+

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is 1500 lbs.

+

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+

What this means to you:
+If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

+

Next steps for a PPM: +

+

Next steps for government arranged shipments:
+

+

Thank you,
+USTRANSCOM MilMove Team

+

The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

` + + htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedHTMLContent), trimExtraSpaces(htmlContent)) +} + +func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithUBWeightRestriction() { + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + originDutyLocation := "origDutyLocation" + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationLocation: "destDutyLocation", + Locator: "abc123", + MyMoveLink: MyMoveLink, + ActualExpenseReimbursement: true, + UbWeightRestriction: "850", + } + + expectedHTMLContent := `

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction is 850 lbs.

+

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+

What this means to you:
+If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

+

Next steps for a PPM: +

+

Next steps for government arranged shipments:
+

+

Thank you,
+USTRANSCOM MilMove Team

+

The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

` + + htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedHTMLContent), trimExtraSpaces(htmlContent)) +} + +func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRestrictionAndUBWeightRestriction() { + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + originDutyLocation := "origDutyLocation" + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationLocation: "destDutyLocation", + Locator: "abc123", + MyMoveLink: MyMoveLink, + ActualExpenseReimbursement: true, + WeightRestriction: "1500", + UbWeightRestriction: "850", + } + + expectedHTMLContent := `

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

Your move has been identified as going to an administratively restricted weight location. Your HHG weight restriction is 1500 lbs and UB weight restriction is 850 lbs.

Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

What this means to you:
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

diff --git a/pkg/notifications/move_submitted_test.go b/pkg/notifications/move_submitted_test.go index 2d1693e79c1..8a952990195 100644 --- a/pkg/notifications/move_submitted_test.go +++ b/pkg/notifications/move_submitted_test.go @@ -276,7 +276,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithGovCounse Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.

-

Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

+

Be advised, if you are moving to an administratively restricted weight location this amount could be less.

@@ -389,7 +389,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.

-

Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

+

Be advised, if you are moving to an administratively restricted weight location this amount could be less.

@@ -488,7 +488,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderNoDutyLocatio Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.

-

Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

+

Be advised, if you are moving to an administratively restricted weight location this amount could be less.

@@ -581,7 +581,7 @@ We have assigned you a move code: abc123. You can use this code when talking to To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office (` + OneSourceTransportationOfficeLink + `) . -Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less. +Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted weight location this amount could be less. If you move more than 7,999 pounds or ship to/from an other than authorized location, you may owe the government the difference in cost between what you are authorized and what you decide to move. diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 17acc89241e..96e482b214b 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -586,11 +586,11 @@ definitions: TransportationOffices: type: array items: - $ref: "definitions/TransportationOffice.yaml" + $ref: 'definitions/TransportationOffice.yaml' VLocations: type: array items: - $ref: "definitions/VLocation.yaml" + $ref: 'definitions/VLocation.yaml' OfficeUser: type: object properties: @@ -634,8 +634,8 @@ definitions: transportation_office: $ref: 'definitions/TransportationOffice.yaml' transportation_office_assignments: - type: array - items: + type: array + items: $ref: 'definitions/TransportationOfficeAssignment.yaml' created_at: type: string @@ -1411,6 +1411,9 @@ definitions: weightRestriction: type: integer x-nullable: true + ubWeightRestriction: + type: integer + x-nullable: true required: - id - service_member_id @@ -1463,6 +1466,11 @@ definitions: example: 1500 x-nullable: true description: Indicates the weight restricted to a specific location. + ub_weight_restriction: + type: integer + example: 1100 + x-nullable: true + description: Indicates the UB weight restricted to a specific location. CreateUpdateOrders: type: object properties: @@ -1994,7 +2002,7 @@ definitions: secondaryPickupAddress: $ref: 'definitions/Address.yaml' destinationAddress: - $ref: "definitions/PPMDestinationAddress.yaml" + $ref: 'definitions/PPMDestinationAddress.yaml' secondaryDestinationAddress: $ref: 'definitions/Address.yaml' tertiaryDestinationAddress: @@ -2059,7 +2067,7 @@ definitions: pattern: ^(\d{5})$ x-nullable: true destinationAddress: - $ref: "definitions/PPMDestinationAddress.yaml" + $ref: 'definitions/PPMDestinationAddress.yaml' secondaryDestinationAddress: $ref: 'definitions/Address.yaml' hasSecondaryDestinationAddress: @@ -4445,15 +4453,15 @@ paths: tags: - addresses parameters: - - in: path - name: search - type: string - required: true + - in: path + name: search + type: string + required: true responses: '200': description: the requested list of city, state, county, and postal code matches schema: - $ref: "#/definitions/VLocations" + $ref: '#/definitions/VLocations' '400': $ref: '#/responses/InvalidRequest' '403': @@ -4462,7 +4470,7 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' - "/mto_shipments": + '/mto_shipments': post: summary: createMTOShipment description: | diff --git a/swagger/internal.yaml b/swagger/internal.yaml index f9ded41f350..92227ce273c 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -1434,6 +1434,9 @@ definitions: weightRestriction: type: integer x-nullable: true + ubWeightRestriction: + type: integer + x-nullable: true required: - id - service_member_id @@ -1497,6 +1500,11 @@ definitions: example: 1500 x-nullable: true description: Indicates the weight restricted to a specific location. + ub_weight_restriction: + type: integer + example: 1100 + x-nullable: true + description: Indicates the UB weight restricted to a specific location. CreateUpdateOrders: type: object properties: