From bad90c12f443fcd6c43bcfe2f8bb1535335bd126 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 27 Apr 2022 14:17:41 +0200 Subject: [PATCH 1/6] feat: add required fields and models --- back/model-config.json | 6 ++++++ back/models/app-version-control.json | 24 +++++++++++++++++++++++ back/models/machine-worker.json | 27 ++++++++++++++++++++++++++ modules/item/back/models/item.json | 3 +++ modules/worker/back/models/worker.json | 6 ++++++ 5 files changed, 66 insertions(+) create mode 100644 back/models/app-version-control.json create mode 100644 back/models/machine-worker.json diff --git a/back/model-config.json b/back/model-config.json index 4ce11b99d..343210383 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -68,6 +68,12 @@ "Language": { "dataSource": "vn" }, + "MachineWorker": { + "dataSource": "vn" + }, + "MobileAppVersionControl": { + "dataSource": "vn" + }, "Module": { "dataSource": "vn" }, diff --git a/back/models/app-version-control.json b/back/models/app-version-control.json new file mode 100644 index 000000000..934d918f9 --- /dev/null +++ b/back/models/app-version-control.json @@ -0,0 +1,24 @@ +{ + "name": "MobileAppVersionControl", + "base": "VnModel", + "options": { + "mysql": { + "table": "vn.mobileAppVersionControl" + } + }, + "properties": { + "id": { + "type": "number", + "id": true + }, + "appName": { + "type": "string" + }, + "version": { + "type": "string" + }, + "IsVersionCritical": { + "type": "number" + } + } +} diff --git a/back/models/machine-worker.json b/back/models/machine-worker.json new file mode 100644 index 000000000..61cde223f --- /dev/null +++ b/back/models/machine-worker.json @@ -0,0 +1,27 @@ +{ + "name": "MachineWorker", + "base": "VnModel", + "options": { + "mysql": { + "table": "vn.machineWorker" + } + }, + "properties": { + "id": { + "type": "number", + "id": true + }, + "workerFk": { + "type": "number" + }, + "machineFk": { + "type": "number" + }, + "inTimed": { + "type": "date" + }, + "outTimed": { + "type": "date" + } + } +} diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index efde2690f..01b6ba093 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -140,6 +140,9 @@ }, "isFloramondo": { "type": "boolean" + }, + "packingShelve": { + "type": "number" } }, "relations": { diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index c8054caff..df75d871e 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -46,6 +46,12 @@ }, "SSN": { "type" : "string" + }, + "sectorFk": { + "type" : "number" + }, + "labelerFk": { + "type" : "number" } }, "relations": { -- 2.40.1 From ad80d0501c5b81a8bbc0651998f939071fd822d4 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 28 Apr 2022 07:48:09 +0200 Subject: [PATCH 2/6] add fixtures --- db/dump/fixtures.sql | 67 +++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 0849e6708..f7fea2d72 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -120,13 +120,13 @@ INSERT INTO `account`.`mailForward`(`account`, `forwardTo`) VALUES (1, 'employee@domain.local'); -INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`) +INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk `) VALUES - (1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106), - (1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107), - (1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108), - (1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109), - (1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110); + (1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL), + (1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, 1), + (1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL), + (1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, 2), + (1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, 1); INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) VALUES @@ -134,7 +134,7 @@ INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) (2, 'USD', 'Dollar USA', 1.4), (3, 'GBP', 'Libra', 1), (4, 'JPY', 'Yen Japones', 1); - + INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`) VALUES (1, 'EspaƱa', 1, 'ES', 1, 24, 4, 0, 1), @@ -838,25 +838,25 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`) ('VT', 'Sales'); INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`, - `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`) + `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`) VALUES - (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL, 'V', 0), - (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0), - (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0), - (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0), - (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0), - (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0), - (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0), - (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0), - (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0), - (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0), - (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0), - (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0), - (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1), - (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0), - (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0), - (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0), - (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0); + (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL, 'V', 0, 15), + (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10), + (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5), + (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), + (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), + (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), + (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), + (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, NULL), + (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL), + (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), + (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL), + (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL), + (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1, NULL), + (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL), + (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL), + (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL), + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0, NULL); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 @@ -2557,3 +2557,20 @@ INSERT INTO `vn`.`supplierAgencyTerm` (`agencyFk`, `supplierFk`, `minimumPackage (3, 2, 0, 15.00, 0.00, NULL, 0, 0.00, 0), (4, 2, 0, 20.00, 0.00, NULL, 0, 0.00, 0), (5, 442, 0, 0.00, 3.05, NULL, 0, 0.00, 0); + +INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `IsVersionCritical`) + VALUES + ('delivery', '9.2', 0), + ('warehouse', '8.1', 0); + +INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`) + VALUES + ('RE-001', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442); + +INSERT INTO `vn`.`machineWorker` (`workerFk`, `machineFk`, `inTimed`, `outTimed`) + VALUES + (1106, 1, CURDATE(), CURDATE()), + (1106, 1, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), + (1106, 2, CURDATE(), NULL), + (1106, 2, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), + -- 2.40.1 From 9eae1f479cd91176ecc1d860a7f474a5350e23f4 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 17 May 2022 10:39:46 +0200 Subject: [PATCH 3/6] add table vn.printer --- db/dump/fixtures.sql | 25 ++++++++++++++++--------- db/dump/structure.sql | 25 +++++++++++++++++++++++++ db/export-structure.sh | 1 - 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 16c671983..418993944 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -99,13 +99,19 @@ INSERT INTO `account`.`mailForward`(`account`, `forwardTo`) VALUES (1, 'employee@domain.local'); -INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk `) +INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`) + VALUES + (1, 'printer1', 'path1', 0), + (2, 'printer2', 'path2', 1); + + +INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`) VALUES (1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL), (1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, 1), - (1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL), - (1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, 2), - (1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, 1); + (1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL), + (1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, 2), + (1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, 1); INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) VALUES @@ -2552,12 +2558,13 @@ INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `IsVersionCrit INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`) VALUES - ('RE-001', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442); + ('RE-001', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442), + ('RE-002', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442); INSERT INTO `vn`.`machineWorker` (`workerFk`, `machineFk`, `inTimed`, `outTimed`) VALUES - (1106, 1, CURDATE(), CURDATE()), - (1106, 1, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (1106, 2, CURDATE(), NULL), - (1106, 2, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), + (1106, 1, CURDATE(), CURDATE()), + (1106, 1, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), + (1106, 2, CURDATE(), NULL), + (1106, 2, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)); diff --git a/db/dump/structure.sql b/db/dump/structure.sql index fdd7e1151..21ef7758c 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -37460,6 +37460,31 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; +-- +-- Temporary table structure for view `printer` +-- + +DROP TABLE IF EXISTS `printer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `printer` ( + `id` tinyint(3) unsigned NOT NULL, + `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `path` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `modelFk` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `macWifi` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ipAddress` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `reference` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `isLabeler` tinyint(1) DEFAULT 0 COMMENT 'Indica si es impresora de etiquetas', + PRIMARY KEY (`id`), + UNIQUE KEY `printer_UN` (`reference`), + UNIQUE KEY `printer_UN1` (`macWifi`), + UNIQUE KEY `printer_UN2` (`name`), + KEY `printer_FK` (`modelFk`), + CONSTRAINT `printer_FK` FOREIGN KEY (`modelFk`) REFERENCES `printerModel` (`code`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `printingQueueCheck` -- diff --git a/db/export-structure.sh b/db/export-structure.sh index 388231306..9b23f43ac 100755 --- a/db/export-structure.sh +++ b/db/export-structure.sh @@ -60,7 +60,6 @@ IGNORETABLES=( --ignore-table=vn.plantpassportAuthority__ --ignore-table=vn.preparationException --ignore-table=vn.priceFixed__ - --ignore-table=vn.printer --ignore-table=vn.printingQueue --ignore-table=vn.printServerQueue__ --ignore-table=vn.promissoryNote -- 2.40.1 From c9bfbe990aaac8e1a1362112fe210cc7a0340479 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 20 May 2022 12:53:10 +0200 Subject: [PATCH 4/6] refactor: request changues --- back/models/app-version-control.json | 4 ++-- db/dump/fixtures.sql | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/back/models/app-version-control.json b/back/models/app-version-control.json index 934d918f9..46c53be3c 100644 --- a/back/models/app-version-control.json +++ b/back/models/app-version-control.json @@ -17,8 +17,8 @@ "version": { "type": "string" }, - "IsVersionCritical": { - "type": "number" + "isVersionCritical": { + "type": "boolean" } } } diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 418993944..e26bc735e 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2551,15 +2551,15 @@ INSERT INTO `vn`.`supplierAgencyTerm` (`agencyFk`, `supplierFk`, `minimumPackage (4, 2, 0, 20.00, 0.00, NULL, 0, 0.00, 0), (5, 442, 0, 0.00, 3.05, NULL, 0, 0.00, 0); -INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `IsVersionCritical`) +INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `isVersionCritical`) VALUES ('delivery', '9.2', 0), ('warehouse', '8.1', 0); INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`) VALUES - ('RE-001', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442), - ('RE-002', 'STILL', 'LTX-20', 60, 23, 'REMOLCADOR ELECTRICO', 'Arrastrar carros', 2020, 103, 442); + ('RE-001', 'STILL', 'LTX-20', 60, 23, 'ELECTRIC TOW', 'Drag cars', 2020, 103, 442), + ('RE-002', 'STILL', 'LTX-20', 60, 23, 'ELECTRIC TOW', 'Drag cars', 2020, 103, 442); INSERT INTO `vn`.`machineWorker` (`workerFk`, `machineFk`, `inTimed`, `outTimed`) VALUES -- 2.40.1 From a043c5d346fe89f2ff432941d683ca6e5efc1ed2 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 20 May 2022 13:10:48 +0200 Subject: [PATCH 5/6] refactor: request changes --- back/models/machine-worker.json | 14 ++++++++++---- modules/worker/back/model-config.json | 3 +++ modules/worker/back/models/sector.json | 20 ++++++++++++++++++++ modules/worker/back/models/worker.json | 5 +++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 modules/worker/back/models/sector.json diff --git a/back/models/machine-worker.json b/back/models/machine-worker.json index 61cde223f..2244a533f 100644 --- a/back/models/machine-worker.json +++ b/back/models/machine-worker.json @@ -17,11 +17,17 @@ "machineFk": { "type": "number" }, - "inTimed": { - "type": "date" + "inTime": { + "type": "date", + "mysql": { + "columnName": "inTimed" + } }, - "outTimed": { - "type": "date" + "outTime": { + "type": "date", + "mysql": { + "columnName": "outTimed" + } } } } diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index c155e331d..c6b984bd2 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -20,6 +20,9 @@ "EducationLevel": { "dataSource": "vn" }, + "Sector": { + "dataSource": "vn" + }, "WorkCenter": { "dataSource": "vn" }, diff --git a/modules/worker/back/models/sector.json b/modules/worker/back/models/sector.json new file mode 100644 index 000000000..8bd5e773f --- /dev/null +++ b/modules/worker/back/models/sector.json @@ -0,0 +1,20 @@ +{ + "name": "Sector", + "base": "VnModel", + "options": { + "mysql": { + "table": "sector" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "description": { + "type": "string", + "required": true + } + } +} \ No newline at end of file diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index df75d871e..0f19ed4ce 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -84,6 +84,11 @@ "type": "hasMany", "model": "WorkerTeamCollegues", "foreignKey": "workerFk" + }, + "sector": { + "type": "belongsTo", + "model": "Sector", + "foreignKey": "sectorFk" } } } \ No newline at end of file -- 2.40.1 From db7638f1535ba6004112d5e3f513385624001c25 Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 23 May 2022 12:45:20 +0200 Subject: [PATCH 6/6] refactor: sectorFk property deleted --- modules/worker/back/models/worker.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 0f19ed4ce..f7a344358 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -47,9 +47,6 @@ "SSN": { "type" : "string" }, - "sectorFk": { - "type" : "number" - }, "labelerFk": { "type" : "number" } -- 2.40.1