diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index b7c355511..7090cfce6 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -124,6 +124,12 @@ }, "Locker": { "dataSource": "vn" + }, + "MedicalReview": { + "dataSource": "vn" + }, + "MedicalCenter": { + "dataSource": "vn" } } diff --git a/modules/worker/back/models/medical-center.json b/modules/worker/back/models/medical-center.json new file mode 100644 index 000000000..5f0a3bbd7 --- /dev/null +++ b/modules/worker/back/models/medical-center.json @@ -0,0 +1,19 @@ +{ + "name": "MedicalCenter", + "base": "VnModel", + "options": { + "mysql": { + "table": "medicalCenter" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string" + } + } +} diff --git a/modules/worker/back/models/medical-review.json b/modules/worker/back/models/medical-review.json new file mode 100644 index 000000000..6fe7d7a01 --- /dev/null +++ b/modules/worker/back/models/medical-review.json @@ -0,0 +1,52 @@ +{ + "name": "MedicalReview", + "base": "VnModel", + "options": { + "mysql": { + "table": "medicalReview" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "workerFk": { + "type": "number" + }, + "centerFk": { + "type": "number" + }, + "date": { + "type": "date" + }, + "time": { + "type": "string" + }, + "isFit": { + "type": "boolean" + }, + "amount": { + "type": "number" + }, + "invoice": { + "type": "string" + }, + "remark": { + "type": "string" + } + }, + "relations": { + "worker": { + "type": "belongsTo", + "model": "Worker", + "foreignKey": "workerFk" + }, + "center": { + "type": "belongsTo", + "model": "MedicalCenter", + "foreignKey": "centerFk" + } + } +} diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 4796c6373..cd7a55223 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -115,6 +115,11 @@ "type": "hasMany", "model": "Locker", "foreignKey": "workerFk" + }, + "medicalReview": { + "type": "hasMany", + "model": "MedicalReview", + "foreignKey": "workerFk" } }, "acls": [ @@ -126,4 +131,4 @@ "principalId": "$owner" } ] -} \ No newline at end of file +}