Commit 19951d9
authored
PLU-344: chore: add mock data improvements (#800)
## Problem
Some fields are either missing or not user-friendly for mock data
## Improvements
- Standardise email field types to the user email so it could be used in
postman step
- Add corppass missing info
- Reference:
https://github.com/opengovsg/FormSG/blob/82c5ba6fff7e9628b6c32449148e89c0224e9ff5/src/app/modules/spcp/spcp.util.ts#L92
- Can refer to this pipe in production for example:
9777d71f-dbac-47c4-a70a-c18f02e3a7bc
- Hide NRIC collection if disabled
- Add mock payment data if the form has payment enabled
- For `Products` payment_type: take the first payment product available
in the form setup (`Product or service`)
- For `Variable` payment_type: mock a default product name and amount to
be returned (`Respondents choose what to pay`)
## Tests (for mock data)
- [x] Old and standard forms still work (no payment, singpass or
corppass)
- [x] Payment forms work (test using staging form, can add payments
without a stripe account)
- [x] Singpass forms still work with or without verified NRIC
- [x] Corppass forms will return the verified NRIC and UEN1 parent 9bc1bf4 commit 19951d9
File tree
1 file changed
+53
-1
lines changed- packages/backend/src/apps/formsg/triggers/new-submission
1 file changed
+53
-1
lines changedLines changed: 53 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
| 34 | + | |
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
| |||
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
44 | 63 | | |
45 | 64 | | |
46 | 65 | | |
47 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
48 | 93 | | |
49 | 94 | | |
50 | 95 | | |
| |||
80 | 125 | | |
81 | 126 | | |
82 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
83 | 132 | | |
84 | 133 | | |
85 | 134 | | |
| |||
95 | 144 | | |
96 | 145 | | |
97 | 146 | | |
98 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
99 | 151 | | |
100 | 152 | | |
101 | 153 | | |
| |||
0 commit comments