@taiger-common/model 1.0.57 → 1.0.58

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 (135) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -23
  3. package/dist/cjs/index.js +0 -2
  4. package/dist/cjs/model/Documentthread.js +4 -2
  5. package/dist/cjs/model/Program.js +83 -331
  6. package/dist/cjs/model/User.js +139 -78
  7. package/dist/cjs/model/index.js +1 -1
  8. package/dist/esm/index.js +0 -2
  9. package/dist/esm/model/Documentthread.js +4 -2
  10. package/dist/esm/model/Program.js +78 -326
  11. package/dist/esm/model/User.js +124 -62
  12. package/dist/esm/model/index.js +1 -1
  13. package/dist/types/index.d.ts +0 -2
  14. package/dist/types/model/Allcourse.d.ts +27 -6
  15. package/dist/types/model/Audit.d.ts +43 -18
  16. package/dist/types/model/Basedocumentationslink.d.ts +16 -11
  17. package/dist/types/model/Communication.d.ts +71 -22
  18. package/dist/types/model/Complaint.d.ts +170 -25
  19. package/dist/types/model/Course.d.ts +49 -23
  20. package/dist/types/model/Docspage.d.ts +37 -14
  21. package/dist/types/model/Documentation.d.ts +28 -15
  22. package/dist/types/model/Documentthread.d.ts +178 -35
  23. package/dist/types/model/Event.d.ts +54 -15
  24. package/dist/types/model/Internaldoc.d.ts +28 -15
  25. package/dist/types/model/Interval.d.ts +26 -13
  26. package/dist/types/model/Interview.d.ts +50 -23
  27. package/dist/types/model/InterviewSurveyResponse.d.ts +62 -20
  28. package/dist/types/model/Keywordset.d.ts +44 -14
  29. package/dist/types/model/Note.d.ts +13 -11
  30. package/dist/types/model/Permission.d.ts +56 -21
  31. package/dist/types/model/Program.d.ts +232 -387
  32. package/dist/types/model/Programrequirement.d.ts +140 -37
  33. package/dist/types/model/ResponseTime.d.ts +17 -12
  34. package/dist/types/model/SurveyInput.d.ts +90 -23
  35. package/dist/types/model/Template.d.ts +13 -8
  36. package/dist/types/model/Tenant.d.ts +13 -10
  37. package/dist/types/model/Ticket.d.ts +38 -16
  38. package/dist/types/model/Token.d.ts +12 -10
  39. package/dist/types/model/User.d.ts +1 -2148
  40. package/dist/types/model/index.d.ts +1 -1
  41. package/dist/umd/index.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/cjs/api/account.js +0 -35
  44. package/dist/cjs/api/applications.js +0 -46
  45. package/dist/cjs/api/audit.js +0 -8
  46. package/dist/cjs/api/auth.js +0 -19
  47. package/dist/cjs/api/common.js +0 -32
  48. package/dist/cjs/api/communications.js +0 -15
  49. package/dist/cjs/api/courses.js +0 -23
  50. package/dist/cjs/api/crm.js +0 -87
  51. package/dist/cjs/api/documentThreads.js +0 -44
  52. package/dist/cjs/api/documentations.js +0 -33
  53. package/dist/cjs/api/events.js +0 -22
  54. package/dist/cjs/api/index.js +0 -41
  55. package/dist/cjs/api/interviews.js +0 -35
  56. package/dist/cjs/api/meetings.js +0 -20
  57. package/dist/cjs/api/notes.js +0 -8
  58. package/dist/cjs/api/permissions.js +0 -9
  59. package/dist/cjs/api/portals.js +0 -24
  60. package/dist/cjs/api/programRequirements.js +0 -26
  61. package/dist/cjs/api/programs.js +0 -93
  62. package/dist/cjs/api/search.js +0 -24
  63. package/dist/cjs/api/serialized.js +0 -50
  64. package/dist/cjs/api/students.js +0 -29
  65. package/dist/cjs/api/teams.js +0 -48
  66. package/dist/cjs/api/tickets.js +0 -21
  67. package/dist/cjs/api/users.js +0 -42
  68. package/dist/cjs/api/widgets.js +0 -21
  69. package/dist/cjs/constants/users.js +0 -12
  70. package/dist/cjs/model/Application.js +0 -78
  71. package/dist/cjs/schema/index.js +0 -22
  72. package/dist/cjs/schema/models.js +0 -523
  73. package/dist/cjs/schema/serialized.js +0 -202
  74. package/dist/esm/api/account.js +0 -32
  75. package/dist/esm/api/applications.js +0 -43
  76. package/dist/esm/api/audit.js +0 -5
  77. package/dist/esm/api/auth.js +0 -16
  78. package/dist/esm/api/common.js +0 -27
  79. package/dist/esm/api/communications.js +0 -12
  80. package/dist/esm/api/courses.js +0 -20
  81. package/dist/esm/api/crm.js +0 -84
  82. package/dist/esm/api/documentThreads.js +0 -41
  83. package/dist/esm/api/documentations.js +0 -30
  84. package/dist/esm/api/events.js +0 -19
  85. package/dist/esm/api/index.js +0 -25
  86. package/dist/esm/api/interviews.js +0 -32
  87. package/dist/esm/api/meetings.js +0 -17
  88. package/dist/esm/api/notes.js +0 -5
  89. package/dist/esm/api/permissions.js +0 -6
  90. package/dist/esm/api/portals.js +0 -21
  91. package/dist/esm/api/programRequirements.js +0 -23
  92. package/dist/esm/api/programs.js +0 -90
  93. package/dist/esm/api/search.js +0 -21
  94. package/dist/esm/api/serialized.js +0 -13
  95. package/dist/esm/api/students.js +0 -26
  96. package/dist/esm/api/teams.js +0 -45
  97. package/dist/esm/api/tickets.js +0 -18
  98. package/dist/esm/api/users.js +0 -39
  99. package/dist/esm/api/widgets.js +0 -18
  100. package/dist/esm/constants/users.js +0 -9
  101. package/dist/esm/model/Application.js +0 -75
  102. package/dist/esm/schema/index.js +0 -6
  103. package/dist/esm/schema/models.js +0 -520
  104. package/dist/esm/schema/serialized.js +0 -199
  105. package/dist/types/api/account.d.ts +0 -503
  106. package/dist/types/api/applications.d.ts +0 -3417
  107. package/dist/types/api/audit.d.ts +0 -89
  108. package/dist/types/api/auth.d.ts +0 -3411
  109. package/dist/types/api/common.d.ts +0 -90
  110. package/dist/types/api/communications.d.ts +0 -617
  111. package/dist/types/api/courses.d.ts +0 -849
  112. package/dist/types/api/crm.d.ts +0 -1113
  113. package/dist/types/api/documentThreads.d.ts +0 -38257
  114. package/dist/types/api/documentations.d.ts +0 -933
  115. package/dist/types/api/events.d.ts +0 -7209
  116. package/dist/types/api/index.d.ts +0 -25
  117. package/dist/types/api/interviews.d.ts +0 -802
  118. package/dist/types/api/meetings.d.ts +0 -49
  119. package/dist/types/api/notes.d.ts +0 -85
  120. package/dist/types/api/permissions.d.ts +0 -195
  121. package/dist/types/api/portals.d.ts +0 -770
  122. package/dist/types/api/programRequirements.d.ts +0 -2685
  123. package/dist/types/api/programs.d.ts +0 -3046
  124. package/dist/types/api/search.d.ts +0 -292
  125. package/dist/types/api/serialized.d.ts +0 -7
  126. package/dist/types/api/students.d.ts +0 -307
  127. package/dist/types/api/teams.d.ts +0 -3671
  128. package/dist/types/api/tickets.d.ts +0 -960
  129. package/dist/types/api/users.d.ts +0 -6960
  130. package/dist/types/api/widgets.d.ts +0 -234
  131. package/dist/types/constants/users.d.ts +0 -9
  132. package/dist/types/model/Application.d.ts +0 -85
  133. package/dist/types/schema/index.d.ts +0 -6
  134. package/dist/types/schema/models.d.ts +0 -2038
  135. package/dist/types/schema/serialized.d.ts +0 -8823
