UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

54 lines (53 loc) 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CSubscriptionFeature = void 0; var mongoose_1 = require("mongoose"); var subscription_features = new mongoose_1.Schema({ sfea_name: { type: String, required: true, maxlength: 100, trim: true }, sfea_code: { type: String, required: true, maxlength: 50, trim: true, unique: true, uppercase: true }, sfea_description: { type: String, maxlength: 500 }, sfea_category: { type: String, required: true, enum: ['users', 'storage', 'api', 'features', 'support', 'custom'] }, sfea_value: { type: mongoose_1.Schema.Types.Mixed }, sfea_unit: { type: String, maxlength: 20 }, sfea_created_at: { type: Date, default: Date.now }, sfea_updated_at: { type: Date, default: Date.now }, sfea_isactive: { type: Boolean, default: true } }, { collection: 'subscription_features', timestamps: { createdAt: 'sfea_created_at', updatedAt: 'sfea_updated_at' } }); // Indexes // Note: sfea_code index is automatically created by unique: true subscription_features.index({ sfea_category: 1 }); var CSubscriptionFeature = mongoose_1.default.model("subscription_features", subscription_features); exports.CSubscriptionFeature = CSubscriptionFeature;