Skip to content

Commit

Permalink
bugfix for TIO assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstonebraker committed Jan 29, 2025
1 parent ff83d59 commit 8ff1134
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2458,6 +2458,7 @@ func queuePaymentRequestStatus(paymentRequest models.PaymentRequest) string {

}

// dad
// QueuePaymentRequests payload
func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers []models.OfficeUser, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser, activeRole string) *ghcmessages.QueuePaymentRequests {

Expand Down Expand Up @@ -2516,6 +2517,13 @@ func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers [
if isSupervisor && orders.OrdersType == "SAFETY" {
availableOfficeUsers = officeUsersSafety
}

// if the assigned TIO doesn't work at the user's counseling office, append them
if queuePaymentRequests[i].AssignedTo != nil && paymentRequest.MoveTaskOrder.TIOAssignedUser.TransportationOfficeID != officeUser.TransportationOfficeID {
availableOfficeUsers = append(availableOfficeUsers, *paymentRequest.MoveTaskOrder.TIOAssignedUser)
}

// if they're not a supervisor and it is assignable, the only option should be themself
if !isSupervisor {
availableOfficeUsers = models.OfficeUsers{officeUser}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (f *paymentRequestListFetcher) FetchPaymentRequestList(appCtx appcontext.Ap
"MoveTaskOrder.Orders.OriginDutyLocation.TransportationOffice",
"MoveTaskOrder.Orders.OriginDutyLocation.Address",
"MoveTaskOrder.TIOAssignedUser",
"MoveTaskOrder.TIOAssignedUser.TransportationOfficeID",
"MoveTaskOrder.CounselingOffice",
// See note further below about having to do this in a separate Load call due to a Pop issue.
// "MoveTaskOrder.Orders.ServiceMember",
Expand Down

0 comments on commit 8ff1134

Please sign in to comment.