feat(salix): refs #6321 #6331 publish negativeOrigin model

This commit is contained in:
Javier Segarra 2024-04-22 14:09:27 +02:00
parent 5a5032f6e6
commit 68158f341d
3 changed files with 28 additions and 6 deletions

View File

@ -1,4 +1,3 @@
const {ParameterizedSQL} = require('loopback-connector');
module.exports = Self => {
Self.remoteMethod('negativeOrigin', {
@ -27,10 +26,7 @@ module.exports = Self => {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
const conn = Self.dataSource.connector;
const stmts = ['SELECT * FROM vn.negativeOrigin'];
const sql = ParameterizedSQL.join(stmts, ';');
const result = await conn.executeStmt(sql, myOptions);
return result;
const negativesOrigin = await Self.app.models.NegativeOrigin.find();
return negativesOrigin;
};
};

View File

@ -35,6 +35,9 @@
"PackingSiteConfig": {
"dataSource": "vn"
},
"NegativeOrigin": {
"dataSource": "vn"
},
"ExpeditionMistake": {
"dataSource": "vn"
},

View File

@ -0,0 +1,23 @@
{
"name": "NegativeOrigin",
"base": "VnModel",
"options": {
"mysql": {
"table": "negativeOrigin"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk"
}
}
}