Skip to content

Commit 822744f

Browse files
authored
Merge pull request #123 from GovTechSG/MOL-19052
[MOL-19052][LD] Add new fake profiles for myinfo
2 parents c7ad262 + f1f8f9a commit 822744f

File tree

11 files changed

+229
-3
lines changed

11 files changed

+229
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelogs
22

3+
## 9.0.1
4+
5+
- Add new myinfo fake profiles
6+
37
## 9.0.0
48

59
- **[BREAKING]** Split MyInfo typings into a different export

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@govtechsg/singpass-myinfo-oidc-helper",
3-
"version": "9.0.0",
3+
"version": "9.0.1",
44
"description": "Helper for building a Relying Party to integrate with Singpass OIDC and MyInfo person basic API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/myinfo/fake/profiles/fake-profile.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,10 @@ export enum ProfileArchetype {
118118
MR_PRPG_RESIDENT_4 = "Mr PRPG Resident 4",
119119
MR_PRPG_RESIDENT_5 = "Mr PRPG Resident 5",
120120
MR_PRPG_RESIDENT_6 = "Mr PRPG Resident 6",
121+
MR_PUTC_RESIDENT = "Mr PUTC Resident",
122+
MR_JYTC_RESIDENT = "Mr JYTC Resident",
123+
MR_TETC_RESIDENT = "Mr TETC Resident",
124+
MR_WATC_RESIDENT = "Mr WATC Resident",
125+
MR_JETC_RESIDENT = "Mr JETC Resident",
126+
MR_MPTC_RESIDENT = "Mr MPTC Resident",
121127
}

