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

179 lines
5.0 KiB
JSON
Raw Normal View History

2017-10-13 14:22:45 +00:00
{
2019-02-01 08:31:01 +00:00
"name": "Worker",
"description": "Company employees",
"base": "VnModel",
"mixins": {
"Loggable": true
},
2019-02-01 08:31:01 +00:00
"options": {
"mysql": {
"table": "worker"
}
},
"properties": {
"id": {
2022-03-31 08:54:30 +00:00
"type": "number",
2019-02-01 08:31:01 +00:00
"id": true,
"description": "Identifier"
},
"firstName": {
"type": "string",
"required": true
},
"lastName": {
2019-02-01 08:31:01 +00:00
"type": "string",
2019-08-27 09:12:17 +00:00
"required": true
2019-02-01 08:31:01 +00:00
},
"phone": {
2022-03-31 08:54:30 +00:00
"type" : "string"
2019-02-01 08:31:01 +00:00
},
2020-09-22 11:59:00 +00:00
"bossFk": {
2022-03-31 08:54:30 +00:00
"type" : "number"
},
"maritalStatus": {
2022-03-31 08:54:30 +00:00
"type" : "string"
},
"originCountryFk": {
2022-03-31 08:54:30 +00:00
"type" : "number"
},
"educationLevelFk": {
2022-03-31 08:54:30 +00:00
"type" : "number"
},
"SSN": {
2022-03-31 08:54:30 +00:00
"type" : "string"
2022-04-27 12:17:41 +00:00
},
"mobileExtension": {
"type" : "number"
2022-11-14 14:19:16 +00:00
},
"code": {
"type" : "string"
2023-02-27 07:39:46 +00:00
},
"locker": {
"type" : "number"
},
2023-10-17 12:02:08 +00:00
"fi": {
"type" : "string"
},
"birth": {
"type" : "date"
},
"isF11Allowed": {
"type" : "boolean"
2019-02-01 08:31:01 +00:00
}
},
"relations": {
"user": {
"type": "belongsTo",
2023-01-24 08:05:50 +00:00
"model": "VnUser",
2023-07-04 07:57:16 +00:00
"foreignKey": "id"
2019-02-01 08:31:01 +00:00
},
2021-02-24 15:12:44 +00:00
"boss": {
"type": "belongsTo",
2023-01-24 08:05:50 +00:00
"model": "VnUser",
2021-02-24 15:12:44 +00:00
"foreignKey": "bossFk"
},
2019-02-01 08:31:01 +00:00
"client": {
"type": "belongsTo",
"model": "Client",
2023-08-22 08:45:41 +00:00
"foreignKey": "id"
2019-02-01 08:31:01 +00:00
},
"sip": {
"type": "belongsTo",
"model": "Sip",
2023-08-22 08:45:41 +00:00
"foreignKey": "id"
2019-02-01 08:31:01 +00:00
},
"department": {
"type": "belongsTo",
"model": "WorkerDepartment",
"foreignKey": "id"
},
"collegues": {
"type": "hasMany",
"model": "WorkerTeamCollegues",
"foreignKey": "workerFk"
}
2024-04-15 08:21:59 +00:00
},
"scopes":{
"summary": {
"include": [
{
"relation": "user",
"scope": {
"fields": ["email", "name", "nickname", "roleFk"],
2024-04-15 12:44:18 +00:00
"include": [
{
"relation": "role",
"scope": {
"fields": ["name"]
}
},
{
"relation": "emailUser",
"scope": {
"fields": ["email"]
}
2024-04-15 08:21:59 +00:00
}
2024-04-15 12:44:18 +00:00
]
2024-04-15 08:21:59 +00:00
}
}, {
"relation": "department",
"scope": {
"include": {
2024-04-15 10:47:27 +00:00
"relation": "department"
2024-04-15 08:21:59 +00:00
}
}
}, {
"relation": "boss"
}, {
2024-04-15 10:47:27 +00:00
"relation": "client",
"scope": {
"fields": [
"id",
"name",
"fi",
"socialName",
"contact",
"street",
"city",
"postcode",
"email",
"mobile",
"isActive",
"credit",
"creditInsurance",
"iban",
"dueDay",
"isEqualizated",
"isFreezed",
"hasToInvoiceByAddress",
"hasToInvoice",
"isToBeMailed",
"hasSepaVnl",
"hasLcr",
"hasCoreVnl",
"hasCoreVnh",
"hasIncoterms",
"isTaxDataChecked",
"eypbc",
"quality",
"isVies",
"isRelevant",
"accountingAccount",
"created",
"sageTaxTypeFk",
"sageTransactionTypeFk",
"businessTypeFk",
"salesPersonFk",
"hasElectronicInvoice",
"rating",
"recommendedCredit"
]
}
2024-04-15 08:21:59 +00:00
}, {
"relation": "sip"
}
]
}
}
2022-11-14 14:19:16 +00:00
}