Skip to content

Commit

Permalink
feat: sgID support for pocdex.public_officer_details
Browse files Browse the repository at this point in the history
  • Loading branch information
cflee committed May 21, 2024
1 parent 702ae94 commit bcea17f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/express/sgid.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ const formatVehicles = (vehicles) => {
return vehicleObjects
}

const formatJsonStringify = (value) => {
return value == undefined ? 'NA' : JSON.stringify(value)
}

const defaultUndefinedToNA = (value) => {
return value || 'NA'
}
Expand Down Expand Up @@ -320,6 +324,8 @@ const sgIDScopeToMyInfoField = (persona, scope) => {
return defaultUndefinedToNA(persona.marital?.desc)
case 'myinfo.mobile_number_with_country_code':
return formatMobileNumberWithPrefix(persona.mobileno)
case 'pocdex.public_officer_details':
return formatJsonStringify(persona.publicofficerdetails)
default:
return 'NA'
}
Expand Down
11 changes: 10 additions & 1 deletion static/myinfo/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,16 @@
"source": "1",
"classification": "C",
"desc": ""
}
},
"publicofficerdetails": [
{
"work_email": "[email protected]",
"agency_name": "Work Allocation Singapore",
"department_name": "Allocation Central",
"employment_type": "Fixed Term",
"employment_title": "Senior Software Engineer - LLv1 (Individual Contributor) (WAS)"
}
]
},
"S9912370B": {
"edulevel": {
Expand Down

0 comments on commit bcea17f

Please sign in to comment.