cloud-ide-model-schema 1.1.131 → 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.
@@ -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
@@ -9,7 +9,7 @@
9
9
  "typescript": "^5.8.3"
10
10
  },
11
11
  "name": "cloud-ide-model-schema",
12
- "version": "1.1.131",
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",