From 8fd133c5e8a10edb4b35b3796887be898d6ff442 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 27 Nov 2024 12:51:09 +0100 Subject: [PATCH] feat: refs #6818 define prefix model --- back/model-config.json | 3 +++ back/models/prefix.json | 27 +++++++++++++++++++ modules/client/back/methods/client/summary.js | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 back/models/prefix.json diff --git a/back/model-config.json b/back/model-config.json index b543071c9..e0bc92200 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -133,6 +133,9 @@ "Postcode": { "dataSource": "vn" }, + "Prefix": { + "dataSource": "vn" + }, "ReferenceRate": { "dataSource": "vn" }, diff --git a/back/models/prefix.json b/back/models/prefix.json new file mode 100644 index 000000000..762354caa --- /dev/null +++ b/back/models/prefix.json @@ -0,0 +1,27 @@ +{ + "name": "Prefix", + "base": "VnModel", + "options": { + "mysql": { + "table": "pbx.prefix" + } + }, + "properties": { + "country": { + "type": "string", + "id": true + }, + "prefix": { + "type": "string" + } + }, + "acls": [ + { + "property": "*", + "accessType": "READ", + "principalType": "ROLE", + "principalId": "employee", + "permission": "ALLOW" + } + ] +} \ No newline at end of file diff --git a/modules/client/back/methods/client/summary.js b/modules/client/back/methods/client/summary.js index 9242fbd44..9c1420b61 100644 --- a/modules/client/back/methods/client/summary.js +++ b/modules/client/back/methods/client/summary.js @@ -54,7 +54,7 @@ module.exports = Self => { { relation: 'country', scope: { - fields: ['id', 'name'], + fields: ['id', 'name', 'code'], include: { relation: 'saySimpleCountry', } -- 2.40.1