From bcea17f0f46ebffadbddb38c3eeac45f198d81be Mon Sep 17 00:00:00 2001 From: Lee Chiang Fong Date: Mon, 20 May 2024 16:33:03 +0800 Subject: [PATCH] feat: sgID support for pocdex.public_officer_details --- lib/express/sgid.js | 6 ++++++ static/myinfo/v3.json | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/express/sgid.js b/lib/express/sgid.js index 96e8c09..1e8c6ba 100644 --- a/lib/express/sgid.js +++ b/lib/express/sgid.js @@ -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' } @@ -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' } diff --git a/static/myinfo/v3.json b/static/myinfo/v3.json index c145412..a89fd2a 100644 --- a/static/myinfo/v3.json +++ b/static/myinfo/v3.json @@ -1203,7 +1203,16 @@ "source": "1", "classification": "C", "desc": "" - } + }, + "publicofficerdetails": [ + { + "work_email": "lim_yong_xiang@was.gov.sg", + "agency_name": "Work Allocation Singapore", + "department_name": "Allocation Central", + "employment_type": "Fixed Term", + "employment_title": "Senior Software Engineer - LLv1 (Individual Contributor) (WAS)" + } + ] }, "S9912370B": { "edulevel": {