cloud-ide-lms-model
Version:
Package for Model management of Cloud IDEsys LMS
66 lines (65 loc) • 2.08 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileManagerInsertUpdatePayload = exports.MFileManagerListByGroupIdPayload = exports.MFileManager = void 0;
const schema_1 = require("../../schema");
/* INTERFACE END */
/* MODEL START */
class MFileManager {
constructor(init) {
this.cyfm_id = "";
Object.assign(this, init);
}
Validate() {
let errorLogger = {};
// Log errors here
if (!this.cyfm_id) {
errorLogger.cyfm_id = "File ID is Required!";
}
return errorLogger;
}
}
exports.MFileManager = MFileManager;
class ICoreCyfmSave extends schema_1.ICoreCyfm {
constructor(init) {
super();
this.cyfm_file_base64 = "";
this.cyfm_temp_unique_id = "";
Object.assign(this, init);
}
}
class CoreFileManagerInsertUpdatePayload {
constructor(init) {
this.core_file_manager_new = [];
this.core_file_manager_update = [];
this.core_file_manager_delete = [];
Object.assign(this, init);
}
Validate() {
let errorLogger = {};
// Log errors here
return errorLogger;
}
}
exports.CoreFileManagerInsertUpdatePayload = CoreFileManagerInsertUpdatePayload;
class MFileManagerListByGroupIdPayload {
constructor(init) {
Object.assign(this, init);
}
Validate() {
let errorLogger = {};
if (!this.cyfm_group_id) {
errorLogger.cyfm_group_id = "Group ID is required!";
}
if (this.page !== undefined && this.page < 1) {
errorLogger.page = "Page number must be greater than 0!";
}
if (this.limit !== undefined && this.limit < 1) {
errorLogger.limit = "Limit must be greater than 0!";
}
if (this.sort_order && !['asc', 'desc'].includes(this.sort_order)) {
errorLogger.sort_order = "Sort order must be 'asc' or 'desc'!";
}
return errorLogger;
}
}
exports.MFileManagerListByGroupIdPayload = MFileManagerListByGroupIdPayload;