2018-04-17 12:49:55 +00:00
|
|
|
module.exports = Self => {
|
|
|
|
Self.remoteMethod('getTaxes', {
|
|
|
|
description: 'Returns ticket taxes',
|
|
|
|
accessType: 'READ',
|
|
|
|
accepts: [{
|
|
|
|
arg: 'id',
|
|
|
|
type: 'number',
|
|
|
|
required: true,
|
|
|
|
description: 'ticket id',
|
|
|
|
http: {source: 'path'}
|
|
|
|
}],
|
|
|
|
returns: {
|
|
|
|
type: 'number',
|
|
|
|
root: true
|
|
|
|
},
|
|
|
|
http: {
|
|
|
|
path: `/:id/getTaxes`,
|
|
|
|
verb: 'GET'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Self.getTaxes = async ticketFk => {
|
|
|
|
let query = `CALL vn.ticketGetTaxAdd(?)`;
|
|
|
|
let [taxes] = await Self.rawSql(query, [ticketFk]);
|
|
|
|
|
|
|
|
return taxes;
|
|
|
|
};
|
2018-05-31 12:48:10 +00:00
|
|
|
};
|