diff --git a/CHANGELOG.md b/CHANGELOG.md index 82e966f3..c7768d8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelogs +## 8.3.3 +- Add new profiles for book facilities UAT + ## 8.3.1 - Add new profiles for book facilities UAT diff --git a/package-lock.json b/package-lock.json index efdf1a7f..472b5035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@govtechsg/singpass-myinfo-oidc-helper", - "version": "8.3.2", + "version": "8.3.3", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index fd714742..5da62640 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govtechsg/singpass-myinfo-oidc-helper", - "version": "8.3.2", + "version": "8.3.3", "description": "Helper for building a Relying Party to integrate with Singpass OIDC and MyInfo person basic API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/myinfo/fake/profiles/fake-profile.ts b/src/myinfo/fake/profiles/fake-profile.ts index a8eb9486..c853c5f0 100644 --- a/src/myinfo/fake/profiles/fake-profile.ts +++ b/src/myinfo/fake/profiles/fake-profile.ts @@ -91,5 +91,9 @@ export enum ProfileArchetype { MS_HBP_RESIDENT_6 = "Ms HBP Resident 6", MR_MP_RESIDENT_4 = "Mr MP Resident 4", MR_NS_RESIDENT_5 = "Mr NS Resident 5", - MS_PRPG_RESIDENT_1 = "Ms PRPG Resident 1" + MS_PRPG_RESIDENT_1 = "Ms PRPG Resident 1", + MR_MP_RESIDENT_6 = "Mr MP Resident 6", + MS_NS_RESIDENT_6 = "Ms NS Resident 6", + MR_MP_RESIDENT_1 = "Mr MP Resident 1", + MR_HBP_RESIDENT_5 = "Mr HBP Resident 5", } diff --git a/src/myinfo/fake/profiles/fake-profiles.ts b/src/myinfo/fake/profiles/fake-profiles.ts index b712379c..b76cc77b 100644 --- a/src/myinfo/fake/profiles/fake-profiles.ts +++ b/src/myinfo/fake/profiles/fake-profiles.ts @@ -75,6 +75,10 @@ import { msHbpResident6 } from "./msHbpResident6"; import { mrMpResident4 } from "./mrMpResident4"; import { mrNsResident5 } from "./mrNsResident5"; import { msPrpgResident1 } from "./msPrpgResident1"; +import { mrMpResident6 } from "./mrMpResident6"; +import { msNsResident6 } from "./msNsResident6"; +import { mrMpResident1 } from "./mrMpResident1"; +import { mrHbpResident5 } from "./mrHbpResident5"; /** * Exhaustive list of our MyInfo archetype profiles @@ -157,5 +161,9 @@ export const profiles = [ msHbpResident6, mrMpResident4, mrNsResident5, - msPrpgResident1 + msPrpgResident1, + mrMpResident6, + msNsResident6, + mrMpResident1, + mrHbpResident5, ]; diff --git a/src/myinfo/fake/profiles/mrHbpResident5.ts b/src/myinfo/fake/profiles/mrHbpResident5.ts new file mode 100644 index 00000000..e3b76a97 --- /dev/null +++ b/src/myinfo/fake/profiles/mrHbpResident5.ts @@ -0,0 +1,34 @@ +import * as _ from "lodash"; +import { MyInfoComponents, MyInfoSexCode } from "../../domain"; +import { FakeProfile, ProfileArchetype } from "./fake-profile"; +import { BaseProfile } from "./sponsored-children/BaseProfile"; + +const id = "T0892280I"; +const name = ProfileArchetype.MR_HBP_RESIDENT_5; + +export const mrHbpResident5: FakeProfile = { + id, + name, + generate: (profileName) => { + profileName = _.isEmpty(profileName) ? name : profileName; + const profile: MyInfoComponents.Schemas.Person = BaseProfile.generate(profileName); + + profile.sex.code = MyInfoSexCode.MALE; + profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE); + + profile.dob = { + lastupdated: "2024-01-22", + source: "1", + classification: "C", + value: "2008-02-26", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "63"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "03"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "15"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "TOH YI DRIVE"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "590015"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/mrMpResident1.ts b/src/myinfo/fake/profiles/mrMpResident1.ts new file mode 100644 index 00000000..480f4d6a --- /dev/null +++ b/src/myinfo/fake/profiles/mrMpResident1.ts @@ -0,0 +1,34 @@ +import * as _ from "lodash"; +import { MyInfoComponents, MyInfoSexCode } from "../../domain"; +import { FakeProfile, ProfileArchetype } from "./fake-profile"; +import { BaseProfile } from "./sponsored-children/BaseProfile"; + +const id = "S5395307G"; +const name = ProfileArchetype.MR_MP_RESIDENT_1; + +export const mrMpResident1: FakeProfile = { + id, + name, + generate: (profileName) => { + profileName = _.isEmpty(profileName) ? name : profileName; + const profile: MyInfoComponents.Schemas.Person = BaseProfile.generate(profileName); + + profile.sex.code = MyInfoSexCode.MALE; + profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE); + + profile.dob = { + lastupdated: "2024-01-22", + source: "1", + classification: "C", + value: "1953-05-15", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "521"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "12"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "320"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "UBI AVENUE 1"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "400320"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/mrMpResident6.ts b/src/myinfo/fake/profiles/mrMpResident6.ts new file mode 100644 index 00000000..e0d32abb --- /dev/null +++ b/src/myinfo/fake/profiles/mrMpResident6.ts @@ -0,0 +1,34 @@ +import * as _ from "lodash"; +import { MyInfoComponents, MyInfoSexCode } from "../../domain"; +import { FakeProfile, ProfileArchetype } from "./fake-profile"; +import { BaseProfile } from "./sponsored-children/BaseProfile"; + +const id = "S7465038D"; +const name = ProfileArchetype.MR_MP_RESIDENT_6; + +export const mrMpResident6: FakeProfile = { + id, + name, + generate: (profileName) => { + profileName = _.isEmpty(profileName) ? name : profileName; + const profile: MyInfoComponents.Schemas.Person = BaseProfile.generate(profileName); + + profile.sex.code = MyInfoSexCode.MALE; + profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE); + + profile.dob = { + lastupdated: "2024-01-22", + source: "1", + classification: "C", + value: "1974-10-17", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "122"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "07"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "808A"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "CHAI CHEE ROAD"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "461808"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/msNsResident6.ts b/src/myinfo/fake/profiles/msNsResident6.ts new file mode 100644 index 00000000..fa137cd4 --- /dev/null +++ b/src/myinfo/fake/profiles/msNsResident6.ts @@ -0,0 +1,34 @@ +import * as _ from "lodash"; +import { MyInfoComponents, MyInfoSexCode } from "../../domain"; +import { FakeProfile, ProfileArchetype } from "./fake-profile"; +import { BaseProfile } from "./sponsored-children/BaseProfile"; + +const id = "S8844367E"; +const name = ProfileArchetype.MS_NS_RESIDENT_6; + +export const msNsResident6: FakeProfile = { + id, + name, + generate: (profileName) => { + profileName = _.isEmpty(profileName) ? name : profileName; + const profile: MyInfoComponents.Schemas.Person = BaseProfile.generate(profileName); + + profile.sex.code = MyInfoSexCode.FEMALE; + profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.FEMALE); + + profile.dob = { + lastupdated: "2023-01-22", + source: "1", + classification: "C", + value: "1988-08-08", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "1914"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "05"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "342A"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "YISHUN RING ROAD"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "761342"; + + return profile; + }, +};