Merge pull request 'feat: refs #6818 saysimple integration' (!3168) from 6818-saySimpleIntegration into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3168
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-11-13 08:25:20 +00:00
commit 968e308ab6
7 changed files with 91 additions and 2 deletions

View File

@ -139,6 +139,12 @@
"StarredModule": {
"dataSource": "vn"
},
"SaySimpleCountry": {
"dataSource": "vn"
},
"SaySimpleConfig": {
"dataSource": "vn"
},
"TempContainer": {
"dataSource": "tempStorage"
},

View File

@ -44,6 +44,11 @@
"type": "belongsTo",
"model": "Continent",
"foreignKey": "continentFk"
},
"saySimpleCountry": {
"type": "hasOne",
"model": "SaySimpleCountry",
"foreignKey": "countryFk"
}
},
"acls": [
@ -54,4 +59,4 @@
"permission": "ALLOW"
}
]
}
}

View File

@ -0,0 +1,26 @@
{
"name": "SaySimpleConfig",
"base": "VnModel",
"options": {
"mysql": {
"table": "saySimpleConfig"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"url": {
"type": "string"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
}
]
}

View File

@ -0,0 +1,26 @@
{
"name": "SaySimpleCountry",
"base": "VnModel",
"options": {
"mysql": {
"table": "saySimpleCountry"
}
},
"properties": {
"countryFk": {
"type": "number",
"id": true
},
"channel": {
"type": "number"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
}
]
}

View File

@ -4022,3 +4022,10 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c
(10, 0, 2000, 500, 13000, 1, 1, 1, '05A', 5, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL);
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, 1169),
(8, 1183),
(NULL, 1320);
INSERT IGNORE INTO vn.saySimpleConfig (url)
VALUES ('saysimle-url-mock');

View File

@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS vn.saySimpleCountry(
countryFk MEDIUMINT(8) UNSIGNED,
channel INT(4) COMMENT 'channel de whatsapp de saySimple',
PRIMARY KEY (countryFk),
CONSTRAINT `saySimpleCountry_FK` FOREIGN KEY (`countryFk`) REFERENCES vn.country (`id`) ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS vn.saySimpleConfig(
id INT AUTO_INCREMENT PRIMARY KEY,
url VARCHAR(255) NOT NULL
);
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, 1169),
(8, 1183),
(NULL, 1320);

View File

@ -54,7 +54,10 @@ module.exports = Self => {
{
relation: 'country',
scope: {
fields: ['name']
fields: ['id', 'name'],
include: {
relation: 'saySimpleCountry',
}
}
},
{