feat: refs #6818 saysimple integration
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-11-08 11:51:00 +01:00
parent dd7c967624
commit 6927f4b28d
6 changed files with 48 additions and 2 deletions

View File

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

View File

@ -44,6 +44,11 @@
"type": "belongsTo", "type": "belongsTo",
"model": "Continent", "model": "Continent",
"foreignKey": "continentFk" "foreignKey": "continentFk"
},
"saySimpleCountry": {
"type": "hasOne",
"model": "SaySimpleCountry",
"foreignKey": "countryFk"
} }
}, },
"acls": [ "acls": [
@ -54,4 +59,4 @@
"permission": "ALLOW" "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": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -4008,3 +4008,6 @@ UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA";
UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS"; UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS";
INSERT INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, 1169),
(8, 1183);

View File

@ -0,0 +1,6 @@
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
);

View File

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