| Line 189... |
Line 189... |
| 189 |
}
|
189 |
}
|
| 190 |
}
|
190 |
}
|
| 191 |
|
191 |
|
| 192 |
/**
|
192 |
/**
|
| 193 |
* Gets auth user ID for given escalation level. If not found, falls back to next level (L1 -> L2 -> L3 -> L4 -> L5)
|
193 |
* Gets auth user ID for given escalation level. If not found, falls back to next level (L1 -> L2 -> L3 -> L4 -> L5)
|
| - |
|
194 |
* Returns both the auth user ID and the actual escalation level that was used.
|
| 194 |
*/
|
195 |
*/
|
| - |
|
196 |
@Override
|
| 195 |
private int getAuthUserIdWithFallback(int categoryId, EscalationType targetEscalation, int fofoId) throws ProfitMandiBusinessException {
|
197 |
public EscalationAssignmentResult getAuthUserWithFallback(int categoryId, EscalationType targetEscalation, int fofoId) throws ProfitMandiBusinessException {
|
| 196 |
EscalationType currentEscalation = targetEscalation;
|
198 |
EscalationType currentEscalation = targetEscalation;
|
| 197 |
while (currentEscalation != null && !currentEscalation.equals(EscalationType.Final)) {
|
199 |
while (currentEscalation != null && !currentEscalation.equals(EscalationType.Final)) {
|
| 198 |
try {
|
200 |
try {
|
| 199 |
int authUserId = this.getAuthUserId(categoryId, currentEscalation, fofoId);
|
201 |
int authUserId = this.getAuthUserId(categoryId, currentEscalation, fofoId);
|
| 200 |
if (authUserId > 0) {
|
202 |
if (authUserId > 0) {
|
| 201 |
LOGGER.info("Found auth user {} for escalation level {} and fofoId {}", authUserId, currentEscalation, fofoId);
|
203 |
LOGGER.info("Found auth user {} for escalation level {} and fofoId {}", authUserId, currentEscalation, fofoId);
|
| 202 |
return authUserId;
|
204 |
return new EscalationAssignmentResult(authUserId, currentEscalation);
|
| 203 |
}
|
205 |
}
|
| 204 |
} catch (Exception e) {
|
206 |
} catch (Exception e) {
|
| 205 |
LOGGER.warn("No auth user found for escalation level {} and fofoId {}, trying next level", currentEscalation, fofoId);
|
207 |
LOGGER.warn("No auth user found for escalation level {} and fofoId {}, trying next level", currentEscalation, fofoId);
|
| 206 |
}
|
208 |
}
|
| 207 |
currentEscalation = currentEscalation.next();
|
209 |
currentEscalation = currentEscalation.next();
|
| 208 |
}
|
210 |
}
|
| 209 |
// If no user found at any level, return 0 to let default assignment handle it
|
211 |
// If no user found at any level, return 0 with the target escalation
|
| 210 |
LOGGER.warn("No auth user found for any escalation level for categoryId {} and fofoId {}", categoryId, fofoId);
|
212 |
LOGGER.warn("No auth user found for any escalation level for categoryId {} and fofoId {}", categoryId, fofoId);
|
| - |
|
213 |
return new EscalationAssignmentResult(0, targetEscalation);
|
| - |
|
214 |
}
|
| - |
|
215 |
|
| - |
|
216 |
/**
|
| - |
|
217 |
* Gets auth user ID with fallback (for backward compatibility)
|
| 211 |
return 0;
|
218 |
*/
|
| - |
|
219 |
private int getAuthUserIdWithFallback(int categoryId, EscalationType targetEscalation, int fofoId) throws ProfitMandiBusinessException {
|
| - |
|
220 |
return getAuthUserWithFallback(categoryId, targetEscalation, fofoId).getAuthUserId();
|
| 212 |
}
|
221 |
}
|
| 213 |
|
222 |
|
| 214 |
@Override
|
223 |
@Override
|
| 215 |
public TicketActivityMedia createMediaActivity(ActivityMediaModel selectedRecording) {
|
224 |
public TicketActivityMedia createMediaActivity(ActivityMediaModel selectedRecording) {
|
| 216 |
TicketActivityMedia activity = new TicketActivityMedia();
|
225 |
TicketActivityMedia activity = new TicketActivityMedia();
|