@taiger-common/model 1.0.12 → 1.0.14

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 (77) hide show
  1. package/dist/cjs/model/Audit.js +2 -2
  2. package/dist/cjs/model/Basedocumentationslink.js +3 -2
  3. package/dist/cjs/model/Communication.js +2 -2
  4. package/dist/cjs/model/Complaint.js +2 -2
  5. package/dist/cjs/model/Course.js +2 -2
  6. package/dist/cjs/model/Docspage.js +4 -3
  7. package/dist/cjs/model/Documentation.js +3 -2
  8. package/dist/cjs/model/Documentthread.js +2 -2
  9. package/dist/cjs/model/Event.js +17 -4
  10. package/dist/cjs/model/Internaldoc.js +14 -0
  11. package/dist/cjs/model/Interval.js +39 -0
  12. package/dist/cjs/model/Interview.js +40 -0
  13. package/dist/cjs/model/InterviewSurveyResponse.js +24 -0
  14. package/dist/cjs/model/Keywordset.js +48 -0
  15. package/dist/cjs/model/Note.js +9 -0
  16. package/dist/cjs/model/Permission.js +48 -0
  17. package/dist/cjs/model/Program.js +290 -0
  18. package/dist/cjs/model/Programrequirement.js +118 -0
  19. package/dist/cjs/model/ResponseTime.js +27 -0
  20. package/dist/cjs/model/SurveyInput.js +56 -0
  21. package/dist/cjs/model/Template.js +19 -0
  22. package/dist/cjs/model/Tenant.js +9 -0
  23. package/dist/cjs/model/Ticket.js +55 -0
  24. package/dist/cjs/model/Token.js +20 -0
  25. package/dist/cjs/model/User.js +676 -0
  26. package/dist/esm/model/Audit.js +2 -2
  27. package/dist/esm/model/Basedocumentationslink.js +3 -2
  28. package/dist/esm/model/Communication.js +2 -2
  29. package/dist/esm/model/Complaint.js +2 -2
  30. package/dist/esm/model/Course.js +2 -2
  31. package/dist/esm/model/Docspage.js +4 -3
  32. package/dist/esm/model/Documentation.js +3 -2
  33. package/dist/esm/model/Documentthread.js +2 -2
  34. package/dist/esm/model/Event.js +17 -4
  35. package/dist/esm/model/Internaldoc.js +11 -0
  36. package/dist/esm/model/Interval.js +36 -0
  37. package/dist/esm/model/Interview.js +37 -0
  38. package/dist/esm/model/InterviewSurveyResponse.js +21 -0
  39. package/dist/esm/model/Keywordset.js +45 -0
  40. package/dist/esm/model/Note.js +6 -0
  41. package/dist/esm/model/Permission.js +45 -0
  42. package/dist/esm/model/Program.js +287 -0
  43. package/dist/esm/model/Programrequirement.js +115 -0
  44. package/dist/esm/model/ResponseTime.js +24 -0
  45. package/dist/esm/model/SurveyInput.js +53 -0
  46. package/dist/esm/model/Template.js +16 -0
  47. package/dist/esm/model/Tenant.js +6 -0
  48. package/dist/esm/model/Ticket.js +52 -0
  49. package/dist/esm/model/Token.js +17 -0
  50. package/dist/esm/model/User.js +670 -0
  51. package/dist/types/model/Audit.d.ts +74 -24
  52. package/dist/types/model/Basedocumentationslink.d.ts +46 -15
  53. package/dist/types/model/Communication.d.ts +101 -36
  54. package/dist/types/model/Complaint.d.ts +200 -58
  55. package/dist/types/model/Course.d.ts +78 -47
  56. package/dist/types/model/Docspage.d.ts +58 -34
  57. package/dist/types/model/Documentation.d.ts +58 -31
  58. package/dist/types/model/Documentthread.d.ts +201 -59
  59. package/dist/types/model/Event.d.ts +74 -44
  60. package/dist/types/model/Internaldoc.d.ts +58 -0
  61. package/dist/types/model/Interval.d.ts +58 -0
  62. package/dist/types/model/Interview.d.ts +84 -0
  63. package/dist/types/model/InterviewSurveyResponse.d.ts +93 -0
  64. package/dist/types/model/Keywordset.d.ts +75 -0
  65. package/dist/types/model/Note.d.ts +43 -0
  66. package/dist/types/model/Permission.d.ts +81 -0
  67. package/dist/types/model/Program.d.ts +453 -0
  68. package/dist/types/model/Programrequirement.d.ts +168 -0
  69. package/dist/types/model/ResponseTime.d.ts +49 -0
  70. package/dist/types/model/SurveyInput.d.ts +121 -0
  71. package/dist/types/model/Template.d.ts +46 -0
  72. package/dist/types/model/Tenant.d.ts +43 -0
  73. package/dist/types/model/Ticket.d.ts +69 -0
  74. package/dist/types/model/Token.d.ts +43 -0
  75. package/dist/types/model/User.d.ts +31 -0
  76. package/dist/umd/index.js +1 -1
  77. package/package.json +6 -1
