From c87fd81a62a35ad4b34e901d2f916cb4366a5518 Mon Sep 17 00:00:00 2001 From: Bernat Date: Mon, 21 Jan 2019 11:35:37 +0100 Subject: [PATCH] new model sip and fixtures #9474 --- modules/client/back/model-config.json | 3 +++ modules/client/back/models/sip.json | 38 +++++++++++++++++++++++++++ services/db/install/dump/fixtures.sql | 9 ++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 modules/client/back/models/sip.json diff --git a/modules/client/back/model-config.json b/modules/client/back/model-config.json index 2a06866dc..06c21f1cf 100644 --- a/modules/client/back/model-config.json +++ b/modules/client/back/model-config.json @@ -82,5 +82,8 @@ }, "TpvResponse": { "dataSource": "vn" + }, + "Sip": { + "dataSource": "vn" } } diff --git a/modules/client/back/models/sip.json b/modules/client/back/models/sip.json new file mode 100644 index 000000000..de6af8ad8 --- /dev/null +++ b/modules/client/back/models/sip.json @@ -0,0 +1,38 @@ +{ + "name": "Sip", + "base": "VnModel", + "options": { + "mysql": { + "table": "pbx.sip" + } + }, + "properties": { + "code": { + "type": "Number", + "id": true, + "mysql": { + "columnName": "extension" + } + }, + "password": { + "type": "string", + "mysql": { + "columnName": "secret" + } + }, + "name": { + "type": "string", + "mysql": { + "columnName": "caller_id" + } + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "user_id" + } + } +} + \ No newline at end of file diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index 4b92486b0..4ac6bb93e 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -1064,4 +1064,11 @@ INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxC VALUES (1, 'delivery charge', 1, 2.00, 1, 1), (2, 'training course', 1, 10.00, 1, 2), - (3, 'delivery charge', 1, 5.50, 1, 11); \ No newline at end of file + (3, 'delivery charge', 1, 5.50, 1, 11); + +INSERT INTO `pbx`.`sip`(`user_id`, `extension`, `secret`, `caller_id`) + VALUES + (1, 1010, '123456', 'employee'), + (3, 1101, '123456', 'agency'), + (5, 1102, '123456', 'administrative'), + (9, 1201, '123456', 'developer'); \ No newline at end of file