@taiger-common/model 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cjs/model/Internaldoc.js +14 -0
  2. package/dist/cjs/model/Interval.js +39 -0
  3. package/dist/cjs/model/Interview.js +40 -0
  4. package/dist/cjs/model/InterviewSurveyResponse.js +24 -0
  5. package/dist/cjs/model/Keywordset.js +48 -0
  6. package/dist/cjs/model/Note.js +9 -0
  7. package/dist/cjs/model/Permission.js +48 -0
  8. package/dist/cjs/model/Program.js +290 -0
  9. package/dist/cjs/model/Programrequirement.js +118 -0
  10. package/dist/cjs/model/ResponseTime.js +27 -0
  11. package/dist/cjs/model/SurveyInput.js +56 -0
  12. package/dist/cjs/model/Template.js +19 -0
  13. package/dist/cjs/model/Tenant.js +9 -0
  14. package/dist/cjs/model/Ticket.js +55 -0
  15. package/dist/cjs/model/Token.js +20 -0
  16. package/dist/cjs/model/User.js +676 -0
  17. package/dist/cjs/model/index.js +17 -0
  18. package/dist/esm/model/Internaldoc.js +11 -0
  19. package/dist/esm/model/Interval.js +36 -0
  20. package/dist/esm/model/Interview.js +37 -0
  21. package/dist/esm/model/InterviewSurveyResponse.js +21 -0
  22. package/dist/esm/model/Keywordset.js +45 -0
  23. package/dist/esm/model/Note.js +6 -0
  24. package/dist/esm/model/Permission.js +45 -0
  25. package/dist/esm/model/Program.js +287 -0
  26. package/dist/esm/model/Programrequirement.js +115 -0
  27. package/dist/esm/model/ResponseTime.js +24 -0
  28. package/dist/esm/model/SurveyInput.js +53 -0
  29. package/dist/esm/model/Template.js +16 -0
  30. package/dist/esm/model/Tenant.js +6 -0
  31. package/dist/esm/model/Ticket.js +52 -0
  32. package/dist/esm/model/Token.js +17 -0
  33. package/dist/esm/model/User.js +670 -0
  34. package/dist/esm/model/index.js +17 -0
  35. package/dist/types/model/Internaldoc.d.ts +58 -0
  36. package/dist/types/model/Interval.d.ts +58 -0
  37. package/dist/types/model/Interview.d.ts +84 -0
  38. package/dist/types/model/InterviewSurveyResponse.d.ts +93 -0
  39. package/dist/types/model/Keywordset.d.ts +75 -0
  40. package/dist/types/model/Note.d.ts +43 -0
  41. package/dist/types/model/Permission.d.ts +81 -0
  42. package/dist/types/model/Program.d.ts +453 -0
  43. package/dist/types/model/Programrequirement.d.ts +168 -0
  44. package/dist/types/model/ResponseTime.d.ts +49 -0
  45. package/dist/types/model/SurveyInput.d.ts +121 -0
  46. package/dist/types/model/Template.d.ts +46 -0
  47. package/dist/types/model/Tenant.d.ts +43 -0
  48. package/dist/types/model/Ticket.d.ts +69 -0
  49. package/dist/types/model/Token.d.ts +43 -0
  50. package/dist/types/model/User.d.ts +31 -0
  51. package/dist/types/model/index.d.ts +17 -0
  52. package/dist/umd/index.js +1 -1
  53. package/package.json +6 -1
