cloud-ide-model-schema 1.1.140 → 1.1.141

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,23 @@
1
+ import mongoose from "mongoose";
2
+ declare const CFeePayment: 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 { CFeePayment };
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CFeePayment = void 0;
4
+ var mongoose_1 = require("mongoose");
5
+ /**
6
+ * Fee Payment Schema
7
+ *
8
+ * Purpose: Payment records for student fees
9
+ * Used by: Fees, Accounts modules
10
+ *
11
+ * BUSINESS LOGIC:
12
+ * 1. Records all fee payments made by students
13
+ * 2. Supports multiple payment methods (Cash, Cheque, Online, etc.)
14
+ * 3. Links to fee assignments being paid
15
+ * 4. Tracks payment status and reconciliation
16
+ * 5. Generates receipts automatically
17
+ * 6. Supports partial payments
18
+ * 7. Integrates with payment gateways
19
+ */
20
+ /* SCHEMA START */
21
+ var fee_payment = new mongoose_1.Schema({
22
+ feepay_receipt_number: {
23
+ type: String,
24
+ required: false,
25
+ unique: true,
26
+ sparse: true,
27
+ maxlength: 50,
28
+ trim: true,
29
+ comment: "Unique receipt number (auto-generated)"
30
+ },
31
+ feepay_student_id: {
32
+ type: String,
33
+ required: true,
34
+ comment: "Student ID (from admission form admap_student_id) - will be ObjectId when student schema exists"
35
+ },
36
+ feepay_academic_year_id_acayr: {
37
+ type: mongoose_1.default.Schema.Types.ObjectId,
38
+ ref: "aca_academic_year",
39
+ required: true,
40
+ comment: "Academic year"
41
+ },
42
+ feepay_entity_id_syen: {
43
+ type: mongoose_1.default.Schema.Types.ObjectId,
44
+ ref: "core_system_entity",
45
+ required: true,
46
+ comment: "Entity/Organization"
47
+ },
48
+ feepay_payment_date: {
49
+ type: Date,
50
+ required: true,
51
+ default: Date.now,
52
+ comment: "Payment date"
53
+ },
54
+ feepay_payment_mode: {
55
+ type: String,
56
+ required: true,
57
+ enum: ['CASH', 'CHEQUE', 'DD', 'ONLINE', 'CARD', 'UPI', 'NET_BANKING', 'BANK_TRANSFER', 'NEFT', 'RTGS', 'OTHER'],
58
+ comment: "Payment mode/method"
59
+ },
60
+ feepay_payment_reference: {
61
+ type: String,
62
+ maxlength: 100,
63
+ trim: true,
64
+ default: null,
65
+ comment: "Payment reference (cheque number, transaction ID, etc.)"
66
+ },
67
+ feepay_bank_name: {
68
+ type: String,
69
+ maxlength: 100,
70
+ trim: true,
71
+ default: null,
72
+ comment: "Bank name (if cheque/bank transfer)"
73
+ },
74
+ feepay_bank_branch_name: {
75
+ type: String,
76
+ maxlength: 100,
77
+ trim: true,
78
+ default: null,
79
+ comment: "Bank branch name (if cheque/bank transfer)"
80
+ },
81
+ feepay_bank_ifsc_code: {
82
+ type: String,
83
+ maxlength: 11,
84
+ trim: true,
85
+ default: null,
86
+ comment: "Bank IFSC code (if cheque/bank transfer)"
87
+ },
88
+ feepay_instrument_date: {
89
+ type: Date,
90
+ default: null,
91
+ comment: "Instrument date (cheque date, DD date, etc.)"
92
+ },
93
+ feepay_cheque_number: {
94
+ type: String,
95
+ maxlength: 50,
96
+ trim: true,
97
+ default: null,
98
+ comment: "Cheque number (if cheque payment)"
99
+ },
100
+ feepay_cheque_date: {
101
+ type: Date,
102
+ default: null,
103
+ comment: "Cheque date (if cheque payment)"
104
+ },
105
+ feepay_bank_account_number: {
106
+ type: String,
107
+ maxlength: 50,
108
+ trim: true,
109
+ default: null,
110
+ comment: "Bank account number (if bank transfer)"
111
+ },
112
+ feepay_transaction_reference: {
113
+ type: String,
114
+ maxlength: 100,
115
+ trim: true,
116
+ default: null,
117
+ comment: "Transaction reference number (for online payments)"
118
+ },
119
+ feepay_gateway_transaction_id: {
120
+ type: String,
121
+ maxlength: 100,
122
+ trim: true,
123
+ default: null,
124
+ comment: "Payment gateway transaction ID"
125
+ },
126
+ feepay_gateway_reference_id: {
127
+ type: String,
128
+ maxlength: 100,
129
+ trim: true,
130
+ default: null,
131
+ comment: "Payment gateway reference ID"
132
+ },
133
+ feepay_discount_percentage: {
134
+ type: Number,
135
+ default: 0,
136
+ min: 0,
137
+ max: 100,
138
+ comment: "Discount percentage applied"
139
+ },
140
+ feepay_discount_on: {
141
+ type: String,
142
+ enum: ['SUB_TOTAL', 'FEE_HEAD', 'TOTAL', 'INSTALLMENT'],
143
+ default: null,
144
+ comment: "Discount applied on: Sub Total, Fee Head, Total, or Installment"
145
+ },
146
+ feepay_discount_reason: {
147
+ type: String,
148
+ maxlength: 500,
149
+ trim: true,
150
+ default: null,
151
+ comment: "Reason for discount"
152
+ },
153
+ feepay_total_amount: {
154
+ type: Number,
155
+ required: true,
156
+ min: 0,
157
+ comment: "Total payment amount"
158
+ },
159
+ feepay_late_fee_amount: {
160
+ type: Number,
161
+ required: true,
162
+ default: 0,
163
+ min: 0,
164
+ comment: "Amount paid towards late fees"
165
+ },
166
+ feepay_discount_amount: {
167
+ type: Number,
168
+ required: true,
169
+ default: 0,
170
+ min: 0,
171
+ comment: "Discount amount applied"
172
+ },
173
+ feepay_remarks: {
174
+ type: String,
175
+ maxlength: 1000,
176
+ trim: true,
177
+ default: null,
178
+ comment: "Additional remarks/notes"
179
+ },
180
+ feepay_status: {
181
+ type: String,
182
+ required: true,
183
+ enum: ['SUCCESS', 'PENDING', 'FAILED', 'CANCELLED', 'REFUNDED'],
184
+ default: 'PENDING',
185
+ comment: "Payment status"
186
+ },
187
+ feepay_receipt_template_id_feert: {
188
+ type: mongoose_1.default.Schema.Types.ObjectId,
189
+ ref: "fee_receipt_templates",
190
+ default: null,
191
+ comment: "Receipt template used (if custom)"
192
+ },
193
+ feepay_created_by_user: {
194
+ type: mongoose_1.default.Schema.Types.ObjectId,
195
+ ref: "auth_user_mst",
196
+ required: false,
197
+ default: null,
198
+ comment: "User who created the payment"
199
+ },
200
+ feepay_isactive: {
201
+ type: Boolean,
202
+ default: true,
203
+ comment: "Active status flag"
204
+ }
205
+ }, {
206
+ collection: 'fee_payments',
207
+ timestamps: true // Adds created_at and updated_at
208
+ });
209
+ // Indexes for performance
210
+ fee_payment.index({ feepay_receipt_number: 1 }, { unique: true, sparse: true });
211
+ fee_payment.index({ feepay_student_id: 1, feepay_payment_date: -1 });
212
+ fee_payment.index({ feepay_payment_date: -1 });
213
+ fee_payment.index({ feepay_status: 1, feepay_payment_date: -1 });
214
+ fee_payment.index({ feepay_entity_id_syen: 1, feepay_academic_year_id_acayr: 1 });
215
+ fee_payment.index({ feepay_transaction_reference: 1 });
216
+ fee_payment.index({ feepay_gateway_transaction_id: 1 });
217
+ /* SCHEMA END */
218
+ // Note: Interface will be defined in cloud-ide-lms-model
219
+ // For now, export the schema model
220
+ var CFeePayment = mongoose_1.default.model("fee_payments", fee_payment);
221
+ exports.CFeePayment = CFeePayment;
@@ -2,3 +2,4 @@ export * from './fee_assignment';
2
2
  export * from './fee_structure';
3
3
  export * from './fee_structure_item';
4
4
  export * from './fee_receipt_template';
5
+ export * from './fee_payment';
@@ -18,3 +18,4 @@ __exportStar(require("./fee_assignment"), exports);
18
18
  __exportStar(require("./fee_structure"), exports);
19
19
  __exportStar(require("./fee_structure_item"), exports);
20
20
  __exportStar(require("./fee_receipt_template"), exports);
21
+ __exportStar(require("./fee_payment"), 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.140",
12
+ "version": "1.1.141",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",