cloud-ide-model-schema 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/database.ts +20 -0
- package/config/index.ts +5 -0
- package/index.ts +5 -0
- package/package.json +2 -3
- package/schema/auth/auth_logses.ts +68 -0
- package/schema/auth/{auth_user_mst.js → auth_user_mst.ts} +143 -130
- package/schema/auth/index.ts +13 -0
- package/schema/auth/mpin.ts +60 -0
- package/schema/core/core_entity_mapping.ts +49 -0
- package/schema/core/core_general_master.ts +52 -0
- package/schema/core/core_general_master_type.ts +46 -0
- package/schema/core/core_page_controls.ts +100 -0
- package/schema/core/core_page_grid.ts +48 -0
- package/schema/core/core_page_tab.ts +54 -0
- package/schema/core/core_pin_code.ts +73 -0
- package/schema/core/core_system_config.ts +54 -0
- package/schema/core/{core_system_entity.js → core_system_entity.ts} +216 -200
- package/schema/core/{core_system_logs.js → core_system_logs.ts} +141 -137
- package/schema/core/core_system_menu.ts +74 -0
- package/schema/core/core_system_pages.ts +59 -0
- package/schema/core/core_system_pages_theme.ts +60 -0
- package/schema/core/index.ts +42 -0
- package/schema/email/elist.ts +47 -0
- package/schema/email/elog.ts +68 -0
- package/schema/email/eref.ts +49 -0
- package/schema/email/esub.ts +81 -0
- package/schema/email/etmp.ts +46 -0
- package/schema/email/evdr.ts +46 -0
- package/schema/email/index.ts +21 -0
- package/config/database.js +0 -57
- package/config/index.js +0 -5
- package/index.js +0 -21
- package/schema/auth/auth_logses.js +0 -73
- package/schema/auth/index.js +0 -10
- package/schema/auth/mpin.js +0 -74
- package/schema/core/core_entity_mapping.js +0 -57
- package/schema/core/core_general_master.js +0 -60
- package/schema/core/core_general_master_type.js +0 -56
- package/schema/core/core_page_controls.js +0 -98
- package/schema/core/core_page_grid.js +0 -59
- package/schema/core/core_page_tab.js +0 -56
- package/schema/core/core_pin_code.js +0 -74
- package/schema/core/core_system_config.js +0 -68
- package/schema/core/core_system_menu.js +0 -83
- package/schema/core/core_system_pages.js +0 -71
- package/schema/core/core_system_pages_theme.js +0 -71
- package/schema/core/index.js +0 -34
- package/schema/email/elist.js +0 -62
- package/schema/email/elog.js +0 -78
- package/schema/email/eref.js +0 -63
- package/schema/email/esub.js +0 -89
- package/schema/email/etmp.js +0 -61
- package/schema/email/evdr.js +0 -61
- package/schema/email/index.js +0 -21
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as mongoose from 'mongoose';
|
|
2
|
+
import dotenv from 'dotenv';
|
|
3
|
+
|
|
4
|
+
dotenv.config();
|
|
5
|
+
|
|
6
|
+
async function connectDB() {
|
|
7
|
+
const options:any = {
|
|
8
|
+
// authSource: process.env.MONGODB_AUTH_SOURCE || 'admin', // Optional authentication database
|
|
9
|
+
connectTimeoutMS: 10000,
|
|
10
|
+
socketTimeoutMS: 30000,
|
|
11
|
+
// Other MongoDB connection options as needed
|
|
12
|
+
};
|
|
13
|
+
await mongoose.connect(process.env.MONGODB_URI || '', options).then(() => {
|
|
14
|
+
console.log('Connected to MongoDB');
|
|
15
|
+
}).catch((error) => {
|
|
16
|
+
console.error('Error connecting to MongoDB:', error);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { connectDB };
|
package/config/index.ts
ADDED
package/index.ts
ADDED
package/package.json
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
"mongoose": "^8.2.1"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@types/node": "^20.11.25"
|
|
8
|
-
"typescript": "^5.4.2"
|
|
7
|
+
"@types/node": "^20.11.25"
|
|
9
8
|
},
|
|
10
9
|
"name": "cloud-ide-model-schema",
|
|
11
|
-
"version": "1.0.
|
|
10
|
+
"version": "1.0.4",
|
|
12
11
|
"description": "Pachage for schema management of Cloud IDEsys LMS",
|
|
13
12
|
"main": "index.js",
|
|
14
13
|
"scripts": {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFACE START */
|
|
4
|
+
interface ILogses {
|
|
5
|
+
_id: string;
|
|
6
|
+
logses_id_user: string;
|
|
7
|
+
logses_start_dtm: Date;
|
|
8
|
+
logses_end_dtm: Date;
|
|
9
|
+
logses_end_max_dtm: Date;
|
|
10
|
+
logses_token: string;
|
|
11
|
+
logses_user_ask_mpin: string;
|
|
12
|
+
logses_last_id_logses: string;
|
|
13
|
+
logses_sequence: number;
|
|
14
|
+
logses_isactive: boolean;
|
|
15
|
+
}
|
|
16
|
+
/* INTERFACE END */
|
|
17
|
+
|
|
18
|
+
/* SCHEMA START */
|
|
19
|
+
const auth_logses = new Schema({
|
|
20
|
+
logses_id_user: {
|
|
21
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
22
|
+
ref: 'auth_user_mst'
|
|
23
|
+
},
|
|
24
|
+
logses_start_dtm: {
|
|
25
|
+
type: Date,
|
|
26
|
+
required: true,
|
|
27
|
+
default: new Date()
|
|
28
|
+
},
|
|
29
|
+
logses_end_dtm: {
|
|
30
|
+
type: Date,
|
|
31
|
+
required: true,
|
|
32
|
+
default: new Date()
|
|
33
|
+
},
|
|
34
|
+
logses_end_max_dtm: {
|
|
35
|
+
type: Date,
|
|
36
|
+
required: true,
|
|
37
|
+
default: new Date()
|
|
38
|
+
},
|
|
39
|
+
logses_token: {
|
|
40
|
+
type: String,
|
|
41
|
+
trim: true
|
|
42
|
+
},
|
|
43
|
+
logses_user_ask_mpin: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: true,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
logses_last_id_logses: {
|
|
49
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
50
|
+
ref: "auth_logses"
|
|
51
|
+
},
|
|
52
|
+
logses_sequence: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 1
|
|
55
|
+
},
|
|
56
|
+
logses_isactive: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
}
|
|
60
|
+
}, { collection: 'auth_logses' });
|
|
61
|
+
|
|
62
|
+
const Clogses = mongoose.model<ILogses>('auth_logses', auth_logses);
|
|
63
|
+
/* SCHEMA END */
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
ILogses, // interface name
|
|
67
|
+
Clogses // collecton name
|
|
68
|
+
};
|
|
@@ -1,130 +1,143 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFACE START */
|
|
4
|
+
interface IUser {
|
|
5
|
+
_id?: string;
|
|
6
|
+
user_id_ent?: string;
|
|
7
|
+
user_username?: string;
|
|
8
|
+
user_firstname?: string;
|
|
9
|
+
user_middlename?: string;
|
|
10
|
+
user_lastname?: string;
|
|
11
|
+
user_fullname?: string;
|
|
12
|
+
user_emailid?: string;
|
|
13
|
+
user_mobileno?: number;
|
|
14
|
+
user_password?: string;
|
|
15
|
+
user_activefrom?: Date;
|
|
16
|
+
user_activeupto?: Date;
|
|
17
|
+
user_photo_id_fm?: string;
|
|
18
|
+
user_passwordchangeonlogin?: boolean;
|
|
19
|
+
user_id_role?: string;
|
|
20
|
+
user_id_desg?: string;
|
|
21
|
+
user_id_dept?: string;
|
|
22
|
+
user_permissions?: IUserPermissions[];
|
|
23
|
+
user_isactive?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface IUserPermissions {
|
|
27
|
+
_id: string;
|
|
28
|
+
create?: boolean;
|
|
29
|
+
read?: boolean;
|
|
30
|
+
update?: boolean;
|
|
31
|
+
delete?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/* INTERFACE END */
|
|
34
|
+
|
|
35
|
+
/* SCHEMA START */
|
|
36
|
+
const auth_user_mst: Schema = new Schema({
|
|
37
|
+
user_id_ent: {
|
|
38
|
+
type: String,
|
|
39
|
+
comment: "Unique Entity id"
|
|
40
|
+
},
|
|
41
|
+
user_username: {
|
|
42
|
+
type: String,
|
|
43
|
+
minlength: 8,
|
|
44
|
+
maxlength: 20,
|
|
45
|
+
required: true,
|
|
46
|
+
trim: true,
|
|
47
|
+
unique: true,
|
|
48
|
+
comment: "Unique User Name",
|
|
49
|
+
message: "Unique User Name"
|
|
50
|
+
},
|
|
51
|
+
user_firstname: {
|
|
52
|
+
type: String,
|
|
53
|
+
minlength: 3,
|
|
54
|
+
maxlength: 20
|
|
55
|
+
},
|
|
56
|
+
user_middlename: {
|
|
57
|
+
type: String,
|
|
58
|
+
minlength: 3,
|
|
59
|
+
maxlength: 20
|
|
60
|
+
},
|
|
61
|
+
user_lastname: {
|
|
62
|
+
type: String,
|
|
63
|
+
minlength: 8,
|
|
64
|
+
maxlength: 20
|
|
65
|
+
},
|
|
66
|
+
user_fullname: {
|
|
67
|
+
type: String,
|
|
68
|
+
minlength: 8,
|
|
69
|
+
maxlength: 52
|
|
70
|
+
},
|
|
71
|
+
user_emailid: {
|
|
72
|
+
type: String,
|
|
73
|
+
minlength: 8,
|
|
74
|
+
maxlength: 50,
|
|
75
|
+
trim: true,
|
|
76
|
+
unique: true,
|
|
77
|
+
comment: "Unique Email ID",
|
|
78
|
+
message: "Unique Email ID"
|
|
79
|
+
},
|
|
80
|
+
user_mobileno: {
|
|
81
|
+
type: Number,
|
|
82
|
+
minlength: 10,
|
|
83
|
+
maxlength: 15,
|
|
84
|
+
trim: true,
|
|
85
|
+
unique: true,
|
|
86
|
+
comment: "Unique Mobile no",
|
|
87
|
+
message: "Unique Mobile no"
|
|
88
|
+
},
|
|
89
|
+
user_password: {
|
|
90
|
+
type: String,
|
|
91
|
+
maxlength: 250,
|
|
92
|
+
trim: true
|
|
93
|
+
},
|
|
94
|
+
user_activefrom: {
|
|
95
|
+
type: Date,
|
|
96
|
+
comment: "User Effective from- Default is created date"
|
|
97
|
+
},
|
|
98
|
+
user_activeupto: {
|
|
99
|
+
type: Date,
|
|
100
|
+
comment: "User Valid upto registered academic year default"
|
|
101
|
+
},
|
|
102
|
+
user_photo_id_fm: {
|
|
103
|
+
type: String,
|
|
104
|
+
comment: "photo file manager id",
|
|
105
|
+
trim: true
|
|
106
|
+
},
|
|
107
|
+
user_passwordchangeonlogin: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
comment: "Change password on Login. Flag can be set by the Admin/ Reset option",
|
|
110
|
+
default: true
|
|
111
|
+
},
|
|
112
|
+
user_id_role: {
|
|
113
|
+
type: String,
|
|
114
|
+
comment: "Role Id associated with the user.",
|
|
115
|
+
trim: true
|
|
116
|
+
},
|
|
117
|
+
user_id_desg: {
|
|
118
|
+
type: String,
|
|
119
|
+
comment: "Users Designation",
|
|
120
|
+
trim: true
|
|
121
|
+
},
|
|
122
|
+
user_id_dept: {
|
|
123
|
+
type: String,
|
|
124
|
+
comment: "Users Department",
|
|
125
|
+
trim: true
|
|
126
|
+
},
|
|
127
|
+
user_permissions: {
|
|
128
|
+
type: Array,
|
|
129
|
+
default: []
|
|
130
|
+
},
|
|
131
|
+
user_isactive: {
|
|
132
|
+
type: Boolean
|
|
133
|
+
}
|
|
134
|
+
}, { collection: 'auth_user_mst' });
|
|
135
|
+
|
|
136
|
+
const CUser = mongoose.model<IUser>('auth_user_mst', auth_user_mst);
|
|
137
|
+
/* SCHEMA END */
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
IUser, // interface name
|
|
141
|
+
IUserPermissions,
|
|
142
|
+
CUser // collecton name
|
|
143
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CUser, IUser, IUserPermissions } from "./auth_user_mst"
|
|
2
|
+
import { Clogses, ILogses } from './auth_logses';
|
|
3
|
+
import { IMpin, CMpin } from './mpin';
|
|
4
|
+
|
|
5
|
+
// export all model and collections
|
|
6
|
+
export {
|
|
7
|
+
/* user Schemas */
|
|
8
|
+
CUser, IUser, IUserPermissions,
|
|
9
|
+
/* Logsession schemas */
|
|
10
|
+
Clogses, ILogses,
|
|
11
|
+
/* Mpin schemas */
|
|
12
|
+
IMpin, CMpin
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFASE START */
|
|
4
|
+
class IMpin {
|
|
5
|
+
mpin_pin!: number;
|
|
6
|
+
mpin_id_user!: string;
|
|
7
|
+
mpin_expiry_dtm!: Date;
|
|
8
|
+
mpin_used!: boolean;
|
|
9
|
+
mpin_isactive!: boolean;
|
|
10
|
+
}
|
|
11
|
+
/* INTERFACE END */
|
|
12
|
+
|
|
13
|
+
/* SCHEMA START */
|
|
14
|
+
const auth_mpin: Schema = new Schema({
|
|
15
|
+
mpin_id_user: {
|
|
16
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
17
|
+
ref: 'auth_user_mst',
|
|
18
|
+
required: true,
|
|
19
|
+
comment: "User unique primery key, reference user"
|
|
20
|
+
},
|
|
21
|
+
mpin_pin: {
|
|
22
|
+
type: Number,
|
|
23
|
+
require: true,
|
|
24
|
+
unique: true,
|
|
25
|
+
minlength: 6,
|
|
26
|
+
minlenght: 6
|
|
27
|
+
},
|
|
28
|
+
mpin_generation_dtm: {
|
|
29
|
+
type: Date,
|
|
30
|
+
required: true,
|
|
31
|
+
default: new Date()
|
|
32
|
+
},
|
|
33
|
+
mpin_expiry_dtm: {
|
|
34
|
+
type: Date,
|
|
35
|
+
required: true,
|
|
36
|
+
default: new Date()
|
|
37
|
+
},
|
|
38
|
+
mpin_used: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
mpin_id_logses: {
|
|
43
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
44
|
+
comment: "logses session table, whre loggin id is stored which used the mpin",
|
|
45
|
+
trim: true
|
|
46
|
+
},
|
|
47
|
+
mpin_isactive: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true,
|
|
50
|
+
comment: "automaticaly expire when expiry time completes, when authenticator is refreshed new key generates and this will set to false"
|
|
51
|
+
}
|
|
52
|
+
}, { collection: 'auth_mpin' });
|
|
53
|
+
|
|
54
|
+
const CMpin = mongoose.model<IMpin>("auth_mpin", auth_mpin);
|
|
55
|
+
/* SCHIMA END */
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
IMpin, // interface
|
|
59
|
+
CMpin // collection
|
|
60
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFASE START */
|
|
4
|
+
interface ICoreSyenm {
|
|
5
|
+
_id?: string;
|
|
6
|
+
syenm_id_user?: string;
|
|
7
|
+
syenm_id_syen?: string;
|
|
8
|
+
syenm_id_logses?: string;
|
|
9
|
+
syenm_isactive?: boolean;
|
|
10
|
+
syenm_isdefault?: boolean;
|
|
11
|
+
syenm_isloggedin?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/* INTERFACE END */
|
|
14
|
+
|
|
15
|
+
/* SCHEMA START */
|
|
16
|
+
const core_entity_mapping: Schema = new Schema({
|
|
17
|
+
syenm_id_user: {
|
|
18
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
19
|
+
ref: "auth_user_mst"
|
|
20
|
+
},
|
|
21
|
+
syenm_id_syen: {
|
|
22
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
23
|
+
ref: "core_system_entity"
|
|
24
|
+
},
|
|
25
|
+
syenm_id_logses: {
|
|
26
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
27
|
+
ref: "auth_logses"
|
|
28
|
+
},
|
|
29
|
+
syenm_isactive: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
32
|
+
},
|
|
33
|
+
syenm_isloggedin: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
syenm_isdefault: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
}, { collection: 'core_entity_mapping' });
|
|
42
|
+
|
|
43
|
+
const CCoreSyenm = mongoose.model<ICoreSyenm>("core_entity_mapping", core_entity_mapping);
|
|
44
|
+
/* SCHIMA END */
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
ICoreSyenm, // interface
|
|
48
|
+
CCoreSyenm // collection
|
|
49
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFASE START */
|
|
4
|
+
interface ICoreSygms {
|
|
5
|
+
_id: string;
|
|
6
|
+
sygms_id_sygmt: string;
|
|
7
|
+
sygms_code: string;
|
|
8
|
+
sygms_title: string;
|
|
9
|
+
sygms_desc: string;
|
|
10
|
+
sygms_isactive: boolean;
|
|
11
|
+
sygms_configuration: object;
|
|
12
|
+
}
|
|
13
|
+
/* INTERFACE END */
|
|
14
|
+
|
|
15
|
+
/* SCHEMA START */
|
|
16
|
+
const core_general_master: Schema = new Schema({
|
|
17
|
+
sygms_id_sygmt: {
|
|
18
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
19
|
+
ref: "core_general_master_type"
|
|
20
|
+
},
|
|
21
|
+
sygms_code: {
|
|
22
|
+
type: String,
|
|
23
|
+
require: true,
|
|
24
|
+
maxlength: 40,
|
|
25
|
+
trim: true
|
|
26
|
+
},
|
|
27
|
+
sygms_title: {
|
|
28
|
+
type: String,
|
|
29
|
+
require: true,
|
|
30
|
+
minlength: 3,
|
|
31
|
+
maxlength: 150,
|
|
32
|
+
trim: true
|
|
33
|
+
},
|
|
34
|
+
sygms_desc: {
|
|
35
|
+
type: String,
|
|
36
|
+
minlength: 0,
|
|
37
|
+
maxlength: 500,
|
|
38
|
+
trim: true
|
|
39
|
+
},
|
|
40
|
+
sygms_isactive: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
},
|
|
44
|
+
}, { collection: 'core_general_master' });
|
|
45
|
+
|
|
46
|
+
const CCoreSygms = mongoose.model<ICoreSygms>("core_general_master", core_general_master);
|
|
47
|
+
/* SCHIMA END */
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
ICoreSygms, // interface
|
|
51
|
+
CCoreSygms // collection
|
|
52
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
|
|
3
|
+
/* INTERFASE START */
|
|
4
|
+
interface ICoreSygmt {
|
|
5
|
+
_id: string;
|
|
6
|
+
sygmt_code: string;
|
|
7
|
+
sygmt_title: string;
|
|
8
|
+
sygmt_desc: string;
|
|
9
|
+
sygmt_isactive: boolean;
|
|
10
|
+
}
|
|
11
|
+
/* INTERFACE END */
|
|
12
|
+
|
|
13
|
+
/* SCHEMA START */
|
|
14
|
+
const core_general_master_type: Schema = new Schema({
|
|
15
|
+
sygmt_code: {
|
|
16
|
+
type: String,
|
|
17
|
+
require: true,
|
|
18
|
+
maxlength: 40,
|
|
19
|
+
trim: true
|
|
20
|
+
},
|
|
21
|
+
sygmt_title: {
|
|
22
|
+
type: String,
|
|
23
|
+
require: true,
|
|
24
|
+
minlength: 3,
|
|
25
|
+
maxlength: 100,
|
|
26
|
+
trim: true
|
|
27
|
+
},
|
|
28
|
+
sygmt_desc: {
|
|
29
|
+
type: String,
|
|
30
|
+
minlength: 0,
|
|
31
|
+
maxlength: 255,
|
|
32
|
+
trim: true
|
|
33
|
+
},
|
|
34
|
+
sygmt_isactive: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
}, { collection: 'core_general_master_type' });
|
|
39
|
+
|
|
40
|
+
const CCoreSygmt = mongoose.model<ICoreSygmt>("core_general_master_type", core_general_master_type);
|
|
41
|
+
/* SCHIMA END */
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
ICoreSygmt, // interface
|
|
45
|
+
CCoreSygmt // collection
|
|
46
|
+
};
|