From 3e1b296b29177f474f8d595d0a4cfa9d3a3622d0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 May 2024 15:46:44 +0200 Subject: [PATCH 01/14] 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 58e989ae08..8c572fb5df 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 4e7617aabe..5c5090691b 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/14] 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 0000000000..d532265981 --- /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 fc1254dd80..e2192ab1b9 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 0000000000..54a632bea8 --- /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 8c572fb5df..78605d6876 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 0000000000..742aaed94c --- /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 0000000000..63c148a818 --- /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 0000000000..54ff8a4c05 --- /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 0000000000..5f812a704f --- /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 0000000000..bd62b2aa39 --- /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 0000000000..146bac7ab7 --- /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/14] 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 e2192ab1b9..8dcfaf5042 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 78605d6876..c870c8f6e1 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 63c148a818..e40eaf2fe1 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 54ff8a4c05..ca3431ba93 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/14] 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 d532265981..1abb234cf5 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/14] 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 1abb234cf5..95038318a5 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 c870c8f6e1..1a500d4442 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/14] 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 95038318a5..84cc82dd92 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/14] 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 1a500d4442..dc6cd0bcd9 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 146bac7ab7..648ce3fd2a 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/14] 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 8f2be694fb..a1b6e21b02 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/14] 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 a1b6e21b02..0fb1feb1be 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/14] 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 84cc82dd92..75fdc0c56f 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/14] 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 eb4f5e7966..d52b1f57bb 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/14] 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 d52b1f57bb..80d0f1a716 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/14] 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 80d0f1a716..e2e4658e26 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/14] 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 e2e4658e26..346c70d567 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",