2018-03-22 14:06:21 +00:00
|
|
|
module.exports = Self => {
|
2018-04-03 14:10:39 +00:00
|
|
|
Self.remoteMethod('getVolume', {
|
2018-03-22 14:06:21 +00:00
|
|
|
description: 'Returns the volumes of a ticket',
|
|
|
|
accessType: 'READ',
|
|
|
|
accepts: [{
|
|
|
|
arg: 'id',
|
|
|
|
type: 'number',
|
|
|
|
required: true,
|
|
|
|
description: 'ticket id',
|
|
|
|
http: {source: 'path'}
|
|
|
|
}],
|
|
|
|
returns: {
|
2018-04-03 14:10:39 +00:00
|
|
|
arg: 'volumes'
|
2018-03-22 14:06:21 +00:00
|
|
|
},
|
|
|
|
http: {
|
2018-04-03 14:10:39 +00:00
|
|
|
path: `/:id/getVolume`,
|
2018-03-22 14:06:21 +00:00
|
|
|
verb: 'GET'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-04-03 14:10:39 +00:00
|
|
|
Self.getVolume = async ticketFk => {
|
2018-05-28 06:52:18 +00:00
|
|
|
let [volume] = await Self.rawSql(`CALL vn.ticketListVolume(?)`, [ticketFk]);
|
|
|
|
return volume;
|
2018-03-22 14:06:21 +00:00
|
|
|
};
|
|
|
|
};
|