@taiger-common/model 1.0.4 → 1.0.5

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.
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TicketStatus = void 0;
4
+ exports.TicketStatus = {
5
+ Open: 'open',
6
+ Resolved: 'resolved'
7
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allCourseSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.allCourseSchema = {
6
+ updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
7
+ all_course_chinese: { type: String, required: true },
8
+ all_course_english: { type: String, required: true },
9
+ description: { type: String, maxlength: 2000 }
10
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.auditSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.auditSchema = {
6
+ performedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
7
+ targetUserId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
8
+ targetDocumentThreadId: {
9
+ type: mongoose_1.Schema.Types.ObjectId,
10
+ ref: 'Documentthread'
11
+ },
12
+ interviewThreadId: {
13
+ type: mongoose_1.Schema.Types.ObjectId,
14
+ ref: 'Interview'
15
+ },
16
+ action: String,
17
+ field: String,
18
+ changes: {
19
+ before: mongoose_1.Schema.Types.Mixed,
20
+ after: mongoose_1.Schema.Types.Mixed
21
+ }
22
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.basedocumentationslinksSchema = void 0;
4
+ exports.basedocumentationslinksSchema = {
5
+ key: { type: String, default: '' },
6
+ category: { type: String, default: 'general' },
7
+ link: { type: String, default: '' },
8
+ updatedAt: Date
9
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.communicationsSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.communicationsSchema = {
6
+ student_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
7
+ user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
8
+ message: {
9
+ type: String,
10
+ default: ''
11
+ },
12
+ readBy: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
13
+ timeStampReadBy: mongoose_1.Schema.Types.Mixed,
14
+ files: [
15
+ {
16
+ name: {
17
+ type: String,
18
+ required: true
19
+ },
20
+ path: {
21
+ type: String,
22
+ required: true
23
+ }
24
+ }
25
+ ],
26
+ createdAt: Date,
27
+ ignore_message: Boolean,
28
+ ignoredMessageUpdatedAt: Date,
29
+ ignoredMessageBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }
30
+ };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.complaintSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ var constants_1 = require("../constants");
6
+ exports.complaintSchema = {
7
+ requester_id: {
8
+ type: mongoose_1.Schema.Types.ObjectId,
9
+ required: true,
10
+ ref: 'User'
11
+ },
12
+ status: {
13
+ type: String,
14
+ enum: Object.values(constants_1.TicketStatus),
15
+ default: 'open'
16
+ },
17
+ title: {
18
+ type: String,
19
+ default: '',
20
+ validate: {
21
+ validator: function (value) {
22
+ // Maximum allowed length
23
+ return value.length <= 200;
24
+ },
25
+ message: 'Description exceeds the maximum allowed length of 3000 characters'
26
+ }
27
+ },
28
+ category: {
29
+ type: String,
30
+ default: 'others'
31
+ },
32
+ description: {
33
+ type: String,
34
+ default: '',
35
+ validate: {
36
+ validator: function (value) {
37
+ // Maximum allowed length
38
+ return value.length <= 3000;
39
+ },
40
+ message: 'Description exceeds the maximum allowed length of 3000 characters'
41
+ }
42
+ },
43
+ messages: [
44
+ {
45
+ user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
46
+ message: {
47
+ type: String,
48
+ default: ''
49
+ },
50
+ createdAt: Date,
51
+ file: [
52
+ {
53
+ name: {
54
+ type: String,
55
+ required: true
56
+ },
57
+ path: {
58
+ type: String,
59
+ required: true
60
+ }
61
+ }
62
+ ],
63
+ ignore_message: Boolean
64
+ }
65
+ ],
66
+ createdAt: {
67
+ type: Date,
68
+ default: Date.now
69
+ }
70
+ };
@@ -14,4 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./docspagesSchema"), exports);
17
+ __exportStar(require("./Allcourse"), exports);
18
+ __exportStar(require("./Audit"), exports);
19
+ __exportStar(require("./Basedocumentationslink"), exports);
20
+ __exportStar(require("./Communication"), exports);
21
+ __exportStar(require("./Complaint"), exports);
22
+ __exportStar(require("./Docspage"), exports);
@@ -0,0 +1,4 @@
1
+ export var TicketStatus = {
2
+ Open: 'open',
3
+ Resolved: 'resolved'
4
+ };
@@ -0,0 +1,7 @@
1
+ import { Schema } from 'mongoose';
2
+ export var allCourseSchema = {
3
+ updatedBy: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ all_course_chinese: { type: String, required: true },
5
+ all_course_english: { type: String, required: true },
6
+ description: { type: String, maxlength: 2000 }
7
+ };
@@ -0,0 +1,19 @@
1
+ import { Schema } from 'mongoose';
2
+ export var auditSchema = {
3
+ performedBy: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ targetUserId: { type: Schema.Types.ObjectId, ref: 'User' },
5
+ targetDocumentThreadId: {
6
+ type: Schema.Types.ObjectId,
7
+ ref: 'Documentthread'
8
+ },
9
+ interviewThreadId: {
10
+ type: Schema.Types.ObjectId,
11
+ ref: 'Interview'
12
+ },
13
+ action: String,
14
+ field: String,
15
+ changes: {
16
+ before: Schema.Types.Mixed,
17
+ after: Schema.Types.Mixed
18
+ }
19
+ };
@@ -0,0 +1,6 @@
1
+ export var basedocumentationslinksSchema = {
2
+ key: { type: String, default: '' },
3
+ category: { type: String, default: 'general' },
4
+ link: { type: String, default: '' },
5
+ updatedAt: Date
6
+ };
@@ -0,0 +1,27 @@
1
+ import { Schema } from 'mongoose';
2
+ export var communicationsSchema = {
3
+ student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ user_id: { type: Schema.Types.ObjectId, ref: 'User' },
5
+ message: {
6
+ type: String,
7
+ default: ''
8
+ },
9
+ readBy: [{ type: Schema.Types.ObjectId, ref: 'User' }],
10
+ timeStampReadBy: Schema.Types.Mixed,
11
+ files: [
12
+ {
13
+ name: {
14
+ type: String,
15
+ required: true
16
+ },
17
+ path: {
18
+ type: String,
19
+ required: true
20
+ }
21
+ }
22
+ ],
23
+ createdAt: Date,
24
+ ignore_message: Boolean,
25
+ ignoredMessageUpdatedAt: Date,
26
+ ignoredMessageBy: { type: Schema.Types.ObjectId, ref: 'User' }
27
+ };
@@ -0,0 +1,67 @@
1
+ import { Schema } from 'mongoose';
2
+ import { TicketStatus } from '../constants';
3
+ export var complaintSchema = {
4
+ requester_id: {
5
+ type: Schema.Types.ObjectId,
6
+ required: true,
7
+ ref: 'User'
8
+ },
9
+ status: {
10
+ type: String,
11
+ enum: Object.values(TicketStatus),
12
+ default: 'open'
13
+ },
14
+ title: {
15
+ type: String,
16
+ default: '',
17
+ validate: {
18
+ validator: function (value) {
19
+ // Maximum allowed length
20
+ return value.length <= 200;
21
+ },
22
+ message: 'Description exceeds the maximum allowed length of 3000 characters'
23
+ }
24
+ },
25
+ category: {
26
+ type: String,
27
+ default: 'others'
28
+ },
29
+ description: {
30
+ type: String,
31
+ default: '',
32
+ validate: {
33
+ validator: function (value) {
34
+ // Maximum allowed length
35
+ return value.length <= 3000;
36
+ },
37
+ message: 'Description exceeds the maximum allowed length of 3000 characters'
38
+ }
39
+ },
40
+ messages: [
41
+ {
42
+ user_id: { type: Schema.Types.ObjectId, ref: 'User' },
43
+ message: {
44
+ type: String,
45
+ default: ''
46
+ },
47
+ createdAt: Date,
48
+ file: [
49
+ {
50
+ name: {
51
+ type: String,
52
+ required: true
53
+ },
54
+ path: {
55
+ type: String,
56
+ required: true
57
+ }
58
+ }
59
+ ],
60
+ ignore_message: Boolean
61
+ }
62
+ ],
63
+ createdAt: {
64
+ type: Date,
65
+ default: Date.now
66
+ }
67
+ };
@@ -1 +1,6 @@
1
- export * from './docspagesSchema';
1
+ export * from './Allcourse';
2
+ export * from './Audit';
3
+ export * from './Basedocumentationslink';
4
+ export * from './Communication';
5
+ export * from './Complaint';
6
+ export * from './Docspage';
@@ -0,0 +1,4 @@
1
+ export declare const TicketStatus: {
2
+ Open: string;
3
+ Resolved: string;
4
+ };
@@ -0,0 +1,25 @@
1
+ import { Schema } from 'mongoose';
2
+ export interface IAllCourse {
3
+ updatedBy: Schema.Types.ObjectId;
4
+ all_course_chinese: string;
5
+ all_course_english: string;
6
+ description: string;
7
+ }
8
+ export declare const allCourseSchema: {
9
+ updatedBy: {
10
+ type: typeof Schema.Types.ObjectId;
11
+ ref: string;
12
+ };
13
+ all_course_chinese: {
14
+ type: StringConstructor;
15
+ required: boolean;
16
+ };
17
+ all_course_english: {
18
+ type: StringConstructor;
19
+ required: boolean;
20
+ };
21
+ description: {
22
+ type: StringConstructor;
23
+ maxlength: number;
24
+ };
25
+ };
@@ -0,0 +1,25 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const auditSchema: {
3
+ performedBy: {
4
+ type: typeof Schema.Types.ObjectId;
5
+ ref: string;
6
+ };
7
+ targetUserId: {
8
+ type: typeof Schema.Types.ObjectId;
9
+ ref: string;
10
+ };
11
+ targetDocumentThreadId: {
12
+ type: typeof Schema.Types.ObjectId;
13
+ ref: string;
14
+ };
15
+ interviewThreadId: {
16
+ type: typeof Schema.Types.ObjectId;
17
+ ref: string;
18
+ };
19
+ action: StringConstructor;
20
+ field: StringConstructor;
21
+ changes: {
22
+ before: typeof Schema.Types.Mixed;
23
+ after: typeof Schema.Types.Mixed;
24
+ };
25
+ };
@@ -0,0 +1,15 @@
1
+ export declare const basedocumentationslinksSchema: {
2
+ key: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ category: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ link: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ updatedAt: DateConstructor;
15
+ };
@@ -0,0 +1,37 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const communicationsSchema: {
3
+ student_id: {
4
+ type: typeof Schema.Types.ObjectId;
5
+ ref: string;
6
+ };
7
+ user_id: {
8
+ type: typeof Schema.Types.ObjectId;
9
+ ref: string;
10
+ };
11
+ message: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ readBy: {
16
+ type: typeof Schema.Types.ObjectId;
17
+ ref: string;
18
+ }[];
19
+ timeStampReadBy: typeof Schema.Types.Mixed;
20
+ files: {
21
+ name: {
22
+ type: StringConstructor;
23
+ required: boolean;
24
+ };
25
+ path: {
26
+ type: StringConstructor;
27
+ required: boolean;
28
+ };
29
+ }[];
30
+ createdAt: DateConstructor;
31
+ ignore_message: BooleanConstructor;
32
+ ignoredMessageUpdatedAt: DateConstructor;
33
+ ignoredMessageBy: {
34
+ type: typeof Schema.Types.ObjectId;
35
+ ref: string;
36
+ };
37
+ };
@@ -0,0 +1,59 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const complaintSchema: {
3
+ requester_id: {
4
+ type: typeof Schema.Types.ObjectId;
5
+ required: boolean;
6
+ ref: string;
7
+ };
8
+ status: {
9
+ type: StringConstructor;
10
+ enum: string[];
11
+ default: string;
12
+ };
13
+ title: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ validate: {
17
+ validator: (value: string) => boolean;
18
+ message: string;
19
+ };
20
+ };
21
+ category: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ description: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ validate: {
29
+ validator: (value: string) => boolean;
30
+ message: string;
31
+ };
32
+ };
33
+ messages: {
34
+ user_id: {
35
+ type: typeof Schema.Types.ObjectId;
36
+ ref: string;
37
+ };
38
+ message: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ createdAt: DateConstructor;
43
+ file: {
44
+ name: {
45
+ type: StringConstructor;
46
+ required: boolean;
47
+ };
48
+ path: {
49
+ type: StringConstructor;
50
+ required: boolean;
51
+ };
52
+ }[];
53
+ ignore_message: BooleanConstructor;
54
+ }[];
55
+ createdAt: {
56
+ type: DateConstructor;
57
+ default: () => number;
58
+ };
59
+ };
@@ -1 +1,6 @@
1
- export * from './docspagesSchema';
1
+ export * from './Allcourse';
2
+ export * from './Audit';
3
+ export * from './Basedocumentationslink';
4
+ export * from './Communication';
5
+ export * from './Complaint';
6
+ export * from './Docspage';