From 686382a0e6f7e878bcebce6c1120f4b3f38a04d9 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Mon, 2 Mar 2020 11:57:09 +0100 Subject: [PATCH] entryLog section --- db/changes/10161-postValentineDay/00-ACL.sql | 2 + modules/entry/back/model-config.json | 3 ++ modules/entry/back/models/entry-log.json | 43 ++++++++++++++++++++ modules/entry/front/routes.json | 2 +- modules/travel/back/model-config.json | 12 ++++-- 5 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 db/changes/10161-postValentineDay/00-ACL.sql create mode 100644 modules/entry/back/models/entry-log.json diff --git a/db/changes/10161-postValentineDay/00-ACL.sql b/db/changes/10161-postValentineDay/00-ACL.sql new file mode 100644 index 000000000..a7ac79486 --- /dev/null +++ b/db/changes/10161-postValentineDay/00-ACL.sql @@ -0,0 +1,2 @@ +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES ('EntryLog', '*', 'READ', 'ALLOW', 'ROLE', 'buyer'); diff --git a/modules/entry/back/model-config.json b/modules/entry/back/model-config.json index cd763c4ea..c8c8babad 100644 --- a/modules/entry/back/model-config.json +++ b/modules/entry/back/model-config.json @@ -1,5 +1,8 @@ { "Entry": { "dataSource": "vn" + }, + "EntryLog": { + "dataSource": "vn" } } diff --git a/modules/entry/back/models/entry-log.json b/modules/entry/back/models/entry-log.json new file mode 100644 index 000000000..4d1a74578 --- /dev/null +++ b/modules/entry/back/models/entry-log.json @@ -0,0 +1,43 @@ +{ + "name": "EntryLog", + "base": "VnModel", + "options": { + "mysql": { + "table": "entryLog" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "originFk": { + "type": "Number", + "required": true + }, + "userFk": { + "type": "Number" + }, + "action": { + "type": "String", + "required": true + }, + "creationDate": { + "type": "Date" + }, + "description": { + "type": "String" + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "userFk" + } + }, + "scope": { + "order": ["creationDate DESC", "id DESC"] + } +} diff --git a/modules/entry/front/routes.json b/modules/entry/front/routes.json index 0d3e2cf14..92d893044 100644 --- a/modules/entry/front/routes.json +++ b/modules/entry/front/routes.json @@ -9,7 +9,7 @@ {"state": "entry.index", "icon": "icon-entry"} ], "card": [ - {"state": "travel.card.log", "icon": "history"}, + {"state": "entry.card.log", "icon": "history"} ] }, "routes": [ diff --git a/modules/travel/back/model-config.json b/modules/travel/back/model-config.json index 03307bd45..b06d00f06 100644 --- a/modules/travel/back/model-config.json +++ b/modules/travel/back/model-config.json @@ -1,13 +1,17 @@ { "Travel": { "dataSource": "vn" - },"TravelLog": { + }, + "TravelLog": { "dataSource": "vn" - },"Currency": { + }, + "Currency": { "dataSource": "vn" - },"Thermograph": { + }, + "Thermograph": { "dataSource": "vn" - },"TravelThermograph": { + }, + "TravelThermograph": { "dataSource": "vn" } }