cloud-ide-model-schema
Version:
Pachage for schema management of Cloud IDEsys LMS
194 lines (193 loc) • 6.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAdmissionContactAddresses = exports.CAdmissionEntityAccessPassManagementAdmca = void 0;
var mongoose_1 = require("mongoose");
/**
* Admission Contact Addresses Schema
*
* Purpose: Store multiple contact addresses for admission applications
* Cloned from: core_user_contact_addresses
* Prefix: admca_ (admission contact addresses)
*
* BUSINESS LOGIC:
* 1. Multiple addresses per admission application
* 2. Different address types (Permanent, Correspondence, Emergency, etc.)
* 3. Contact person details for each address
* 4. Complete address with pin code, city, state, country
* 5. Phone, email, and fax details
* 6. Entity-based access control
*/
/* SCHEMA START */
var admission_contact_addresses = new mongoose_1.Schema({
admca_admission_id_admap: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: 'admission_application_main',
comment: "Reference to admission application"
},
admca_address_type_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: 'core_general_master',
comment: "Address type (Permanent, Correspondence, Emergency, etc.)"
},
admca_contact_person_name: {
type: String,
default: "",
maxlength: 200,
trim: true,
comment: "Name of contact person at this address"
},
admca_contact_person_relation_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: 'core_general_master',
default: null,
comment: "Relation to student from general master (Parent, Guardian, etc.) - type code: family_relationship"
},
admca_contact_address: {
type: String,
default: "",
maxlength: 500,
trim: true,
comment: "Street address line 1 and 2"
},
admca_contact_pin_sypin: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: 'core_pin_code',
comment: "Reference to pin code master"
},
admca_contact_city_sypin: {
type: String,
default: "",
maxlength: 100,
trim: true,
comment: "City/Town name"
},
admca_contact_state_sypin: {
type: String,
default: "",
maxlength: 100,
trim: true,
comment: "State/Province name"
},
admca_contact_country_syctr: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: 'core_system_country',
comment: "Country reference"
},
admca_contact_phone: {
type: Number,
default: null,
comment: "Primary phone number"
},
admca_contact_phone_country_code: {
type: String,
default: "",
maxlength: 10,
trim: true,
comment: "Country code for phone"
},
admca_contact_phone_alt: {
type: Number,
default: null,
comment: "Alternative phone number"
},
admca_contact_phone_alt_country_code: {
type: String,
default: "",
maxlength: 10,
trim: true,
comment: "Country code for alternative phone"
},
admca_contact_fax: {
type: String,
default: "",
maxlength: 50,
trim: true,
comment: "Fax number"
},
admca_contact_email: {
type: String,
default: "",
maxlength: 255,
trim: true,
lowercase: true,
comment: "Primary email address"
},
admca_contact_email_alt: {
type: String,
default: "",
maxlength: 255,
trim: true,
lowercase: true,
comment: "Alternative email address"
},
admca_is_primary: {
type: Boolean,
default: false,
comment: "Is this the primary address"
},
admca_same_as_permanent: {
type: Boolean,
default: false,
comment: "Is this same as permanent address"
},
admca_isactive: {
type: Boolean,
default: true,
comment: "Is address active"
}
}, {
collection: 'admission_contact_addresses'
});
// Indexes for better performance
admission_contact_addresses.index({ admca_admission_id_admap: 1 });
admission_contact_addresses.index({ admca_address_type_id_sygms: 1 });
admission_contact_addresses.index({ admca_contact_person_relation_id_sygms: 1 });
admission_contact_addresses.index({ admca_is_primary: 1 });
admission_contact_addresses.index({ admca_isactive: 1 });
var CAdmissionContactAddresses = mongoose_1.default.model("admission_contact_addresses", admission_contact_addresses);
exports.CAdmissionContactAddresses = CAdmissionContactAddresses;
// Access pass for entity-based access control
var admission_entity_access_pass_management_admca = 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_contact_addresses',
comment: "Address 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_admca' });
var CAdmissionEntityAccessPassManagementAdmca = mongoose_1.default.model("admission_entity_access_pass_management_admca", admission_entity_access_pass_management_admca);
exports.CAdmissionEntityAccessPassManagementAdmca = CAdmissionEntityAccessPassManagementAdmca;