@@ -0,0 +1,676 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Admin = void 0;
7
+ var mongoose_1 = require("mongoose");
8
+ var isEmail_1 = __importDefault(require("validator/lib/isEmail"));
9
+ var core_1 = require("@taiger-common/core");
10
+ var Program_1 = require("./Program");
11
+ var ManagerType = {
12
+ Agent: 'Agent',
13
+ Editor: 'Editor',
14
+ AgentAndEditor: 'AgentAndEditor',
15
+ None: 'None'
16
+ };
17
+ var options = { discriminatorKey: 'role', timestamps: true };
18
+ var attributeSchema = new mongoose_1.Schema({
19
+ value: {
20
+ type: Number,
21
+ required: true
22
+ },
23
+ name: {
24
+ type: String,
25
+ required: true
26
+ }
27
+ });
28
+ var UserSchema = new mongoose_1.Schema({
29
+ firstname: {
30
+ type: String,
31
+ trim: true
32
+ },
33
+ firstname_chinese: {
34
+ type: String,
35
+ trim: true
36
+ },
37
+ lastname: {
38
+ type: String,
39
+ trim: true
40
+ },
41
+ lastname_chinese: {
42
+ type: String,
43
+ trim: true
44
+ },
45
+ email: {
46
+ type: String,
47
+ unique: true,
48
+ lowercase: true,
49
+ validate: [isEmail_1.default, 'Invalid email address']
50
+ },
51
+ password: {
52
+ type: String,
53
+ select: false,
54
+ trim: true,
55
+ minlength: [8, 'Password must contain at least 8 characters']
56
+ },
57
+ archiv: { type: Boolean, default: false },
58
+ birthday: {
59
+ type: String,
60
+ default: ''
61
+ },
62
+ linkedIn: String,
63
+ lineId: String,
64
+ isAccountActivated: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ notification: {
69
+ isRead_survey_not_complete: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ isRead_uni_assist_task_assigned: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ isRead_new_agent_assigned: {
78
+ type: Boolean,
79
+ default: true
80
+ },
81
+ isRead_new_editor_assigned: {
82
+ type: Boolean,
83
+ default: true
84
+ },
85
+ isRead_new_cvmlrl_tasks_created: {
86
+ type: Boolean,
87
+ default: true
88
+ },
89
+ isRead_new_cvmlrl_messsage: {
90
+ type: Boolean,
91
+ default: true
92
+ },
93
+ isRead_base_documents_missing: {
94
+ type: Boolean,
95
+ default: false
96
+ },
97
+ isRead_base_documents_rejected: {
98
+ type: Boolean,
99
+ default: true
100
+ },
101
+ isRead_new_programs_assigned: {
102
+ type: Boolean,
103
+ default: false
104
+ }
105
+ },
106
+ taigerai: {
107
+ input: {
108
+ name: {
109
+ type: String,
110
+ default: ''
111
+ },
112
+ status: {
113
+ type: String,
114
+ enum: Object.values(core_1.DocumentStatusType),
115
+ default: core_1.DocumentStatusType.Missing
116
+ },
117
+ file_category: {
118
+ type: String,
119
+ default: 'Others'
120
+ },
121
+ path: {
122
+ type: String,
123
+ default: ''
124
+ },
125
+ // TODO: updateBy
126
+ updatedAt: Date
127
+ },
128
+ output: {
129
+ name: {
130
+ type: String,
131
+ default: ''
132
+ },
133
+ status: {
134
+ type: String,
135
+ enum: Object.values(core_1.DocumentStatusType),
136
+ default: core_1.DocumentStatusType.Missing
137
+ },
138
+ file_category: {
139
+ type: String,
140
+ default: 'Others'
141
+ },
142
+ path: {
143
+ type: String,
144
+ default: ''
145
+ },
146
+ // TODO: updateBy
147
+ updatedAt: Date
148
+ },
149
+ feedback: {
150
+ message: {
151
+ type: String,
152
+ default: ''
153
+ },
154
+ // TODO: updateBy
155
+ updatedAt: Date
156
+ }
157
+ },
158
+ application_preference: {
159
+ expected_application_date: {
160
+ type: String,
161
+ default: ''
162
+ },
163
+ expected_application_semester: {
164
+ type: String,
165
+ default: ''
166
+ },
167
+ target_program_language: {
168
+ type: String,
169
+ default: ''
170
+ },
171
+ // To be deprecated -> read only in frontend
172
+ target_application_field: {
173
+ type: String,
174
+ default: ''
175
+ },
176
+ targetApplicationSubjects: [
177
+ {
178
+ type: String,
179
+ enum: Program_1.PROGRAM_SUBJECT_KEYS
180
+ }
181
+ ],
182
+ target_degree: {
183
+ type: String,
184
+ default: ''
185
+ },
186
+ considered_privat_universities: {
187
+ type: String,
188
+ default: '-'
189
+ },
190
+ special_wished: {
191
+ type: String,
192
+ default: ''
193
+ },
194
+ application_outside_germany: {
195
+ type: String,
196
+ default: '-'
197
+ },
198
+ updatedAt: Date
199
+ },
200
+ academic_background: {
201
+ university: {
202
+ high_school_isGraduated: {
203
+ type: String,
204
+ default: ''
205
+ },
206
+ attended_high_school: {
207
+ type: String,
208
+ default: ''
209
+ },
210
+ high_school_graduated_year: {
211
+ type: String,
212
+ default: ''
213
+ },
214
+ attended_university: {
215
+ type: String,
216
+ default: ''
217
+ },
218
+ attended_university_program: {
219
+ type: String,
220
+ default: ''
221
+ },
222
+ isGraduated: {
223
+ type: String,
224
+ default: '-'
225
+ },
226
+ expected_grad_date: {
227
+ type: String,
228
+ default: ''
229
+ },
230
+ Highest_GPA_Uni: {
231
+ type: Number
232
+ },
233
+ Passing_GPA_Uni: {
234
+ type: Number
235
+ },
236
+ My_GPA_Uni: {
237
+ type: Number
238
+ },
239
+ Has_Exchange_Experience: {
240
+ type: String,
241
+ default: '-'
242
+ },
243
+ isSecondGraduated: {
244
+ type: String,
245
+ default: '-'
246
+ },
247
+ expectedSecondDegreeGradDate: {
248
+ type: String,
249
+ default: ''
250
+ },
251
+ attendedSecondDegreeUniversity: {
252
+ type: String,
253
+ default: ''
254
+ },
255
+ attendedSecondDegreeProgram: {
256
+ type: String,
257
+ default: ''
258
+ },
259
+ highestSecondDegreeGPA: {
260
+ type: Number
261
+ },
262
+ passingSecondDegreeGPA: {
263
+ type: Number
264
+ },
265
+ mySecondDegreeGPA: {
266
+ type: Number
267
+ },
268
+ Has_Internship_Experience: {
269
+ type: String,
270
+ default: '-'
271
+ },
272
+ Has_Working_Experience: {
273
+ type: String,
274
+ default: '-'
275
+ },
276
+ updatedAt: Date
277
+ },
278
+ language: {
279
+ english_isPassed: {
280
+ type: String,
281
+ default: '-'
282
+ },
283
+ english_certificate: {
284
+ type: String,
285
+ default: ''
286
+ },
287
+ english_score: {
288
+ type: String,
289
+ default: ''
290
+ },
291
+ english_score_reading: {
292
+ type: String,
293
+ default: ''
294
+ },
295
+ english_score_listening: {
296
+ type: String,
297
+ default: ''
298
+ },
299
+ english_score_writing: {
300
+ type: String,
301
+ default: ''
302
+ },
303
+ english_score_speaking: {
304
+ type: String,
305
+ default: ''
306
+ },
307
+ english_test_date: {
308
+ type: String,
309
+ default: ''
310
+ },
311
+ german_isPassed: {
312
+ type: String,
313
+ default: '-'
314
+ },
315
+ german_certificate: {
316
+ type: String,
317
+ default: ''
318
+ },
319
+ german_score: {
320
+ type: String,
321
+ default: ''
322
+ },
323
+ german_test_date: {
324
+ type: String,
325
+ default: ''
326
+ },
327
+ gre_isPassed: {
328
+ type: String,
329
+ default: '-'
330
+ },
331
+ gre_certificate: {
332
+ type: String,
333
+ default: ''
334
+ },
335
+ gre_score: {
336
+ type: String,
337
+ default: ''
338
+ },
339
+ gre_test_date: {
340
+ type: String,
341
+ default: ''
342
+ },
343
+ gmat_isPassed: {
344
+ type: String,
345
+ default: '-'
346
+ },
347
+ gmat_certificate: {
348
+ type: String,
349
+ default: ''
350
+ },
351
+ gmat_score: {
352
+ type: String,
353
+ default: ''
354
+ },
355
+ gmat_test_date: {
356
+ type: String,
357
+ default: ''
358
+ },
359
+ updatedAt: Date
360
+ }
361
+ },
362
+ lastLoginAt: Date
363
+ }, options);
364
+ var User = (0, mongoose_1.model)('User', UserSchema);
365
+ var Guest = User.discriminator('Guest', new mongoose_1.Schema({}, options), core_1.Role.Guest);
366
+ var applicationSchema = new mongoose_1.Schema({
367
+ programId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Program' },
368
+ uni_assist: {
369
+ status: {
370
+ type: String,
371
+ default: 'notstarted'
372
+ },
373
+ vpd_file_path: {
374
+ type: String,
375
+ default: ''
376
+ },
377
+ vpd_paid_confirmation_file_path: {
378
+ type: String,
379
+ default: ''
380
+ },
381
+ vpd_paid_confirmation_file_status: {
382
+ type: String,
383
+ default: ''
384
+ },
385
+ isPaid: {
386
+ type: Boolean,
387
+ default: false
388
+ },
389
+ updatedAt: Date
390
+ },
391
+ portal_credentials: {
392
+ application_portal_a: {
393
+ account: { type: String, select: false, trim: true },
394
+ password: { type: String, select: false, trim: true }
395
+ },
396
+ application_portal_b: {
397
+ account: { type: String, select: false, trim: true },
398
+ password: { type: String, select: false, trim: true }
399
+ }
400
+ },
401
+ doc_modification_thread: [
402
+ {
403
+ isFinalVersion: {
404
+ type: Boolean,
405
+ default: false
406
+ },
407
+ latest_message_left_by_id: {
408
+ type: String,
409
+ default: ''
410
+ },
411
+ doc_thread_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Documentthread' },
412
+ updatedAt: Date,
413
+ createdAt: Date
414
+ }
415
+ ],
416
+ reject_reason: {
417
+ type: String,
418
+ default: ''
419
+ },
420
+ admission_letter: {
421
+ status: {
422
+ type: String,
423
+ default: 'notstarted'
424
+ },
425
+ admission_file_path: {
426
+ type: String,
427
+ default: ''
428
+ },
429
+ comments: { type: String, default: '' },
430
+ updatedAt: Date
431
+ },
432
+ finalEnrolment: { type: Boolean, default: false },
433
+ decided: { type: String, default: '-' },
434
+ closed: { type: String, default: '-' },
435
+ admission: { type: String, default: '-' }
436
+ });
437
+ var Student = User.discriminator('Student', new mongoose_1.Schema({
438
+ agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
439
+ editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
440
+ needEditor: { type: Boolean, default: false },
441
+ applications: [applicationSchema],
442
+ applying_program_count: {
443
+ type: Number,
444
+ default: 0
445
+ },
446
+ attributes: [
447
+ {
448
+ type: attributeSchema,
449
+ required: true
450
+ }
451
+ ],
452
+ profile: [
453
+ {
454
+ name: {
455
+ type: String,
456
+ required: true
457
+ },
458
+ status: {
459
+ type: String,
460
+ enum: Object.values(core_1.DocumentStatusType),
461
+ default: core_1.DocumentStatusType.Missing
462
+ },
463
+ required: {
464
+ type: Boolean,
465
+ required: true
466
+ },
467
+ path: {
468
+ type: String,
469
+ default: ''
470
+ },
471
+ feedback: {
472
+ type: String,
473
+ default: ''
474
+ },
475
+ // TODO: updateBy
476
+ updatedAt: Date
477
+ }
478
+ ],
479
+ generaldocs_threads: [
480
+ {
481
+ isFinalVersion: {
482
+ type: Boolean,
483
+ default: false
484
+ },
485
+ latest_message_left_by_id: {
486
+ type: String,
487
+ default: ''
488
+ },
489
+ doc_thread_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Documentthread' },
490
+ updatedAt: Date,
491
+ createdAt: Date
492
+ }
493
+ ]
494
+ }, options), core_1.Role.Student);
495
+ var External = User.discriminator('External', new mongoose_1.Schema({
496
+ attribute: {
497
+ can_update_program_list: {
498
+ type: Boolean,
499
+ default: false
500
+ },
501
+ can_update_course_analysis: {
502
+ type: Boolean,
503
+ default: false
504
+ },
505
+ can_add_articles: {
506
+ type: Boolean,
507
+ default: false
508
+ }
509
+ }
510
+ }, options), core_1.Role.External);
511
+ var Manager = User.discriminator('Manager', new mongoose_1.Schema({
512
+ agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
513
+ editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
514
+ manager_type: {
515
+ type: String,
516
+ enum: Object.values(ManagerType),
517
+ default: ManagerType.None
518
+ },
519
+ manager_notification: {
520
+ isRead_new_base_docs_uploaded: [
521
+ {
522
+ student_id: {
523
+ type: String,
524
+ default: ''
525
+ }
526
+ }
527
+ ],
528
+ isRead_new_programs_assigned: {
529
+ type: Boolean,
530
+ default: false
531
+ }
532
+ },
533
+ attribute: {
534
+ can_write_ml: {
535
+ type: Boolean,
536
+ default: false
537
+ },
538
+ can_write_rl: {
539
+ type: Boolean,
540
+ default: false
541
+ },
542
+ can_write_cv: {
543
+ type: Boolean,
544
+ default: false
545
+ },
546
+ can_write_essay: {
547
+ type: Boolean,
548
+ default: false
549
+ },
550
+ can_do_interview: {
551
+ type: Boolean,
552
+ default: false
553
+ }
554
+ }
555
+ }, options), core_1.Role.Manager);
556
+ var Agent = User.discriminator('Agent', new mongoose_1.Schema({
557
+ timezone: { type: String, default: '' },
558
+ officehours: {
559
+ Monday: {
560
+ active: { type: Boolean, default: false },
561
+ time_slots: [{ type: Object }]
562
+ },
563
+ Tuesday: {
564
+ active: { type: Boolean, default: false },
565
+ time_slots: [{ type: Object }]
566
+ },
567
+ Wednesday: {
568
+ active: { type: Boolean, default: false },
569
+ time_slots: [{ type: Object }]
570
+ },
571
+ Thursday: {
572
+ active: { type: Boolean, default: false },
573
+ time_slots: [{ type: Object }]
574
+ },
575
+ Friday: {
576
+ active: { type: Boolean, default: false },
577
+ time_slots: [{ type: Object }]
578
+ },
579
+ Saturday: {
580
+ active: { type: Boolean, default: false },
581
+ time_slots: [{ type: Object }]
582
+ },
583
+ Sunday: {
584
+ active: { type: Boolean, default: false },
585
+ time_slots: [{ type: Object }]
586
+ }
587
+ },
588
+ selfIntroduction: {
589
+ type: String,
590
+ default: ''
591
+ },
592
+ agent_notification: {
593
+ isRead_new_base_docs_uploaded: [
594
+ {
595
+ student_id: {
596
+ type: String,
597
+ default: ''
598
+ },
599
+ student_firstname: {
600
+ type: String,
601
+ default: ''
602
+ },
603
+ student_lastname: {
604
+ type: String,
605
+ default: ''
606
+ }
607
+ }
608
+ ],
609
+ isRead_new_survey_updated: {
610
+ type: Boolean,
611
+ default: true
612
+ },
613
+ isRead_applications_status_changed: {
614
+ type: Boolean,
615
+ default: true
616
+ },
617
+ isRead_new_programs_assigned: {
618
+ type: Boolean,
619
+ default: false
620
+ }
621
+ }
622
+ }, options), core_1.Role.Agent);
623
+ var Editor = User.discriminator('Editor', new mongoose_1.Schema({
624
+ editor_notification: {
625
+ isRead_survey_not_complete: {
626
+ type: Boolean,
627
+ default: false
628
+ },
629
+ isRead_base_documents_missing: {
630
+ type: Boolean,
631
+ default: false
632
+ },
633
+ isRead_base_documents_rejected: {
634
+ type: Boolean,
635
+ default: false
636
+ },
637
+ isRead_new_programs_assigned: {
638
+ type: Boolean,
639
+ default: false
640
+ }
641
+ },
642
+ attribute: {
643
+ can_write_ml: {
644
+ type: Boolean,
645
+ default: false
646
+ },
647
+ can_write_rl: {
648
+ type: Boolean,
649
+ default: false
650
+ },
651
+ can_write_cv: {
652
+ type: Boolean,
653
+ default: false
654
+ },
655
+ can_write_essay: {
656
+ type: Boolean,
657
+ default: false
658
+ },
659
+ can_do_interview: {
660
+ type: Boolean,
661
+ default: false
662
+ }
663
+ }
664
+ }, options), core_1.Role.Editor);
665
+ exports.Admin = User.discriminator('Admin', new mongoose_1.Schema({}, options), core_1.Role.Admin);
666
+ module.exports = {
667
+ User: User,
668
+ UserSchema: UserSchema,
669
+ Guest: Guest,
670
+ Student: Student,
671
+ Agent: Agent,
672
+ External: External,
673
+ Editor: Editor,
674
+ Manager: Manager,
675
+ Admin: exports.Admin
676
+ };
@@ -24,3 +24,20 @@ __exportStar(require("./Docspage"), exports);
24
24
  __exportStar(require("./Documentation"), exports);
