UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

97 lines (96 loc) 3.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CAppPlatformLinkMst = void 0; var mongoose_1 = require("mongoose"); /* SCHEMA START */ var app_platform_link_mst = new mongoose_1.Schema({ applink_reg_id_appreg: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "app_registration_mst", required: true, comment: "FK to app_registration_mst - Reference to app registration" }, applink_store_provider_id_appstore: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "app_store_provider_mst", required: true, comment: "FK to app_store_provider_mst - Reference to store provider" }, applink_platform_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", required: true, comment: "FK to core_general_master - Platform type (APP_PLATFORM: 'ios', 'android', 'web')" }, applink_link_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", required: true, comment: "FK to core_general_master - Link status (APP_LINK_STATUS)" }, applink_workflow_id_wfrg: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_workflow_registry", comment: "FK to core_workflow_registry - Workflow for platform linking approval (optional)" }, applink_current_step: { type: Number, comment: "Current workflow step (if workflow is active)" }, applink_platform_app_id: { type: String, required: true, maxlength: 200, trim: true, comment: "Bundle ID (iOS), Package Name (Android), or Domain/Project ID (Web)" }, applink_store_app_id: { type: String, maxlength: 200, trim: true, comment: "App ID in the store/platform (if already published)" }, applink_platform_config: { type: mongoose_1.Schema.Types.Mixed, comment: "JSON object - Platform-specific configuration (ios_config, android_config, web_config, general_config)" }, applink_platform_api_config: { type: mongoose_1.Schema.Types.Mixed, comment: "JSON object - Platform API credentials and configuration for single-click deployment" }, applink_linked_by_id_auth: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", required: true, comment: "FK to auth_user_mst - User who linked the platform" }, applink_linked_at: { type: Date, required: true, default: Date.now, comment: "Date when platform was linked" }, applink_unlinked_at: { type: Date, comment: "Date when platform was unlinked" }, applink_created_at: { type: Date, default: Date.now, comment: "Creation timestamp" }, applink_updated_at: { type: Date, default: Date.now, comment: "Last update timestamp" } }, { collection: 'app_platform_link_mst', timestamps: { createdAt: 'applink_created_at', updatedAt: 'applink_updated_at' } }); // Indexes for performance optimization app_platform_link_mst.index({ applink_reg_id_appreg: 1, applink_store_provider_id_appstore: 1 }, { unique: true }); app_platform_link_mst.index({ applink_platform_id_sygms: 1 }); app_platform_link_mst.index({ applink_link_status_id_sygms: 1 }); app_platform_link_mst.index({ applink_store_provider_id_appstore: 1 }); app_platform_link_mst.index({ applink_workflow_id_wfrg: 1, applink_current_step: 1 }); app_platform_link_mst.index({ applink_platform_app_id: 1 }); var CAppPlatformLinkMst = mongoose_1.default.model("app_platform_link_mst", app_platform_link_mst); exports.CAppPlatformLinkMst = CAppPlatformLinkMst;