Skip to content

Commit

Permalink
Merge pull request #14699 from transcom/B-21935-int
Browse files Browse the repository at this point in the history
  • Loading branch information
deandreJones authored Feb 5, 2025
2 parents 79c7b4b + 034ec0c commit c9f75f6
Show file tree
Hide file tree
Showing 30 changed files with 171 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<p>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.</p>

{{if .WeightRestriction}}
<p>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. </p>
{{end}}
<p>What this means to you:</br>
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
*** 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}}
<p>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. </p>
{{end}}
What this means to you:
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</p>

<p>
<strong>Your weight allowance: {{.WeightAllowance}} pounds.</strong>
<strong>Your standard weight allowance: {{.WeightAllowance}} pounds.</strong>
That is how much combined weight the government will pay for all movements between authorized locations under your
orders.
orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.
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.

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.

Expand Down
1 change: 1 addition & 0 deletions pkg/factory/entitlement_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai
}

return entitlement

}
6 changes: 4 additions & 2 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.

20 changes: 20 additions & 0 deletions pkg/gen/internalapi/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/internalmessages/entitlement.go

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

3 changes: 3 additions & 0 deletions pkg/gen/internalmessages/orders.go

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

1 change: 1 addition & 0 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements {
WeightRestriction: weightRestriction,
ETag: etag.GenerateEtag(entitlement.UpdatedAt),
}

}

// DutyLocation payload
Expand Down
1 change: 1 addition & 0 deletions pkg/handlers/ghcapi/orders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ func (suite *HandlerSuite) TestCounselingUpdateAllowanceHandler() {
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
StorageInTransit: models.Int64Pointer(80),
WeightRestriction: models.Int64Pointer(0),
}

request := httptest.NewRequest("PATCH", "/counseling/orders/{orderID}/allowances", nil)
Expand Down
3 changes: 3 additions & 0 deletions pkg/handlers/internalapi/orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ func payloadForOrdersModel(storer storage.FileStorer, order models.Order) (*inte
if order.Entitlement.UBAllowance != nil {
entitlement.UbAllowance = models.Int64Pointer(int64(*order.Entitlement.UBAllowance))
}
if order.Entitlement.WeightRestriction != nil {
entitlement.WeightRestriction = models.Int64Pointer(int64(*order.Entitlement.WeightRestriction))
}
}
var originDutyLocation models.DutyLocation
originDutyLocation = models.DutyLocation{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func Entitlement(entitlement *models.Entitlement) *supportmessages.Entitlement {
if entitlement.UBAllowance != nil {
ubAllowance = int64(*entitlement.UBAllowance)
}

return &supportmessages.Entitlement{
ID: strfmt.UUID(entitlement.ID.String()),
AuthorizedWeight: authorizedWeight,
Expand Down
13 changes: 12 additions & 1 deletion pkg/notifications/move_counseled.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
html "html/template"
text "text/template"

"github.com/dustin/go-humanize"
"github.com/gofrs/uuid"
"go.uber.org/zap"

Expand Down Expand Up @@ -91,12 +92,21 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err
return emails, fmt.Errorf("no email found for service member")
}

var weightRestriction *int64
if orders.Entitlement != nil && orders.Entitlement.WeightRestriction != nil {
weightRestrictionInt64 := int64(*orders.Entitlement.WeightRestriction)
weightRestriction = &weightRestrictionInt64
}

weightRestrictionFormatted := humanize.Comma(int64(*weightRestriction))

htmlBody, textBody, err := m.renderTemplates(appCtx, MoveCounseledEmailData{
OriginDutyLocation: originDutyLocationName,
DestinationLocation: destinationAddress,
Locator: move.Locator,
MyMoveLink: MyMoveLink,
ActualExpenseReimbursement: actualExpenseReimbursement,
WeightRestriction: weightRestrictionFormatted,
})

if err != nil {
Expand All @@ -115,8 +125,8 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err

// TODO: Send email to trusted contacts when that's supported
return append(emails, smEmail), nil
}

}
func (m MoveCounseled) renderTemplates(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, string, error) {
htmlBody, err := m.RenderHTML(appCtx, data)
if err != nil {
Expand All @@ -135,6 +145,7 @@ type MoveCounseledEmailData struct {
Locator string
MyMoveLink string
ActualExpenseReimbursement bool
WeightRestriction string
}

// RenderHTML renders the html for the email
Expand Down
53 changes: 53 additions & 0 deletions pkg/notifications/move_counseled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,56 @@ func (suite *NotificationSuite) TestMoveCounseledDestinationIsDutyStationForPpmP
suite.Contains(email.htmlBody, "from "+move.Orders.OriginDutyLocation.Name+" to "+move.Orders.NewDutyLocation.Name+" in the ")
suite.Contains(email.textBody, "from "+move.Orders.OriginDutyLocation.Name+" to "+move.Orders.NewDutyLocation.Name+" in the ")
}

func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRestriction() {
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",
}

expectedHTMLContent := `<p>*** DO NOT REPLY directly to this email ***</p>
<p>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.</p>
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is 1,500lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
<p>What this means to you:</br>
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.</p>
<p><strong>Next steps for a PPM:</strong>
<ul>
<li>Please Note: Your PPM has been designated as Actual Expense Reimbursement. This is the standard entitlement for Civilian employees. For uniformed Service Members, your PPM may have been designated as Actual Expense Reimbursement due to failure to receive authorization prior to movement or failure to obtain certified weight tickets. Actual Expense Reimbursement means reimbursement for expenses not to exceed the Government Constructed Cost (GCC).</li>
<li>Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive (or Actual Expense Reimbursement for Civilians) could be affected. Failure to obtain weight tickets will result in losing eligibility to receive your incentive.</li>
<p>Note: To receive allowance for Pro-Gear, you must identify allowable items and provide weight tickets separately for Pro-Gear.</p>
<li>For authorized storage:</li>
<ul>
<li>You will need to get weight ticket(s) for the items you store.</li>
<li>Storage costs cannot be paid in advance.</li>
</ul>
<li>If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into <a href="https://my.move.mil/">MilMove</a> to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.</li>
<li>Once you complete your PPM, log into <a href="https://my.move.mil/">MilMove</a>, upload your receipts and weight tickets, and submit your PPM for review.</li>
</ul>
<p><strong>Next steps for government arranged shipments:</strong></br>
<ul>
<li>Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance.</li>
<li>Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey.</li>
<li>HomeSafe is required to contact you within one Government Business Day. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.</li>
</ul>
<p>Thank you,<br>
USTRANSCOM MilMove Team</p>
<p>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.</p>`

htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{
UserID: approver.ID,
ApplicationName: auth.OfficeApp,
}), s)