@@ -1,6 +1,6 @@
1
1
  import { Schema } from 'mongoose';
2
2
  import { TicketStatus } from '../constants';
3
- export var complaintSchema = {
3
+ export var complaintSchema = new Schema({
4
4
  requester_id: {
5
5
  type: Schema.Types.ObjectId,
6
6
  required: true,
@@ -64,4 +64,4 @@ export var complaintSchema = {
64
64
  type: Date,
65
65
  default: Date.now
66
66
  }
67
- };
67
+ }, { timestamps: true });
@@ -1,5 +1,5 @@
1
1
  import { Schema } from 'mongoose';
2
- export var coursesSchema = {
2
+ export var coursesSchema = new Schema({
3
3
  student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
4
  name: { type: String, default: '' },
5
5
  table_data_string: { type: String, default: '' },
@@ -18,4 +18,4 @@ export var coursesSchema = {
18
18
  updatedAtV2: Date,
19
19
  updatedAt: Date
20
20
  }
21
- };
21
+ });
@@ -1,4 +1,5 @@
1
- export var docspagesSchema = {
1
+ import { Schema } from 'mongoose';
2
+ export var docspagesSchema = new Schema({
2
3
  name: { type: String, default: '' },
3
4
  title: { type: String, default: '' },
4
5
  category: { type: String, default: '' },
@@ -6,5 +7,5 @@ export var docspagesSchema = {
6
7
  author: { type: String, default: '' },
7
8
  text: { type: String, default: '' },
8
9
  country: { type: String, default: '' },
9
- updatedAt: { type: Date, default: Date.now }
10
- };
10
+ updatedAt: Date
11
+ });
@@ -1,4 +1,5 @@
1
- export var documentationsSchema = {
1
+ import { Schema } from 'mongoose';
2
+ export var documentationsSchema = new Schema({
2
3
  name: { type: String, default: '' },
3
4
  title: { type: String, default: '' },
4
5
  category: { type: String, default: '' },
@@ -7,4 +8,4 @@ export var documentationsSchema = {
7
8
  text: { type: String, default: '' },
8
9
  country: { type: String, default: '' },
9
10
  updatedAt: Date
10
- };
11
+ });
@@ -1,5 +1,5 @@
1
1
  import { Schema } from 'mongoose';
2
- export var documentThreadsSchema = {
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
5
  outsourced_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
@@ -39,4 +39,4 @@ export var documentThreadsSchema = {
39
39
  }
40
40
  ],
41
41
  updatedAt: Date
42
- };
42
+ });
@@ -1,5 +1,5 @@
1
1
  import { Schema } from 'mongoose';
