From 3e1b296b29177f474f8d595d0a4cfa9d3a3622d0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 May 2024 15:46:44 +0200 Subject: [PATCH 01/17] refs #6553 changes models --- modules/client/back/models/business.json | 60 ++++++++++++++++++++++++ modules/worker/back/models/worker.json | 5 ++ 2 files changed, 65 insertions(+) diff --git a/modules/client/back/models/business.json b/modules/client/back/models/business.json index 58e989ae0..8c572fb5d 100644 --- a/modules/client/back/models/business.json +++ b/modules/client/back/models/business.json @@ -13,6 +13,66 @@ }, "workcenterFk" : { "type": "number" + }, + "companyCodeFk" : { + "type": "string" + }, + "started" : { + "type": "date" + }, + "ended" : { + "type": "date" + }, + "workerBusiness" : { + "type": "string" + }, + "reasonEndFk" : { + "type": "number" + }, + "payedHolidays" : { + "type": "number" + }, + "occupationCodeFk" : { + "type": "number" + }, + "workerFk" : { + "type": "number" + }, + "notes" : { + "type": "string" + }, + "departmentFk": { + "type": "number" + }, + "workerBusinessProfessionalCategoryFk": { + "type": "number" + }, + "calendarTypeFk": { + "type": "string" + }, + "isHourlyLabor": { + "type": "boolean" + }, + "rate": { + "type": "number" + }, + "workerBusinessCategoryFk": { + "type": "number" + }, + "workerBusinessTypeFk": { + "type": "number" + }, + "amount": { + "type": "number" + }, + "workerBusinessAgreementFk": { + "type": "number" + }, + "basicSalary": { + "type": "number" + }, + "editorFk": { + "type": "number" } }, "relations": { diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 4e7617aab..5c5090691 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -115,6 +115,11 @@ "type": "hasMany", "model": "Locker", "foreignKey": "workerFk" + }, + "business": { + "type": "hasMany", + "model": "Business", + "foreignKey": "workerFk" } }, "acls":[ From a5ffdddb53d8d8b14414344b9a35fddec6fd34ca Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 29 May 2024 15:56:27 +0200 Subject: [PATCH 02/17] refs #6553 fix back --- .../11076-blueChico/00-firstScript.sql | 20 ++++++++ modules/client/back/model-config.json | 15 ++++++ .../back/models/business-reason-end.json | 17 +++++++ modules/client/back/models/business.json | 50 +++++++++++++++++-- modules/client/back/models/calendar-type.json | 21 ++++++++ .../client/back/models/occupationCode.json | 17 +++++++ .../back/models/payroll-categories.json | 20 ++++++++ .../back/models/professional-category.json | 20 ++++++++ .../models/worker-business-agreement.json | 29 +++++++++++ .../back/models/worker-business-type.json | 26 ++++++++++ 10 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 db/versions/11076-blueChico/00-firstScript.sql create mode 100644 modules/client/back/models/business-reason-end.json create mode 100644 modules/client/back/models/calendar-type.json create mode 100644 modules/client/back/models/occupationCode.json create mode 100644 modules/client/back/models/payroll-categories.json create mode 100644 modules/client/back/models/professional-category.json create mode 100644 modules/client/back/models/worker-business-agreement.json create mode 100644 modules/client/back/models/worker-business-type.json diff --git a/db/versions/11076-blueChico/00-firstScript.sql b/db/versions/11076-blueChico/00-firstScript.sql new file mode 100644 index 000000000..d53226598 --- /dev/null +++ b/db/versions/11076-blueChico/00-firstScript.sql @@ -0,0 +1,20 @@ +ALTER TABLE vn.business +ADD CONSTRAINT `business_companyCodeFk` FOREIGN KEY (`companyCodeFk`) REFERENCES `company` (`code`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values. +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('CalendarType','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('OccupationCode','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('WorkerBusinessProfessionalCategory','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('WorkerBusinessAgreement','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('WorkerBusinessType','*','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','__get__business','*','ALLOW','ROLE','employee'); diff --git a/modules/client/back/model-config.json b/modules/client/back/model-config.json index fc1254dd8..e2192ab1b 100644 --- a/modules/client/back/model-config.json +++ b/modules/client/back/model-config.json @@ -139,5 +139,20 @@ }, "Xdiario": { "dataSource": "vn" + }, + "BusinessReasonEnd": { + "dataSource": "vn" + }, + "OccupationCode": { + "dataSource": "vn" + }, + "WorkerBusinessProfessionalCategory": { + "dataSource": "vn" + }, + "CalendarType": { + "dataSource": "vn" + }, + "WorkerBusinessType": { + "dataSource": "vn" } } diff --git a/modules/client/back/models/business-reason-end.json b/modules/client/back/models/business-reason-end.json new file mode 100644 index 000000000..54a632bea --- /dev/null +++ b/modules/client/back/models/business-reason-end.json @@ -0,0 +1,17 @@ +{ + "name": "BusinessReasonEnd", + "base": "VnModel", + "options": { + "mysql": { + "table": "businessReasonEnd" + } + }, + "properties": { + "id": { + "type": "number" + }, + "reason": { + "type": "string" + } + } +} diff --git a/modules/client/back/models/business.json b/modules/client/back/models/business.json index 8c572fb5d..78605d687 100644 --- a/modules/client/back/models/business.json +++ b/modules/client/back/models/business.json @@ -70,9 +70,6 @@ }, "basicSalary": { "type": "number" - }, - "editorFk": { - "type": "number" } }, "relations": { @@ -85,6 +82,53 @@ "type": "belongsTo", "model": "Department", "foreignKey": "departmentFk" + }, + "workCenter": { + "type": "belongsTo", + "model": "WorkCenter", + "foreignKey": "workcenterFk" + }, + "companyCode": { + "type": "belongsTo", + "model": "Company", + "foreignKey": "companyCodeFk" + }, + "reasonEnd": { + "type": "belongsTo", + "model": "BusinessReasonEnd", + "foreignKey": "reasonEndFk" + }, + "occupationCode": { + "type": "belongsTo", + "model": "OccupationCode", + "foreignKey":"occupationCodeFk" + }, + "workerBusinessProfessionalCategory": { + "type": "belongsTo", + "model": "WorkerBusinessProfessionalCategory", + "foreignKey": "workerBusinessProfessionalCategoryFk" } + , + "calendarType": { + "type": "belongsTo", + "model": "CalendarType", + "foreignKey": "calendarTypeFk" + }, + "workerBusinessCategory": { + "type": "belongsTo", + "model": "WorkerBusinessCategory", + "foreignKey": "workerBusinessCategoryFk" + }, + "workerBusinessType": { + "type": "belongsTo", + "model": "WorkerBusinessType", + "foreignKey": "workerBusinessTypeFk" + }, + "workerBusinessAgreement": { + "type": "belongsTo", + "model": "WorkerBusinessAgreement", + "foreignKey": "workerBusinessAgreementFk" + } + } } diff --git a/modules/client/back/models/calendar-type.json b/modules/client/back/models/calendar-type.json new file mode 100644 index 000000000..742aaed94 --- /dev/null +++ b/modules/client/back/models/calendar-type.json @@ -0,0 +1,21 @@ +{ + "name": "CalendarType", + "base": "VnModel", + "options": { + "mysql": { + "table": "calendarType" + } + }, + "properties": { + "id": { + "type": "number" + }, + "description": { + "type": "string" + }, + "hoursWeek": { + "type": "number" + }, + "isPartial": "number" + } +} diff --git a/modules/client/back/models/occupationCode.json b/modules/client/back/models/occupationCode.json new file mode 100644 index 000000000..63c148a81 --- /dev/null +++ b/modules/client/back/models/occupationCode.json @@ -0,0 +1,17 @@ +{ + "name": "OccupationCode", + "base": "VnModel", + "options": { + "mysql": { + "table": "occupationCode" + } + }, + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + } + } +} diff --git a/modules/client/back/models/payroll-categories.json b/modules/client/back/models/payroll-categories.json new file mode 100644 index 000000000..54ff8a4c0 --- /dev/null +++ b/modules/client/back/models/payroll-categories.json @@ -0,0 +1,20 @@ +{ + "name": "BusinessReasonEnd", + "base": "VnModel", + "options": { + "mysql": { + "table": "payrollCategories" + } + }, + "properties": { + "id": { + "type": "number" + }, + "description": { + "type": "string" + }, + "rate": { + "type": "number" + } + } +} diff --git a/modules/client/back/models/professional-category.json b/modules/client/back/models/professional-category.json new file mode 100644 index 000000000..5f812a704 --- /dev/null +++ b/modules/client/back/models/professional-category.json @@ -0,0 +1,20 @@ +{ + "name": "WorkerBusinessProfessionalCategory", + "base": "VnModel", + "options": { + "mysql": { + "table": "professionalCategory" + } + }, + "properties": { + "id": { + "type": "number" + }, + "description": { + "type": "string" + }, + "code": { + "type": "string" + } + } +} diff --git a/modules/client/back/models/worker-business-agreement.json b/modules/client/back/models/worker-business-agreement.json new file mode 100644 index 000000000..bd62b2aa3 --- /dev/null +++ b/modules/client/back/models/worker-business-agreement.json @@ -0,0 +1,29 @@ +{ + "name": "WorkerBusinessAgreement", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerBusinessAgreement" + } + }, + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "monthHolidays": { + "type": "number" + }, + "yearsHours": { + "type": "number" + }, + "started": { + "type": "date" + }, + "ended": { + "type": "date" + } + } +} diff --git a/modules/client/back/models/worker-business-type.json b/modules/client/back/models/worker-business-type.json new file mode 100644 index 000000000..146bac7ab --- /dev/null +++ b/modules/client/back/models/worker-business-type.json @@ -0,0 +1,26 @@ +{ + "name": "WorkerBusinessType", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerBusinessType" + } + }, + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "isFullTime": { + "type": "number" + }, + "isPermanent": { + "type": "number" + }, + "hasHolidayEntitlement": { + "type": "number" + } + } +} From 5d73af5392f9d46300ccf633cbe42302f1bb05e2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 5 Jun 2024 10:43:53 +0200 Subject: [PATCH 03/17] refs #6553 fix back --- modules/client/back/model-config.json | 3 +++ modules/client/back/models/business.json | 8 ++++++-- modules/client/back/models/occupationCode.json | 3 ++- modules/client/back/models/payroll-categories.json | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/client/back/model-config.json b/modules/client/back/model-config.json index e2192ab1b..8dcfaf504 100644 --- a/modules/client/back/model-config.json +++ b/modules/client/back/model-config.json @@ -154,5 +154,8 @@ }, "WorkerBusinessType": { "dataSource": "vn" + }, + "PayrollCategory": { + "dataSource": "vn" } } diff --git a/modules/client/back/models/business.json b/modules/client/back/models/business.json index 78605d687..c870c8f6e 100644 --- a/modules/client/back/models/business.json +++ b/modules/client/back/models/business.json @@ -103,12 +103,16 @@ "model": "OccupationCode", "foreignKey":"occupationCodeFk" }, + "payrollCategory": { + "type": "belongsTo", + "model": "PayrollCategory", + "foreignKey":"workerBusinessCategoryFk" + }, "workerBusinessProfessionalCategory": { "type": "belongsTo", "model": "WorkerBusinessProfessionalCategory", "foreignKey": "workerBusinessProfessionalCategoryFk" - } - , + }, "calendarType": { "type": "belongsTo", "model": "CalendarType", diff --git a/modules/client/back/models/occupationCode.json b/modules/client/back/models/occupationCode.json index 63c148a81..e40eaf2fe 100644 --- a/modules/client/back/models/occupationCode.json +++ b/modules/client/back/models/occupationCode.json @@ -8,7 +8,8 @@ }, "properties": { "code": { - "type": "string" + "type": "string", + "id": true }, "name": { "type": "string" diff --git a/modules/client/back/models/payroll-categories.json b/modules/client/back/models/payroll-categories.json index 54ff8a4c0..ca3431ba9 100644 --- a/modules/client/back/models/payroll-categories.json +++ b/modules/client/back/models/payroll-categories.json @@ -1,5 +1,5 @@ { - "name": "BusinessReasonEnd", + "name": "PayrollCategory", "base": "VnModel", "options": { "mysql": { From 06fe0f5cefc30e643fbe49c2a527652f3b9609be Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 6 Jun 2024 07:34:17 +0200 Subject: [PATCH 04/17] refs #6553 fix acls --- db/versions/11076-blueChico/00-firstScript.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/versions/11076-blueChico/00-firstScript.sql b/db/versions/11076-blueChico/00-firstScript.sql index d53226598..1abb234cf 100644 --- a/db/versions/11076-blueChico/00-firstScript.sql +++ b/db/versions/11076-blueChico/00-firstScript.sql @@ -16,5 +16,7 @@ INSERT INTO salix.ACL (model,property,accessType,permission,principalType,princi VALUES ('WorkerBusinessAgreement','*','*','ALLOW','ROLE','employee'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) VALUES ('WorkerBusinessType','*','*','ALLOW','ROLE','employee'); + INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('PayrollCategory','*','*','ALLOW','ROLE','employee'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) VALUES ('Worker','__get__business','*','ALLOW','ROLE','employee'); From 41fabecc9b0dfd5fc67fa03282e2d1a45798d5f2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jun 2024 09:29:37 +0200 Subject: [PATCH 05/17] refs #6553 fix acls --- db/versions/11076-blueChico/00-firstScript.sql | 3 +++ modules/client/back/models/business.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/db/versions/11076-blueChico/00-firstScript.sql b/db/versions/11076-blueChico/00-firstScript.sql index 1abb234cf..95038318a 100644 --- a/db/versions/11076-blueChico/00-firstScript.sql +++ b/db/versions/11076-blueChico/00-firstScript.sql @@ -20,3 +20,6 @@ INSERT INTO salix.ACL (model,property,accessType,permission,principalType,princi VALUES ('PayrollCategory','*','*','ALLOW','ROLE','employee'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) VALUES ('Worker','__get__business','*','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','__create__business','*','ALLOW','ROLE','employee'); + diff --git a/modules/client/back/models/business.json b/modules/client/back/models/business.json index c870c8f6e..1a500d444 100644 --- a/modules/client/back/models/business.json +++ b/modules/client/back/models/business.json @@ -33,7 +33,7 @@ "type": "number" }, "occupationCodeFk" : { - "type": "number" + "type": "string" }, "workerFk" : { "type": "number" From 4f7b625a4fe62fb92e9a1c1dcbb29786d727d8d5 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Jun 2024 14:48:45 +0200 Subject: [PATCH 06/17] fix(business): sql role --- .../11076-blueChico/00-firstScript.sql | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/db/versions/11076-blueChico/00-firstScript.sql b/db/versions/11076-blueChico/00-firstScript.sql index 95038318a..84cc82dd9 100644 --- a/db/versions/11076-blueChico/00-firstScript.sql +++ b/db/versions/11076-blueChico/00-firstScript.sql @@ -3,23 +3,25 @@ ADD CONSTRAINT `business_companyCodeFk` FOREIGN KEY (`companyCodeFk`) REFERENCES -- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values. INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','employee'); + VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('CalendarType','*','*','ALLOW','ROLE','employee'); + VALUES ('CalendarType','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('OccupationCode','*','*','ALLOW','ROLE','employee'); + VALUES ('OccupationCode','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','employee'); + VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessProfessionalCategory','*','*','ALLOW','ROLE','employee'); + VALUES ('WorkerBusinessProfessionalCategory','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessAgreement','*','*','ALLOW','ROLE','employee'); + VALUES ('WorkerBusinessAgreement','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessType','*','*','ALLOW','ROLE','employee'); - INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('PayrollCategory','*','*','ALLOW','ROLE','employee'); + VALUES ('WorkerBusinessType','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('Worker','__get__business','*','ALLOW','ROLE','employee'); + VALUES ('PayrollCategory','*','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('Worker','__create__business','*','ALLOW','ROLE','employee'); + VALUES ('Worker','__get__business','*','ALLOW','ROLE','hr'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','__create__business','*','ALLOW','ROLE','hr'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Business','crud','*','ALLOW','ROLE','hr'); From cc8af9d14afdb5e3229da37279cfb2d9fa07ae4a Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 25 Jun 2024 10:21:24 +0200 Subject: [PATCH 07/17] refs #6553 fix back --- modules/client/back/models/business.json | 8 +++++--- .../models/{occupationCode.json => occupation-code.json} | 0 modules/client/back/models/worker-business-type.json | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) rename modules/client/back/models/{occupationCode.json => occupation-code.json} (100%) diff --git a/modules/client/back/models/business.json b/modules/client/back/models/business.json index 1a500d444..dc6cd0bcd 100644 --- a/modules/client/back/models/business.json +++ b/modules/client/back/models/business.json @@ -42,7 +42,7 @@ "type": "string" }, "departmentFk": { - "type": "number" + "type": "string" }, "workerBusinessProfessionalCategoryFk": { "type": "number" @@ -91,7 +91,8 @@ "companyCode": { "type": "belongsTo", "model": "Company", - "foreignKey": "companyCodeFk" + "foreignKey": "companyCodeFk", + "primaryKey": "code" }, "reasonEnd": { "type": "belongsTo", @@ -101,7 +102,8 @@ "occupationCode": { "type": "belongsTo", "model": "OccupationCode", - "foreignKey":"occupationCodeFk" + "foreignKey":"occupationCodeFk", + "primaryKey": "code" }, "payrollCategory": { "type": "belongsTo", diff --git a/modules/client/back/models/occupationCode.json b/modules/client/back/models/occupation-code.json similarity index 100% rename from modules/client/back/models/occupationCode.json rename to modules/client/back/models/occupation-code.json diff --git a/modules/client/back/models/worker-business-type.json b/modules/client/back/models/worker-business-type.json index 146bac7ab..648ce3fd2 100644 --- a/modules/client/back/models/worker-business-type.json +++ b/modules/client/back/models/worker-business-type.json @@ -8,7 +8,8 @@ }, "properties": { "id": { - "type": "number" + "type": "number", + "id": true }, "name": { "type": "string" From 36b4c7fb7474158f8c150ab13c9fa0d20dd645cc Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 26 Jun 2024 12:33:38 +0200 Subject: [PATCH 08/17] typo --- modules/worker/back/models/worker.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 8f2be694f..a1b6e21b0 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -118,7 +118,7 @@ }, "business": { "type": "hasMany", - "model": "Business", + "model": "Business" }, "incomes": { "type": "hasMany", From 5e5a8078ca43e2972db6c75311b400a6617e6e53 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Sep 2024 13:59:02 +0200 Subject: [PATCH 09/17] fix: refs #6553 json worker --- modules/worker/back/models/worker.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index a1b6e21b0..0fb1feb1b 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -118,7 +118,8 @@ }, "business": { "type": "hasMany", - "model": "Business" + "model": "Business", + "foreignKey": "workerFk" }, "incomes": { "type": "hasMany", From e2a4c5339a44b8c614d2d149ffecd812d385629f Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 16 Dec 2024 13:01:44 +0100 Subject: [PATCH 10/17] fix: refs #6553 fix back --- db/versions/11076-blueChico/00-firstScript.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/versions/11076-blueChico/00-firstScript.sql b/db/versions/11076-blueChico/00-firstScript.sql index 84cc82dd9..75fdc0c56 100644 --- a/db/versions/11076-blueChico/00-firstScript.sql +++ b/db/versions/11076-blueChico/00-firstScript.sql @@ -3,21 +3,21 @@ ADD CONSTRAINT `business_companyCodeFk` FOREIGN KEY (`companyCodeFk`) REFERENCES -- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values. INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','hr'); + VALUES ('BusinessReasonEnd','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('CalendarType','*','*','ALLOW','ROLE','hr'); + VALUES ('CalendarType','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('OccupationCode','*','*','ALLOW','ROLE','hr'); + VALUES ('OccupationCode','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('BusinessReasonEnd','*','*','ALLOW','ROLE','hr'); + VALUES ('BusinessReasonEnd','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessProfessionalCategory','*','*','ALLOW','ROLE','hr'); + VALUES ('WorkerBusinessProfessionalCategory','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessAgreement','*','*','ALLOW','ROLE','hr'); + VALUES ('WorkerBusinessAgreement','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('WorkerBusinessType','*','*','ALLOW','ROLE','hr'); + VALUES ('WorkerBusinessType','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('PayrollCategory','*','*','ALLOW','ROLE','hr'); + VALUES ('PayrollCategory','find','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) VALUES ('Worker','__get__business','*','ALLOW','ROLE','hr'); INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) From a139c9849c60484a9a9cfd28218b781f11229d48 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 7 Jan 2025 10:33:30 +0100 Subject: [PATCH 11/17] fix: refs #6553 fix model --- modules/worker/back/models/worker.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index eb4f5e796..d52b1f57b 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -264,12 +264,36 @@ "relation": "department", "scope": { "fields": [ - "name" + "id" ] } } } }, + { + "relation": "business", + "scope": { + "fields": [ + "id", + "started", + "ended", + "reasonEndFk", + "departmentFk", + "workerBusinessProfessionalCategoryFk" + ], + "include": [ + { + "relation": "reasonEnd", + "scope": { + "fields": [ + "id", + "reason" + ] + } + } + ] + } + }, { "relation": "boss", "scope": { From 358f93c454e6a2db65c0ef7731374584b94f8148 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 13 Jan 2025 12:23:21 +0100 Subject: [PATCH 12/17] fix: refs #6553 fix worker back --- modules/worker/back/models/worker.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index d52b1f57b..80d0f1a71 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -75,6 +75,9 @@ }, "isSsDiscounted": { "type": "boolean" + }, + "businessFk": { + "type": "number" } }, "relations": { From 60f0b169d4697221ebb4ee2e67a2013cbb4e2313 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 13 Jan 2025 13:56:24 +0100 Subject: [PATCH 13/17] fix: refs #6553 fix advanced --- modules/worker/back/models/worker.json | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 80d0f1a71..e2e4658e2 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -355,6 +355,48 @@ "phone" ] } + }, + { + "relation": "business", + "scope": { + "fields": [ + "id", + "started", + "ended", + "reasonEndFk", + "departmentFk", + "workerBusinessProfessionalCategoryFk" + ], + "include": [ + { + "relation": "reasonEnd", + "scope": { + "fields": [ + "id", + "reason" + ] + } + }, + { + "relation": "department", + "scope": { + "fields": [ + "id", + "name" + ] + } + }, + { + "relation": "workerBusinessProfessionalCategory", + "scope": { + "fields": [ + "id", + "description" + ] + } + } + ] + } } ] } From 024ab8602d6f761e4a918486b90a412ba4f87e9d Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 15 Jan 2025 10:31:49 +0100 Subject: [PATCH 14/17] fix: refs #6553 fix back advanced summary --- modules/worker/back/models/worker.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index e2e4658e2..346c70d56 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -106,6 +106,11 @@ "model": "WorkerDepartment", "foreignKey": "id" }, + "currentBusiness": { + "type": "belongsTo", + "model": "Business", + "foreignKey": "businessFk" + }, "collegues": { "type": "hasMany", "model": "WorkerTeamCollegues", @@ -344,7 +349,8 @@ "educationLevelFk", "originCountryFk", "maritalStatus", - "SSN" + "SSN", + "businessFk" ], "include": [ { @@ -357,7 +363,7 @@ } }, { - "relation": "business", + "relation": "currentBusiness", "scope": { "fields": [ "id", From 53ee0c16170f0e133b33a98fc878801940c4989e Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 31 Jan 2025 09:17:15 +0100 Subject: [PATCH 15/17] fix: fixed country field --- modules/client/back/methods/client/filter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js index 7df973f19..c217b2a86 100644 --- a/modules/client/back/methods/client/filter.js +++ b/modules/client/back/methods/client/filter.js @@ -158,10 +158,12 @@ module.exports = Self => { a.provinceFk AS provinceAddressFk, p.name AS province, u.id AS salesPersonFk, - u.name AS salesPerson + u.name AS salesPerson, + co.name AS country FROM client c LEFT JOIN account.user u ON u.id = c.salesPersonFk LEFT JOIN province p ON p.id = c.provinceFk + LEFT JOIN country co ON co.id = c.countryFk JOIN address a ON a.clientFk = c.id ` ); From da5e395450626fd9823eb014d88e02e874b8bf9b Mon Sep 17 00:00:00 2001 From: ivanm Date: Fri, 31 Jan 2025 10:17:01 +0100 Subject: [PATCH 16/17] feat: refs #8312 add flippingCost column to Cubos view --- db/routines/vn2008/views/Cubos.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/routines/vn2008/views/Cubos.sql b/db/routines/vn2008/views/Cubos.sql index 1b23af4fc..7ca82e66e 100644 --- a/db/routines/vn2008/views/Cubos.sql +++ b/db/routines/vn2008/views/Cubos.sql @@ -18,5 +18,6 @@ AS SELECT `p`.`id` AS `Id_Cubo`, `p`.`base` AS `Base`, `p`.`isBox` AS `box`, `p`.`returnCost` AS `costeRetorno`, - `p`.`isActive` AS `isActive` + `p`.`isActive` AS `isActive`, + `p`.`flippingCost` AS `flippingCost` FROM `vn`.`packaging` `p` From fa9b9cc5a3e46b45f7e116e63a6df19e8701151d Mon Sep 17 00:00:00 2001 From: ivanm Date: Fri, 31 Jan 2025 11:06:24 +0100 Subject: [PATCH 17/17] feat: refs #8312 modify fixtures.before --- db/dump/fixtures.before.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index b7197d1db..c08938f04 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -3207,7 +3207,7 @@ UPDATE vn.department SET workerFk = null; INSERT INTO vn.packaging - VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0,1); + VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0,1,0); INSERT IGNORE INTO vn.intrastat