Direction: EPC --> HRMS (Outbound)
Version: 1.0
Date: 11 Feb 2026
Status: Implemented
---
EPC fetches employee details from HRMS during member registration to validate and pre-populate member data. Two endpoints are used:
All requests are authenticated via PING OAuth2.0 Client Credentials flow.
| Parameter | Value |
|---|---|
| Token URL | SSM: /platinum-api/{stage}/hrms-ping-token-url |
| Grant Type | client_credentials |
| Auth Header | Basic {base64} from SSM: /platinum-api/{stage}/hrms-ping-auth-basic |
| Token TTL | 2 hours (refreshed 10 min before expiry) |
| Token Cache | In-memory (per Lambda instance) |
POST {tokenUrl}
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {hrms-ping-auth-basic}
Cache-Control: no-cache
grant_type=client_credentials
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 7200
}
---
GET {baseUrl}/platinum/erp/webservices/rest/EmployeeDetails/getEmployeeDetails/{employeeNumber}?fields={fields}
Authorization: Bearer {access_token}
Accept: application/json
| Parameter | Source | Description |
|---|---|---|
baseUrl |
SSM: /platinum-api/{stage}/hrms-api-base-url |
e.g. https://stgservices.emirates.dev |
employeeNumber |
User input (staffId) | URL-encoded employee number |
fields |
Static | See Fields Requested below |
STAFFNR,EMAIL,MOBILE,EMP_NAME,LAST_NAME,GRADE,PERSON_TYPE,STATUS,WORK_LOCAITON,BG_NAME,CRA,TERM_DATE,DOB,PREV_EMP_NUM,CORE_GRADE,DEP_EXITS,LEAV_RES
{
"getEmployeeDetails_Output": {
"OutputParameters": {
"Output": {
"employeeResponse": [
{
"EMPLOYEE_NUMBER": "EK123456",
"EMAIL_ID": "john.doe@emirates.com",
"MOBILE": "+971501234567",
"NAME": "John",
"LAST_NAME": "Doe",
"GRADE_CODE": "EK.07",
"EMPLOYEE_TYPE": "EMP",
"ACTIVE_STATUS": "Active Assignment",
"WORKLOCATION": "Dubai Airport Free Zone",
"BG_COUNTRY": "Emirates Group - UAE",
"CURRENT_RES_ADDRESS": "Dubai, UAE",
"ACTUAL_TERMINATION_DATE": "",
"DATE_OF_BIRTH": "1990-01-15",
"PREV_EMP__ID": "",
"IS_DEP_EXISTS": "Y",
"CORE_GRADE": "EK.07",
"LEAVING_REASON": ""
}
]
}
}
}
}
---
Used as fallback when the active employee endpoint returns no results.
GET {baseUrl}/platinum/erp/webservices/rest/EmpDetailsByEmail/getEmpDetailsbyEmail/?emailID={email}&fields={fields}
Authorization: Bearer {access_token}
Accept: application/json
{
"getEmpDetailsbyEmail_Output": {
"OutputParameters": {
"Output": {
"employeeResponse": [
{
"EMPLOYEE_NUMBER": "EK123456",
"ACTIVE_STATUS": "Terminate - Process",
"LEAVING_REASON": "Retirement",
"ACTUAL_TERMINATION_DATE": "2025-12-31",
...
}
]
}
}
}
}
---
| HRMS Field | EPC Field | Notes |
|---|---|---|
EMPLOYEE_NUMBER |
employeeId / staffId |
Primary identifier |
EMAIL_ID |
email |
|
MOBILE |
phone |
|
NAME |
name |
|
LAST_NAME |
surname |
|
GRADE_CODE |
grade |
|
EMPLOYEE_TYPE |
employmentType / memberType |
|
ACTIVE_STATUS |
status |
See Status Mapping below |
WORKLOCATION |
addressOptional |
|
BG_COUNTRY |
country / address.country |
|
CURRENT_RES_ADDRESS |
address |
|
ACTUAL_TERMINATION_DATE |
lastDayOfService |
Null if empty |
DATE_OF_BIRTH |
birthdate |
|
PREV_EMP__ID |
oldStaffId / previousStaffIds |
Null if empty |
IS_DEP_EXISTS |
dependantsExists |
"Y" or "N" |
CORE_GRADE |
coreGrade |
|
LEAVING_REASON |
leavingReason |
Null if empty |
| HRMS `ACTIVE_STATUS` | Allowed for Registration |
|---|---|
Active Assignment |
Yes |
Terminate - Process with LEAVING_REASON = "Retirement" |
Yes (retiree) |
| Any other terminated/inactive status | No -- rejected with HR_EMPLOYEE_NOT_ACTIVE |
---
| Scenario | HTTP Status | Behavior |
|---|---|---|
| Employee not found (active + retiree) | N/A | Return HR_EMPLOYEE_NOT_FOUND_IN_HRMS (10080) |
| Employee not active | N/A | Return HR_EMPLOYEE_NOT_ACTIVE (10081) |
| HRMS unavailable (503, timeout, HTML) | 503 | Return HR_HRMS_UNAVAILABLE (10079) |
| ISGServiceFault | Varies | Retry up to 3 times, then fail |
| 401 Unauthorized | 401 | Clear token cache, retry once |
{
"ISGServiceFault": {
"Code": "500",
"Message": "Internal Server Error"
}
}
HRMS may return HTML (Weblogic bridge failure) instead of JSON on 503. Detected via Content-Type: text/html.
---
| Parameter | Value |
|---|---|
| Max Retries | 3 |
| Retry Delay | 5 seconds |
| Request Timeout | 10 seconds |
| 401 Handling | Clear token cache, retry once |
| 503 Handling | Retry with backoff |
---
Called synchronously during member registration (register-member handler) when the registrant's email domain matches emirates.com or danat.com.
getEmployeeByNumber(staffId) (active endpoint)getEmployeeByEmail(email) (retiree endpoint)hrmsValidated: true on the member record---
| File | Purpose |
|---|---|
src/lib/services/hrms-auth.service.ts |
PING OAuth2.0 token management |
src/lib/services/hrms-employee.service.ts |
Employee fetch with retry logic |
src/lib/mappers/hrms-employee.mapper.ts |
Raw response to domain model mapping |
src/lib/entities/hr-integration.ts |
Type definitions (HrmsEmployeeRaw, HrmsEmployee) |
src/modules/member/register-member/handler.ts |
Integration trigger point |
---
| Parameter | Type | Description |
|---|---|---|
/platinum-api/{stage}/hrms-ping-token-url |
String | PING OAuth2.0 token endpoint |
/platinum-api/{stage}/hrms-api-base-url |
String | HRMS API base URL |
/platinum-api/{stage}/hrms-ping-auth-basic |
SecureString | Base64 client credentials for HRMS APIs |