suite.NoError(err)
suite.Equal(trimExtraSpaces(expectedHTMLContent), trimExtraSpaces(htmlContent))
}
14 changes: 7 additions & 7 deletions pkg/notifications/move_submitted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithGovCounse
</p>
<p>
<strong>Your weight allowance: 7,999 pounds.</strong>
<strong>Your standard weight allowance: 7,999 pounds.</strong>
That is how much combined weight the government will pay for all movements between authorized locations under your
orders.
orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.
</p>
<p>
Expand Down Expand Up @@ -385,9 +385,9 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou
</p>
<p>
<strong>Your weight allowance: 7,999 pounds.</strong>
<strong>Your standard weight allowance: 7,999 pounds.</strong>
That is how much combined weight the government will pay for all movements between authorized locations under your
orders.
orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.
</p>
<p>
Expand Down Expand Up @@ -483,9 +483,9 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderNoDutyLocatio
</p>
<p>
<strong>Your weight allowance: 7,999 pounds.</strong>
<strong>Your standard weight allowance: 7,999 pounds.</strong>
That is how much combined weight the government will pay for all movements between authorized locations under your
orders.
orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.
</p>
<p>
Expand Down Expand Up @@ -578,7 +578,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 weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.
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.
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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/order/order_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models.

return order, nil
}

func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder models.Order, payload ghcmessages.CounselingUpdateAllowancePayload) (models.Order, error) {
order := existingOrder
waf := entitlements.NewWeightAllotmentFetcher()
Expand Down Expand Up @@ -640,7 +641,6 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder

return order, nil
}

func (f *orderUpdater) saveDocumentForAmendedOrder(appCtx appcontext.AppContext, doc *models.Document) (*models.Document, error) {
var docID uuid.UUID
if doc != nil {
Expand Down
5 changes: 5 additions & 0 deletions pkg/services/order/order_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() {
AccompaniedTour: models.BoolPointer(true),
DependentsTwelveAndOver: models.Int64Pointer(1),
DependentsUnderTwelve: models.Int64Pointer(2),
WeightRestriction: models.Int64Pointer(0),
}

updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag)
Expand Down Expand Up @@ -832,6 +833,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() {
ProGearWeight: proGearWeight,
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
WeightRestriction: models.Int64Pointer(0),
}

updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag)
Expand Down Expand Up @@ -881,6 +883,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() {
ProGearWeight: proGearWeight,
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
WeightRestriction: models.Int64Pointer(0),
}

updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), orderWithoutDefaults.ID, payload, eTag)
Expand Down Expand Up @@ -932,6 +935,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() {
ProGearWeight: proGearWeight,
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
WeightRestriction: models.Int64Pointer(0),
}

updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag)
Expand Down Expand Up @@ -968,6 +972,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() {
ProGearWeight: proGearWeight,
ProGearWeightSpouse: proGearWeightSpouse,
RequiredMedicalEquipmentWeight: rmeWeight,
WeightRestriction: models.Int64Pointer(0),
}

updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag)
Expand Down
Loading

0 comments on commit c9f75f6

Please sign in to comment.