cloud-ide-model-schema 1.1.106 → 1.1.108

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.
@@ -9,6 +9,11 @@ var aca_class_prg_branch = new mongoose_1.Schema({
9
9
  ref: "aca_class_program_master",
10
10
  required: true
11
11
  },
12
+ acabrn_branch_id_sygms: {
13
+ type: mongoose_1.default.Schema.Types.ObjectId,
14
+ ref: "core_general_master",
15
+ default: null
16
+ },
12
17
  acabrn_name: {
13
18
  type: String,
14
19
  required: true,
@@ -5,3 +5,4 @@ export * from "./academics";
5
5
  export * from "./accounts";
6
6
  export * from "./frontdesk";
7
7
  export * from "./admission";
8
+ export * from "./notifications";
@@ -21,3 +21,4 @@ __exportStar(require("./academics"), exports);
21
21
  __exportStar(require("./accounts"), exports);
22
22
  __exportStar(require("./frontdesk"), exports);
23
23
  __exportStar(require("./admission"), exports);
24
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1,4 @@
1
+ export * from "./notification";
2
+ export * from "./notification_log";
3
+ export * from "./notification_preference";
4
+ export * from "./notification_template";
@@ -0,0 +1,20 @@
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
+ __exportStar(require("./notification"), exports);
18
+ __exportStar(require("./notification_log"), exports);
19
+ __exportStar(require("./notification_preference"), exports);
20
+ __exportStar(require("./notification_template"), exports);
@@ -0,0 +1,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CNotification: mongoose.Model<{
3
+ [x: string]: unknown;
4
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
5
+ [x: string]: unknown;
6
+ }, {}> & {
7
+ [x: string]: unknown;
8
+ } & Required<{
9
+ _id: unknown;
10
+ }> & {
11
+ __v: number;
12
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
13
+ [x: string]: unknown;
14
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
15
+ [x: string]: unknown;
16
+ }>, {}> & mongoose.FlatRecord<{
17
+ [x: string]: unknown;
18
+ }> & Required<{
19
+ _id: unknown;
20
+ }> & {
21
+ __v: number;
22
+ }>>;
23
+ export { CNotification };
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CNotification = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /* SCHEMA START */
6
+ var notification = new mongoose_1.Schema({
7
+ not_id_user: {
8
+ type: mongoose_1.default.Schema.Types.ObjectId,
9
+ ref: "auth_user_mst",
10
+ required: true,
11
+ index: true,
12
+ comment: "Target user for notification"
13
+ },
14
+ not_type: {
15
+ type: String,
16
+ enum: ['info', 'success', 'warning', 'error', 'system'],
17
+ required: true,
18
+ default: 'info',
19
+ index: true,
20
+ comment: "Notification type"
21
+ },
22
+ not_category: {
23
+ type: String,
24
+ required: true,
25
+ maxlength: 50,
26
+ index: true,
27
+ comment: "Notification category"
28
+ },
29
+ not_title: {
30
+ type: String,
31
+ required: true,
32
+ maxlength: 200,
33
+ comment: "Notification title"
34
+ },
35
+ not_message: {
36
+ type: String,
37
+ required: true,
38
+ maxlength: 1000,
39
+ comment: "Notification message"
40
+ },
41
+ not_data: {
42
+ type: mongoose_1.Schema.Types.Mixed,
43
+ comment: "Additional data in JSON format"
44
+ },
45
+ not_action_url: {
46
+ type: String,
47
+ maxlength: 500,
48
+ comment: "URL to navigate on click"
49
+ },
50
+ not_action_label: {
51
+ type: String,
52
+ maxlength: 50,
53
+ comment: "Action button label"
54
+ },
55
+ not_status: {
56
+ type: String,
57
+ enum: ['pending', 'sent', 'delivered', 'read', 'archived'],
58
+ required: true,
59
+ default: 'pending',
60
+ index: true,
61
+ comment: "Notification status"
62
+ },
63
+ not_read_at: {
64
+ type: Date,
65
+ comment: "When notification was read"
66
+ },
67
+ not_delivered_at: {
68
+ type: Date,
69
+ comment: "When notification was delivered"
70
+ },
71
+ not_archived_at: {
72
+ type: Date,
73
+ comment: "When notification was archived"
74
+ },
75
+ not_channels: {
76
+ in_app: {
77
+ type: Boolean,
78
+ default: true,
79
+ comment: "In-app notification enabled"
80
+ },
81
+ email: {
82
+ type: Boolean,
83
+ default: false,
84
+ comment: "Email notification enabled"
85
+ },
86
+ sms: {
87
+ type: Boolean,
88
+ default: false,
89
+ comment: "SMS notification enabled"
90
+ }
91
+ },
92
+ not_priority: {
93
+ type: String,
94
+ enum: ['low', 'normal', 'high', 'urgent'],
95
+ required: true,
96
+ default: 'normal',
97
+ index: true,
98
+ comment: "Notification priority"
99
+ },
100
+ not_expires_at: {
101
+ type: Date,
102
+ comment: "Auto-archive after this date"
103
+ },
104
+ not_id_created_by: {
105
+ type: mongoose_1.default.Schema.Types.ObjectId,
106
+ ref: "auth_user_mst",
107
+ comment: "User/system that created notification"
108
+ },
109
+ not_created_at: {
110
+ type: Date,
111
+ default: Date.now,
112
+ index: true,
113
+ comment: "Creation timestamp"
114
+ },
115
+ not_updated_at: {
116
+ type: Date,
117
+ default: Date.now,
118
+ comment: "Last update timestamp"
119
+ }
120
+ }, {
121
+ timestamps: { createdAt: 'not_created_at', updatedAt: 'not_updated_at' },
122
+ collection: 'notifications'
123
+ });
124
+ // Indexes for performance
125
+ notification.index({ not_id_user: 1, not_status: 1 });
126
+ notification.index({ not_id_user: 1, not_created_at: -1 });
127
+ notification.index({ not_type: 1 });
128
+ notification.index({ not_category: 1 });
129
+ notification.index({ not_priority: 1 });
130
+ notification.index({ not_status: 1, not_created_at: -1 });
131
+ // Compound index for common queries
132
+ notification.index({
133
+ not_id_user: 1,
134
+ not_status: 1,
135
+ not_created_at: -1
136
+ });
137
+ var CNotification = mongoose_1.default.model("notification", notification);
138
+ exports.CNotification = CNotification;
@@ -0,0 +1,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CNotificationLog: mongoose.Model<{
3
+ [x: string]: unknown;
4
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
5
+ [x: string]: unknown;
6
+ }, {}> & {
7
+ [x: string]: unknown;
8
+ } & Required<{
9
+ _id: unknown;
10
+ }> & {
11
+ __v: number;
12
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
13
+ [x: string]: unknown;
14
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
15
+ [x: string]: unknown;
16
+ }>, {}> & mongoose.FlatRecord<{
17
+ [x: string]: unknown;
18
+ }> & Required<{
19
+ _id: unknown;
20
+ }> & {
21
+ __v: number;
22
+ }>>;
23
+ export { CNotificationLog };
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CNotificationLog = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /* SCHEMA START */
6
+ var notification_log = new mongoose_1.Schema({
7
+ nlog_id_user: {
8
+ type: mongoose_1.default.Schema.Types.ObjectId,
9
+ ref: "auth_user_mst",
10
+ required: true,
11
+ index: true,
12
+ comment: "Target user"
13
+ },
14
+ nlog_event_type: {
15
+ type: String,
16
+ enum: ['created', 'sent', 'delivered', 'read', 'archived', 'failed'],
17
+ required: true,
18
+ index: true,
19
+ comment: "Event type"
20
+ },
21
+ nlog_event_timestamp: {
22
+ type: Date,
23
+ required: true,
24
+ default: Date.now,
25
+ index: true,
26
+ comment: "Event timestamp"
27
+ },
28
+ nlog_channel: {
29
+ type: String,
30
+ enum: ['in_app', 'email', 'sms', 'websocket'],
31
+ required: true,
32
+ index: true,
33
+ comment: "Notification channel"
34
+ },
35
+ nlog_channel_status: {
36
+ type: String,
37
+ enum: ['success', 'failed', 'pending'],
38
+ required: true,
39
+ default: 'pending',
40
+ comment: "Channel delivery status"
41
+ },
42
+ nlog_channel_error: {
43
+ type: String,
44
+ maxlength: 500,
45
+ comment: "Error message if delivery failed"
46
+ },
47
+ nlog_websocket_connection_id: {
48
+ type: String,
49
+ comment: "Socket.IO connection ID"
50
+ },
51
+ nlog_websocket_room: {
52
+ type: String,
53
+ comment: "Socket.IO room name"
54
+ },
55
+ nlog_ip_address: {
56
+ type: String,
57
+ maxlength: 45,
58
+ comment: "IP address of user"
59
+ },
60
+ nlog_user_agent: {
61
+ type: String,
62
+ maxlength: 500,
63
+ comment: "User agent string"
64
+ },
65
+ nlog_metadata: {
66
+ type: mongoose_1.Schema.Types.Mixed,
67
+ comment: "Additional context data"
68
+ },
69
+ nlog_created_at: {
70
+ type: Date,
71
+ default: Date.now,
72
+ index: true,
73
+ comment: "Log creation timestamp"
74
+ }
75
+ }, {
76
+ timestamps: { createdAt: 'nlog_created_at' },
77
+ collection: 'notification_logs'
78
+ });
79
+ // Indexes
80
+ notification_log.index({ nlog_id_user: 1, nlog_event_timestamp: -1 });
81
+ notification_log.index({ nlog_channel: 1, nlog_channel_status: 1 });
82
+ notification_log.index({ nlog_event_type: 1, nlog_event_timestamp: -1 });
83
+ var CNotificationLog = mongoose_1.default.model("notification_log", notification_log);
84
+ exports.CNotificationLog = CNotificationLog;
@@ -0,0 +1,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CNotificationPreference: mongoose.Model<{
3
+ [x: string]: unknown;
4
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
5
+ [x: string]: unknown;
6
+ }, {}> & {
7
+ [x: string]: unknown;
8
+ } & Required<{
9
+ _id: unknown;
10
+ }> & {
11
+ __v: number;
12
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
13
+ [x: string]: unknown;
14
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
15
+ [x: string]: unknown;
16
+ }>, {}> & mongoose.FlatRecord<{
17
+ [x: string]: unknown;
18
+ }> & Required<{
19
+ _id: unknown;
20
+ }> & {
21
+ __v: number;
22
+ }>>;
23
+ export { CNotificationPreference };
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CNotificationPreference = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /* SCHEMA START */
6
+ var notification_preference = new mongoose_1.Schema({
7
+ npref_id_user: {
8
+ type: mongoose_1.default.Schema.Types.ObjectId,
9
+ ref: "auth_user_mst",
10
+ required: true,
11
+ unique: true,
12
+ index: true,
13
+ comment: "User reference"
14
+ },
15
+ npref_channels: {
16
+ in_app: {
17
+ enabled: {
18
+ type: Boolean,
19
+ default: true,
20
+ comment: "In-app notifications enabled"
21
+ },
22
+ categories: {
23
+ type: [String],
24
+ default: [],
25
+ comment: "Allowed categories"
26
+ },
27
+ priority_levels: {
28
+ type: [String],
29
+ default: ['low', 'normal', 'high', 'urgent'],
30
+ comment: "Allowed priority levels"
31
+ }
32
+ },
33
+ email: {
34
+ enabled: {
35
+ type: Boolean,
36
+ default: false,
37
+ comment: "Email notifications enabled"
38
+ },
39
+ categories: {
40
+ type: [String],
41
+ default: [],
42
+ comment: "Allowed categories"
43
+ },
44
+ priority_levels: {
45
+ type: [String],
46
+ default: ['high', 'urgent'],
47
+ comment: "Allowed priority levels"
48
+ },
49
+ email_address: {
50
+ type: String,
51
+ maxlength: 255,
52
+ comment: "Email address for notifications"
53
+ }
54
+ },
55
+ sms: {
56
+ enabled: {
57
+ type: Boolean,
58
+ default: false,
59
+ comment: "SMS notifications enabled"
60
+ },
61
+ categories: {
62
+ type: [String],
63
+ default: [],
64
+ comment: "Allowed categories"
65
+ },
66
+ priority_levels: {
67
+ type: [String],
68
+ default: ['urgent'],
69
+ comment: "Allowed priority levels"
70
+ },
71
+ phone_number: {
72
+ type: String,
73
+ maxlength: 20,
74
+ comment: "Phone number for SMS"
75
+ }
76
+ }
77
+ },
78
+ npref_quiet_hours: {
79
+ enabled: {
80
+ type: Boolean,
81
+ default: false,
82
+ comment: "Quiet hours enabled"
83
+ },
84
+ start_time: {
85
+ type: String,
86
+ default: "22:00",
87
+ comment: "Quiet hours start time"
88
+ },
89
+ end_time: {
90
+ type: String,
91
+ default: "08:00",
92
+ comment: "Quiet hours end time"
93
+ },
94
+ timezone: {
95
+ type: String,
96
+ default: "Asia/Kolkata",
97
+ comment: "Timezone for quiet hours"
98
+ }
99
+ },
100
+ npref_do_not_disturb: {
101
+ type: Boolean,
102
+ default: false,
103
+ comment: "Do not disturb mode"
104
+ },
105
+ npref_updated_at: {
106
+ type: Date,
107
+ default: Date.now,
108
+ comment: "Last update timestamp"
109
+ },
110
+ npref_created_at: {
111
+ type: Date,
112
+ default: Date.now,
113
+ comment: "Creation timestamp"
114
+ }
115
+ }, {
116
+ timestamps: { createdAt: 'npref_created_at', updatedAt: 'npref_updated_at' },
117
+ collection: 'notification_preferences'
118
+ });
119
+ // Unique index on user_id
120
+ notification_preference.index({ npref_id_user: 1 }, { unique: true });
121
+ var CNotificationPreference = mongoose_1.default.model("notification_preference", notification_preference);
122
+ exports.CNotificationPreference = CNotificationPreference;
@@ -0,0 +1,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CNotificationTemplate: mongoose.Model<{
3
+ [x: string]: unknown;
4
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
5
+ [x: string]: unknown;
6
+ }, {}> & {
7
+ [x: string]: unknown;
8
+ } & Required<{
9
+ _id: unknown;
10
+ }> & {
11
+ __v: number;
12
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
13
+ [x: string]: unknown;
14
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
15
+ [x: string]: unknown;
16
+ }>, {}> & mongoose.FlatRecord<{
17
+ [x: string]: unknown;
18
+ }> & Required<{
19
+ _id: unknown;
20
+ }> & {
21
+ __v: number;
22
+ }>>;
23
+ export { CNotificationTemplate };
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CNotificationTemplate = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /* SCHEMA START */
6
+ var notification_template = new mongoose_1.Schema({
7
+ ntemp_template_name: {
8
+ type: String,
9
+ required: true,
10
+ unique: true,
11
+ maxlength: 100,
12
+ index: true,
13
+ comment: "Unique template identifier"
14
+ },
15
+ ntemp_template_type: {
16
+ type: String,
17
+ enum: ['in_app', 'email', 'sms', 'all'],
18
+ required: true,
19
+ default: 'all',
20
+ comment: "Template type"
21
+ },
22
+ ntemp_category: {
23
+ type: String,
24
+ required: true,
25
+ maxlength: 50,
26
+ index: true,
27
+ comment: "Notification category"
28
+ },
29
+ ntemp_subject: {
30
+ type: String,
31
+ maxlength: 200,
32
+ comment: "Subject for email/SMS"
33
+ },
34
+ ntemp_title: {
35
+ type: String,
36
+ required: true,
37
+ maxlength: 200,
38
+ comment: "Title for in-app notification"
39
+ },
40
+ ntemp_message: {
41
+ type: String,
42
+ required: true,
43
+ maxlength: 1000,
44
+ comment: "Message template with variables"
45
+ },
46
+ ntemp_variables: {
47
+ type: [String],
48
+ default: [],
49
+ comment: "Available template variables"
50
+ },
51
+ ntemp_default_priority: {
52
+ type: String,
53
+ enum: ['low', 'normal', 'high', 'urgent'],
54
+ default: 'normal',
55
+ comment: "Default priority"
56
+ },
57
+ ntemp_default_channels: {
58
+ type: [String],
59
+ default: ['in_app'],
60
+ comment: "Default channels"
61
+ },
62
+ ntemp_is_active: {
63
+ type: Boolean,
64
+ default: true,
65
+ index: true,
66
+ comment: "Template active status"
67
+ },
68
+ ntemp_created_at: {
69
+ type: Date,
70
+ default: Date.now,
71
+ comment: "Creation timestamp"
72
+ },
73
+ ntemp_updated_at: {
74
+ type: Date,
75
+ default: Date.now,
76
+ comment: "Last update timestamp"
77
+ }
78
+ }, {
79
+ timestamps: { createdAt: 'ntemp_created_at', updatedAt: 'ntemp_updated_at' },
80
+ collection: 'notification_templates'
81
+ });
82
+ // Indexes
83
+ notification_template.index({ ntemp_template_name: 1 }, { unique: true });
84
+ notification_template.index({ ntemp_category: 1 });
85
+ notification_template.index({ ntemp_is_active: 1 });
86
+ var CNotificationTemplate = mongoose_1.default.model("notification_template", notification_template);
87
+ exports.CNotificationTemplate = CNotificationTemplate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "cloud-ide-lms-model": "^1.0.321",
3
+ "cloud-ide-lms-model": "^1.0.329",
4
4
  "dotenv": "^16.5.0",
5
5
  "mongoose": "^8.15.0"
6
6
  },
@@ -9,7 +9,7 @@
9
9
  "typescript": "^5.8.3"
10
10
  },
11
11
  "name": "cloud-ide-model-schema",
12
- "version": "1.1.106",
12
+ "version": "1.1.108",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",