@taiger-common/model 1.0.58 → 1.0.59
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.
- package/dist/cjs/api/account.js +35 -0
- package/dist/cjs/api/applications.js +46 -0
- package/dist/cjs/api/audit.js +8 -0
- package/dist/cjs/api/auth.js +19 -0
- package/dist/cjs/api/common.js +32 -0
- package/dist/cjs/api/communications.js +15 -0
- package/dist/cjs/api/courses.js +23 -0
- package/dist/cjs/api/crm.js +87 -0
- package/dist/cjs/api/documentThreads.js +44 -0
- package/dist/cjs/api/documentations.js +33 -0
- package/dist/cjs/api/events.js +22 -0
- package/dist/cjs/api/index.js +41 -0
- package/dist/cjs/api/interviews.js +35 -0
- package/dist/cjs/api/meetings.js +20 -0
- package/dist/cjs/api/notes.js +8 -0
- package/dist/cjs/api/permissions.js +9 -0
- package/dist/cjs/api/portals.js +24 -0
- package/dist/cjs/api/programRequirements.js +26 -0
- package/dist/cjs/api/programs.js +93 -0
- package/dist/cjs/api/search.js +24 -0
- package/dist/cjs/api/serialized.js +50 -0
- package/dist/cjs/api/students.js +29 -0
- package/dist/cjs/api/teams.js +48 -0
- package/dist/cjs/api/tickets.js +21 -0
- package/dist/cjs/api/users.js +42 -0
- package/dist/cjs/api/widgets.js +21 -0
- package/dist/cjs/constants/users.js +12 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/model/Application.js +78 -0
- package/dist/cjs/model/Documentthread.js +2 -4
- package/dist/cjs/model/Program.js +331 -83
- package/dist/cjs/model/User.js +79 -139
- package/dist/cjs/model/index.js +1 -1
- package/dist/cjs/schema/index.js +22 -0
- package/dist/cjs/schema/models.js +523 -0
- package/dist/cjs/schema/serialized.js +202 -0
- package/package.json +1 -1
package/dist/cjs/model/User.js
CHANGED
|
@@ -3,18 +3,28 @@ 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;
|
|
6
7
|
var mongoose_1 = require("mongoose");
|
|
7
|
-
var
|
|
8
|
-
var
|
|
8
|
+
var validator_1 = __importDefault(require("validator"));
|
|
9
|
+
var users_1 = require("../constants/users");
|
|
9
10
|
var Program_1 = require("./Program");
|
|
10
|
-
|
|
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 = {
|
|
11
21
|
Agent: 'Agent',
|
|
12
22
|
Editor: 'Editor',
|
|
13
23
|
AgentAndEditor: 'AgentAndEditor',
|
|
14
24
|
None: 'None'
|
|
15
25
|
};
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
exports.options = { discriminatorKey: 'role', timestamps: true };
|
|
27
|
+
exports.attributeSchema = new mongoose_1.Schema({
|
|
18
28
|
value: {
|
|
19
29
|
type: Number,
|
|
20
30
|
required: true
|
|
@@ -24,7 +34,12 @@ var attributeSchema = new mongoose_1.Schema({
|
|
|
24
34
|
required: true
|
|
25
35
|
}
|
|
26
36
|
});
|
|
27
|
-
|
|
37
|
+
exports.userSchema = new mongoose_1.Schema({
|
|
38
|
+
role: {
|
|
39
|
+
type: String,
|
|
40
|
+
enum: Object.values(users_1.Role),
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
28
43
|
firstname: {
|
|
29
44
|
type: String,
|
|
30
45
|
trim: true
|
|
@@ -45,7 +60,10 @@ var userSchema = new mongoose_1.Schema({
|
|
|
45
60
|
type: String,
|
|
46
61
|
unique: true,
|
|
47
62
|
lowercase: true,
|
|
48
|
-
validate: [
|
|
63
|
+
validate: [validator_1.default.isEmail, 'Invalid email address']
|
|
64
|
+
},
|
|
65
|
+
pictureUrl: {
|
|
66
|
+
type: String
|
|
49
67
|
},
|
|
50
68
|
password: {
|
|
51
69
|
type: String,
|
|
@@ -60,6 +78,7 @@ var userSchema = new mongoose_1.Schema({
|
|
|
60
78
|
},
|
|
61
79
|
linkedIn: String,
|
|
62
80
|
lineId: String,
|
|
81
|
+
slackId: String,
|
|
63
82
|
isAccountActivated: {
|
|
64
83
|
type: Boolean,
|
|
65
84
|
default: false
|
|
@@ -110,8 +129,8 @@ var userSchema = new mongoose_1.Schema({
|
|
|
110
129
|
},
|
|
111
130
|
status: {
|
|
112
131
|
type: String,
|
|
113
|
-
enum: Object.values(
|
|
114
|
-
default:
|
|
132
|
+
enum: Object.values(DocumentStatusType),
|
|
133
|
+
default: DocumentStatusType.Missing
|
|
115
134
|
},
|
|
116
135
|
file_category: {
|
|
117
136
|
type: String,
|
|
@@ -131,8 +150,8 @@ var userSchema = new mongoose_1.Schema({
|
|
|
131
150
|
},
|
|
132
151
|
status: {
|
|
133
152
|
type: String,
|
|
134
|
-
enum: Object.values(
|
|
135
|
-
default:
|
|
153
|
+
enum: Object.values(DocumentStatusType),
|
|
154
|
+
default: DocumentStatusType.Missing
|
|
136
155
|
},
|
|
137
156
|
file_category: {
|
|
138
157
|
type: String,
|
|
@@ -359,91 +378,18 @@ var userSchema = new mongoose_1.Schema({
|
|
|
359
378
|
}
|
|
360
379
|
},
|
|
361
380
|
lastLoginAt: Date
|
|
362
|
-
}, options);
|
|
363
|
-
|
|
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({
|
|
381
|
+
}, exports.options);
|
|
382
|
+
exports.studentSchema = new mongoose_1.Schema({
|
|
435
383
|
agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
|
|
436
384
|
editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
|
|
437
385
|
needEditor: { type: Boolean, default: false },
|
|
438
|
-
isInterviewTrained: { type: Boolean, default: false },
|
|
439
|
-
applications: [applicationSchema],
|
|
440
386
|
applying_program_count: {
|
|
441
387
|
type: Number,
|
|
442
388
|
default: 0
|
|
443
389
|
},
|
|
444
390
|
attributes: [
|
|
445
391
|
{
|
|
446
|
-
type: attributeSchema,
|
|
392
|
+
type: exports.attributeSchema,
|
|
447
393
|
required: true
|
|
448
394
|
}
|
|
449
395
|
],
|
|
@@ -455,8 +401,8 @@ var studentSchema = new mongoose_1.Schema({
|
|
|
455
401
|
},
|
|
456
402
|
status: {
|
|
457
403
|
type: String,
|
|
458
|
-
enum: Object.values(
|
|
459
|
-
default:
|
|
404
|
+
enum: Object.values(DocumentStatusType),
|
|
405
|
+
default: DocumentStatusType.Missing
|
|
460
406
|
},
|
|
461
407
|
required: {
|
|
462
408
|
type: Boolean,
|
|
@@ -489,8 +435,8 @@ var studentSchema = new mongoose_1.Schema({
|
|
|
489
435
|
createdAt: Date
|
|
490
436
|
}
|
|
491
437
|
]
|
|
492
|
-
}, options);
|
|
493
|
-
|
|
438
|
+
}, exports.options);
|
|
439
|
+
exports.externalSchema = new mongoose_1.Schema({
|
|
494
440
|
attribute: {
|
|
495
441
|
can_update_program_list: {
|
|
496
442
|
type: Boolean,
|
|
@@ -505,14 +451,14 @@ var externalSchema = new mongoose_1.Schema({
|
|
|
505
451
|
default: false
|
|
506
452
|
}
|
|
507
453
|
}
|
|
508
|
-
}, options);
|
|
509
|
-
|
|
454
|
+
}, exports.options);
|
|
455
|
+
exports.managerSchema = new mongoose_1.Schema({
|
|
510
456
|
agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
|
|
511
457
|
editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
|
|
512
458
|
manager_type: {
|
|
513
459
|
type: String,
|
|
514
|
-
enum: Object.values(ManagerType),
|
|
515
|
-
default: ManagerType.None
|
|
460
|
+
enum: Object.values(exports.ManagerType),
|
|
461
|
+
default: exports.ManagerType.None
|
|
516
462
|
},
|
|
517
463
|
manager_notification: {
|
|
518
464
|
isRead_new_base_docs_uploaded: [
|
|
@@ -550,39 +496,40 @@ var managerSchema = new mongoose_1.Schema({
|
|
|
550
496
|
default: false
|
|
551
497
|
}
|
|
552
498
|
}
|
|
553
|
-
}, options);
|
|
554
|
-
var
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
},
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
},
|
|
569
|
-
|
|
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
|
-
}
|
|
499
|
+
}, exports.options);
|
|
500
|
+
var officehours = {
|
|
501
|
+
Monday: {
|
|
502
|
+
active: { type: Boolean, default: false },
|
|
503
|
+
time_slots: [{ type: Object }]
|
|
504
|
+
},
|
|
505
|
+
Tuesday: {
|
|
506
|
+
active: { type: Boolean, default: false },
|
|
507
|
+
time_slots: [{ type: Object }]
|
|
508
|
+
},
|
|
509
|
+
Wednesday: {
|
|
510
|
+
active: { type: Boolean, default: false },
|
|
511
|
+
time_slots: [{ type: Object }]
|
|
512
|
+
},
|
|
513
|
+
Thursday: {
|
|
514
|
+
active: { type: Boolean, default: false },
|
|
515
|
+
time_slots: [{ type: Object }]
|
|
585
516
|
},
|
|
517
|
+
Friday: {
|
|
518
|
+
active: { type: Boolean, default: false },
|
|
519
|
+
time_slots: [{ type: Object }]
|
|
520
|
+
},
|
|
521
|
+
Saturday: {
|
|
522
|
+
active: { type: Boolean, default: false },
|
|
523
|
+
time_slots: [{ type: Object }]
|
|
524
|
+
},
|
|
525
|
+
Sunday: {
|
|
526
|
+
active: { type: Boolean, default: false },
|
|
527
|
+
time_slots: [{ type: Object }]
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
exports.agentSchema = new mongoose_1.Schema({
|
|
531
|
+
timezone: { type: String, default: '' },
|
|
532
|
+
officehours: officehours,
|
|
586
533
|
selfIntroduction: {
|
|
587
534
|
type: String,
|
|
588
535
|
default: ''
|
|
@@ -617,8 +564,10 @@ var agentSchema = new mongoose_1.Schema({
|
|
|
617
564
|
default: false
|
|
618
565
|
}
|
|
619
566
|
}
|
|
620
|
-
}, options);
|
|
621
|
-
|
|
567
|
+
}, exports.options);
|
|
568
|
+
exports.editorSchema = new mongoose_1.Schema({
|
|
569
|
+
timezone: { type: String, default: '' },
|
|
570
|
+
officehours: officehours,
|
|
622
571
|
editor_notification: {
|
|
623
572
|
isRead_survey_not_complete: {
|
|
624
573
|
type: Boolean,
|
|
@@ -659,13 +608,4 @@ var editorSchema = new mongoose_1.Schema({
|
|
|
659
608
|
default: false
|
|
660
609
|
}
|
|
661
610
|
}
|
|
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
|
-
};
|
|
611
|
+
}, exports.options);
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -15,6 +15,7 @@ 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);
|
|
18
19
|
__exportStar(require("./Audit"), exports);
|
|
19
20
|
__exportStar(require("./Basedocumentationslink"), exports);
|
|
20
21
|
__exportStar(require("./Communication"), exports);
|
|
@@ -26,7 +27,6 @@ __exportStar(require("./Documentthread"), exports);
|
|
|
26
27
|
__exportStar(require("./Event"), exports);
|
|
27
28
|
__exportStar(require("./Internaldoc"), exports);
|
|
28
29
|
__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);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Zod schemas for TaiGer models and API responses.
|
|
19
|
+
* All TypeScript types are derived via z.infer<typeof Schema>.
|
|
20
|
+
*/
|
|
21
|
+
__exportStar(require("./models"), exports);
|
|
22
|
+
__exportStar(require("./serialized"), exports);
|