@taiger-common/model 1.0.5 → 1.0.6

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,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coursesSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.coursesSchema = {
6
+ student_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
7
+ name: { type: String, default: '' },
8
+ table_data_string: { type: String, default: '' },
9
+ table_data_string_locked: { type: Boolean, default: false },
10
+ table_data_string_taiger_guided: {
11
+ type: String,
12
+ default: '[{"course_chinese":"","course_english":"","credits":"0","grades":""}]'
13
+ },
14
+ updatedAt: Date,
15
+ analysis: {
16
+ path: { type: String, default: '' },
17
+ analyzed_course: [{ type: String, default: '' }],
18
+ isAnalysed: { type: Boolean, default: false },
19
+ isAnalysedV2: { type: Boolean, default: false },
20
+ pathV2: { type: String, default: '' },
21
+ updatedAtV2: Date,
22
+ updatedAt: Date
23
+ }
24
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.documentationsSchema = void 0;
4
+ exports.documentationsSchema = {
5
+ name: { type: String, default: '' },
6
+ title: { type: String, default: '' },
7
+ category: { type: String, default: '' },
8
+ author: { type: String, default: '' },
9
+ prop: { type: String, default: '' },
10
+ text: { type: String, default: '' },
11
+ country: { type: String, default: '' },
12
+ updatedAt: Date
13
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.documentThreadsSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.documentThreadsSchema = {
6
+ student_id: { type: mongoose_1.Schema.Types.ObjectId, require: true, ref: 'User' },
7
+ program_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Program' },
8
+ outsourced_user_id: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
9
+ pin_by_user_id: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
10
+ flag_by_user_id: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
11
+ file_type: { type: String, require: true },
12
+ isFinalVersion: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ isOriginAuthorDeclarationConfirmedByStudent: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ isOriginAuthorDeclarationConfirmedByStudentTimestamp: Date,
21
+ messages: [
22
+ {
23
+ user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User' },
24
+ message: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ createdAt: Date,
29
+ file: [
30
+ {
31
+ name: {
32
+ type: String,
33
+ required: true
34
+ },
35
+ path: {
36
+ type: String,
37
+ required: true
38
+ }
39
+ }
40
+ ],
41
+ ignore_message: Boolean
42
+ }
43
+ ],
44
+ updatedAt: Date
45
+ };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventSchema = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ exports.EventSchema = {
6
+ requester_id: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
7
+ receiver_id: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
8
+ isConfirmedRequester: {
9
+ type: Boolean,
10
+ default: false
11
+ },
12
+ isConfirmedReceiver: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ meetingLink: {
17
+ type: String,
18
+ default: false
19
+ },
20
+ event_type: {
21
+ type: String
22
+ },
23
+ title: {
24
+ type: String
25
+ // required: [true, 'Please write a title for your event']
26
+ },
27
+ description: {
28
+ type: String,
29
+ required: [true, 'Please write a description for your event'],
30
+ validate: {
31
+ validator: function (value) {
32
+ return value.length <= 2000; // Maximum allowed length
33
+ },
34
+ message: 'Description exceeds the maximum allowed length of 500 characters'
35
+ }
36
+ },
37
+ start: {
38
+ type: Date,
39
+ required: [true, 'Please Insert The Start of your event'],
40
+ min: [new Date(), "time can't be before now!!"]
41
+ },
42
+ end: {
43
+ type: Date,
44
+ // setting a min function to accept any date one hour ahead of start
45
+ min: [
46
+ function () {
47
+ var date = new Date(this.start);
48
+ var validDate = new Date(date.getTime() + 60000);
49
+ return validDate;
50
+ },
51
+ 'Event End must be at least one minute a head of event time'
52
+ ],
53
+ default: function () {
54
+ var date = new Date(this.start);
55
+ var validDate = new Date(date.getTime() + 60000 * 30);
56
+ return validDate;
57
+ }
58
+ }
59
+ };
@@ -19,4 +19,8 @@ __exportStar(require("./Audit"), exports);
19
19
  __exportStar(require("./Basedocumentationslink"), exports);
20
20
  __exportStar(require("./Communication"), exports);
21
21
  __exportStar(require("./Complaint"), exports);
22
+ __exportStar(require("./Course"), exports);
22
23
  __exportStar(require("./Docspage"), exports);
24
+ __exportStar(require("./Documentation"), exports);
25
+ __exportStar(require("./Documentthread"), exports);
26
+ __exportStar(require("./Event"), exports);
@@ -0,0 +1,21 @@
1
+ import { Schema } from 'mongoose';
2
+ export var coursesSchema = {
3
+ student_id: { type: Schema.Types.ObjectId, ref: 'User' },
4
+ name: { type: String, default: '' },
5
+ table_data_string: { type: String, default: '' },
6
+ table_data_string_locked: { type: Boolean, default: false },
7
+ table_data_string_taiger_guided: {
8
+ type: String,
9
+ default: '[{"course_chinese":"","course_english":"","credits":"0","grades":""}]'
10
+ },
11
+ updatedAt: Date,
12
+ analysis: {
13
+ path: { type: String, default: '' },
14
+ analyzed_course: [{ type: String, default: '' }],
15
+ isAnalysed: { type: Boolean, default: false },
16
+ isAnalysedV2: { type: Boolean, default: false },
17
+ pathV2: { type: String, default: '' },
18
+ updatedAtV2: Date,
19
+ updatedAt: Date
20
+ }
21
+ };
@@ -0,0 +1,10 @@
1
+ export var documentationsSchema = {
2
+ name: { type: String, default: '' },
3
+ title: { type: String, default: '' },
4
+ category: { type: String, default: '' },
5
+ author: { type: String, default: '' },
6
+ prop: { type: String, default: '' },
7
+ text: { type: String, default: '' },
8
+ country: { type: String, default: '' },
9
+ updatedAt: Date
10
+ };
@@ -0,0 +1,42 @@
1
+ import { Schema } from 'mongoose';
2
+ export var documentThreadsSchema = {
3
+ student_id: { type: Schema.Types.ObjectId, require: true, ref: 'User' },
4
+ program_id: { type: Schema.Types.ObjectId, ref: 'Program' },
5
+ outsourced_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
6
+ pin_by_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
7
+ flag_by_user_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
8
+ file_type: { type: String, require: true },
9
+ isFinalVersion: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ isOriginAuthorDeclarationConfirmedByStudent: {
14
+ type: Boolean,
15
+ default: false
16
+ },
17
+ isOriginAuthorDeclarationConfirmedByStudentTimestamp: Date,
18
+ messages: [
19
+ {
20
+ user_id: { type: Schema.Types.ObjectId, ref: 'User' },
21
+ message: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ createdAt: Date,
26
+ file: [
27
+ {
28
+ name: {
29
+ type: String,
30
+ required: true
31
+ },
32
+ path: {
33
+ type: String,
34
+ required: true
35
+ }
36
+ }
37
+ ],
38
+ ignore_message: Boolean
39
+ }
40
+ ],
41
+ updatedAt: Date
42
+ };
@@ -0,0 +1,56 @@
1
+ import { Schema } from 'mongoose';
2
+ export var EventSchema = {
3
+ requester_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
4
+ receiver_id: [{ type: Schema.Types.ObjectId, ref: 'User' }],
5
+ isConfirmedRequester: {
6
+ type: Boolean,
7
+ default: false
8
+ },
9
+ isConfirmedReceiver: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ meetingLink: {
14
+ type: String,
15
+ default: false
16
+ },
17
+ event_type: {
18
+ type: String
19
+ },
20
+ title: {
21
+ type: String
22
+ // required: [true, 'Please write a title for your event']
23
+ },
24
+ description: {
25
+ type: String,
26
+ required: [true, 'Please write a description for your event'],
27
+ validate: {
28
+ validator: function (value) {
29
+ return value.length <= 2000; // Maximum allowed length
30
+ },
31
+ message: 'Description exceeds the maximum allowed length of 500 characters'
32
+ }
33
+ },
34
+ start: {
35
+ type: Date,
36
+ required: [true, 'Please Insert The Start of your event'],
37
+ min: [new Date(), "time can't be before now!!"]
38
+ },
39
+ end: {
40
+ type: Date,
41
+ // setting a min function to accept any date one hour ahead of start
42
+ min: [
43
+ function () {
44
+ var date = new Date(this.start);
45
+ var 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
+ var date = new Date(this.start);
52
+ var validDate = new Date(date.getTime() + 60000 * 30);
53
+ return validDate;
54
+ }
55
+ }
56
+ };
@@ -3,4 +3,8 @@ export * from './Audit';
3
3
  export * from './Basedocumentationslink';
4
4
  export * from './Communication';
5
5
  export * from './Complaint';
6
+ export * from './Course';
6
7
  export * from './Docspage';
8
+ export * from './Documentation';
9
+ export * from './Documentthread';
10
+ export * from './Event';
@@ -0,0 +1,48 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const coursesSchema: {
3
+ student_id: {
4
+ type: typeof Schema.Types.ObjectId;
5
+ ref: string;
6
+ };
7
+ name: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ table_data_string: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ table_data_string_locked: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ table_data_string_taiger_guided: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ updatedAt: DateConstructor;
24
+ analysis: {
25
+ path: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ analyzed_course: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ }[];
33
+ isAnalysed: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ isAnalysedV2: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ pathV2: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ updatedAtV2: DateConstructor;
46
+ updatedAt: DateConstructor;
47
+ };
48
+ };
@@ -0,0 +1,31 @@
1
+ export declare const documentationsSchema: {
2
+ name: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ title: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ category: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ author: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ prop: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ text: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ country: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ updatedAt: DateConstructor;
31
+ };
@@ -0,0 +1,60 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const documentThreadsSchema: {
3
+ student_id: {
4
+ type: typeof Schema.Types.ObjectId;
5
+ require: boolean;
6
+ ref: string;
7
+ };
8
+ program_id: {
9
+ type: typeof Schema.Types.ObjectId;
10
+ ref: string;
11
+ };
12
+ outsourced_user_id: {
13
+ type: typeof Schema.Types.ObjectId;
14
+ ref: string;
15
+ }[];
16
+ pin_by_user_id: {
17
+ type: typeof Schema.Types.ObjectId;
18
+ ref: string;
19
+ }[];
20
+ flag_by_user_id: {
21
+ type: typeof Schema.Types.ObjectId;
22
+ ref: string;
23
+ }[];
24
+ file_type: {
25
+ type: StringConstructor;
26
+ require: boolean;
27
+ };
28
+ isFinalVersion: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ isOriginAuthorDeclarationConfirmedByStudent: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ isOriginAuthorDeclarationConfirmedByStudentTimestamp: DateConstructor;
37
+ messages: {
38
+ user_id: {
39
+ type: typeof Schema.Types.ObjectId;
40
+ ref: string;
41
+ };
42
+ message: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ createdAt: DateConstructor;
47
+ file: {
48
+ name: {
49
+ type: StringConstructor;
50
+ required: boolean;
51
+ };
52
+ path: {
53
+ type: StringConstructor;
54
+ required: boolean;
55
+ };
56
+ }[];
57
+ ignore_message: BooleanConstructor;
58
+ }[];
59
+ updatedAt: DateConstructor;
60
+ };
@@ -0,0 +1,60 @@
1
+ import { Schema } from 'mongoose';
2
+ interface IEvent {
3
+ requester_id: string[];
4
+ receiver_id: string[];
5
+ isConfirmedRequester: boolean;
6
+ isConfirmedReceiver: boolean;
7
+ meetingLink: string;
8
+ event_type: string;
9
+ title: string;
10
+ description: string;
11
+ start: Date;
12
+ end: Date;
13
+ }
14
+ export declare const EventSchema: {
15
+ requester_id: {
16
+ type: typeof Schema.Types.ObjectId;
17
+ ref: string;
18
+ }[];
19
+ receiver_id: {
20
+ type: typeof Schema.Types.ObjectId;
21
+ ref: string;
22
+ }[];
23
+ isConfirmedRequester: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ isConfirmedReceiver: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ meetingLink: {
32
+ type: StringConstructor;
33
+ default: boolean;
34
+ };
35
+ event_type: {
36
+ type: StringConstructor;
37
+ };
38
+ title: {
39
+ type: StringConstructor;
40
+ };
41
+ description: {
42
+ type: StringConstructor;
43
+ required: (string | boolean)[];
44
+ validate: {
45
+ validator: (value: string) => boolean;
46
+ message: string;
47
+ };
48
+ };
49
+ start: {
50
+ type: DateConstructor;
51
+ required: (string | boolean)[];
52
+ min: (string | Date)[];
53
+ };
54
+ end: {
55
+ type: DateConstructor;
56
+ min: (string | ((this: IEvent) => Date))[];
57
+ default: (this: IEvent) => Date;
58
+ };
59
+ };
60
+ export {};
@@ -3,4 +3,8 @@ export * from './Audit';
3
3
  export * from './Basedocumentationslink';
4
4
  export * from './Communication';
5
5
  export * from './Complaint';
6
+ export * from './Course';
6
7
  export * from './Docspage';
8
+ export * from './Documentation';
9
+ export * from './Documentthread';
10
+ export * from './Event';