UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

178 lines (177 loc) 6.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CAdmissionRteDetails = exports.CAdmissionEntityAccessPassManagementAdmrte = void 0; var mongoose_1 = require("mongoose"); /** * Admission RTE (Right to Education) Details Schema * * Purpose: Store comprehensive RTE scheme details for admission applications * Prefix: admrte_ (admission RTE) * * BUSINESS LOGIC: * 1. Separate table for RTE details to allow future integration with multiple tables * 2. One RTE details record per admission (when RTE scheme is applicable) * 3. Stores certificates, income details, caste information, BPL card details * 4. Reference fields for future extensibility to connect with student master and other tables * 5. Entity-based access control */ /* SCHEMA START */ var admission_rte_details = new mongoose_1.Schema({ admrte_admission_id_admap: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'admission_application_main', required: true, comment: "Reference to admission application (primary reference)" }, admrte_reference_table: { type: String, maxlength: 100, trim: true, comment: "Reference table name for future extensibility (e.g., 'admission_application_main', 'student_master')" }, admrte_reference_id: { type: mongoose_1.default.Schema.Types.ObjectId, comment: "Reference ID for future extensibility (reference to other tables)" }, admrte_rte_certificate_number: { type: String, maxlength: 100, trim: true, comment: "RTE certificate number" }, admrte_rte_certificate_date: { type: Date, comment: "RTE certificate issue date" }, admrte_rte_category_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_general_master', comment: "RTE category (Economically Weaker Section, Disadvantaged Group, etc.) - Reference to core_general_master with type 'RTE_CATEGORY'" }, admrte_income_certificate_number: { type: String, maxlength: 100, trim: true, comment: "Income certificate number" }, admrte_income_certificate_date: { type: Date, comment: "Income certificate date" }, admrte_income_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_file_manager', comment: "Income certificate file manager ID" }, admrte_caste_certificate_number: { type: String, maxlength: 100, trim: true, comment: "Caste certificate number" }, admrte_caste_certificate_date: { type: Date, comment: "Caste certificate date" }, admrte_caste_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_file_manager', comment: "Caste certificate file manager ID" }, admrte_caste_category_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_general_master', comment: "Caste category (General, OBC, SC, ST, etc.) - Reference to core_general_master with type 'CASTE_CATEGORY'" }, admrte_bpl_card_number: { type: String, maxlength: 100, trim: true, comment: "BPL (Below Poverty Line) card number" }, admrte_bpl_card_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_file_manager', comment: "BPL card file manager ID" }, admrte_annual_income: { type: Number, min: 0, comment: "Annual family income" }, admrte_annual_income_currency_id_syic: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_iso_currency', comment: "Currency reference for annual income" }, admrte_rte_quota_percentage: { type: Number, min: 0, max: 100, comment: "RTE quota percentage (0-100)" }, admrte_remarks: { type: String, maxlength: 1000, trim: true, comment: "Additional remarks/notes" }, admrte_isactive: { type: Boolean, default: true, comment: "Is active" } }, { collection: 'admission_rte_details' }); // Indexes for better performance admission_rte_details.index({ admrte_admission_id_admap: 1 }); admission_rte_details.index({ admrte_reference_table: 1, admrte_reference_id: 1 }); admission_rte_details.index({ admrte_isactive: 1 }); var CAdmissionRteDetails = mongoose_1.default.model("admission_rte_details", admission_rte_details); exports.CAdmissionRteDetails = CAdmissionRteDetails; // Access pass for entity-based access control var admission_entity_access_pass_management_admrte = new mongoose_1.Schema({ admepm_user_id_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'auth_user_mst', comment: "User who has access" }, admepm_entity_id_syen: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'core_system_entity', comment: "Entity context" }, admepm_access_pass_to: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'admission_rte_details', comment: "RTE details record access" }, admepm_is_owner: { type: Boolean, default: true, comment: "Is owner of record" }, admepm_can_edit: { type: Boolean, default: true, comment: "Can edit permission" }, admepm_can_view: { type: Boolean, default: true, comment: "Can view permission" }, admepm_isactive: { type: Boolean, default: true, comment: "Is access active" }, admepm_actions_allowed: { type: Object, default: {}, comment: "Specific actions allowed" } }, { collection: 'admission_entity_access_pass_management_admrte' }); var CAdmissionEntityAccessPassManagementAdmrte = mongoose_1.default.model("admission_entity_access_pass_management_admrte", admission_entity_access_pass_management_admrte); exports.CAdmissionEntityAccessPassManagementAdmrte = CAdmissionEntityAccessPassManagementAdmrte;