Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into B-22779-INT
Browse files Browse the repository at this point in the history
  • Loading branch information
r-mettler authored Mar 4, 2025
2 parents 52bb327 + e0b2ab8 commit 7fca730
Show file tree
Hide file tree
Showing 12 changed files with 196 additions and 23 deletions.
13 changes: 11 additions & 2 deletions pkg/assets/notifications/templates/move_counseled_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

<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.</p>
{{if and .UbWeightRestriction .WeightRestriction}}
<p>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.</p>
<p>Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction
is {{.WeightRestriction}} lbs.</p>
<p>Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .UbWeightRestriction}}
<p>Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction
is {{.UbWeightRestriction}} lbs.</p>
<p>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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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}}
<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>
{{if and .UbWeightRestriction .WeightRestriction}}
<p>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. </p>
{{else 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>
{{else if .UbWeightRestriction}}
<p>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. </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 @@ -23,7 +23,7 @@
<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.</p>
<p>Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.</p>
<p>Be advised, if you are moving to an administratively restricted 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 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.

Expand Down
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.

10 changes: 10 additions & 0 deletions pkg/notifications/move_counseled.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,22 @@ 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,
Locator: move.Locator,
MyMoveLink: MyMoveLink,
ActualExpenseReimbursement: actualExpenseReimbursement,
WeightRestriction: weightRestrictionFormatted,
UbWeightRestriction: ubWeightRestrictionFormatted,
})

if err != nil {
Expand Down Expand Up @@ -146,6 +155,7 @@ type MoveCounseledEmailData struct {
MyMoveLink string
ActualExpenseReimbursement bool
WeightRestriction string
UbWeightRestriction string
}

// RenderHTML renders the html for the email
Expand Down
109 changes: 108 additions & 1 deletion pkg/notifications/move_counseled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,114 @@ func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRes
}

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 1500lbs.</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 1500 lbs.</p>
<p>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))
}

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 := `<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 UB weight location. Your weight restriction is 850 lbs.</p>
<p>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))
}

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 := `<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 weight location. Your HHG weight restriction is 1500 lbs and UB weight restriction is 850 lbs.</p>
<p>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>
Expand Down
Loading

0 comments on commit 7fca730

Please sign in to comment.