diff --git a/CHANGELOG.md b/CHANGELOG.md index 5108bc30..82e966f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelogs +## 8.3.1 +- Add new profiles for book facilities UAT + ## 8.2.0 - **[WARNING]** Remove `vehiclestatus` as a mock param option for `getPersonInfo` in fake helper diff --git a/package-lock.json b/package-lock.json index 25bd342f..c8165262 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@govtechsg/singpass-myinfo-oidc-helper", - "version": "8.3.0", + "version": "8.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@govtechsg/singpass-myinfo-oidc-helper", - "version": "8.3.0", + "version": "8.3.1", "license": "MIT", "dependencies": { "@js-joda/core": "^5.6.1", diff --git a/package.json b/package.json index 2b0383bf..76344f5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govtechsg/singpass-myinfo-oidc-helper", - "version": "8.3.0", + "version": "8.3.1", "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 e4f4b3a0..a8eb9486 100644 --- a/src/myinfo/fake/profiles/fake-profile.ts +++ b/src/myinfo/fake/profiles/fake-profile.ts @@ -86,4 +86,10 @@ export enum ProfileArchetype { MRS_ICA_PR_MOMMY_MAIN_SCENARIO_6 = "Mrs PR Mommy Main Applicant Scenario Six IDE", MR_ICA_SC_DADDY_MAIN_SCENARIO_7 = "Mr SG Daddy Spouse Applicant Scenario Seven IML", MRS_ICA_SC_SINGLE_MOMMY_MAIN_SCENARIO_8 = "Mrs SG Single Mommy Main Applicant Scenario Eight", + // For Book Fac UAT + MR_CCK_RESIDENT_1 = "Mr CCK Resident 1", + 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" } diff --git a/src/myinfo/fake/profiles/fake-profiles.ts b/src/myinfo/fake/profiles/fake-profiles.ts index e08831f5..b712379c 100644 --- a/src/myinfo/fake/profiles/fake-profiles.ts +++ b/src/myinfo/fake/profiles/fake-profiles.ts @@ -70,6 +70,11 @@ import { mrsICAMommyScenario4 } from "./mrICAMommyScenario4"; import { mrsICAMommyScenario5 } from "./mrICAMommyScenario5"; import { mrsICAMommyScenario6 } from "./mrICAMommyScenario6"; import { mrsICAMommyScenario8 } from "./mrICAMommyScenario8"; +import { mrCckResident1 } from "./mrCckResident1"; +import { msHbpResident6 } from "./msHbpResident6"; +import { mrMpResident4 } from "./mrMpResident4"; +import { mrNsResident5 } from "./mrNsResident5"; +import { msPrpgResident1 } from "./msPrpgResident1"; /** * Exhaustive list of our MyInfo archetype profiles @@ -147,5 +152,10 @@ export const profiles = [ mrsICAMommyScenario4, mrsICAMommyScenario5, mrsICAMommyScenario6, - mrsICAMommyScenario8 + mrsICAMommyScenario8, + mrCckResident1, + msHbpResident6, + mrMpResident4, + mrNsResident5, + msPrpgResident1 ]; diff --git a/src/myinfo/fake/profiles/mrCckResident1.ts b/src/myinfo/fake/profiles/mrCckResident1.ts new file mode 100644 index 00000000..79471265 --- /dev/null +++ b/src/myinfo/fake/profiles/mrCckResident1.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 = "S8939392B"; +const name = ProfileArchetype.MR_CCK_RESIDENT_1; + +export const mrCckResident1: 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: "2023-12-20", + source: "1", + classification: "C", + value: "1989-04-24", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "32"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "07"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "130"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "CHOA CHU KANG AVENUE 1"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "680130"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/mrMpResident4.ts b/src/myinfo/fake/profiles/mrMpResident4.ts new file mode 100644 index 00000000..f5c036d3 --- /dev/null +++ b/src/myinfo/fake/profiles/mrMpResident4.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 = "S7456600F"; +const name = ProfileArchetype.MR_MP_RESIDENT_4; + +export const mrMpResident4: 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: "2023-12-20", + source: "1", + classification: "C", + value: "1974-10-17", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "65"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "08"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "58"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "MARINE TERRACE"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "440058"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/mrNsResident5.ts b/src/myinfo/fake/profiles/mrNsResident5.ts new file mode 100644 index 00000000..56b7197c --- /dev/null +++ b/src/myinfo/fake/profiles/mrNsResident5.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 = "T0871447E"; +const name = ProfileArchetype.MR_NS_RESIDENT_5; + +export const mrNsResident5: 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: "2023-12-20", + source: "1", + classification: "C", + value: "1962-11-24", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "77"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "10"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "868"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "YISHUN STREET 81"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "760868"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/msHbpResident6.ts b/src/myinfo/fake/profiles/msHbpResident6.ts new file mode 100644 index 00000000..9b0c417a --- /dev/null +++ b/src/myinfo/fake/profiles/msHbpResident6.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 = "S6217524I"; +const name = ProfileArchetype.MS_HBP_RESIDENT_6; + +export const msHbpResident6: 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-12-20", + source: "1", + classification: "C", + value: "1962-11-24", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "167"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "10"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "21"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "GHIM MOH ROAD"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "270021"; + + return profile; + }, +}; diff --git a/src/myinfo/fake/profiles/msPrpgResident1.ts b/src/myinfo/fake/profiles/msPrpgResident1.ts new file mode 100644 index 00000000..0ea46231 --- /dev/null +++ b/src/myinfo/fake/profiles/msPrpgResident1.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 = "S6003491E"; +const name = ProfileArchetype.MS_PRPG_RESIDENT_1; + +export const msPrpgResident1: 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-12-20", + source: "1", + classification: "C", + value: "1960-06-04", + }; + + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).unit.value = "317"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).floor.value = "12"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).block.value = "458"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).street.value = "PASIR RIS DRIVE 4"; + (profile.regadd as MyInfoComponents.Schemas.DataitemAddressSg).postal.value = "510458"; + + return profile; + }, +};