Skip to content

Commit

Permalink
[MOL-12787][CWH] Add new profile for book facilities UAT
Browse files Browse the repository at this point in the history
  • Loading branch information
CWH-UF committed Jan 22, 2024
1 parent 5f11aa3 commit 2e54822
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/myinfo/fake/profiles/fake-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
10 changes: 9 additions & 1 deletion src/myinfo/fake/profiles/fake-profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -157,5 +161,9 @@ export const profiles = [
msHbpResident6,
mrMpResident4,
mrNsResident5,
msPrpgResident1
msPrpgResident1,
mrMpResident6,
msNsResident6,
mrMpResident1,
mrHbpResident5,
];
34 changes: 34 additions & 0 deletions src/myinfo/fake/profiles/mrHbpResident5.ts
Original file line number Diff line number Diff line change
@@ -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;
},
};
34 changes: 34 additions & 0 deletions src/myinfo/fake/profiles/mrMpResident1.ts
Original file line number Diff line number Diff line change
@@ -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;
},
};
34 changes: 34 additions & 0 deletions src/myinfo/fake/profiles/mrMpResident6.ts
Original file line number Diff line number Diff line change
@@ -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;
},
};
34 changes: 34 additions & 0 deletions src/myinfo/fake/profiles/msNsResident6.ts
Original file line number Diff line number Diff line change
@@ -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;
},
};

0 comments on commit 2e54822

Please sign in to comment.