lms-sync 1.0.47 → 1.0.49
Sign up to get free protection for your applications and to get access to all the features.
- package/apiConnections/mapping.js +379 -604
- package/models/employees.model.js +393 -0
- package/package.json +1 -1
@@ -0,0 +1,393 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = (sequelize, DataTypes) => {
|
4
|
+
|
5
|
+
const Employees = sequelize.define('Employees', {
|
6
|
+
|
7
|
+
employeeNumber: {
|
8
|
+
type: DataTypes.STRING,
|
9
|
+
allowNull: true,
|
10
|
+
},
|
11
|
+
employeeType: {
|
12
|
+
type: DataTypes.STRING,
|
13
|
+
allowNull: true,
|
14
|
+
defaultValue: "PLANTILLA",
|
15
|
+
},
|
16
|
+
fullName: {
|
17
|
+
type: DataTypes.VIRTUAL,
|
18
|
+
get() {
|
19
|
+
return `${this.lastName}, ${this.firstName} `;
|
20
|
+
},
|
21
|
+
},
|
22
|
+
firstName: {
|
23
|
+
type: DataTypes.STRING,
|
24
|
+
allowNull: false,
|
25
|
+
},
|
26
|
+
lastName: {
|
27
|
+
type: DataTypes.STRING,
|
28
|
+
allowNull: false,
|
29
|
+
},
|
30
|
+
middleName: {
|
31
|
+
type: DataTypes.STRING,
|
32
|
+
allowNull: true,
|
33
|
+
},
|
34
|
+
extension: {
|
35
|
+
type: DataTypes.STRING,
|
36
|
+
allowNull: true,
|
37
|
+
},
|
38
|
+
designationId: {
|
39
|
+
type: DataTypes.INTEGER,
|
40
|
+
allowNull: true,
|
41
|
+
},
|
42
|
+
salaryGradeId: {
|
43
|
+
type: DataTypes.INTEGER,
|
44
|
+
allowNull: true,
|
45
|
+
},
|
46
|
+
salaryGradeStep: {
|
47
|
+
type: DataTypes.INTEGER,
|
48
|
+
allowNull: true,
|
49
|
+
defaultValue: 1
|
50
|
+
},
|
51
|
+
email: {
|
52
|
+
type: DataTypes.STRING,
|
53
|
+
allowNull: false,
|
54
|
+
},
|
55
|
+
monthlyRate: {
|
56
|
+
type: DataTypes.STRING,
|
57
|
+
allowNull: true,
|
58
|
+
},
|
59
|
+
dailyRate: {
|
60
|
+
type: DataTypes.STRING,
|
61
|
+
allowNull: true,
|
62
|
+
},
|
63
|
+
hourlyRate: {
|
64
|
+
type: DataTypes.STRING,
|
65
|
+
allowNull: true,
|
66
|
+
},
|
67
|
+
dateHired: {
|
68
|
+
type: DataTypes.DATE,
|
69
|
+
allowNull: true,
|
70
|
+
set(storedValue) {
|
71
|
+
const d = new Date(storedValue);
|
72
|
+
this.setDataValue('dateHired', storedValue);
|
73
|
+
this.setDataValue('dateHiredMonth', d.getMonth());
|
74
|
+
this.setDataValue('dateHiredYear', d.getFullYear());
|
75
|
+
this.setDataValue('dateHiredDay', d.getDate());
|
76
|
+
}
|
77
|
+
},
|
78
|
+
dateResigned: {
|
79
|
+
type: DataTypes.DATE,
|
80
|
+
allowNull: true,
|
81
|
+
},
|
82
|
+
dateClearance: {
|
83
|
+
type: DataTypes.DATE,
|
84
|
+
allowNull: true,
|
85
|
+
},
|
86
|
+
lastDay: {
|
87
|
+
type: DataTypes.DATE,
|
88
|
+
allowNull: true,
|
89
|
+
},
|
90
|
+
avatar: {
|
91
|
+
type: DataTypes.STRING,
|
92
|
+
allowNull: true,
|
93
|
+
},
|
94
|
+
signature: {
|
95
|
+
type: DataTypes.TEXT,
|
96
|
+
allowNull: true,
|
97
|
+
},
|
98
|
+
gender: {
|
99
|
+
type: DataTypes.STRING,
|
100
|
+
allowNull: true,
|
101
|
+
},
|
102
|
+
civilStatus: {
|
103
|
+
type: DataTypes.STRING,
|
104
|
+
allowNull: true,
|
105
|
+
},
|
106
|
+
citizenship: {
|
107
|
+
type: DataTypes.STRING,
|
108
|
+
allowNull: true,
|
109
|
+
},
|
110
|
+
dualCitizenship: {
|
111
|
+
type: DataTypes.STRING,
|
112
|
+
allowNull: true,
|
113
|
+
},
|
114
|
+
birthday: {
|
115
|
+
type: DataTypes.DATE,
|
116
|
+
allowNull: true,
|
117
|
+
},
|
118
|
+
birthPlace: {
|
119
|
+
type: DataTypes.STRING,
|
120
|
+
allowNull: true,
|
121
|
+
},
|
122
|
+
mobileNumber: {
|
123
|
+
type: DataTypes.STRING,
|
124
|
+
allowNull: true,
|
125
|
+
},
|
126
|
+
telephoneNumber: {
|
127
|
+
type: DataTypes.STRING,
|
128
|
+
allowNull: true,
|
129
|
+
},
|
130
|
+
height: {
|
131
|
+
type: DataTypes.STRING,
|
132
|
+
allowNull: true,
|
133
|
+
},
|
134
|
+
weight: {
|
135
|
+
type: DataTypes.STRING,
|
136
|
+
allowNull: true,
|
137
|
+
},
|
138
|
+
bloodType: {
|
139
|
+
type: DataTypes.STRING,
|
140
|
+
allowNull: true,
|
141
|
+
},
|
142
|
+
gsis: {
|
143
|
+
type: DataTypes.STRING,
|
144
|
+
allowNull: true,
|
145
|
+
},
|
146
|
+
tin: {
|
147
|
+
type: DataTypes.STRING,
|
148
|
+
allowNull: true,
|
149
|
+
},
|
150
|
+
sss: {
|
151
|
+
type: DataTypes.STRING,
|
152
|
+
allowNull: true,
|
153
|
+
},
|
154
|
+
pagibig: {
|
155
|
+
type: DataTypes.STRING,
|
156
|
+
allowNull: true,
|
157
|
+
},
|
158
|
+
phealth: {
|
159
|
+
type: DataTypes.STRING,
|
160
|
+
allowNull: true,
|
161
|
+
},
|
162
|
+
agencyEmployeeNumber: {
|
163
|
+
type: DataTypes.STRING,
|
164
|
+
allowNull: true,
|
165
|
+
},
|
166
|
+
residentialAddress: {
|
167
|
+
type: DataTypes.JSON,
|
168
|
+
allowNull: true,
|
169
|
+
},
|
170
|
+
permanentAddress: {
|
171
|
+
type: DataTypes.JSON,
|
172
|
+
allowNull: true,
|
173
|
+
},
|
174
|
+
familyBackground: {
|
175
|
+
type: DataTypes.JSON,
|
176
|
+
allowNull: true,
|
177
|
+
},
|
178
|
+
course: {
|
179
|
+
type: DataTypes.STRING,
|
180
|
+
allowNull: true,
|
181
|
+
},
|
182
|
+
yearGraduated: {
|
183
|
+
type: DataTypes.STRING,
|
184
|
+
allowNull: true,
|
185
|
+
},
|
186
|
+
school: {
|
187
|
+
type: DataTypes.STRING,
|
188
|
+
allowNull: true,
|
189
|
+
},
|
190
|
+
educationalBackground: {
|
191
|
+
type: DataTypes.JSON,
|
192
|
+
allowNull: true,
|
193
|
+
},
|
194
|
+
civilServiceEligibility: {
|
195
|
+
type: DataTypes.JSON,
|
196
|
+
allowNull: true,
|
197
|
+
},
|
198
|
+
/* workExperiences: { // DEPRECATED
|
199
|
+
type: DataTypes.JSON,
|
200
|
+
allowNull: true,
|
201
|
+
}, */
|
202
|
+
voluntaryWork: {
|
203
|
+
type: DataTypes.JSON,
|
204
|
+
allowNull: true,
|
205
|
+
},
|
206
|
+
learningDevelopment: {
|
207
|
+
type: DataTypes.JSON,
|
208
|
+
allowNull: true,
|
209
|
+
},
|
210
|
+
otherInformation: {
|
211
|
+
type: DataTypes.JSON,
|
212
|
+
allowNull: true,
|
213
|
+
},
|
214
|
+
jobApplicantId: {
|
215
|
+
type: DataTypes.INTEGER,
|
216
|
+
allowNull: true,
|
217
|
+
},
|
218
|
+
category: {
|
219
|
+
type: DataTypes.STRING,
|
220
|
+
allowNull: true,
|
221
|
+
},
|
222
|
+
statusOfAppointment: {
|
223
|
+
type: DataTypes.STRING,
|
224
|
+
allowNull: true,
|
225
|
+
},
|
226
|
+
withDesignation: {
|
227
|
+
type: DataTypes.BOOLEAN,
|
228
|
+
allowNull: false,
|
229
|
+
defaultValue: false
|
230
|
+
},
|
231
|
+
designationName: {
|
232
|
+
type: DataTypes.STRING,
|
233
|
+
allowNull: true,
|
234
|
+
},
|
235
|
+
stepIncrementAt: {
|
236
|
+
type: DataTypes.DATE,
|
237
|
+
allowNull: true,
|
238
|
+
set(storedValue) {
|
239
|
+
const d = new Date(storedValue);
|
240
|
+
this.setDataValue('stepIncrementAt', storedValue);
|
241
|
+
this.setDataValue('stepIncrementAtMonth', d.getMonth());
|
242
|
+
this.setDataValue('stepIncrementAtYear', d.getFullYear());
|
243
|
+
this.setDataValue('stepIncrementAtDay', d.getDate());
|
244
|
+
}
|
245
|
+
},
|
246
|
+
contractPeriod: {
|
247
|
+
type: DataTypes.ARRAY(DataTypes.DATE),
|
248
|
+
allowNull: true,
|
249
|
+
},
|
250
|
+
status: {
|
251
|
+
type: DataTypes.STRING,
|
252
|
+
allowNull: true,
|
253
|
+
},
|
254
|
+
retirementDate: {
|
255
|
+
type: DataTypes.DATE,
|
256
|
+
allowNull: true,
|
257
|
+
},
|
258
|
+
deathDate: {
|
259
|
+
type: DataTypes.DATE,
|
260
|
+
allowNull: true,
|
261
|
+
},
|
262
|
+
dateTransfer: {
|
263
|
+
type: DataTypes.DATE,
|
264
|
+
allowNull: true,
|
265
|
+
},
|
266
|
+
causeOfDeath: {
|
267
|
+
type: DataTypes.STRING,
|
268
|
+
allowNull: true,
|
269
|
+
},
|
270
|
+
reason: {
|
271
|
+
type: DataTypes.STRING,
|
272
|
+
allowNull: true,
|
273
|
+
},
|
274
|
+
userId: {
|
275
|
+
type: DataTypes.INTEGER,
|
276
|
+
allowNull: true,
|
277
|
+
},
|
278
|
+
stepIncrementAtMonth: {
|
279
|
+
type: DataTypes.STRING,
|
280
|
+
allowNull: true,
|
281
|
+
},
|
282
|
+
stepIncrementAtDay: {
|
283
|
+
type: DataTypes.STRING,
|
284
|
+
allowNull: true,
|
285
|
+
},
|
286
|
+
stepIncrementAtYear: {
|
287
|
+
type: DataTypes.STRING,
|
288
|
+
allowNull: true,
|
289
|
+
},
|
290
|
+
dateHiredMonth: {
|
291
|
+
type: DataTypes.STRING,
|
292
|
+
allowNull: true,
|
293
|
+
},
|
294
|
+
dateHiredDay: {
|
295
|
+
type: DataTypes.STRING,
|
296
|
+
allowNull: true,
|
297
|
+
},
|
298
|
+
dateHiredYear: {
|
299
|
+
type: DataTypes.STRING,
|
300
|
+
allowNull: true,
|
301
|
+
},
|
302
|
+
title: {
|
303
|
+
type: DataTypes.STRING,
|
304
|
+
allowNull: true,
|
305
|
+
},
|
306
|
+
isActive: {
|
307
|
+
type: DataTypes.BOOLEAN,
|
308
|
+
unique: false,
|
309
|
+
allowNull: true,
|
310
|
+
autoIncrement: false,
|
311
|
+
primaryKey: false,
|
312
|
+
},
|
313
|
+
createdAt: {
|
314
|
+
type: DataTypes.DATE,
|
315
|
+
allowNull: true,
|
316
|
+
},
|
317
|
+
updatedAt: {
|
318
|
+
type: DataTypes.DATE,
|
319
|
+
allowNull: true,
|
320
|
+
},
|
321
|
+
_id: {
|
322
|
+
type: DataTypes.INTEGER,
|
323
|
+
unique: true,
|
324
|
+
allowNull: false,
|
325
|
+
autoIncrement: true,
|
326
|
+
primaryKey: true,
|
327
|
+
},
|
328
|
+
title: {
|
329
|
+
type: DataTypes.STRING,
|
330
|
+
unique: false,
|
331
|
+
allowNull: true,
|
332
|
+
autoIncrement: false,
|
333
|
+
primaryKey: false,
|
334
|
+
},
|
335
|
+
appointmentId: {
|
336
|
+
type: DataTypes.INTEGER,
|
337
|
+
unique: false,
|
338
|
+
allowNull: true,
|
339
|
+
autoIncrement: false,
|
340
|
+
primaryKey: false,
|
341
|
+
},
|
342
|
+
departmentId: {
|
343
|
+
type: DataTypes.INTEGER,
|
344
|
+
unique: false,
|
345
|
+
allowNull: true,
|
346
|
+
autoIncrement: false,
|
347
|
+
primaryKey: false,
|
348
|
+
},
|
349
|
+
createdById: {
|
350
|
+
type: DataTypes.INTEGER,
|
351
|
+
unique: false,
|
352
|
+
allowNull: true,
|
353
|
+
autoIncrement: false,
|
354
|
+
primaryKey: false,
|
355
|
+
},
|
356
|
+
modifiedById: {
|
357
|
+
type: DataTypes.INTEGER,
|
358
|
+
unique: false,
|
359
|
+
allowNull: true,
|
360
|
+
autoIncrement: false,
|
361
|
+
primaryKey: false,
|
362
|
+
},
|
363
|
+
additionalInformation: {
|
364
|
+
type: DataTypes.JSON,
|
365
|
+
allowNull: true,
|
366
|
+
},
|
367
|
+
migratedAt:{
|
368
|
+
type: DataTypes.DATE,
|
369
|
+
allowNull: true,
|
370
|
+
},
|
371
|
+
migratedTable:{
|
372
|
+
type: DataTypes.STRING,
|
373
|
+
allowNull: true,
|
374
|
+
},
|
375
|
+
referenceId:{
|
376
|
+
type: DataTypes.INTEGER,
|
377
|
+
allowNull: true,
|
378
|
+
},
|
379
|
+
isMigrated:{
|
380
|
+
type: DataTypes.BOOLEAN,
|
381
|
+
allowNull: true,
|
382
|
+
},
|
383
|
+
},
|
384
|
+
{
|
385
|
+
sequelize,
|
386
|
+
modelName: "Employees",
|
387
|
+
tableName: "Employees",
|
388
|
+
schema: 'hris'
|
389
|
+
|
390
|
+
}
|
391
|
+
);
|
392
|
+
return Employees;
|
393
|
+
}
|