diff --git a/back/model-config.json b/back/model-config.json
index a770a200a..057311992 100644
--- a/back/model-config.json
+++ b/back/model-config.json
@@ -59,12 +59,6 @@
"Postcode": {
"dataSource": "vn"
},
- "UserPhoneType": {
- "dataSource": "vn"
- },
- "UserPhone": {
- "dataSource": "vn"
- },
"UserLog": {
"dataSource": "vn"
}
diff --git a/back/models/user-phone-type.json b/back/models/user-phone-type.json
deleted file mode 100644
index 9410bd8db..000000000
--- a/back/models/user-phone-type.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "UserPhoneType",
- "base": "VnModel",
- "options": {
- "mysql": {
- "table": "userPhoneType"
- }
- },
- "properties": {
- "code": {
- "id": true,
- "type": "String"
- },
- "description": {
- "type": "String"
- }
- },
- "acls": [
- {
- "accessType": "READ",
- "principalType": "ROLE",
- "principalId": "$everyone",
- "permission": "ALLOW"
- }
- ]
-}
diff --git a/back/models/user-phone.js b/back/models/user-phone.js
deleted file mode 100644
index 6f6c20049..000000000
--- a/back/models/user-phone.js
+++ /dev/null
@@ -1,9 +0,0 @@
-let UserError = require('vn-loopback/util/user-error');
-
-module.exports = Self => {
- Self.rewriteDbError(function(err) {
- if (err.code === 'ER_DUP_ENTRY')
- return new UserError(`This phone already exists`);
- return err;
- });
-};
diff --git a/back/models/user-phone.json b/back/models/user-phone.json
deleted file mode 100644
index f264ff28f..000000000
--- a/back/models/user-phone.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "UserPhone",
- "base": "Loggable",
- "log": {
- "model":"UserLog",
- "relation": "user"
- },
- "options": {
- "mysql": {
- "table": "userPhone"
- }
- },
- "properties": {
- "id": {
- "id": true,
- "type": "Number"
- },
- "phone": {
- "type": "Number",
- "required": true
- },
- "typeFk": {
- "type": "String",
- "required": true
- }
- },
- "relations": {
- "user": {
- "type": "belongsTo",
- "model": "Account",
- "foreignKey": "userFk"
- },
- "type": {
- "type": "belongsTo",
- "model": "UserPhoneType",
- "foreignKey": "typeFk"
- }
- }
-}
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 395d034a8..d72b579db 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -68,13 +68,13 @@ INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,
(111, 'Missing', 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es'),
(112, 'Trash', 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es');
-INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`)
+INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`)
VALUES
- (106, 'LGN', 'David Charles', 'Haller', 106, 19),
- (107, 'ANT', 'Hank' , 'Pym' , 107, 19),
- (108, 'DCX', 'Charles' , 'Xavier', 108, 19),
- (109, 'HLK', 'Bruce' , 'Banner', 109, 19),
- (110, 'JJJ', 'Jessica' , 'Jones' , 110, 19);
+ (106, 'LGN', 'David Charles', 'Haller', 106, 19, 432978106),
+ (107, 'ANT', 'Hank' , 'Pym' , 107, 19, 432978107),
+ (108, 'DCX', 'Charles' , 'Xavier', 108, 19, 432978108),
+ (109, 'HLK', 'Bruce' , 'Banner', 109, 19, 432978109),
+ (110, 'JJJ', 'Jessica' , 'Jones' , 110, 19, 432978110);
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`)
VALUES
@@ -1940,73 +1940,6 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`)
(2, 'Normal'),
(3, 'Baja');
-INSERT INTO `vn`.`userPhoneType` (`code`, `description`)
- VALUES
- ('businessPhone', 'Telefono de empresa del usuario'),
- ('personalPhone', 'Telefono personal del usuario');
-
-INSERT INTO `vn`.`userPhone`(`id`, `userFk`, `typeFk`, `phone`)
- VALUES
- (1, 101, 'personalPhone', 1111111111),
- (2, 102, 'personalPhone', 1111111111),
- (3, 103, 'personalPhone', 1111111111),
- (4, 104, 'personalPhone', 1111111111),
- (5, 105, 'personalPhone', 1111111111),
- (6, 106, 'personalPhone', 1111111111),
- (7, 107, 'personalPhone', 1111111111),
- (8, 108, 'personalPhone', 1111111111),
- (9, 109, 'personalPhone', 1111111111),
- (10, 110, 'personalPhone', 1111111111),
- (11, 111, 'personalPhone', 1111111111),
- (12, 112, 'personalPhone', 1111111111),
- (13, 1, 'personalPhone', 623111111),
- (14, 2, 'personalPhone', 623111111),
- (15, 3, 'personalPhone', 623111111),
- (16, 5, 'personalPhone', 623111111),
- (17, 6, 'personalPhone', 623111111),
- (18, 9, 'personalPhone', 623111111),
- (19, 13, 'personalPhone', 623111111),
- (20, 15, 'personalPhone', 623111111),
- (21, 16, 'personalPhone', 623111111),
- (22, 17, 'personalPhone', 623111111),
- (23, 18, 'personalPhone', 623111111),
- (24, 19, 'personalPhone', 623111111),
- (26, 21, 'personalPhone', 623111111),
- (27, 22, 'personalPhone', 623111111),
- (28, 30, 'personalPhone', 623111111),
- (29, 31, 'personalPhone', 623111111),
- (30, 32, 'personalPhone', 623111111),
- (31, 34, 'personalPhone', 623111111),
- (32, 35, 'personalPhone', 623111111),
- (33, 36, 'personalPhone', 623111111),
- (34, 37, 'personalPhone', 623111111),
- (35, 38, 'personalPhone', 623111111),
- (36, 39, 'personalPhone', 623111111),
- (37, 40, 'personalPhone', 623111111),
- (38, 41, 'personalPhone', 623111111),
- (39, 42, 'personalPhone', 623111111),
- (40, 43, 'personalPhone', 623111111),
- (41, 44, 'personalPhone', 623111111),
- (42, 45, 'personalPhone', 623111111),
- (43, 47, 'personalPhone', 623111111),
- (44, 48, 'personalPhone', 623111111),
- (45, 50, 'personalPhone', 623111111),
- (46, 51, 'personalPhone', 623111111),
- (47, 52, 'personalPhone', 623111111),
- (48, 54, 'personalPhone', 623111111),
- (49, 55, 'personalPhone', 623111111),
- (50, 56, 'personalPhone', 623111111),
- (51, 57, 'personalPhone', 623111111),
- (52, 58, 'personalPhone', 623111111),
- (53, 59, 'personalPhone', 623111111),
- (54, 60, 'personalPhone', 623111111),
- (55, 61, 'personalPhone', 623111111),
- (56, 65, 'personalPhone', 623111111),
- (57, 66, 'personalPhone', 623111111),
- (65, 107, 'businessPhone', 700987987),
- (67, 106, 'businessPhone', 1111111112),
- (68, 106, 'personalPhone', 1111111113);
-
INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`)
VALUES
(1, 43200, 129600, 734400, 43200, 50400);
diff --git a/modules/client/back/methods/client/specs/sendSms.spec.js b/modules/client/back/methods/client/specs/sendSms.spec.js
index 06435fdbd..b299ac3c1 100644
--- a/modules/client/back/methods/client/specs/sendSms.spec.js
+++ b/modules/client/back/methods/client/specs/sendSms.spec.js
@@ -1,10 +1,10 @@
const app = require('vn-loopback/server/server');
describe('client sendSms()', () => {
- let clientLog;
+ let createdLog;
afterAll(async done => {
- await app.models.ClientLog.destroyById(clientLog.id);
+ await app.models.ClientLog.destroyById(createdLog.id);
done();
});
@@ -19,7 +19,7 @@ describe('client sendSms()', () => {
logId = sms.logId;
- let createdLog = await app.models.ClientLog.findById(logId);
+ createdLog = await app.models.ClientLog.findById(logId);
let json = JSON.parse(JSON.stringify(createdLog.newInstance));
expect(json.message).toEqual(message);
diff --git a/modules/client/front/phones/index.html b/modules/client/front/phones/index.html
deleted file mode 100644
index c0966ce0f..000000000
--- a/modules/client/front/phones/index.html
+++ /dev/null
@@ -1,54 +0,0 @@
-