cloud-ide-model-schema 1.1.131 → 1.1.133
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/lib/schema/fees/fee_assignment.js +1 -1
- package/lib/schema/fees/fee_receipt_template.d.ts +3 -0
- package/lib/schema/fees/fee_receipt_template.js +109 -0
- package/lib/schema/fees/fee_structure.js +1 -1
- package/lib/schema/fees/index.d.ts +1 -0
- package/lib/schema/fees/index.js +1 -0
- package/lib/schema/notifications/notification.js +7 -9
- package/lib/schema/notifications/notification_preference.js +1 -3
- package/lib/schema/notifications/notification_template.js +1 -4
- package/lib/schema/system/api_keys.js +1 -1
- package/lib/schema/system/backup_jobs.js +1 -1
- package/lib/schema/system/backup_policies.js +1 -1
- package/lib/schema/system/subscription_features.js +1 -1
- package/lib/schema/system/subscription_plans.js +1 -1
- package/package.json +1 -1
|
@@ -238,7 +238,7 @@ var fee_assignment = new mongoose_1.Schema({
|
|
|
238
238
|
timestamps: true // Adds created_at and updated_at
|
|
239
239
|
});
|
|
240
240
|
// Indexes for performance
|
|
241
|
-
|
|
241
|
+
// Note: feeas_assignment_number already has unique index from field definition (unique: true)
|
|
242
242
|
fee_assignment.index({ feeas_student_id: 1, feeas_due_date: 1 });
|
|
243
243
|
fee_assignment.index({ feeas_fee_structure_id_feest: 1 });
|
|
244
244
|
fee_assignment.index({ feeas_payment_status: 1, feeas_due_date: 1 });
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CFeeReceiptTemplate = void 0;
|
|
4
|
+
var mongoose_1 = require("mongoose");
|
|
5
|
+
/**
|
|
6
|
+
* Fee Receipt Template Schema
|
|
7
|
+
* Customizable receipt templates with HTML editor
|
|
8
|
+
*/
|
|
9
|
+
/* SCHEMA START */
|
|
10
|
+
var fee_receipt_template = new mongoose_1.Schema({
|
|
11
|
+
feert_template_name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
minlength: 1,
|
|
15
|
+
maxlength: 200,
|
|
16
|
+
trim: true,
|
|
17
|
+
comment: "Receipt template name"
|
|
18
|
+
},
|
|
19
|
+
feert_template_code: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
unique: true,
|
|
23
|
+
sparse: true,
|
|
24
|
+
maxlength: 50,
|
|
25
|
+
trim: true,
|
|
26
|
+
comment: "Unique receipt template code (auto-generated)"
|
|
27
|
+
},
|
|
28
|
+
feert_template_html: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
comment: "HTML content with placeholders for receipt data"
|
|
32
|
+
},
|
|
33
|
+
feert_template_type: {
|
|
34
|
+
type: String,
|
|
35
|
+
enum: ['PAYMENT', 'REFUND', 'PROVISIONAL'],
|
|
36
|
+
required: true,
|
|
37
|
+
comment: "Type of receipt template"
|
|
38
|
+
},
|
|
39
|
+
feert_template_for: {
|
|
40
|
+
type: String,
|
|
41
|
+
enum: ['STUDENT', 'OFFICE', 'BOTH'],
|
|
42
|
+
required: true,
|
|
43
|
+
default: 'BOTH',
|
|
44
|
+
comment: "Who this template is for"
|
|
45
|
+
},
|
|
46
|
+
feert_is_default: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
comment: "Whether this is the default template for its type"
|
|
50
|
+
},
|
|
51
|
+
feert_entity_id_syen: {
|
|
52
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
53
|
+
ref: "core_system_entity",
|
|
54
|
+
required: false,
|
|
55
|
+
default: null,
|
|
56
|
+
comment: "Entity/Organization this template belongs to (null = global)"
|
|
57
|
+
},
|
|
58
|
+
feert_status: {
|
|
59
|
+
type: String,
|
|
60
|
+
enum: ['ACTIVE', 'INACTIVE'],
|
|
61
|
+
required: true,
|
|
62
|
+
default: 'ACTIVE',
|
|
63
|
+
comment: "Template status"
|
|
64
|
+
},
|
|
65
|
+
feert_created_by_user: {
|
|
66
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
67
|
+
ref: "auth_user_mst",
|
|
68
|
+
required: false,
|
|
69
|
+
default: null,
|
|
70
|
+
comment: "User who created this template"
|
|
71
|
+
},
|
|
72
|
+
feert_created_at: {
|
|
73
|
+
type: Date,
|
|
74
|
+
default: Date.now,
|
|
75
|
+
comment: "Template creation timestamp"
|
|
76
|
+
},
|
|
77
|
+
feert_updated_at: {
|
|
78
|
+
type: Date,
|
|
79
|
+
default: Date.now,
|
|
80
|
+
comment: "Template last update timestamp"
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
timestamps: false, // We handle timestamps manually
|
|
84
|
+
collection: "fee_receipt_template"
|
|
85
|
+
});
|
|
86
|
+
// Indexes
|
|
87
|
+
// Note: feert_template_code index is automatically created by unique: true
|
|
88
|
+
fee_receipt_template.index({ feert_entity_id_syen: 1 });
|
|
89
|
+
fee_receipt_template.index({ feert_template_type: 1 });
|
|
90
|
+
fee_receipt_template.index({ feert_status: 1 });
|
|
91
|
+
fee_receipt_template.index({ feert_is_default: 1 });
|
|
92
|
+
fee_receipt_template.index({ feert_created_at: -1 });
|
|
93
|
+
// Pre-save middleware to update feert_updated_at
|
|
94
|
+
fee_receipt_template.pre('save', function (next) {
|
|
95
|
+
this.feert_updated_at = new Date();
|
|
96
|
+
if (this.isNew) {
|
|
97
|
+
this.feert_created_at = new Date();
|
|
98
|
+
}
|
|
99
|
+
next();
|
|
100
|
+
});
|
|
101
|
+
// Pre-update middleware to update feert_updated_at
|
|
102
|
+
fee_receipt_template.pre(['updateOne', 'findOneAndUpdate', 'updateMany'], function (next) {
|
|
103
|
+
this.set({ feert_updated_at: new Date() });
|
|
104
|
+
next();
|
|
105
|
+
});
|
|
106
|
+
/* SCHEMA END */
|
|
107
|
+
/* MODEL START */
|
|
108
|
+
var CFeeReceiptTemplate = mongoose_1.default.models.fee_receipt_template || mongoose_1.default.model("fee_receipt_template", fee_receipt_template);
|
|
109
|
+
exports.CFeeReceiptTemplate = CFeeReceiptTemplate;
|
|
@@ -89,7 +89,7 @@ var fee_structure = new mongoose_1.Schema({
|
|
|
89
89
|
timestamps: false
|
|
90
90
|
});
|
|
91
91
|
// Indexes for performance
|
|
92
|
-
|
|
92
|
+
// Note: fees_structure_code index is automatically created by unique: true
|
|
93
93
|
fee_structure.index({ fees_entity_id_syen: 1, fees_academic_year_id_acayr: 1 });
|
|
94
94
|
fee_structure.index({ fees_class_program_id_acacpm: 1 });
|
|
95
95
|
fee_structure.index({ fees_entity_id_syen: 1, fees_is_active: 1 });
|
package/lib/schema/fees/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./fee_assignment"), exports);
|
|
18
18
|
__exportStar(require("./fee_structure"), exports);
|
|
19
19
|
__exportStar(require("./fee_structure_item"), exports);
|
|
20
|
+
__exportStar(require("./fee_receipt_template"), exports);
|
|
@@ -8,7 +8,6 @@ var notification = new mongoose_1.Schema({
|
|
|
8
8
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
9
9
|
ref: "auth_user_mst",
|
|
10
10
|
required: true,
|
|
11
|
-
index: true,
|
|
12
11
|
comment: "Target user for notification"
|
|
13
12
|
},
|
|
14
13
|
not_type: {
|
|
@@ -16,14 +15,12 @@ var notification = new mongoose_1.Schema({
|
|
|
16
15
|
enum: ['info', 'success', 'warning', 'error', 'system'],
|
|
17
16
|
required: true,
|
|
18
17
|
default: 'info',
|
|
19
|
-
index: true,
|
|
20
18
|
comment: "Notification type"
|
|
21
19
|
},
|
|
22
20
|
not_category: {
|
|
23
21
|
type: String,
|
|
24
22
|
required: true,
|
|
25
23
|
maxlength: 50,
|
|
26
|
-
index: true,
|
|
27
24
|
comment: "Notification category"
|
|
28
25
|
},
|
|
29
26
|
not_title: {
|
|
@@ -57,7 +54,6 @@ var notification = new mongoose_1.Schema({
|
|
|
57
54
|
enum: ['pending', 'sent', 'delivered', 'read', 'archived'],
|
|
58
55
|
required: true,
|
|
59
56
|
default: 'pending',
|
|
60
|
-
index: true,
|
|
61
57
|
comment: "Notification status"
|
|
62
58
|
},
|
|
63
59
|
not_read_at: {
|
|
@@ -94,7 +90,6 @@ var notification = new mongoose_1.Schema({
|
|
|
94
90
|
enum: ['low', 'normal', 'high', 'urgent'],
|
|
95
91
|
required: true,
|
|
96
92
|
default: 'normal',
|
|
97
|
-
index: true,
|
|
98
93
|
comment: "Notification priority"
|
|
99
94
|
},
|
|
100
95
|
not_expires_at: {
|
|
@@ -109,7 +104,6 @@ var notification = new mongoose_1.Schema({
|
|
|
109
104
|
not_created_at: {
|
|
110
105
|
type: Date,
|
|
111
106
|
default: Date.now,
|
|
112
|
-
index: true,
|
|
113
107
|
comment: "Creation timestamp"
|
|
114
108
|
},
|
|
115
109
|
not_updated_at: {
|
|
@@ -122,13 +116,17 @@ var notification = new mongoose_1.Schema({
|
|
|
122
116
|
collection: 'notifications'
|
|
123
117
|
});
|
|
124
118
|
// Indexes for performance
|
|
125
|
-
|
|
126
|
-
notification.index({ not_id_user: 1
|
|
119
|
+
// Single field indexes
|
|
120
|
+
notification.index({ not_id_user: 1 });
|
|
127
121
|
notification.index({ not_type: 1 });
|
|
128
122
|
notification.index({ not_category: 1 });
|
|
129
123
|
notification.index({ not_priority: 1 });
|
|
124
|
+
notification.index({ not_status: 1 });
|
|
125
|
+
notification.index({ not_created_at: -1 }); // Descending for recent-first queries
|
|
126
|
+
// Compound indexes for common query patterns
|
|
127
|
+
notification.index({ not_id_user: 1, not_status: 1 });
|
|
128
|
+
notification.index({ not_id_user: 1, not_created_at: -1 });
|
|
130
129
|
notification.index({ not_status: 1, not_created_at: -1 });
|
|
131
|
-
// Compound index for common queries
|
|
132
130
|
notification.index({
|
|
133
131
|
not_id_user: 1,
|
|
134
132
|
not_status: 1,
|
|
@@ -9,7 +9,6 @@ var notification_preference = new mongoose_1.Schema({
|
|
|
9
9
|
ref: "auth_user_mst",
|
|
10
10
|
required: true,
|
|
11
11
|
unique: true,
|
|
12
|
-
index: true,
|
|
13
12
|
comment: "User reference"
|
|
14
13
|
},
|
|
15
14
|
npref_channels: {
|
|
@@ -116,7 +115,6 @@ var notification_preference = new mongoose_1.Schema({
|
|
|
116
115
|
timestamps: { createdAt: 'npref_created_at', updatedAt: 'npref_updated_at' },
|
|
117
116
|
collection: 'notification_preferences'
|
|
118
117
|
});
|
|
119
|
-
//
|
|
120
|
-
notification_preference.index({ npref_id_user: 1 }, { unique: true });
|
|
118
|
+
// Note: npref_id_user index is automatically created by unique: true
|
|
121
119
|
var CNotificationPreference = mongoose_1.default.model("notification_preference", notification_preference);
|
|
122
120
|
exports.CNotificationPreference = CNotificationPreference;
|
|
@@ -9,7 +9,6 @@ var notification_template = new mongoose_1.Schema({
|
|
|
9
9
|
required: true,
|
|
10
10
|
unique: true,
|
|
11
11
|
maxlength: 100,
|
|
12
|
-
index: true,
|
|
13
12
|
comment: "Unique template identifier"
|
|
14
13
|
},
|
|
15
14
|
ntemp_template_type: {
|
|
@@ -23,7 +22,6 @@ var notification_template = new mongoose_1.Schema({
|
|
|
23
22
|
type: String,
|
|
24
23
|
required: true,
|
|
25
24
|
maxlength: 50,
|
|
26
|
-
index: true,
|
|
27
25
|
comment: "Notification category"
|
|
28
26
|
},
|
|
29
27
|
ntemp_subject: {
|
|
@@ -62,7 +60,6 @@ var notification_template = new mongoose_1.Schema({
|
|
|
62
60
|
ntemp_is_active: {
|
|
63
61
|
type: Boolean,
|
|
64
62
|
default: true,
|
|
65
|
-
index: true,
|
|
66
63
|
comment: "Template active status"
|
|
67
64
|
},
|
|
68
65
|
ntemp_created_at: {
|
|
@@ -80,7 +77,7 @@ var notification_template = new mongoose_1.Schema({
|
|
|
80
77
|
collection: 'notification_templates'
|
|
81
78
|
});
|
|
82
79
|
// Indexes
|
|
83
|
-
|
|
80
|
+
// Note: ntemp_template_name index is automatically created by unique: true
|
|
84
81
|
notification_template.index({ ntemp_category: 1 });
|
|
85
82
|
notification_template.index({ ntemp_is_active: 1 });
|
|
86
83
|
var CNotificationTemplate = mongoose_1.default.model("notification_template", notification_template);
|
|
@@ -69,6 +69,6 @@ var api_keys = new mongoose_1.Schema({
|
|
|
69
69
|
// Indexes
|
|
70
70
|
api_keys.index({ akey_name: 1 });
|
|
71
71
|
api_keys.index({ akey_status: 1 });
|
|
72
|
-
|
|
72
|
+
// Note: akey_api_key index is automatically created by unique: true
|
|
73
73
|
var CApiKey = mongoose_1.default.model("api_keys", api_keys);
|
|
74
74
|
exports.CApiKey = CApiKey;
|
|
@@ -83,7 +83,7 @@ var backup_jobs = new mongoose_1.Schema({
|
|
|
83
83
|
}
|
|
84
84
|
}, { collection: 'backup_jobs', timestamps: { createdAt: 'bjob_created_at', updatedAt: 'bjob_updated_at' } });
|
|
85
85
|
// Indexes
|
|
86
|
-
|
|
86
|
+
// Note: bjob_name index is automatically created by unique: true
|
|
87
87
|
backup_jobs.index({ bjob_status: 1 });
|
|
88
88
|
backup_jobs.index({ bjob_backup_type: 1 });
|
|
89
89
|
backup_jobs.index({ bjob_backup_policy_id: 1 });
|
|
@@ -62,7 +62,7 @@ var backup_policies = new mongoose_1.Schema({
|
|
|
62
62
|
}
|
|
63
63
|
}, { collection: 'backup_policies', timestamps: { createdAt: 'bpol_created_at', updatedAt: 'bpol_updated_at' } });
|
|
64
64
|
// Indexes
|
|
65
|
-
|
|
65
|
+
// Note: bpol_name index is automatically created by unique: true
|
|
66
66
|
backup_policies.index({ bpol_isactive: 1 });
|
|
67
67
|
var CBackupPolicy = mongoose_1.default.model("backup_policies", backup_policies);
|
|
68
68
|
exports.CBackupPolicy = CBackupPolicy;
|
|
@@ -47,7 +47,7 @@ var subscription_features = new mongoose_1.Schema({
|
|
|
47
47
|
}
|
|
48
48
|
}, { collection: 'subscription_features', timestamps: { createdAt: 'sfea_created_at', updatedAt: 'sfea_updated_at' } });
|
|
49
49
|
// Indexes
|
|
50
|
-
|
|
50
|
+
// Note: sfea_code index is automatically created by unique: true
|
|
51
51
|
subscription_features.index({ sfea_category: 1 });
|
|
52
52
|
var CSubscriptionFeature = mongoose_1.default.model("subscription_features", subscription_features);
|
|
53
53
|
exports.CSubscriptionFeature = CSubscriptionFeature;
|
|
@@ -86,7 +86,7 @@ var subscription_plans = new mongoose_1.Schema({
|
|
|
86
86
|
}
|
|
87
87
|
}, { collection: 'subscription_plans', timestamps: { createdAt: 'spln_created_at', updatedAt: 'spln_updated_at' } });
|
|
88
88
|
// Indexes
|
|
89
|
-
|
|
89
|
+
// Note: spln_code index is automatically created by unique: true
|
|
90
90
|
subscription_plans.index({ spln_is_active: 1 });
|
|
91
91
|
subscription_plans.index({ spln_billing_cycle: 1 });
|
|
92
92
|
var CSubscriptionPlan = mongoose_1.default.model("subscription_plans", subscription_plans);
|
package/package.json
CHANGED