Worker module fixes

This commit is contained in:
Juan Ferrer 2019-02-01 09:31:01 +01:00
parent 1bcaf27563
commit e63e4319cd
9 changed files with 118 additions and 94 deletions

View File

@ -1,4 +1,7 @@
{
"Department": {
"dataSource": "vn"
},
"Worker": {
"dataSource": "vn"
},

View File

@ -0,0 +1,25 @@
{
"name": "Department",
"base": "VnModel",
"options": {
"mysql": {
"table": "department"
}
},
"properties": {
"id": {
"id": true,
"type": "Number"
},
"name": {
"type": "String"
}
},
"relations": {
"father": {
"type": "belongsTo",
"model": "Department",
"foreignKey": "fatherFk"
}
}
}

View File

@ -11,8 +11,8 @@
"id": true,
"type": "Number"
},
"department": {
"type": "String"
"departmentFk": {
"type": "Number"
}
},
"relations": {
@ -20,6 +20,11 @@
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"department": {
"type": "belongsTo",
"model": "Department",
"foreignKey": "departmentFk"
}
}
}

View File

@ -1,31 +1,31 @@
{
"name": "WorkerTeam",
"base": "VnModel",
"options": {
"mysql": {
"table": "workerTeam"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
"name": "WorkerTeam",
"base": "VnModel",
"options": {
"mysql": {
"table": "workerTeam"
}
},
"team": {
"type": "Number"
}
},
"relations": {
"user": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "userFk"
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"team": {
"type": "Number"
}
},
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "Id_Trabajador"
"relations": {
"user": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "userFk"
},
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "Id_Trabajador"
}
}
}
}

View File

@ -1,59 +1,59 @@
{
"name": "Worker",
"description": "Company employees",
"base": "VnModel",
"options": {
"mysql": {
"table": "worker"
"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"
}
}
},
"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"
}
}
}

View File

@ -22,9 +22,6 @@ class Controller {
}, {
relation: 'client',
scope: {fields: ['fi']}
}, {
relation: 'department',
scope: {fields: ['department']}
}, {
relation: 'sip',
scope: {fields: ['extension']}

View File

@ -12,9 +12,6 @@ export default class Controller {
}, {
relation: 'client',
scope: {fields: ['fi']}
}, {
relation: 'department',
scope: {fields: ['department']}
}
]
});

View File

@ -32,9 +32,6 @@ class Controller {
}, {
relation: 'client',
scope: {fields: ['fi']}
}, {
relation: 'department',
scope: {fields: ['department']}
}, {
relation: 'sip',
scope: {fields: ['extension']}

View File

@ -117,7 +117,7 @@ let devConfig = {
new webpack.HotModuleReplacementPlugin()
],
devServer: {
host: 'localhost',
host: '0.0.0.0',
port: 5000,
publicPath: '/',
contentBase: 'dist',