src/myinfo/fake/profiles/fake-profiles.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ import { mrsICAMommyScenario6 } from "./mrICAMommyScenario6";
2020
import { mrsICAMommyScenario8 } from "./mrICAMommyScenario8";
2121
import { mrJapaneseAddressBlank } from "./mrJapaneseAddressBlank";
2222
import { mrJapaneseNoAddressObject } from "./mrJapaneseNoAddressObject";
23+
import { mrJeTcResident } from "./mrJeTcResident";
24+
import { mrJyTcResident } from "./mrJyTcResident";
2325
import { mrMpResident1 } from "./mrMpResident1";
2426
import { mrMpResident3 } from "./mrMpResident3";
2527
import { mrMpResident4 } from "./mrMpResident4";
2628
import { mrMpResident6 } from "./mrMpResident6";
29+
import { mrMpTcResident } from "./mrMpTcResident";
2730
import { mrMYDaddyPerfect } from "./mrMYDaddyPerfect";
2831
import { mrMYDadJobless } from "./mrMYDadJobless";
2932
import { mrNsResident2 } from "./mrNsResident2";
@@ -38,6 +41,7 @@ import { mrPrpgResident3 } from "./mrPrpgResident3";
3841
import { mrPrpgResident4 } from "./mrPrpgResident4";
3942
import { mrPrpgResident5 } from "./mrPrpgResident5";
4043
import { mrPrpgResident6 } from "./mrPrpgResident6";
44+
import { mrPuTcResident } from "./mrPuTcResident";
4145
import { mrSGDaddyChildIsOld } from "./mrSGDaddyChildIsOld";
4246
import { mrSGDaddyChildNone } from "./mrSGDaddyChildNone";
4347
import { mrSGDaddyLongNames } from "./mrSGDaddyLongNames";
@@ -75,6 +79,8 @@ import { mrsMYMommyPerfect } from "./mrsMYMommyPerfect";
7579
import { mrsPreschoolRegistration } from "./MrsPreschoolRegistration";
7680
import { mrsPRHdbOwnerWorkingAdult } from "./mrsPRHdbOwnerWorkingAdult";
7781
import { mrsSGMommyPerfect } from "./mrsSGMommyPerfect";
82+
import { mrTeTcResident } from "./mrTeTcResident";
83+
import { mrWaTcResident } from "./mrWaTCResident";
7884
import { msCckResident2 } from "./msCckResident2";
7985
import { msCckResident5 } from "./msCckResident5";
8086
import { msHbpResident1 } from "./msHbpResident1";
@@ -192,4 +198,10 @@ export const profiles = [
192198
mrPrpgResident4,
193199
mrPrpgResident5,
194200
mrPrpgResident6,
201+
mrPuTcResident,
202+
mrJyTcResident,
203+
mrTeTcResident,
204+
mrWaTcResident,
205+
mrJeTcResident,
206+
mrMpTcResident,
195207
];
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as _ from "lodash";
2+
import { MyInfoComponentsV4, MyInfoSexCode } from "src/types";
3+
import { FakeProfile, ProfileArchetype } from "./fake-profile";
4+
import { BaseProfile } from "./sponsored-children/BaseProfile";
5+
6+
const id = "S9890162J";
7+
const name = ProfileArchetype.MR_JETC_RESIDENT;
8+
9+
export const mrJeTcResident: FakeProfile = {
10+
id,
11+
name,
12+
generate: (profileName) => {
13+
profileName = _.isEmpty(profileName) ? name : profileName;
14+
const profile: MyInfoComponentsV4.Schemas.Person = BaseProfile.generate(profileName);
15+
16+
profile.sex.code = MyInfoSexCode.MALE;
17+
profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE);
18+
19+
profile.dob = {
20+
lastupdated: "2024-01-24",
21+
source: "1",
22+
classification: "C",
23+
value: "1998-11-24",
24+
};
25+
26+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).unit.value = "180";
27+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).floor.value = "08";
28+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).block.value = "101";
29+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).street.value = "JURONG EAST STREET 13";
30+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).postal.value = "600101";
31+
32+
return profile;
33+
},
34+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as _ from "lodash";
2+
import { MyInfoComponentsV4, MyInfoSexCode } from "src/types";
3+
import { FakeProfile, ProfileArchetype } from "./fake-profile";
4+
import { BaseProfile } from "./sponsored-children/BaseProfile";
5+
6+
const id = "S8723243C";
7+
const name = ProfileArchetype.MR_JYTC_RESIDENT;
8+
9+
export const mrJyTcResident: FakeProfile = {
10+
id,
11+
name,
12+
generate: (profileName) => {
13+
profileName = _.isEmpty(profileName) ? name : profileName;
14+
const profile: MyInfoComponentsV4.Schemas.Person = BaseProfile.generate(profileName);
15+
16+
profile.sex.code = MyInfoSexCode.MALE;
17+
profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE);
18+
19+
profile.dob = {
20+
lastupdated: "2024-01-24",
21+
source: "1",
22+
classification: "C",
23+
value: "1987-11-24",
24+
};
25+
26+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).unit.value = "176";
27+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).floor.value = "12";
28+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).block.value = "436B";
29+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).street.value = "FERNVALE ROAD";
30+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).postal.value = "792436";
31+
32+
return profile;
33+
},
34+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as _ from "lodash";
2+
import { MyInfoComponentsV4, MyInfoSexCode } from "src/types";
3+
import { FakeProfile, ProfileArchetype } from "./fake-profile";
4+
import { BaseProfile } from "./sponsored-children/BaseProfile";
5+
6+
const id = "S9353807B";
7+
const name = ProfileArchetype.MR_MPTC_RESIDENT;
8+
9+
export const mrMpTcResident: FakeProfile = {
10+
id,
11+
name,
12+
generate: (profileName) => {
13+
profileName = _.isEmpty(profileName) ? name : profileName;
14+
const profile: MyInfoComponentsV4.Schemas.Person = BaseProfile.generate(profileName);
15+
16+
profile.sex.code = MyInfoSexCode.MALE;
17+
profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE);
18+
19+
profile.dob = {
20+
lastupdated: "2024-01-24",
21+
source: "1",
22+
classification: "C",
23+
value: "1993-11-24",
24+
};
25+
26+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).unit.value = "3007";
27+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).floor.value = "06";
28+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).block.value = "22";
29+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).street.value = "EUNOS CRESCENT";
30+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).postal.value = "400022";
31+
32+
return profile;
33+
},
34+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as _ from "lodash";
2+
import { MyInfoComponentsV4, MyInfoSexCode } from "src/types";
3+
import { FakeProfile, ProfileArchetype } from "./fake-profile";
4+
import { BaseProfile } from "./sponsored-children/BaseProfile";
5+
6+
const id = "S9863761C";
7+
const name = ProfileArchetype.MR_PUTC_RESIDENT;
8+
9+
export const mrPuTcResident: FakeProfile = {
10+
id,
11+
name,
12+
generate: (profileName) => {
13+
profileName = _.isEmpty(profileName) ? name : profileName;
14+
const profile: MyInfoComponentsV4.Schemas.Person = BaseProfile.generate(profileName);
15+
16+
profile.sex.code = MyInfoSexCode.MALE;
17+
profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE);
18+
19+
profile.dob = {
20+
lastupdated: "2024-01-24",
21+
source: "1",
22+
classification: "C",
23+
value: "1998-11-24",
24+
};
25+
26+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).unit.value = "530";
27+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).floor.value = "10";
28+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).block.value = "106B";
29+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).street.value = "PUNGGOL FIELD";
30+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).postal.value = "822106";
31+
32+
return profile;
33+
},
34+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as _ from "lodash";
2+
import { MyInfoComponentsV4, MyInfoSexCode } from "src/types";
3+
import { FakeProfile, ProfileArchetype } from "./fake-profile";
4+
import { BaseProfile } from "./sponsored-children/BaseProfile";
5+
6+
const id = "S8063585J";
7+
const name = ProfileArchetype.MR_TETC_RESIDENT;
8+
9+
export const mrTeTcResident: FakeProfile = {
10+
id,
11+
name,
12+
generate: (profileName) => {
13+
profileName = _.isEmpty(profileName) ? name : profileName;
14+
const profile: MyInfoComponentsV4.Schemas.Person = BaseProfile.generate(profileName);
15+
16+
profile.sex.code = MyInfoSexCode.MALE;
17+
profile.sex.desc = MyInfoSexCode.fn.toEnumDesc(MyInfoSexCode.MALE);
18+
19+
profile.dob = {
20+
lastupdated: "2024-01-24",
21+
source: "1",
22+
classification: "C",
23+
value: "1980-11-24",
24+
};
25+
26+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).unit.value = "19";
27+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).floor.value = "10";
28+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).block.value = "101";
29+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).street.value = "PASIR RIS STREET 12";
30+
(profile.regadd as MyInfoComponentsV4.Schemas.DataitemAddressSg).postal.value = "510101";
31+
32+
return profile;
33+
},
34+
};

0 commit comments

Comments
 (0)