refs #5630 feat: borrar expediciones de GLS
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-06-06 13:41:42 +02:00
parent a477bb32ad
commit a499f7c633
3 changed files with 34 additions and 0 deletions

View File

@ -35,6 +35,11 @@ module.exports = Self => {
try {
const promises = [];
for (let expeditionId of expeditionIds) {
const glsExpedition = await models.GlsExpedition.findById(expeditionId);
if (glsExpedition) {
const barcode = glsExpedition.barcode;
}
const deletedExpedition = models.Expedition.destroyById(expeditionId, myOptions);
promises.push(deletedExpedition);
}

View File

@ -20,6 +20,9 @@
"ExpeditionState": {
"dataSource": "vn"
},
"GlsExpedition": {
"dataSource": "vn"
},
"Packaging": {
"dataSource": "vn"
},

View File

@ -0,0 +1,26 @@
{
"name": "GlsExpedition",
"base": "VnModel",
"options": {
"mysql": {
"table": "glsExpedition"
}
},
"properties": {
"expeditionFk": {
"id": true,
"type": "number",
"description": "Identifier"
},
"barcode": {
"type": "string"
}
},
"relations": {
"expedition": {
"type": "belongsTo",
"model": "Expedition",
"foreignKey": "expeditionFk"
}
}
}