refactoring: sales receipts service.

This commit is contained in:
Ahmed Bouhuolia
2020-10-24 20:17:46 +02:00
parent 5e139e9b54
commit da448f445c
6 changed files with 174 additions and 211 deletions

View File

@@ -12,6 +12,7 @@ const ERRORS = {
ITEMS_NOT_FOUND: 'ITEMS_NOT_FOUND',
ENTRIES_IDS_NOT_FOUND: 'ENTRIES_IDS_NOT_FOUND',
NOT_PURCHASE_ABLE_ITEMS: 'NOT_PURCHASE_ABLE_ITEMS',
NOT_SELL_ABLE_ITEMS: 'NOT_SELL_ABLE_ITEMS'
};
@Service()
@@ -98,7 +99,7 @@ export default class ItemsEntriesService {
const nonSellableItems = difference(itemsIds, sellableItemsIds);
if (nonSellableItems.length > 0) {
throw new ServiceError(ERRORS.NOT_PURCHASE_ABLE_ITEMS);
throw new ServiceError(ERRORS.NOT_SELL_ABLE_ITEMS);
}
}
}