UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

79 lines (78 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CIntegration = void 0; var mongoose_1 = require("mongoose"); var integrations = new mongoose_1.Schema({ intg_name: { type: String, required: true, maxlength: 100, trim: true }, intg_type: { type: String, required: true, enum: ['payment_gateway', 'shipping_carrier', 'accounting_software', 'ecommerce_platform', 'sms_gateway', 'email_service', 'bank', 'tax_service', 'custom'] }, intg_provider: { type: String, required: true, maxlength: 100, trim: true }, intg_api_key: { type: String, maxlength: 500 }, intg_api_secret: { type: String, maxlength: 500 }, intg_merchant_id: { type: String, maxlength: 100 }, intg_status: { type: String, required: true, enum: ['active', 'inactive', 'testing'], default: 'testing' }, intg_configuration: { type: Object }, intg_test_mode: { type: Boolean, default: true }, intg_last_sync: { type: Date }, intg_sync_frequency: { type: String, enum: ['realtime', 'hourly', 'daily', 'manual'], default: 'manual' }, intg_created_by: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst" }, intg_created_at: { type: Date, default: Date.now }, intg_updated_at: { type: Date, default: Date.now }, intg_isactive: { type: Boolean, default: true } }, { collection: 'integrations', timestamps: { createdAt: 'intg_created_at', updatedAt: 'intg_updated_at' } }); // Indexes integrations.index({ intg_name: 1 }); integrations.index({ intg_type: 1, intg_status: 1 }); integrations.index({ intg_provider: 1 }); var CIntegration = mongoose_1.default.model("integrations", integrations); exports.CIntegration = CIntegration;