From 495e3b7c5e66bfef9f1e3eb7aabc849119c5fc9f Mon Sep 17 00:00:00 2001 From: nelo Date: Thu, 11 May 2017 13:01:33 +0200 Subject: [PATCH] creado el modelo Chanel. Se puede seleccionar en el cliente. --- client/client/src/basic-data/index.html | 8 +++++++- services/client/common/models/Chanel.json | 24 +++++++++++++++++++++++ services/client/common/models/Client.js | 2 +- services/client/common/models/Client.json | 5 +++++ services/client/server/model-config.json | 4 ++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 services/client/common/models/Chanel.json diff --git a/client/client/src/basic-data/index.html b/client/client/src/basic-data/index.html index e7f9398dd..a97fa3b84 100644 --- a/client/client/src/basic-data/index.html +++ b/client/client/src/basic-data/index.html @@ -28,7 +28,13 @@ value-field="id" label="Comercial"> - + + diff --git a/services/client/common/models/Chanel.json b/services/client/common/models/Chanel.json new file mode 100644 index 000000000..ec2edcacb --- /dev/null +++ b/services/client/common/models/Chanel.json @@ -0,0 +1,24 @@ +{ + "name": "Chanel", + "base": "PersistedModel", + "validateUpsert": true, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string", + "required": true + } + }, + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} \ No newline at end of file diff --git a/services/client/common/models/Client.js b/services/client/common/models/Client.js index cb564a93c..13990502b 100644 --- a/services/client/common/models/Client.js +++ b/services/client/common/models/Client.js @@ -70,7 +70,7 @@ module.exports = function(Client) { Client.update({id: client.id}, {active: !client.active}); cb(null, !client.active); } - }) + }); }; // Basic filter diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json index 36c735634..d961bbe4c 100644 --- a/services/client/common/models/Client.json +++ b/services/client/common/models/Client.json @@ -144,6 +144,11 @@ "type": "hasMany", "model": "Address", "foreignKey": "clientFk" + }, + "chanelFK":{ + "type": "hasOne", + "model": "Chanel", + "foreignKey": "chanelFK" } }, "acls": [ diff --git a/services/client/server/model-config.json b/services/client/server/model-config.json index 8d127f15f..b2190fdaa 100644 --- a/services/client/server/model-config.json +++ b/services/client/server/model-config.json @@ -69,5 +69,9 @@ "Account": { "dataSource": "vn", "public": true + }, + "Chanel": { + "dataSource": "vn", + "public": true } }