25
25
  __exportStar(require("./Documentthread"), exports);
26
26
  __exportStar(require("./Event"), exports);
27
+ __exportStar(require("./Internaldoc"), exports);
28
+ __exportStar(require("./Interval"), exports);
29
+ __exportStar(require("./Event"), exports);
30
+ __exportStar(require("./Interview"), exports);
31
+ __exportStar(require("./InterviewSurveyResponse"), exports);
32
+ __exportStar(require("./Keywordset"), exports);
33
+ __exportStar(require("./Note"), exports);
34
+ __exportStar(require("./Permission"), exports);
35
+ __exportStar(require("./Program"), exports);
36
+ __exportStar(require("./Programrequirement"), exports);
37
+ __exportStar(require("./ResponseTime"), exports);
38
+ __exportStar(require("./SurveyInput"), exports);
39
+ __exportStar(require("./Template"), exports);
40
+ __exportStar(require("./Tenant"), exports);
41
+ __exportStar(require("./Ticket"), exports);
42
+ __exportStar(require("./Token"), exports);
43
+ __exportStar(require("./User"), exports);
@@ -0,0 +1,11 @@
1
+ import { Schema } from 'mongoose';
2
+ export var internaldocsSchema = new Schema({
3
+ name: { type: String, default: '' },
4
+ title: { type: String, default: '' },
5
+ category: { type: String, default: '' },
6
+ internal: { type: Boolean, default: true },
7
+ author: { type: String, default: '' },
8
+ text: { type: String, default: '' },
9
+ country: { type: String, default: '' },
10
+ updatedAt: Date
11
+ });