UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

84 lines (83 loc) 2.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CAppRegistrationMst = void 0; var mongoose_1 = require("mongoose"); /* SCHEMA START */ var app_registration_mst = new mongoose_1.Schema({ appreg_app_id: { type: String, required: true, unique: true, maxlength: 100, trim: true, comment: "Unique app identifier (com.company.app or my-web-app-id) - unique across all apps" }, appreg_app_name: { type: String, required: true, maxlength: 200, trim: true, comment: "App display name" }, appreg_app_description: { type: String, maxlength: 1000, trim: true, comment: "App description" }, appreg_organization_name: { type: String, maxlength: 200, trim: true, comment: "Organization name" }, appreg_organization_id: { type: String, maxlength: 100, trim: true, comment: "Organization identifier" }, appreg_registration_date: { type: Date, required: true, default: Date.now, comment: "Registration date" }, appreg_registration_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", required: true, comment: "FK to core_general_master - Registration status (APP_REG_STATUS)" }, appreg_registered_by_id_auth: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", required: true, comment: "FK to auth_user_mst - User who registered" }, appreg_workflow_id_wfrg: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_workflow_registry", comment: "FK to core_workflow_registry - Workflow for registration approval (optional)" }, appreg_current_step: { type: Number, comment: "Current workflow step (if workflow is active)" }, appreg_created_at: { type: Date, default: Date.now, comment: "Creation timestamp" }, appreg_updated_at: { type: Date, default: Date.now, comment: "Last update timestamp" } }, { collection: 'app_registration_mst', timestamps: { createdAt: 'appreg_created_at', updatedAt: 'appreg_updated_at' } }); // Indexes for performance optimization app_registration_mst.index({ appreg_registration_status_id_sygms: 1 }); app_registration_mst.index({ appreg_registered_by_id_auth: 1 }); app_registration_mst.index({ appreg_workflow_id_wfrg: 1, appreg_current_step: 1 }); var CAppRegistrationMst = mongoose_1.default.model("app_registration_mst", app_registration_mst); exports.CAppRegistrationMst = CAppRegistrationMst;