2
- export var EventSchema = {
2
+ export var EventSchema = new Schema({
3
3
  requester_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
4
4
  receiver_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
5
5
  isConfirmedRequester: {
@@ -37,7 +37,20 @@ export var EventSchema = {
37
37
  min: [new Date(), "time can't be before now!!"]
38
38
  },
39
39
  end: {
40
- type: Date
41
- // setting a min function to accept any date one hour ahead of start
40
+ type: Date,
41
+ //setting a min function to accept any date one hour ahead of start
42
+ // min: [
43
+ // function () {
44
+ // const date = new Date(this.start);
45
+ // const validDate = new Date(date.getTime() + 60000);
46
+ // return validDate;
47
+ // },
48
+ // 'Event End must be at least one minute a head of event time'
49
+ // ],
50
+ // default: function () {
51
+ // const date = new Date(this.start);
52
+ // const validDate = new Date(date.getTime() + 60000 * 30);
53
+ // return validDate;
54
+ // }
42
55
  }
43
- };
56
+ }, { timestamps: true });
@@ -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
+ });
@@ -0,0 +1,36 @@
1
+ import { Schema } from 'mongoose';
2
+ export var intervalSchema = new Schema({
3
+ thread_id: {
4
+ type: Schema.Types.ObjectId,
5
+ ref: 'Documentthread'
6
+ },
7
+ student_id: {
8
+ type: Schema.Types.ObjectId,
9
+ ref: 'User'
10
+ },
11
+ message_1_id: {
12
+ type: Schema.Types.ObjectId,
13
+ required: true
14
+ },
15
+ message_2_id: {
16
+ type: Schema.Types.ObjectId,
17
+ required: true
18
+ },
19
+ interval_type: {
20
+ type: String,
21
+ required: true
22
+ },
23
+ interval: {
24
+ type: Number,
25
+ required: true
26
+ },
27
+ intervalStartAt: {
28
+ type: Date,
29
+ required: true
30
+ },
31
+ updatedAt: {
32
+ type: Date,
33
+ default: Date.now,
34
+ expires: 93312000 // 3 years
35
+ }
36
+ });
@@ -0,0 +1,37 @@
1
+ import { Schema } from 'mongoose';
2
+ export var interviewsSchema = new Schema({
3
+ student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ trainer_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
5
+ thread_id: { type: Schema.Types.ObjectId, ref: 'Documentthread' },
6
+ program_id: { type: Schema.Types.ObjectId, ref: 'Program' },
7
+ event_id: { type: Schema.Types.ObjectId, ref: 'Event' },
8
+ interview_description: {
9
+ type: String,
10
+ default: ''
11
+ },
12
+ status: {
13
+ type: String,
14
+ default: 'Unscheduled'
15
+ },
16
+ interviewer: {
17
+ type: String,
18
+ default: ''
19
+ },
20
+ interview_duration: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+ interview_date: {
25
+ type: Date
26
+ },
27
+ isClosed: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ start: {
32
+ type: Date
33
+ },
34
+ end: {
35
+ type: Date
36
+ }
37
+ }, { timestamps: true });
@@ -0,0 +1,21 @@
1
+ import { Schema } from 'mongoose';
2
+ export var interviewSurveyResponseSchema = new Schema({
3
+ student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ interview_id: { type: Schema.Types.ObjectId, ref: 'Interview' },
5
+ program_id: { type: Schema.Types.ObjectId, ref: 'Program' },
6
+ responses: [
7
+ {
8
+ questionId: String,
9
+ answer: Number
10
+ }
11
+ ],
12
+ isFinal: {
13
+ type: Boolean
14
+ },
15
+ interviewQuestions: {
16
+ type: String
17
+ },
18
+ interviewFeedback: {
19
+ type: String
20
+ }
21
+ }, { timestamps: true });
@@ -0,0 +1,45 @@
1
+ import { Schema } from 'mongoose';
2
+ export var keywordSetSchema = new Schema({
3
+ categoryName: {
4
+ type: String
5
+ },
6
+ description: {
7
+ type: String,
8
+ default: '',
9
+ validate: {
10
+ validator: function (value) {
11
+ // Maximum allowed length
12
+ return value.length <= 3000;
13
+ },
14
+ message: 'Description exceeds the maximum allowed length of 3000 characters'
15
+ }
16
+ },
17
+ keywords: {
18
+ zh: [
19
+ {
20
+ type: String,
21
+ default: ''
22
+ }
23
+ ],
24
+ en: [
25
+ {
26
+ type: String,
27
+ default: ''
28
+ }
29
+ ]
30
+ },
31
+ antiKeywords: {
32
+ zh: [
33
+ {
34
+ type: String,
35
+ default: ''
36
+ }
37
+ ],
38
+ en: [
39
+ {
40
+ type: String,
41
+ default: ''
42
+ }
43
+ ]
44
+ }
45
+ }, { timestamps: true });
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'mongoose';
2
+ export var notesSchema = new Schema({
3
+ student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ notes: { type: String, default: '' },
5
+ updatedAt: Date
6
+ });
@@ -0,0 +1,45 @@
1
+ import { Schema } from 'mongoose';
2
+ export var permissionSchema = new Schema({
3
+ user_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ taigerAiQuota: {
5
+ type: Number,
6
+ default: 0
7
+ },
8
+ canAssignEditors: {
9
+ type: Boolean,
10
+ default: false
11
+ },
12
+ canUseTaiGerAI: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ canModifyProgramList: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ canModifyAllBaseDocuments: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ canAccessAllChat: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ canAssignAgents: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ canModifyDocumentation: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ canAccessStudentDatabase: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ isEssayWriters: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ updatedAt: Date
45
+ }, { timestamps: true });
@@ -0,0 +1,287 @@
1
+ import { Schema } from 'mongoose';
2
+ import { PROGRAM_SUBJECTS, SCHOOL_TAGS, SCHOOL_TYPES } from '@taiger-common/core';
3
+ var ObjectId = Schema.Types.ObjectId;
4
+ var SCHOOL_TAG_KEYS = Object.keys(SCHOOL_TAGS);
5
+ export var PROGRAM_SUBJECT_KEYS = Object.keys(PROGRAM_SUBJECTS);
6
+ // export type ProgramModule = {
7
+ // [key: string]: any; // Allows dynamic key access
8
+ // } & {
9
+ // isArchiv: boolean;
10
+ // school: string;
11
+ // program_name: string;
12
+ // programSubjects: string[];
13
+ // degree?: string;
14
+ // semester?: string;
15
+ // lang?: string;
16
+ // gpa_requirement?: string;
17
+ // allowOnlyGraduatedApplicant?: boolean;
18
+ // application_start?: string;
19
+ // application_deadline?: string;
20
+ // uni_assist?: string;
21
+ // englishTestHandLater?: boolean;
22
+ // toefl?: string;
23
+ // toefl_reading?: number;
24
+ // toefl_listening?: number;
25
+ // toefl_writing?: number;
26
+ // toefl_speaking?: number;
27
+ // ielts?: string;
28
+ // ielts_reading?: number;
29
+ // ielts_listening?: number;
30
+ // ielts_writing?: number;
31
+ // ielts_speaking?: number;
32
+ // germanTestHandLater?: boolean;
33
+ // testdaf?: string;
34
+ // basic_german_requirement?: string;
35
+ // gre?: string;
36
+ // gre_verbal?: number;
37
+ // gre_quantitative?: number;
38
+ // gre_analytical_writing?: number;
39
+ // gmat?: string;
40
+ // ml_required?: string;
41
+ // ml_requirements?: string;
42
+ // rl_required?: string;
43
+ // rl_requirements?: string;
44
+ // is_rl_specific?: boolean;
45
+ // essay_required?: string;
46
+ // essay_requirements?: string;
47
+ // portfolio_required?: string;
48
+ // portfolio_requirements?: string;
49
+ // supplementary_form_required?: string;
50
+ // supplementary_form_requirements?: string;
51
+ // curriculum_analysis_required?: string;
52
+ // curriculum_analysis_requirements?: string;
53
+ // scholarship_form_required?: string;
54
+ // scholarship_form_requirements?: string;
55
+ // module_description_required?: string;
56
+ // ects_requirements?: string;
57
+ // special_notes?: string;
58
+ // comments?: string;
59
+ // application_portal_a?: string;
60
+ // application_portal_b?: string;
61
+ // application_portal_a_instructions?: string;
62
+ // application_portal_b_instructions?: string;
63
+ // uni_assist_link?: string;
64
+ // website?: string;
65
+ // fpso?: string;
66
+ // updatedAt?: Date;
67
+ // whoupdated?: string;
68
+ // tuition_fees?: string;
69
+ // contact?: string;
70
+ // country?: string;
71
+ // isPrivateSchool?: boolean;
72
+ // isPartnerSchool?: boolean;
73
+ // schoolType?: string;
74
+ // tags?: string[];
75
+ // url?: string;
76
+ // vcId?: ObjectId;
77
+ // };
78
+ export var programModule = {
79
+ isArchiv: Boolean,
80
+ school: {
81
+ type: String,
82
+ default: '',
83
+ required: true
84
+ },
85
+ program_name: {
86
+ type: String,
87
+ required: true
88
+ },
89
+ programSubjects: [
90
+ {
91
+ type: String,
92
+ enum: PROGRAM_SUBJECT_KEYS
93
+ }
94
+ ],
95
+ degree: {
96
+ type: String
97
+ // enum: Object.values(Degree),
98
+ },
99
+ semester: String,
100
+ lang: {
101
+ type: String
102
+ // enum: Object.values(Languages)
103
+ },
104
+ gpa_requirement: {
105
+ type: String
106
+ },
107
+ allowOnlyGraduatedApplicant: {
108
+ type: Boolean,
109
+ default: false
110
+ },
111
+ application_start: String,
112
+ application_deadline: {
113
+ type: String
114
+ },
115
+ uni_assist: {
116
+ type: String
117
+ },
118
+ englishTestHandLater: {
119
+ type: Boolean,
120
+ default: false
121
+ },
122
+ toefl: {
123
+ type: String
124
+ },
125
+ toefl_reading: {
126
+ type: Number
127
+ },
128
+ toefl_listening: {
129
+ type: Number
130
+ },
131
+ toefl_writing: {
132
+ type: Number
133
+ },
134
+ toefl_speaking: {
135
+ type: Number
136
+ },
137
+ ielts: {
138
+ type: String
139
+ },
140
+ ielts_reading: {
141
+ type: Number
142
+ },
143
+ ielts_listening: {
144
+ type: Number
145
+ },
146
+ ielts_writing: {
147
+ type: Number
148
+ },
149
+ ielts_speaking: {
150
+ type: Number
151
+ },
152
+ germanTestHandLater: {
153
+ type: Boolean,
154
+ default: false
155
+ },
156
+ testdaf: {
157
+ type: String
158
+ },
159
+ basic_german_requirement: {
160
+ type: String
161
+ },
162
+ gre: {
163
+ type: String
164
+ },
165
+ gre_verbal: {
166
+ type: Number
167
+ },
168
+ gre_quantitative: {
169
+ type: Number
170
+ },
171
+ gre_analytical_writing: {
172
+ type: Number
173
+ },
174
+ gmat: {
175
+ type: String
176
+ },
177
+ ml_required: {
178
+ type: String
179
+ },
180
+ ml_requirements: {
181
+ type: String
182
+ },
183
+ rl_required: {
184
+ type: String
185
+ },
186
+ rl_requirements: {
187
+ type: String
188
+ },
189
+ is_rl_specific: {
190
+ type: Boolean
191
+ },
192
+ essay_required: {
193
+ type: String
194
+ },
195
+ essay_requirements: {
196
+ type: String
197
+ },
198
+ portfolio_required: {
199
+ type: String
200
+ },
201
+ portfolio_requirements: {
202
+ type: String
203
+ },
204
+ supplementary_form_required: {
205
+ type: String
206
+ },
207
+ supplementary_form_requirements: {
208
+ type: String
209
+ },
210
+ curriculum_analysis_required: {
211
+ type: String
212
+ },
213
+ curriculum_analysis_requirements: {
214
+ type: String
215
+ },
216
+ scholarship_form_required: {
217
+ type: String
218
+ },
219
+ scholarship_form_requirements: {
220
+ type: String
221
+ },
222
+ module_description_required: {
223
+ type: String
224
+ },
225
+ ects_requirements: {
226
+ type: String
227
+ },
228
+ special_notes: {
229
+ type: String
230
+ },
231
+ comments: {
232
+ type: String
233
+ },
234
+ application_portal_a: {
235
+ type: String
236
+ },
237
+ application_portal_b: {
238
+ type: String
239
+ },
240
+ application_portal_a_instructions: {
241
+ type: String
242
+ },
243
+ application_portal_b_instructions: {
244
+ type: String
245
+ },
246
+ uni_assist_link: {
247
+ type: String
248
+ },
249
+ website: {
250
+ type: String
251
+ },
252
+ fpso: {
253
+ type: String
254
+ },
255
+ updatedAt: Date,
256
+ whoupdated: {
257
+ type: String
258
+ },
259
+ tuition_fees: {
260
+ type: String
261
+ },
262
+ contact: {
263
+ type: String
264
+ },
265
+ country: {
266
+ type: String
267
+ },
268
+ isPrivateSchool: {
269
+ type: Boolean
270
+ },
271
+ isPartnerSchool: {
272
+ type: Boolean
273
+ },
274
+ schoolType: {
275
+ type: String,
276
+ enum: SCHOOL_TYPES
277
+ },
278
+ tags: [
279
+ {
280
+ type: String,
281
+ enum: SCHOOL_TAG_KEYS
282
+ }
283
+ ],
284
+ url: String,
285
+ vcId: ObjectId
286
+ };
287
+ export var programSchema = new Schema(programModule, { timestamps: true });