@@ -3,28 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.editorSchema = exports.agentSchema = exports.managerSchema = exports.externalSchema = exports.studentSchema = exports.userSchema = exports.attributeSchema = exports.options = exports.ManagerType = exports.DocumentStatusType = void 0;
7
6
  var mongoose_1 = require("mongoose");
8
- var validator_1 = __importDefault(require("validator"));
9
- var users_1 = require("../constants/users");
7
+ var isEmail_1 = __importDefault(require("validator/lib/isEmail"));
8
+ var core_1 = require("@taiger-common/core");
10
9
  var Program_1 = require("./Program");
11
- // --- Interfaces for frontend/backend type reference ---
12
- var DocumentStatusType;
13
- (function (DocumentStatusType) {
14
- DocumentStatusType["Uploaded"] = "uploaded";
15
- DocumentStatusType["Missing"] = "missing";
16
- DocumentStatusType["Accepted"] = "accepted";
17
- DocumentStatusType["Rejected"] = "rejected";
18
- DocumentStatusType["NotNeeded"] = "notneeded";
19
- })(DocumentStatusType = exports.DocumentStatusType || (exports.DocumentStatusType = {}));
20
- exports.ManagerType = {
10
+ var ManagerType = {
21
11
  Agent: 'Agent',
22
12
  Editor: 'Editor',
23
13
  AgentAndEditor: 'AgentAndEditor',
24
14
  None: 'None'
25
15
  };
26
- exports.options = { discriminatorKey: 'role', timestamps: true };
27
- exports.attributeSchema = new mongoose_1.Schema({
16
+ var options = { discriminatorKey: 'role', timestamps: true };
17
+ var attributeSchema = new mongoose_1.Schema({
28
18
  value: {
29
19
  type: Number,
30
20
  required: true
@@ -34,12 +24,7 @@ exports.attributeSchema = new mongoose_1.Schema({
34
24
  required: true
35
25
  }
36
26
  });
37
- exports.userSchema = new mongoose_1.Schema({
38
- role: {
39
- type: String,
40
- enum: Object.values(users_1.Role),
41
- required: true
42
- },
27
+ var userSchema = new mongoose_1.Schema({
43
28
  firstname: {
44
29
  type: String,
45
30
  trim: true
@@ -60,10 +45,7 @@ exports.userSchema = new mongoose_1.Schema({
60
45
  type: String,
61
46
  unique: true,
62
47
  lowercase: true,
63
- validate: [validator_1.default.isEmail, 'Invalid email address']
64
- },
65
- pictureUrl: {
66
- type: String
48
+ validate: [isEmail_1.default, 'Invalid email address']
67
49
  },
68
50
  password: {
69
51
  type: String,
@@ -128,8 +110,8 @@ exports.userSchema = new mongoose_1.Schema({
128
110
  },
129
111
  status: {
130
112
  type: String,
131
- enum: Object.values(DocumentStatusType),
132
- default: DocumentStatusType.Missing
113
+ enum: Object.values(core_1.DocumentStatusType),
114
+ default: core_1.DocumentStatusType.Missing
133
115
  },
134
116
  file_category: {
135
117
  type: String,
@@ -149,8 +131,8 @@ exports.userSchema = new mongoose_1.Schema({
149
131
  },
150
132
  status: {
151
133
  type: String,
152
- enum: Object.values(DocumentStatusType),
153
- default: DocumentStatusType.Missing
134
+ enum: Object.values(core_1.DocumentStatusType),
135
+ default: core_1.DocumentStatusType.Missing
154
136
  },
155
137
  file_category: {
156
138
  type: String,
@@ -377,18 +359,91 @@ exports.userSchema = new mongoose_1.Schema({
377
359
  }
378
360
  },
379
361
  lastLoginAt: Date
380
- }, exports.options);
381
- exports.studentSchema = new mongoose_1.Schema({
362
+ }, options);
363
+ var applicationSchema = new mongoose_1.Schema({
364
+ programId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Program' },
365
+ uni_assist: {
366
+ status: {
367
+ type: String,
368
+ default: 'notstarted'
369
+ },
370
+ vpd_file_path: {
371
+ type: String,
372
+ default: ''
373
+ },
374
+ vpd_paid_confirmation_file_path: {
375
+ type: String,
376
+ default: ''
377
+ },
378
+ vpd_paid_confirmation_file_status: {
379
+ type: String,
380
+ default: ''
381
+ },
382
+ isPaid: {
383
+ type: Boolean,
384
+ default: false
385
+ },
386
+ updatedAt: Date
387
+ },
388
+ portal_credentials: {
389
+ application_portal_a: {
390
+ account: { type: String, select: false, trim: true },
391
+ password: { type: String, select: false, trim: true }
392
+ },
393
+ application_portal_b: {
394
+ account: { type: String, select: false, trim: true },
395
+ password: { type: String, select: false, trim: true }
396
+ }
397
+ },
398
+ doc_modification_thread: [
399
+ {
400
+ isFinalVersion: {
401
+ type: Boolean,
402
+ default: false
403
+ },
404
+ latest_message_left_by_id: {
405
+ type: String,
406
+ default: ''
407
+ },
408
+ doc_thread_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Documentthread' },
409
+ updatedAt: Date,
410
+ createdAt: Date
411
+ }
412
+ ],
413
+ reject_reason: {
414
+ type: String,
415
+ default: ''
416
+ },
417
+ admission_letter: {
418
+ status: {
419
+ type: String,
420
+ default: 'notstarted'
421
+ },
422
+ admission_file_path: {
423
+ type: String,
424
+ default: ''
425
+ },
426
+ comments: { type: String, default: '' },
427
+ updatedAt: Date
428
+ },
429
+ finalEnrolment: { type: Boolean, default: false },
430
+ decided: { type: String, default: '-' },
431
+ closed: { type: String, default: '-' },
432
+ admission: { type: String, default: '-' }
433
+ });
434
+ var studentSchema = new mongoose_1.Schema({
382
435
  agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
383
436
  editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
384
437
  needEditor: { type: Boolean, default: false },
438
+ isInterviewTrained: { type: Boolean, default: false },
439
+ applications: [applicationSchema],
385
440
  applying_program_count: {
386
441
  type: Number,
387
442
  default: 0
388
443
  },
389
444
  attributes: [
390
445
  {
391
- type: exports.attributeSchema,
446
+ type: attributeSchema,
392
447
  required: true
393
448
  }
394
449
  ],
@@ -400,8 +455,8 @@ exports.studentSchema = new mongoose_1.Schema({
400
455
  },
401
456
  status: {
402
457
  type: String,
403
- enum: Object.values(DocumentStatusType),
404
- default: DocumentStatusType.Missing
458
+ enum: Object.values(core_1.DocumentStatusType),
459
+ default: core_1.DocumentStatusType.Missing
405
460
  },
406
461
  required: {
407
462
  type: Boolean,
@@ -434,8 +489,8 @@ exports.studentSchema = new mongoose_1.Schema({
434
489
  createdAt: Date
435
490
  }
436
491
  ]
437
- }, exports.options);
438
- exports.externalSchema = new mongoose_1.Schema({
492
+ }, options);
493
+ var externalSchema = new mongoose_1.Schema({
439
494
  attribute: {
440
495
  can_update_program_list: {
441
496
  type: Boolean,
@@ -450,14 +505,14 @@ exports.externalSchema = new mongoose_1.Schema({
450
505
  default: false
451
506
  }
452
507
  }
453
- }, exports.options);
454
- exports.managerSchema = new mongoose_1.Schema({
508
+ }, options);
509
+ var managerSchema = new mongoose_1.Schema({
455
510
  agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
456
511
  editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
457
512
  manager_type: {
458
513
  type: String,
459
- enum: Object.values(exports.ManagerType),
460
- default: exports.ManagerType.None
514
+ enum: Object.values(ManagerType),
515
+ default: ManagerType.None
461
516
  },
462
517
  manager_notification: {
463
518
  isRead_new_base_docs_uploaded: [
@@ -495,40 +550,39 @@ exports.managerSchema = new mongoose_1.Schema({
495
550
  default: false
496
551
  }
497
552
  }
498
- }, exports.options);
499
- var officehours = {
500
- Monday: {
501
- active: { type: Boolean, default: false },
502
- time_slots: [{ type: Object }]
503
- },
504
- Tuesday: {
505
- active: { type: Boolean, default: false },
506
- time_slots: [{ type: Object }]
507
- },
508
- Wednesday: {
509
- active: { type: Boolean, default: false },
510
- time_slots: [{ type: Object }]
511
- },
512
- Thursday: {
513
- active: { type: Boolean, default: false },
514
- time_slots: [{ type: Object }]
515
- },
516
- Friday: {
517
- active: { type: Boolean, default: false },
518
- time_slots: [{ type: Object }]
519
- },
520
- Saturday: {
521
- active: { type: Boolean, default: false },
522
- time_slots: [{ type: Object }]
523
- },
524
- Sunday: {
525
- active: { type: Boolean, default: false },
526
- time_slots: [{ type: Object }]
527
- }
528
- };
529
- exports.agentSchema = new mongoose_1.Schema({
553
+ }, options);
554
+ var agentSchema = new mongoose_1.Schema({
530
555
  timezone: { type: String, default: '' },
531
- officehours: officehours,
556
+ officehours: {
557
+ Monday: {
558
+ active: { type: Boolean, default: false },
559
+ time_slots: [{ type: Object }]
560
+ },
561
+ Tuesday: {
562
+ active: { type: Boolean, default: false },
563
+ time_slots: [{ type: Object }]
564
+ },
565
+ Wednesday: {
566
+ active: { type: Boolean, default: false },
567
+ time_slots: [{ type: Object }]
568
+ },
569
+ Thursday: {
570
+ active: { type: Boolean, default: false },
571
+ time_slots: [{ type: Object }]
572
+ },
573
+ Friday: {
574
+ active: { type: Boolean, default: false },
575
+ time_slots: [{ type: Object }]
576
+ },
577
+ Saturday: {
578
+ active: { type: Boolean, default: false },
579
+ time_slots: [{ type: Object }]
580
+ },
581
+ Sunday: {
582
+ active: { type: Boolean, default: false },
583
+ time_slots: [{ type: Object }]
584
+ }
585
+ },
532
586
  selfIntroduction: {
533
587
  type: String,
534
588
  default: ''
@@ -563,10 +617,8 @@ exports.agentSchema = new mongoose_1.Schema({
563
617
  default: false
564
618
  }
565
619
  }
566
- }, exports.options);
567
- exports.editorSchema = new mongoose_1.Schema({
568
- timezone: { type: String, default: '' },
569
- officehours: officehours,
620
+ }, options);
621
+ var editorSchema = new mongoose_1.Schema({
570
622
  editor_notification: {
571
623
  isRead_survey_not_complete: {
572
624
  type: Boolean,
@@ -607,4 +659,13 @@ exports.editorSchema = new mongoose_1.Schema({
607
659
  default: false
608
660
  }
609
661
  }
610
- }, exports.options);
662
+ }, options);
663
+ module.exports = {
664
+ attributeSchema: attributeSchema,
665
+ userSchema: userSchema,
666
+ studentSchema: studentSchema,
667
+ agentSchema: agentSchema,
668
+ externalSchema: externalSchema,
669
+ editorSchema: editorSchema,
670
+ managerSchema: managerSchema
671
+ };
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Allcourse"), exports);
18
- __exportStar(require("./Application"), exports);
19
18
  __exportStar(require("./Audit"), exports);
20
19
  __exportStar(require("./Basedocumentationslink"), exports);
21
20
  __exportStar(require("./Communication"), exports);
@@ -27,6 +26,7 @@ __exportStar(require("./Documentthread"), exports);
27
26
  __exportStar(require("./Event"), exports);
28
27
  __exportStar(require("./Internaldoc"), exports);
29
28
  __exportStar(require("./Interval"), exports);
29
+ __exportStar(require("./Event"), exports);
30
30
  __exportStar(require("./Interview"), exports);
31
31
  __exportStar(require("./InterviewSurveyResponse"), exports);
32
32
  __exportStar(require("./Keywordset"), exports);
package/dist/esm/index.js CHANGED
@@ -1,3 +1 @@
1
1
  export * from './model';
2
- export * from './api';
3
- export * from './schema';
@@ -2,7 +2,6 @@ import { Schema } from 'mongoose';
2
2
  export var documentThreadsSchema = new Schema({
3
3
  student_id: { type: Schema.Types.ObjectId, require: true, ref: 'User' },
4
4
  program_id: { type: Schema.Types.ObjectId, ref: 'Program' },
5
- application_id: { type: Schema.Types.ObjectId, ref: 'Application' },
6
5
  outsourced_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
7
6
  pin_by_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
8
7
  flag_by_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
@@ -39,6 +38,9 @@ export var documentThreadsSchema = new Schema({
39
38
  ignore_message: Boolean
40
39
  }
41
40
  ],
42
- essayReviewerIds: [{ type: Schema.Types.ObjectId, ref: 'User' }],
41
+ isEssayConsultantNeeded: {
42
+ type: Boolean
43
+ },
44
+ essayConsultantIds: [{ type: Schema.Types.ObjectId, ref: 'User' }],
43
45
  updatedAt: Date
44
46
  });