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

59 lines
1.1 KiB
JSON

{
"name": "Worker",
"description": "Company employees",
"base": "VnModel",
"options": {
"mysql": {
"table": "worker"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"firstName": {
"type": "string",
"required": true
},
"name": {
"type": "string",
"required": true
},
"phone": {
"type" : "String"
},
"userFk": {
"type" : "Number",
"required": true
}
},
"relations": {
"user": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "userFk"
},
"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"
}
}
}