Skip to content

Commit

Permalink
fix assigned column not showing users assigned to moves if they're no…
Browse files Browse the repository at this point in the history
…t at same office
  • Loading branch information
loganwc committed Feb 27, 2025
1 parent 401282f commit 94bb9e9
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2401,19 +2401,32 @@ func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedP
}

// if the assigned user is not in the returned list of available users append them to the end
if (activeRole == string(roles.RoleTypeTOO)) && (move.TOOAssignedUser != nil) {
userFound := false
for _, officeUser := range availableOfficeUsers {
if officeUser.ID == *move.TOOAssignedID {
userFound = true
break
}
if activeRole == string(roles.RoleTypeTOO) || activeRole == string(roles.RoleTypeServicesCounselor) {
var assignedUser *models.OfficeUser
var assignedID *uuid.UUID

switch activeRole {
case string(roles.RoleTypeTOO):
assignedUser = move.TOOAssignedUser
assignedID = move.TOOAssignedID
case string(roles.RoleTypeServicesCounselor):
assignedUser = move.SCAssignedUser
assignedID = move.SCAssignedID
}
if !userFound {
availableOfficeUsers = append(availableOfficeUsers, *move.TOOAssignedUser)

if assignedUser != nil {
userFound := false
for _, officeUser := range availableOfficeUsers {
if assignedID != nil && officeUser.ID == *assignedID {
userFound = true
break
}
}
if !userFound {
availableOfficeUsers = append(availableOfficeUsers, *assignedUser)
}
}
}

if activeRole == string(roles.RoleTypeServicesCounselor) {
availableOfficeUsers = servicesCounselorAvailableOfficeUsers(move, availableOfficeUsers, officeUser, ppmCloseoutGblocs, isCloseoutQueue)
}
Expand Down

0 comments on commit 94bb9e9

Please sign in to comment.