From 22af34c0cb69a6fb0a5532ad6ac5574ebd11887a Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 19 Sep 2024 09:27:05 +0200 Subject: [PATCH 1/2] feat: refs #7323 use scopes --- .../11247-chocolateChico/00-firstScript.sql | 4 ++ modules/worker/back/models/worker.json | 68 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 db/versions/11247-chocolateChico/00-firstScript.sql diff --git a/db/versions/11247-chocolateChico/00-firstScript.sql b/db/versions/11247-chocolateChico/00-firstScript.sql new file mode 100644 index 000000000..8cbfebdde --- /dev/null +++ b/db/versions/11247-chocolateChico/00-firstScript.sql @@ -0,0 +1,4 @@ +UPDATE salix.ACL SET principalId = 'employee' WHERE model = 'Worker' AND principalId = '$subordinate'; +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) +VALUES ('Worker', '__get__advancedSummary', 'READ', 'ALLOW', 'ROLE', 'hr'), + ('Worker', '__get__summary', 'READ', 'ALLOW', 'ROLE', 'employee'); diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 82cd1cc2d..6cdf77337 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -193,6 +193,74 @@ } } ] + }, + "summary": { + "include": [ + { + "relation": "user", + "scope": { + "fields": [ + "name", + "nickname", + "roleFk" + ], + "include": [ + { + "relation": "role", + "scope": { + "fields": [ + "name" + ] + } + }, + { + "relation": "emailUser", + "scope": { + "fields": [ + "email" + ] + } + } + ] + } + }, + { + "relation": "department", + "scope": { + "include": { + "relation": "department", + "scope": { + "fields": [ + "name" + ] + } + } + } + }, + { + "relation": "boss" + }, + { + "relation": "client" + }, + { + "relation": "sip" + } + ] + }, + "advancedSummary": { + "fields": [ + "id", + "fiDueDate", + "sex", + "seniority", + "fi", + "isFreelance", + "isSsDiscounted", + "hasMachineryAuthorized", + "isDisable", + "birth" + ] } } } \ No newline at end of file From e40e3ebed6762c61830184450044cdfd65740b25 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 19 Sep 2024 16:40:33 +0200 Subject: [PATCH 2/2] fix: refs #7882 Quadmind api config --- back/models/quadminds-api-config.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/back/models/quadminds-api-config.json b/back/models/quadminds-api-config.json index 4213699a9..4001badf3 100644 --- a/back/models/quadminds-api-config.json +++ b/back/models/quadminds-api-config.json @@ -23,6 +23,12 @@ }, "limit": { "type": "number" + }, + "orderTimeFrom": { + "type": "string" + }, + "orderTimeTo": { + "type": "string" } } }