This commit is contained in:
parent
9b5823384a
commit
072280cc9c
|
@ -1,8 +1,8 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('mark', {
|
||||
description: 'Insert an itemShelvingSale and Modify a saleTracking record',
|
||||
Self.remoteMethodCtx('setPicked', {
|
||||
description: 'Add the sales line of the item and set the tracking.',
|
||||
accessType: 'WRITE',
|
||||
accepts: [
|
||||
{
|
||||
|
@ -46,12 +46,12 @@ module.exports = Self => {
|
|||
}
|
||||
],
|
||||
http: {
|
||||
path: `/mark`,
|
||||
path: `/setPicked`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
Self.mark = async(ctx, saleFk, originalQuantity, code, isChecked, buyFk, isScanned, quantity, itemShelvingFk, options) => {
|
||||
Self.setPicked = async(ctx, saleFk, originalQuantity, code, isChecked, buyFk, isScanned, quantity, itemShelvingFk, options) => {
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
|
@ -1,5 +1,5 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
describe('saleTracking mark()', () => {
|
||||
describe('saleTracking setPicked()', () => {
|
||||
const saleFk = 1;
|
||||
const originalQuantity = 10;
|
||||
const code = 'PREPARED';
|
||||
|
@ -24,7 +24,7 @@ describe('saleTracking mark()', () => {
|
|||
const options = {transaction: tx};
|
||||
const code = 'FAKESTATE';
|
||||
try {
|
||||
await models.SaleTracking.mark(
|
||||
await models.SaleTracking.setPicked(
|
||||
ctx,
|
||||
saleFk,
|
||||
originalQuantity,
|
||||
|
@ -50,7 +50,7 @@ describe('saleTracking mark()', () => {
|
|||
const tx = await models.SaleTracking.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
try {
|
||||
await models.SaleTracking.mark(
|
||||
await models.SaleTracking.setPicked(
|
||||
ctx,
|
||||
saleFk,
|
||||
originalQuantity,
|
||||
|
@ -63,7 +63,7 @@ describe('saleTracking mark()', () => {
|
|||
options
|
||||
);
|
||||
|
||||
await models.SaleTracking.mark(
|
||||
await models.SaleTracking.setPicked(
|
||||
ctx,
|
||||
saleFk,
|
||||
originalQuantity,
|
||||
|
@ -89,7 +89,7 @@ describe('saleTracking mark()', () => {
|
|||
const options = {transaction: tx};
|
||||
try {
|
||||
const itemShelvingSaleBefore = await models.ItemShelvingSale.find({}, options);
|
||||
await models.SaleTracking.mark(
|
||||
await models.SaleTracking.setPicked(
|
||||
ctx,
|
||||
saleFk,
|
||||
originalQuantity,
|
|
@ -4,5 +4,5 @@ module.exports = Self => {
|
|||
require('../methods/sale-tracking/new')(Self);
|
||||
require('../methods/sale-tracking/delete')(Self);
|
||||
require('../methods/sale-tracking/updateTracking')(Self);
|
||||
require('../methods/sale-tracking/mark')(Self);
|
||||
require('../methods/sale-tracking/setPicked')(Self);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue