forked from uport-project/uportlandia
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
451 lines (416 loc) · 10.3 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
import dayjs from "dayjs";
// Images/Logos
import logo from "../images/uport-logo.svg";
// import CityIDIcon from "../images/city-logo.png";
import CityIDIcon from "../images/jeju/jeju.png";
import DiplomaIcon from "../images/jeju/university.png";
import EmploymentIcon from "../images/company-logo.png";
import InsuranceIcon from "../images/jeju/insurance.png";
import PharmacyIcon from "../images/pharmacy-logo.png";
import TransportIcon from "../images/transport-logo.png";
import MuseumIcon from "../images/museum-logo.png";
import COUNTRIES from "./countries";
import getSignerUrl from "./signerUrl";
// Home Page
export const home = {
logo: logo,
logoLink: "https://uport.me/",
name: "제주 + uPort"
};
// Registration Flow
export const registration = {
path: "/city",
name: "City ID",
serviceId: "CITY_ID",
text: {
landingSteps: [
"regnLandingStep1",
"regnLandingStep2",
"regnLandingStep3"
]
},
form: {
firstName: {
label: "First Name",
defaultValue: "",
type: "text",
required: true
},
lastName: {
label: "Last Name",
defaultValue: "",
type: "text",
required: true
},
address: {
label: "Address",
defaultValue: "",
type: "text",
required: true
},
city: {
label: "City",
defaultValue: "",
type: "text",
required: true
},
province: {
label: "State or Province",
defaultValue: "제주",
type: "text",
required: true
},
zipCode: {
label: "Zip Code",
defaultValue: "",
type: "text",
required: true
},
country: {
label: "Country",
defaultValue: "",
type: "dropdown",
items: COUNTRIES,
required: true
},
dob: {
label: "Date of Birth",
defaultValue: "",
placeholder: "YYYY-MM-DD",
type: "date",
min: "1900-01-01",
max: dayjs().add(-13, "year").format("YYYY-MM-DD"),
required: true,
isValid: value => {
const today = dayjs();
if(!/^\d{4}-\d{2}-\d{2}$/.test(value) ||
!dayjs(value).isValid() ||
dayjs(value).year() > today.year() - 13 ||
dayjs(value).year() < 1900
) {
return {
valid: false,
fieldId: "dob",
error: "Invalid date of birth"
};
}
return { valid: true };
}
},
toc: {
label: "I agree to the uPort",
defaultValue: false,
link: "https://www.uport.me/terms-conditions",
linkLabel: "Terms and Conditions",
type: "tnc",
required: true,
validationError: "You must agree to the terms and conditions"
}
}
};
const CITY_ID = { // This should match the Registration Config
id: "CITY_ID",
name: "City ID",
displayName: "cityIdDisplayName",
icon: CityIDIcon,
entity: "The City of uPortlandia",
description: "cityIdDescription",
url: "/city",
claim: "Citizenship",
steps: [
"cityIdStep1",
"cityIdStep2",
"cityIdStep3",
"cityIdStep4"
]
};
// All Services
const DIPLOMA = {
id: "DIPLOMA",
name: "Diploma",
displayName: "diplomaDisplayName",
icon: DiplomaIcon,
entity: "The University of uPortlandia",
description: "diplomaDescription",
url: "/university",
claim: "Diploma",
steps: [
"diplomaStep1",
"diplomaStep2",
"diplomaStep3"
],
details: [
"diplomaDetail1",
"diplomaDetail2"
],
claimData: {
"학교명": "제주대학교",
"전공과목": "컴퓨터 엔지니어링",
"졸업년도": "2019",
"학점": "B+"
}
};
const COMPANY = {
id: "COMPANY",
name: "Employment Verification",
displayName: "employmentDisplayName",
icon: EmploymentIcon,
entity: "Dream Job LLC",
description: "employmentDescription",
url: "/company",
claim: "Employment",
steps: [
"employmentStep1",
"employmentStep2",
"employmentStep3"
],
details: [
"companyDetail1",
"companyDetail2"
],
claimData: {
"Company Name": "Dream Job LLC.",
"Salary": "$100,000",
"Date of Employment": "01/06/2019"
}
};
const INSURANCE = {
id: "INSURANCE",
name: "Insurance Coverage",
displayName: "insuranceDisplayName",
icon: InsuranceIcon,
entity: "People Care Insurance LLC",
description: "insuranceDescription",
url: "/insurance",
claim: "Insurance",
steps: [
"insuranceStep1",
"insuranceStep2",
"insuranceStep3"
],
details: [
"insuranceDetail1"
],
claimData: {
"Policy Number": "0000",
"Group Number": "G-01",
"Dependencies": "2"
}
};
const PHARMACY = {
id: "PHARMACY",
name: "Prescription Drug",
displayName: "pharmacyDisplayName",
icon: PharmacyIcon,
entity: "Your Health Medical Center",
description: "pharmacyDescription",
url: "/pharmacy",
claim: "Prescription Drug",
steps: [
"pharmacyStep1",
"pharmacyStep2",
"pharmacyStep3"
],
details: [
"pharmacyDetail1"
],
claimData: {
"Prescription Drug": "Yes"
}
};
const TRANSPORT = {
id: "TRANSPORT",
name: "Monthly Bus Ticket",
displayName: "transportDisplayName",
icon: TransportIcon,
entity: "uPortlandia City Transit",
description: "transportDescription",
url: "/transport",
claim: "Bus Ticket",
steps: [
"transportStep1",
"transportStep2",
"transportStep3"
],
details: [
"transportDetail1"
],
claimData: {
"Monthly Bus Ticket": "June 2019",
}
};
const MUSEUM = {
id: "MUSEUM",
name: "Annual Membership",
displayName: "museumDisplayName",
icon: MuseumIcon,
entity: "uPortlandia Museum of Modern Art",
description: "museumDescription",
url: "/museum",
claim: "Museum Membership",
steps: [
"museumStep1",
"museumStep2",
"museumStep3"
],
details: [
"museumDetail1"
],
claimData: {
"Annual Membership": "2019"
}
};
const YOURSELF = {
id: "YOURSELF",
name: "Yourself, Any Issuer",
displayName: "Yourself, Any Issuer",
icon: CityIDIcon,
entity: "Yourself, Any Issuer",
description: "Yourself, Any Issuer"
};
// Claims
const FIRST_NAME = {
id: "firstName",
name: "First Name",
displayName: "First Name",
issuedBy: [CITY_ID],
honoredBy: [DIPLOMA, INSURANCE, MUSEUM, TRANSPORT, PHARMACY]
};
const LAST_NAME = {
id: "lastName",
name: "Last Name",
displayName: "Last Name",
issuedBy: [CITY_ID],
honoredBy: [DIPLOMA, INSURANCE, MUSEUM, TRANSPORT, PHARMACY]
};
const DATE_OF_BIRTH = {
id: "dob",
name: "Date of Birth",
displayName: "Date of Birth",
issuedBy: [CITY_ID],
honoredBy: [DIPLOMA, INSURANCE, MUSEUM, TRANSPORT, PHARMACY]
};
const ADDRESS = {
id: "address",
name: "Address",
displayName: "Address",
issuedBy: [CITY_ID],
honoredBy: [DIPLOMA, INSURANCE, MUSEUM, TRANSPORT, PHARMACY]
};
const SCHOOL_NAME = {
name: "School Name",
displayName: "School Name",
issuedBy: [DIPLOMA],
honoredBy: [COMPANY]
};
const PROGRAM_NAME = {
name: "Program Name",
displayName: "Program Name",
type: "required",
issuedBy: [DIPLOMA],
honoredBy: [COMPANY]
};
const FINAL_GRADES = {
name: "Final Grades",
displayName: "Final Grades",
issuedBy: [DIPLOMA],
honoredBy: [COMPANY]
};
const GRADUATION_YEAR = {
name: "Graduation Year",
displayName: "Graduation Year",
issuedBy: [DIPLOMA],
honoredBy: [INSURANCE, COMPANY]
};
const COMPANY_NAME = {
name: "Company Name",
displayName: "Company Name",
issuedBy: [COMPANY],
honoredBy: [INSURANCE]
};
const SALARY = {
name: "Salary",
displayName: "Salary",
issuedBy: [COMPANY]
};
const DATE_OF_EMPLOYMENT = {
name: "Date of Employment",
displayName: "Date of Employment",
issuedBy: [COMPANY],
honoredBy: [INSURANCE]
};
const POLICY_NUMBER = {
name: "Policy Number",
displayName: "Policy Number",
issuedBy: [INSURANCE],
honoredBy: [PHARMACY]
};
const GROUP_NUMBER = {
name: "Group Number",
displayName: "Group Number",
issuedBy: [INSURANCE],
honoredBy: [PHARMACY]
};
const DEPENDENCIES = {
name: "Dependencies",
displayName: "Dependencies",
issuedBy: [INSURANCE],
honoredBy: [PHARMACY]
};
const PRESCRIPTION_DRUG = {
name: "Prescription Drug",
displayName: "pharmacyDisplayName",
issuedBy: [PHARMACY],
honoredBy: [PHARMACY]
};
const BUS_TICKET = {
name: "Monthly Bus Ticket",
displayName: "transportDisplayName",
issuedBy: [TRANSPORT],
honoredBy: [TRANSPORT]
};
const MUSEUM_MEMBERSHIP = {
name: "Annual Membership",
displayName: "museumDisplayName",
issuedBy: [MUSEUM],
honoredBy: [MUSEUM]
};
// Attach claims to services
CITY_ID.generatedClaims = [FIRST_NAME, LAST_NAME, ADDRESS, DATE_OF_BIRTH];
CITY_ID.requiredClaims = CITY_ID.generatedClaims.map(c => ({
...c,
issuedBy: [YOURSELF]
}));
DIPLOMA.requiredClaims = [FIRST_NAME, LAST_NAME, DATE_OF_BIRTH];
DIPLOMA.requiredServices = [CITY_ID];
DIPLOMA.generatedClaims = [SCHOOL_NAME, PROGRAM_NAME, GRADUATION_YEAR, FINAL_GRADES];
COMPANY.requiredClaims = [FIRST_NAME, LAST_NAME, SCHOOL_NAME, PROGRAM_NAME, FINAL_GRADES];
COMPANY.requiredServices = [CITY_ID, DIPLOMA];
COMPANY.generatedClaims = [COMPANY_NAME, SALARY, DATE_OF_EMPLOYMENT];
INSURANCE.requiredClaims = [FIRST_NAME, LAST_NAME, COMPANY_NAME, DATE_OF_EMPLOYMENT];
INSURANCE.requiredServices = [CITY_ID, COMPANY];
INSURANCE.generatedClaims = [POLICY_NUMBER, GROUP_NUMBER, DEPENDENCIES];
PHARMACY.requiredClaims = [FIRST_NAME, LAST_NAME, POLICY_NUMBER, GRADUATION_YEAR, DEPENDENCIES];
PHARMACY.requiredServices = [CITY_ID, INSURANCE, DIPLOMA];
PHARMACY.generatedClaims = [PRESCRIPTION_DRUG];
TRANSPORT.requiredClaims = [FIRST_NAME, LAST_NAME, ADDRESS, DATE_OF_BIRTH, GRADUATION_YEAR];
TRANSPORT.requiredServices = [CITY_ID, DIPLOMA];
TRANSPORT.generatedClaims = [BUS_TICKET];
MUSEUM.requiredClaims = [FIRST_NAME, LAST_NAME, ADDRESS, DATE_OF_BIRTH]
MUSEUM.requiredServices = [CITY_ID];
MUSEUM.generatedClaims = [MUSEUM_MEMBERSHIP];
export const SERVICES = {
CITY_ID, DIPLOMA, COMPANY, INSURANCE, PHARMACY, TRANSPORT, MUSEUM
};
// Create route config for services
export const routes = Object.keys(SERVICES).map(serviceId => ({
path: SERVICES[serviceId].url,
serviceId
}));
// Ext Service URLs
const getChasquiUrl = () => process.env.REACT_APP_TARGET_ENV === "prod"
? "https://api.uport.me/chasqui/"
: "https://api.uport.space/chasqui/";
export const CHASQUI_URL = getChasquiUrl();
export const SIGNER_URL = getSignerUrl();
export const SENTRY_DSN = "https://7a87f2dc2e774d5891ec2ea565b40c05@sentry.io/1449781";