cloud-ide-model-schema
Version:
Pachage for schema management of Cloud IDEsys LMS
251 lines (250 loc) • 8.66 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAppPublishDetailsMst = void 0;
var mongoose_1 = require("mongoose");
/* SCHEMA START */
var app_publish_details_mst = new mongoose_1.Schema({
apppub_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"
},
apppub_link_id_applink: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "app_platform_link_mst",
required: true,
comment: "FK to app_platform_link_mst - Reference to platform link"
},
apppub_version_id_appver: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "app_version_mst",
required: true,
comment: "FK to app_version_mst - Reference to app version"
},
apppub_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"
},
apppub_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)"
},
apppub_store_version_number: {
type: String,
required: true,
maxlength: 50,
trim: true,
comment: "Version number for this store (e.g., '1.0.0' for App Store, '1.0.1' for Play Store)"
},
apppub_store_version_code: {
type: Number,
comment: "Version code for this store (Android)"
},
apppub_store_build_number: {
type: String,
maxlength: 50,
trim: true,
comment: "Build number for this store"
},
apppub_publish_type_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "FK to core_general_master - Publish type (APP_PUBLISH_TYPE)"
},
apppub_publish_status_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "FK to core_general_master - Publish status (APP_PUBLISH_STATUS)"
},
apppub_workflow_id_wfrg: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_workflow_registry",
comment: "FK to core_workflow_registry - Workflow for publish approval (optional, recommended for production)"
},
apppub_current_step: {
type: Number,
comment: "Current workflow step (if workflow is active)"
},
apppub_store_app_id: {
type: String,
maxlength: 200,
trim: true,
comment: "App ID in this store"
},
apppub_store_listing_id: {
type: String,
maxlength: 200,
trim: true,
comment: "Listing ID if multiple listings"
},
apppub_store_url: {
type: String,
maxlength: 500,
trim: true,
comment: "Store URL"
},
apppub_release_notes: {
type: String,
maxlength: 5000,
trim: true,
comment: "Store-specific release notes"
},
apppub_promotional_text: {
type: String,
maxlength: 500,
trim: true,
comment: "Promotional text"
},
apppub_product_description: {
type: String,
maxlength: 5000,
trim: true,
comment: "Product/app description for store"
},
apppub_category_ids_sygms: {
type: [mongoose_1.default.Schema.Types.ObjectId],
ref: "core_general_master",
comment: "Array of FK to core_general_master - App categories (APP_APP_CATEGORY)"
},
apppub_preview_image_ids_cyfm: {
type: [mongoose_1.default.Schema.Types.ObjectId],
ref: "core_file_manager",
comment: "Array of FK to core_file_manager - Preview images"
},
apppub_screenshot_ids_cyfm: {
type: [mongoose_1.default.Schema.Types.ObjectId],
ref: "core_file_manager",
comment: "Array of FK to core_file_manager - Screenshots"
},
apppub_feature_image_id_cyfm: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_file_manager",
comment: "FK to core_file_manager - Feature/preview image"
},
apppub_promo_image_id_cyfm: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_file_manager",
comment: "FK to core_file_manager - Promotional image"
},
apppub_icon_file_id_cyfm: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_file_manager",
comment: "FK to core_file_manager - App icon for store"
},
apppub_keywords: {
type: [String],
comment: "Keywords for search"
},
apppub_tags: {
type: [String],
comment: "Tags"
},
apppub_pricing_info: {
type: mongoose_1.Schema.Types.Mixed,
comment: "JSON object - Pricing details"
},
apppub_availability_info: {
type: mongoose_1.Schema.Types.Mixed,
comment: "JSON object - Availability/regions"
},
apppub_store_specific_data: {
type: mongoose_1.Schema.Types.Mixed,
comment: "JSON object - Any other store-specific fields"
},
apppub_deployment_method_id_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "FK to core_general_master - Deployment method (APP_DEPLOYMENT_METHOD)"
},
apppub_auto_deploy_enabled: {
type: Boolean,
default: false,
comment: "Enable automatic deployment via API when version is approved"
},
apppub_deployment_api_response: {
type: mongoose_1.Schema.Types.Mixed,
comment: "JSON object - Response from platform API after deployment"
},
apppub_deployment_url: {
type: String,
maxlength: 500,
trim: true,
comment: "URL of deployed app (for web apps: Vercel/Netlify URL)"
},
apppub_deployment_log: {
type: String,
comment: "Deployment log/output from platform API"
},
apppub_submitted_at: {
type: Date,
comment: "Date when publish was submitted"
},
apppub_review_started_at: {
type: Date,
comment: "Date when review started"
},
apppub_approved_at: {
type: Date,
comment: "Date when publish was approved"
},
apppub_published_at: {
type: Date,
comment: "Date when publish was published"
},
apppub_deployed_at: {
type: Date,
comment: "When deployment was completed via API"
},
apppub_deployment_started_at: {
type: Date,
comment: "When deployment started via API"
},
apppub_removed_at: {
type: Date,
comment: "Date when publish was removed"
},
apppub_rejection_reason: {
type: String,
maxlength: 1000,
trim: true,
comment: "Rejection reason"
},
apppub_rejection_details: {
type: mongoose_1.Schema.Types.Mixed,
comment: "JSON object with detailed rejection info"
},
apppub_published_by_id_auth: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "auth_user_mst",
required: true,
comment: "FK to auth_user_mst - User who published"
},
apppub_created_at: {
type: Date,
default: Date.now,
comment: "Creation timestamp"
},
apppub_updated_at: {
type: Date,
default: Date.now,
comment: "Last update timestamp"
}
}, { collection: 'app_publish_details_mst', timestamps: { createdAt: 'apppub_created_at', updatedAt: 'apppub_updated_at' } });
// Indexes for performance optimization
app_publish_details_mst.index({ apppub_link_id_applink: 1, apppub_version_id_appver: 1 }, { unique: true });
app_publish_details_mst.index({ apppub_reg_id_appreg: 1 });
app_publish_details_mst.index({ apppub_link_id_applink: 1 });
app_publish_details_mst.index({ apppub_version_id_appver: 1 });
app_publish_details_mst.index({ apppub_store_provider_id_appstore: 1 });
app_publish_details_mst.index({ apppub_platform_id_sygms: 1 });
app_publish_details_mst.index({ apppub_publish_status_id_sygms: 1 });
app_publish_details_mst.index({ apppub_workflow_id_wfrg: 1, apppub_current_step: 1 });
var CAppPublishDetailsMst = mongoose_1.default.model("app_publish_details_mst", app_publish_details_mst);
exports.CAppPublishDetailsMst = CAppPublishDetailsMst;