diff --git a/db/changes/10480-june/00-aclShelvingLog.sql b/db/changes/10480-june/00-aclShelvingLog.sql
new file mode 100644
index 000000000..dc75142d1
--- /dev/null
+++ b/db/changes/10480-june/00-aclShelvingLog.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
+ VALUES
+ ('ShelvingLog','*','READ','ALLOW','ROLE','employee');
\ No newline at end of file
diff --git a/modules/shelving/back/model-config.json b/modules/shelving/back/model-config.json
index ff4164b31..b5619d8c5 100644
--- a/modules/shelving/back/model-config.json
+++ b/modules/shelving/back/model-config.json
@@ -4,5 +4,8 @@
},
"Shelving": {
"dataSource": "vn"
+ },
+ "ShelvingLog": {
+ "dataSource": "vn"
}
}
diff --git a/modules/shelving/back/models/shelvingLog.json b/modules/shelving/back/models/shelving-log.json
similarity index 75%
rename from modules/shelving/back/models/shelvingLog.json
rename to modules/shelving/back/models/shelving-log.json
index 61eb0813f..fd30d8be8 100644
--- a/modules/shelving/back/models/shelvingLog.json
+++ b/modules/shelving/back/models/shelving-log.json
@@ -8,20 +8,20 @@
},
"properties": {
"id": {
- "type": "number",
"id": true,
- "description": "Identifier"
+ "type": "number",
+ "forceId": false
},
"originFk": {
"type": "string",
"required": true
},
"userFk": {
- "type": "number",
- "required": true
+ "type": "number"
},
"action": {
- "type": "string"
+ "type": "string",
+ "required": true
},
"creationDate": {
"type": "date"
@@ -44,5 +44,15 @@
"changedModelValue": {
"type": "string"
}
- }
+ },
+ "relations": {
+ "user": {
+ "type": "belongsTo",
+ "model": "Account",
+ "foreignKey": "userFk"
+ }
+ },
+ "scope": {
+ "order": ["creationDate DESC", "id DESC"]
+ }
}
diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json
index c7fcb2560..508ac428f 100644
--- a/modules/shelving/back/models/shelving.json
+++ b/modules/shelving/back/models/shelving.json
@@ -1,6 +1,10 @@
{
"name": "Shelving",
- "base": "VnModel",
+ "base": "Loggable",
+ "log": {
+ "model": "ShelvingLog",
+ "showField": "id"
+ },
"options": {
"mysql": {
"table": "shelving"
diff --git a/modules/shelving/front/index.js b/modules/shelving/front/index.js
index df26602fc..2ad9bc1b9 100644
--- a/modules/shelving/front/index.js
+++ b/modules/shelving/front/index.js
@@ -8,3 +8,4 @@ import './index/';
import './main';
import './search-panel';
import './summary';
+import './log';
diff --git a/modules/shelving/front/log/index.html b/modules/shelving/front/log/index.html
index e11d39a99..6ea349316 100644
--- a/modules/shelving/front/log/index.html
+++ b/modules/shelving/front/log/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file