3570-feat(setQuantitySale): back route and test #869
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#869
Loading…
Reference in New Issue
No description provided.
Delete Branch "3558-setQuantitySale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: 3570-feat(setQuantitySale): back route and testto 3570-feat(setQuantitySale): back route and test3570-feat(setQuantitySale): back route and testto WIP: 3570-feat(setQuantitySale): back route and testWIP: 3570-feat(setQuantitySale): back route and testto 3570-feat(setQuantitySale): back route and test@ -0,0 +1,55 @@
module.exports = Self => {
Self.remoteMethodCtx('setQuantitySale', {
This should be called setSaleQuantity
@ -0,0 +34,4 @@
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
No need to create a new transaction for a single modification
@ -0,0 +39,4 @@
myOptions.transaction = tx;
}
try {
Try-catch block not needed
@ -0,0 +15,4 @@
}
};
const originalSale = await models.Sale.findById(30, null, options);
Should use the saleId constant instead of "30"
@ -0,0 +18,4 @@
const originalSale = await models.Sale.findById(30, null, options);
await models.Collection.setQuantitySale(ctx, options);
const updateSale = await models.Sale.findById(30, null, options);
Should use the saleId constant instead of "30"
"isWithoutNegatives" is generated only when passing the e2e