cloud-ide-model-schema 1.1.130 → 1.1.132

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.
@@ -959,6 +959,11 @@ var admission_application_main = new mongoose_1.Schema({
959
959
  trim: true,
960
960
  comment: "Remarks or notes about the admission confirmation"
961
961
  },
962
+ admap_islocked: {
963
+ type: Boolean,
964
+ default: false,
965
+ comment: "Lock admission form to prevent editing after confirmation"
966
+ },
962
967
  // FOREIGN KEYS & REFERENCES
963
968
  admap_entity_id_syen: {
964
969
  type: mongoose_1.default.Schema.Types.ObjectId,
@@ -0,0 +1,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CAdmissionFeeSnapshot: 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 { CAdmissionFeeSnapshot };
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CAdmissionFeeSnapshot = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /**
6
+ * Admission Fee Snapshot Schema
7
+ *
8
+ * Purpose: Store complete fee structure snapshot at the time of admission confirmation/conversion
9
+ * This ensures that changes to fee structure definitions don't affect already applied fees
10
+ *
11
+ * BUSINESS LOGIC:
12
+ * 1. Stores complete fee structure with all items, amounts, discounts, scholarships
13
+ * 2. Linked to admission_id at confirmation stage
14
+ * 3. Updated with student_id at conversion stage
15
+ * 4. Used for viewing fee status instead of actual fee structure tables
16
+ * 5. Supports different school scenarios (apply at confirmation or conversion)
17
+ */
18
+ /* SCHEMA START */
19
+ var admission_fee_snapshot = new mongoose_1.Schema({
20
+ adfsn_snapshot_number: {
21
+ type: String,
22
+ required: true,
23
+ unique: true,
24
+ maxlength: 50,
25
+ trim: true,
26
+ comment: "Unique snapshot number (auto-generated, e.g., SNAP2026-001)"
27
+ },
28
+ adfsn_admission_id_admap: {
29
+ type: mongoose_1.default.Schema.Types.ObjectId,
30
+ ref: "admission_application_main",
31
+ required: true,
32
+ comment: "Reference to admission application"
33
+ },
34
+ adfsn_student_id: {
35
+ type: String,
36
+ maxlength: 50,
37
+ trim: true,
38
+ default: null,
39
+ comment: "Student ID (updated at conversion stage, null until conversion)"
40
+ },
41
+ adfsn_user_id_auth: {
42
+ type: mongoose_1.default.Schema.Types.ObjectId,
43
+ ref: "auth_user_mst",
44
+ default: null,
45
+ comment: "Reference to user account (updated at conversion stage)"
46
+ },
47
+ adfsn_entity_id_syen: {
48
+ type: mongoose_1.default.Schema.Types.ObjectId,
49
+ ref: "core_system_entity",
50
+ required: true,
51
+ comment: "Entity for which fees are applicable"
52
+ },
53
+ adfsn_academic_year_id_acayr: {
54
+ type: mongoose_1.default.Schema.Types.ObjectId,
55
+ ref: "aca_academic_year",
56
+ required: true,
57
+ comment: "Academic year for which fees are applicable"
58
+ },
59
+ adfsn_class_program_id_acacpm: {
60
+ type: mongoose_1.default.Schema.Types.ObjectId,
61
+ ref: "aca_class_program_master",
62
+ required: true,
63
+ comment: "Class/Program for which fees are applicable"
64
+ },
65
+ adfsn_class_program_term_id_acapt: {
66
+ type: mongoose_1.default.Schema.Types.ObjectId,
67
+ ref: "aca_class_program_term",
68
+ default: null,
69
+ comment: "Program term (if applicable)"
70
+ },
71
+ adfsn_class_program_branch_id_acabrn: {
72
+ type: mongoose_1.default.Schema.Types.ObjectId,
73
+ ref: "aca_class_program_branch",
74
+ default: null,
75
+ comment: "Specialization/Branch (if applicable)"
76
+ },
77
+ adfsn_section_id_acapts: {
78
+ type: mongoose_1.default.Schema.Types.ObjectId,
79
+ ref: "aca_prg_trm_section",
80
+ default: null,
81
+ comment: "Section (if applicable)"
82
+ },
83
+ adfsn_fee_structure_id_feest: {
84
+ type: mongoose_1.default.Schema.Types.ObjectId,
85
+ ref: "fee_structures",
86
+ default: null,
87
+ comment: "Original fee structure ID (for reference, snapshot is independent)"
88
+ },
89
+ adfsn_snapshot_date: {
90
+ type: Date,
91
+ required: true,
92
+ default: Date.now,
93
+ comment: "Date when snapshot was created (confirmation or conversion date)"
94
+ },
95
+ adfsn_applied_at_stage: {
96
+ type: String,
97
+ required: true,
98
+ enum: ['CONFIRMATION', 'CONVERSION'],
99
+ comment: "Stage at which fees were applied (confirmation or student conversion)"
100
+ },
101
+ adfsn_fee_items: [{
102
+ // Store complete fee item details (snapshot of fee_structure_item at time of application)
103
+ feesi_original_item_id: {
104
+ type: mongoose_1.default.Schema.Types.ObjectId,
105
+ ref: "fee_structure_items",
106
+ default: null,
107
+ comment: "Original fee structure item ID (for reference)"
108
+ },
109
+ feesi_category_id_sygms: {
110
+ type: mongoose_1.default.Schema.Types.ObjectId,
111
+ ref: "core_general_master",
112
+ required: true,
113
+ comment: "Fee category"
114
+ },
115
+ feesi_category_name: {
116
+ type: String,
117
+ maxlength: 200,
118
+ trim: true,
119
+ comment: "Fee category name (snapshot)"
120
+ },
121
+ feesi_item_code: {
122
+ type: String,
123
+ maxlength: 50,
124
+ trim: true,
125
+ comment: "Fee item code"
126
+ },
127
+ feesi_item_name: {
128
+ type: String,
129
+ required: true,
130
+ maxlength: 200,
131
+ trim: true,
132
+ comment: "Fee item name"
133
+ },
134
+ feesi_description: {
135
+ type: String,
136
+ maxlength: 500,
137
+ trim: true,
138
+ comment: "Fee item description"
139
+ },
140
+ feesi_original_amount: {
141
+ type: Number,
142
+ required: true,
143
+ min: 0,
144
+ comment: "Original fee amount (before discounts/scholarships)"
145
+ },
146
+ feesi_applied_amount: {
147
+ type: Number,
148
+ required: true,
149
+ min: 0,
150
+ comment: "Amount applied (may differ from original if editable)"
151
+ },
152
+ feesi_discount_type: {
153
+ type: String,
154
+ enum: ['PERCENTAGE', 'FIXED_AMOUNT', null],
155
+ default: null,
156
+ comment: "Discount type if applicable"
157
+ },
158
+ feesi_discount_value: {
159
+ type: Number,
160
+ default: 0,
161
+ min: 0,
162
+ comment: "Discount value (percentage or fixed amount)"
163
+ },
164
+ feesi_discount_amount: {
165
+ type: Number,
166
+ required: true,
167
+ default: 0,
168
+ min: 0,
169
+ comment: "Calculated discount amount"
170
+ },
171
+ feesi_discount_reason_id_sygms: {
172
+ type: mongoose_1.default.Schema.Types.ObjectId,
173
+ ref: "core_general_master",
174
+ default: null,
175
+ comment: "Discount reason (if applicable)"
176
+ },
177
+ feesi_scholarship_type_id_sygms: {
178
+ type: mongoose_1.default.Schema.Types.ObjectId,
179
+ ref: "core_general_master",
180
+ default: null,
181
+ comment: "Scholarship type (if applicable)"
182
+ },
183
+ feesi_scholarship_category: {
184
+ type: String,
185
+ enum: ['FULL', 'PARTIAL', null],
186
+ default: null,
187
+ comment: "Scholarship category"
188
+ },
189
+ feesi_scholarship_percentage: {
190
+ type: Number,
191
+ default: null,
192
+ min: 0,
193
+ max: 100,
194
+ comment: "Scholarship percentage (if partial)"
195
+ },
196
+ feesi_scholarship_amount: {
197
+ type: Number,
198
+ required: true,
199
+ default: 0,
200
+ min: 0,
201
+ comment: "Scholarship amount"
202
+ },
203
+ feesi_final_amount: {
204
+ type: Number,
205
+ required: true,
206
+ min: 0,
207
+ comment: "Final amount after discounts and scholarships"
208
+ },
209
+ feesi_tax_applicable: {
210
+ type: Boolean,
211
+ default: false,
212
+ comment: "Is tax applicable"
213
+ },
214
+ feesi_tax_percentage: {
215
+ type: Number,
216
+ default: 0,
217
+ min: 0,
218
+ max: 100,
219
+ comment: "Tax percentage"
220
+ },
221
+ feesi_tax_amount: {
222
+ type: Number,
223
+ default: 0,
224
+ min: 0,
225
+ comment: "Tax amount"
226
+ },
227
+ feesi_total_amount: {
228
+ type: Number,
229
+ required: true,
230
+ min: 0,
231
+ comment: "Total amount including tax"
232
+ },
233
+ feesi_is_mandatory: {
234
+ type: Boolean,
235
+ default: true,
236
+ comment: "Is this fee mandatory"
237
+ },
238
+ feesi_is_refundable: {
239
+ type: Boolean,
240
+ default: false,
241
+ comment: "Is this fee refundable"
242
+ },
243
+ feesi_is_installment_allowed: {
244
+ type: Boolean,
245
+ default: false,
246
+ comment: "Allow installments"
247
+ },
248
+ feesi_installment_count: {
249
+ type: Number,
250
+ default: 1,
251
+ min: 1,
252
+ comment: "Number of installments"
253
+ },
254
+ feesi_due_date_offset_days: {
255
+ type: Number,
256
+ default: 0,
257
+ comment: "Due date offset in days"
258
+ },
259
+ feesi_collection_start_offset_days: {
260
+ type: Number,
261
+ default: 0,
262
+ comment: "Collection start offset"
263
+ },
264
+ feesi_collection_end_offset_days: {
265
+ type: Number,
266
+ default: 30,
267
+ comment: "Collection end offset"
268
+ },
269
+ feesi_display_order: {
270
+ type: Number,
271
+ default: 0,
272
+ comment: "Display order"
273
+ },
274
+ feesi_notes: {
275
+ type: String,
276
+ maxlength: 500,
277
+ trim: true,
278
+ comment: "Additional notes for this fee item"
279
+ }
280
+ }],
281
+ adfsn_total_original_amount: {
282
+ type: Number,
283
+ required: true,
284
+ min: 0,
285
+ comment: "Total original amount (sum of all fee items before discounts)"
286
+ },
287
+ adfsn_total_discount_amount: {
288
+ type: Number,
289
+ required: true,
290
+ default: 0,
291
+ min: 0,
292
+ comment: "Total discount amount"
293
+ },
294
+ adfsn_total_scholarship_amount: {
295
+ type: Number,
296
+ required: true,
297
+ default: 0,
298
+ min: 0,
299
+ comment: "Total scholarship amount"
300
+ },
301
+ adfsn_total_tax_amount: {
302
+ type: Number,
303
+ required: true,
304
+ default: 0,
305
+ min: 0,
306
+ comment: "Total tax amount"
307
+ },
308
+ adfsn_total_final_amount: {
309
+ type: Number,
310
+ required: true,
311
+ min: 0,
312
+ comment: "Total final amount (after all adjustments)"
313
+ },
314
+ adfsn_currency_id_sycr: {
315
+ type: mongoose_1.default.Schema.Types.ObjectId,
316
+ ref: "core_currency",
317
+ default: null,
318
+ comment: "Currency for fees"
319
+ },
320
+ adfsn_currency_code: {
321
+ type: String,
322
+ maxlength: 10,
323
+ trim: true,
324
+ default: 'USD',
325
+ comment: "Currency code (snapshot)"
326
+ },
327
+ adfsn_notes: {
328
+ type: String,
329
+ maxlength: 1000,
330
+ trim: true,
331
+ comment: "Additional notes about this fee snapshot"
332
+ },
333
+ adfsn_created_by_user: {
334
+ type: mongoose_1.default.Schema.Types.ObjectId,
335
+ ref: "auth_user_mst",
336
+ comment: "User who created this snapshot"
337
+ },
338
+ adfsn_modified_by_user: {
339
+ type: mongoose_1.default.Schema.Types.ObjectId,
340
+ ref: "auth_user_mst",
341
+ comment: "User who last modified this snapshot"
342
+ },
343
+ adfsn_isactive: {
344
+ type: Boolean,
345
+ default: true,
346
+ comment: "Active status"
347
+ },
348
+ adfsn_created_date: {
349
+ type: Date,
350
+ default: Date.now,
351
+ comment: "Creation timestamp"
352
+ },
353
+ adfsn_modified_date: {
354
+ type: Date,
355
+ default: Date.now,
356
+ comment: "Last modification timestamp"
357
+ }
358
+ }, {
359
+ collection: 'admission_fee_snapshot',
360
+ timestamps: false // Using custom timestamp fields
361
+ });
362
+ // Indexes for performance
363
+ admission_fee_snapshot.index({ adfsn_admission_id_admap: 1 });
364
+ admission_fee_snapshot.index({ adfsn_student_id: 1 });
365
+ admission_fee_snapshot.index({ adfsn_user_id_auth: 1 });
366
+ admission_fee_snapshot.index({ adfsn_entity_id_syen: 1 });
367
+ admission_fee_snapshot.index({ adfsn_academic_year_id_acayr: 1 });
368
+ admission_fee_snapshot.index({ adfsn_class_program_id_acacpm: 1 });
369
+ admission_fee_snapshot.index({ adfsn_snapshot_date: 1 });
370
+ admission_fee_snapshot.index({ adfsn_applied_at_stage: 1 });
371
+ // Compound index for efficient lookups
372
+ admission_fee_snapshot.index({ adfsn_admission_id_admap: 1, adfsn_isactive: 1 });
373
+ admission_fee_snapshot.index({ adfsn_student_id: 1, adfsn_isactive: 1 });
374
+ var CAdmissionFeeSnapshot = mongoose_1.default.model("admission_fee_snapshot", admission_fee_snapshot);
375
+ exports.CAdmissionFeeSnapshot = CAdmissionFeeSnapshot;
@@ -4,3 +4,4 @@ export * from "./admission_status_history";
4
4
  export * from "./admission_document_uploads";
5
5
  export * from "./admission_contact_addresses";
6
6
  export * from "./admission_family_members";
7
+ export * from "./admission_fee_snapshot";
@@ -20,3 +20,4 @@ __exportStar(require("./admission_status_history"), exports);
20
20
  __exportStar(require("./admission_document_uploads"), exports);
21
21
  __exportStar(require("./admission_contact_addresses"), exports);
22
22
  __exportStar(require("./admission_family_members"), exports);
23
+ __exportStar(require("./admission_fee_snapshot"), exports);
@@ -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
- fee_assignment.index({ feeas_assignment_number: 1 }, { unique: true });
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,3 @@
1
+ import mongoose from "mongoose";
2
+ declare const CFeeReceiptTemplate: mongoose.Model<any, {}, {}, {}, any, any>;
3
+ export { CFeeReceiptTemplate };
@@ -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
+ fee_receipt_template.index({ feert_template_code: 1 }, { unique: true, sparse: 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;
@@ -1,3 +1,4 @@
1
1
  export * from './fee_assignment';
2
2
  export * from './fee_structure';
3
3
  export * from './fee_structure_item';
4
+ export * from './fee_receipt_template';
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "cloud-ide-lms-model": "^1.0.354",
3
+ "cloud-ide-lms-model": "^1.0.356",
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.130",
12
+ "version": "1.1.132",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",