salix/modules/worker/back/models/worker.json

97 lines
2.1 KiB
JSON

{
"name": "Worker",
"description": "Company employees",
"base": "Loggable",
"options": {
"mysql": {
"table": "worker"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"firstName": {
"type": "string",
"required": true
},
"lastName": {
"type": "string",
"required": true
},
"phone": {
"type" : "string"
},
"userFk": {
"type" : "number",
"required": true
},
"bossFk": {
"type" : "number"
},
"maritalStatus": {
"type" : "string"
},
"originCountryFk": {
"type" : "number"
},
"educationLevelFk": {
"type" : "number"
},
"SSN": {
"type" : "string"
},
"labelerFk": {
"type" : "number"
},
"mobileExtension": {
"type" : "number"
},
"code": {
"type" : "string"
},
"locker": {
"type" : "number"
}
},
"relations": {
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "userFk"
},
"boss": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "bossFk"
},
"client": {
"type": "belongsTo",
"model": "Client",
"foreignKey": "userFk"
},
"sip": {
"type": "belongsTo",
"model": "Sip",
"foreignKey": "userFk"
},
"department": {
"type": "belongsTo",
"model": "WorkerDepartment",
"foreignKey": "id"
},
"collegues": {
"type": "hasMany",
"model": "WorkerTeamCollegues",
"foreignKey": "workerFk"
},
"sector": {
"type": "belongsTo",
"model": "Sector",
"foreignKey": "sectorFk"
}
}
}