UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

65 lines (64 loc) 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CFeePaymentItem = void 0; var mongoose_1 = require("mongoose"); /** * Fee Payment Item Schema * * Purpose: Line items for individual payments (mapping payment to assignments) * Used by: Fees, Accounts modules */ /* SCHEMA START */ var fee_payment_item = new mongoose_1.Schema({ feepayit_payment_id_feepay: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "fee_payments", required: true, comment: "Reference to fee_payment" }, feepayit_assignment_id_feeas: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "fee_assignments", required: true, comment: "Reference to specific fee_assignment being paid" }, feepayit_structure_item_id_feesi: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "fee_structure_items", default: null, comment: "Specific fee structure item reference" }, feepayit_item_name: { type: String, required: true, trim: true, comment: "Fee head/item name" }, feepayit_amount_paid: { type: Number, required: true, min: 0, comment: "Amount paid for this specific item" }, feepayit_late_fee: { type: Number, default: 0, min: 0, comment: "Late fee paid for this item" }, feepayit_discount_applied: { type: Number, default: 0, min: 0, comment: "Discount applied during this payment" } }, { collection: 'fee_payment_items', timestamps: true }); // Indexes for performance fee_payment_item.index({ feepayit_payment_id_feepay: 1 }); fee_payment_item.index({ feepayit_assignment_id_feeas: 1 }); /* SCHEMA END */ var CFeePaymentItem = mongoose_1.default.model("fee_payment_items", fee_payment_item); exports.CFeePaymentItem = CFeePaymentItem;