From 045519c38a788750cab8a70033830aeb61784669 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 26 Jul 2023 10:41:42 +0200 Subject: [PATCH] refs #4879 feat: genericAllocation model --- .../233201/00-genereicAllocationACL.sql | 2 + modules/item/back/model-config.json | 3 ++ .../item/back/models/generic-allocation.json | 38 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 db/changes/233201/00-genereicAllocationACL.sql create mode 100644 modules/item/back/models/generic-allocation.json diff --git a/db/changes/233201/00-genereicAllocationACL.sql b/db/changes/233201/00-genereicAllocationACL.sql new file mode 100644 index 000000000..d46fb2665 --- /dev/null +++ b/db/changes/233201/00-genereicAllocationACL.sql @@ -0,0 +1,2 @@ +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) + VALUES ('GenericAllocation','find','READ','ALLOW','ROLE','employee'); diff --git a/modules/item/back/model-config.json b/modules/item/back/model-config.json index 40d73f1a6..eba9e0306 100644 --- a/modules/item/back/model-config.json +++ b/modules/item/back/model-config.json @@ -2,6 +2,9 @@ "Expense": { "dataSource": "vn" }, + "GenericAllocation": { + "dataSource": "vn" + }, "Genus": { "dataSource": "vn" }, diff --git a/modules/item/back/models/generic-allocation.json b/modules/item/back/models/generic-allocation.json new file mode 100644 index 000000000..711566bdf --- /dev/null +++ b/modules/item/back/models/generic-allocation.json @@ -0,0 +1,38 @@ +{ + "name": "GenericAllocation", + "base": "VnModel", + "options": { + "mysql": { + "table": "genericAllocation" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "color": { + "type": "string" + }, + "started": { + "type": "date", + "mysql": { + "columnName": "startDated" + } + }, + "finished": { + "type": "date", + "mysql": { + "columnName": "endDated" + } + } + }, + "relations": { + "item": { + "type": "belongsTo", + "model": "Item", + "foreignKey": "itemFk" + } + } +}