@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,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 });
@@ -0,0 +1,115 @@
1
+ import { Schema } from 'mongoose';
2
+ import { PROGRAM_SUBJECT_KEYS } from '../model/Program';
3
+ export var programRequirementSchema = new Schema({
4
+ programId: [{ type: Schema.Types.ObjectId, ref: 'Program' }],
5
+ program_categories: [
6
+ {
7
+ program_category: {
8
+ type: String,
9
+ default: ''
10
+ },
11
+ category_description: {
12
+ type: String,
13
+ default: ''
14
+ },
15
+ requiredECTS: {
16
+ type: Number,
17
+ default: 0
18
+ },
19
+ keywordSets: [{ type: Schema.Types.ObjectId, ref: 'KeywordSet' }],
20
+ maxScore: {
21
+ type: Number,
22
+ default: 0
23
+ }
24
+ }
25
+ ],
26
+ attributes: [
27
+ {
28
+ type: String,
29
+ enum: PROGRAM_SUBJECT_KEYS
30
+ }
31
+ ],
32
+ fpso: {
33
+ type: String
34
+ },
35
+ admissionDescription: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ gpaScoreBoundaryGPA: {
40
+ type: Number,
41
+ default: 0
42
+ },
43
+ // max.
44
+ gpaScore: {
45
+ type: Number,
46
+ default: 0
47
+ },
48
+ // min. score at gpaScoreBoundaryGPA. Some program has offset instead of 0
49
+ gpaMinScore: {
50
+ type: Number,
51
+ default: 0
52
+ },
53
+ coursesScore: {
54
+ type: Number,
55
+ default: 0
56
+ },
57
+ cvScore: {
58
+ type: Number,
59
+ default: 0
60
+ },
61
+ mlScore: {
62
+ type: Number,
63
+ default: 0
64
+ },
65
+ rlScore: {
66
+ type: Number,
67
+ default: 0
68
+ },
69
+ essayScore: {
70
+ type: Number,
71
+ default: 0
72
+ },
73
+ gmatScore: {
74
+ type: Number,
75
+ default: 0
76
+ },
77
+ greScore: {
78
+ type: Number,
79
+ default: 0
80
+ },
81
+ interviewScore: {
82
+ type: Number,
83
+ default: 0
84
+ },
85
+ testScore: {
86
+ type: Number,
87
+ default: 0
88
+ },
89
+ firstRoundConsidered: [
90
+ {
91
+ type: String
92
+ }
93
+ ],
94
+ secondRoundConsidered: [
95
+ {
96
+ type: String
97
+ }
98
+ ],
99
+ directRejectionScore: {
100
+ type: Number,
101
+ default: 0
102
+ },
103
+ directAdmissionScore: {
104
+ type: Number,
105
+ default: 0
106
+ },
107
+ directRejectionSecondScore: {
108
+ type: Number,
109
+ default: 0
110
+ },
111
+ directAdmissionSecondScore: {
112
+ type: Number,
113
+ default: 0
114
+ }
115
+ }, { timestamps: true });
@@ -0,0 +1,24 @@
1
+ import { Schema } from 'mongoose';
2
+ export var ResponseTimeSchema = 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
+ interval_type: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ intervalAvg: {
16
+ type: Number,
17
+ required: true
18
+ },
19
+ updatedAt: {
20
+ type: Date,
21
+ default: Date.now,
22
+ expires: 93312000 // 3 years
23
+ }
24
+ });
@@ -0,0 +1,53 @@
1
+ import { Schema } from 'mongoose';
2
+ var contentType = ['sentence', 'paragraph', 'essay'];
3
+ var STUDENT_INPUT_STATUS_E = {
4
+ EMPTY: 'empty',
5
+ PRODIVDED: 'provided',
6
+ GENERATED: 'generated',
7
+ BLOCKED: 'blocked'
8
+ };
9
+ export var surveyInputSchema = new Schema({
10
+ studentId: {
11
+ type: Schema.Types.ObjectId,
12
+ immutable: true,
13
+ required: true,
14
+ ref: 'User'
15
+ },
16
+ programId: { type: Schema.Types.ObjectId, immutable: true, ref: 'Program' },
17
+ fileType: {
18
+ type: String,
19
+ immutable: true,
20
+ required: true
21
+ },
22
+ isFinalVersion: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ surveyContent: [
27
+ {
28
+ _id: false,
29
+ questionId: String,
30
+ question: String,
31
+ answer: String,
32
+ type: {
33
+ type: String,
34
+ enum: ['word', 'sentence', 'paragraph', 'essay']
35
+ },
36
+ contentType: { type: String, enum: contentType }
37
+ }
38
+ ],
39
+ surveyStatus: {
40
+ type: String,
41
+ enum: Object.values(STUDENT_INPUT_STATUS_E),
42
+ default: STUDENT_INPUT_STATUS_E.EMPTY
43
+ },
44
+ createdAt: {
45
+ type: Date,
46
+ immutable: true,
47
+ default: function () { return Date.now(); }
48
+ },
49
+ updatedAt: {
50
+ type: Date,
51
+ default: function () { return Date.now(); }
52
+ }
53
+ });
@@ -0,0 +1,16 @@
1
+ import { Schema } from 'mongoose';
2
+ export var templatesSchema = new Schema({
3
+ name: {
4
+ type: String,
5
+ required: true
6
+ },
7
+ category_name: {
8
+ type: String,
9
+ required: true
10
+ },
11
+ path: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ updatedAt: Date
16
+ });
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'mongoose';
2
+ export var tenantsSchema = new Schema({
3
+ tenantId: { type: String, require: true, unique: true },
4
+ domainName: { type: String, require: true, unique: true },
5
+ updatedAt: Date
6
+ });