UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

128 lines (127 loc) 3.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CAdmissionElectiveDetail = void 0; var mongoose_1 = require("mongoose"); /* SCHEMA START */ var admission_elective_detail = new mongoose_1.Schema({ // FOREIGN KEY TO MAIN APPLICATION adme_application_id_admap: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "admission_application_main", required: true, comment: "Foreign key to admission_application_main" }, // ELECTIVE SELECTION DETAILS adme_priority: { type: Number, required: true, min: 1, max: 20, comment: "Priority order (1st choice, 2nd choice, etc.)" }, adme_subject_code: { type: String, required: true, maxlength: 50, trim: true, comment: "Unique identifier for the selected course/subject" }, adme_subject_name: { type: String, required: true, maxlength: 200, trim: true, comment: "Name of the selected course/subject" }, adme_subject_type: { type: String, required: true, maxlength: 100, trim: true, enum: ["Elective", "Advanced Placement", "Honors", "Major Core", "Major Elective", "General Education", "Core", "Other"], comment: "Type of subject/course" }, adme_credits: { type: Number, min: 0, max: 10, default: 0, comment: "Number of credits for the course" }, adme_status: { type: String, required: true, maxlength: 50, trim: true, enum: ["Pending", "Approved", "Rejected", "Waitlisted", "Alternative"], default: "Pending", comment: "Status of elective selection" }, adme_approval_date: { type: Date, comment: "Date when elective was approved" }, adme_approved_by_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "User who approved the elective selection" }, adme_rejection_reason: { type: String, maxlength: 500, trim: true, comment: "Reason for rejection (if applicable)" }, adme_prerequisites_met: { type: Boolean, default: false, comment: "Whether prerequisites are met" }, adme_prerequisites_notes: { type: String, maxlength: 500, trim: true, comment: "Notes about prerequisites" }, adme_alternative_subject_code: { type: String, maxlength: 50, trim: true, comment: "Alternative subject code if primary is not available" }, adme_alternative_subject_name: { type: String, maxlength: 200, trim: true, comment: "Alternative subject name if primary is not available" }, adme_notes: { type: String, maxlength: 1000, trim: true, comment: "Additional notes about the elective selection" }, // METADATA adme_created_date: { type: Date, default: Date.now }, adme_modified_date: { type: Date, default: Date.now }, adme_isactive: { type: Boolean, default: true } }, { collection: 'admission_elective_detail', timestamps: true }); // Indexes for performance admission_elective_detail.index({ adme_application_id_admap: 1 }); admission_elective_detail.index({ adme_priority: 1 }); admission_elective_detail.index({ adme_subject_code: 1 }); admission_elective_detail.index({ adme_status: 1 }); var CAdmissionElectiveDetail = mongoose_1.default.model("admission_elective_detail", admission_elective_detail); exports.CAdmissionElectiveDetail = CAdmissionElectiveDetail;