"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeePaymentSchema = exports.FeePayment = void 0;
const mongoose_1 = require("@nestjs/mongoose");
const base_entity_1 = require("../../common/entities/base.entity");
let FeePayment = class FeePayment extends base_entity_1.BaseEntity {
    assignmentId;
    studentId;
    academicYearId;
    amount;
    fineComponent;
    paymentMethod;
    receiptNumber;
    razorpayOrderId;
    razorpayPaymentId;
    razorpaySignature;
    transactionId;
    collectedBy;
    collectedByName;
    receiptUrl;
    notes;
    paidAt;
};
exports.FeePayment = FeePayment;
__decorate([
    (0, mongoose_1.Prop)({ required: true }),
    __metadata("design:type", String)
], FeePayment.prototype, "assignmentId", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true }),
    __metadata("design:type", String)
], FeePayment.prototype, "studentId", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true }),
    __metadata("design:type", String)
], FeePayment.prototype, "academicYearId", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true, min: 1 }),
    __metadata("design:type", Number)
], FeePayment.prototype, "amount", void 0);
__decorate([
    (0, mongoose_1.Prop)({ default: 0, min: 0 }),
    __metadata("design:type", Number)
], FeePayment.prototype, "fineComponent", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true, enum: ['razorpay', 'cash', 'cheque', 'bank_transfer', 'upi', 'online'] }),
    __metadata("design:type", String)
], FeePayment.prototype, "paymentMethod", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true }),
    __metadata("design:type", String)
], FeePayment.prototype, "receiptNumber", void 0);
__decorate([
    (0, mongoose_1.Prop)(),
    __metadata("design:type", String)
], FeePayment.prototype, "razorpayOrderId", void 0);
__decorate([
    (0, mongoose_1.Prop)(),
    __metadata("design:type", String)
], FeePayment.prototype, "razorpayPaymentId", void 0);
__decorate([
    (0, mongoose_1.Prop)(),
    __metadata("design:type", String)
], FeePayment.prototype, "razorpaySignature", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true, maxlength: 200 }),
    __metadata("design:type", String)
], FeePayment.prototype, "transactionId", void 0);
__decorate([
    (0, mongoose_1.Prop)(),
    __metadata("design:type", String)
], FeePayment.prototype, "collectedBy", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true, maxlength: 200 }),
    __metadata("design:type", String)
], FeePayment.prototype, "collectedByName", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true }),
    __metadata("design:type", String)
], FeePayment.prototype, "receiptUrl", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true, maxlength: 1000 }),
    __metadata("design:type", String)
], FeePayment.prototype, "notes", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true }),
    __metadata("design:type", Date)
], FeePayment.prototype, "paidAt", void 0);
exports.FeePayment = FeePayment = __decorate([
    (0, mongoose_1.Schema)({ timestamps: true })
], FeePayment);
exports.FeePaymentSchema = mongoose_1.SchemaFactory.createForClass(FeePayment);
exports.FeePaymentSchema.index({ assignmentId: 1, paidAt: 1 });
exports.FeePaymentSchema.index({ studentId: 1, academicYearId: 1 });
exports.FeePaymentSchema.index({ razorpayOrderId: 1 }, { unique: true, sparse: true });
exports.FeePaymentSchema.index({ receiptNumber: 1 }, { unique: true, sparse: true });
exports.FeePaymentSchema.set('toJSON', { versionKey: false });
exports.FeePaymentSchema.set('toObject', { versionKey: false });
//# sourceMappingURL=fee-payment.schema.js.map