@darkpos/pricing 1.0.51 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +0,0 @@
1
- module.exports = ({ modifierActions, _, settings }) =>
2
- function getItemModifiersDescription(item) {
3
- const groupModifiers =
4
- settings && settings.order && settings.order.groupModifiers;
5
- if (!item || !Array.isArray(item.modifiers)) return [];
6
- let description = item.modifiers
7
- .filter(
8
- each =>
9
- !modifierActions.isHidden(each) &&
10
- modifierActions.isValid(each) &&
11
- !modifierActions.isAmountOverride(each) &&
12
- !modifierActions.isDepartment(each) &&
13
- modifierActions.isDirect(each) &&
14
- !modifierActions.isGroup(each)
15
- )
16
- .map(modifier => {
17
- const { name, _id, compute = {} } = modifier;
18
- let label = name;
19
- if (modifierActions.isGroupOfValues(modifier))
20
- label = modifierActions.getSelectedValues(modifier) || label;
21
- const selectedOverrideOptions = _.get(
22
- modifier,
23
- 'properties.override.selected'
24
- );
25
- if (
26
- modifier &&
27
- !modifier.included &&
28
- modifier._computed &&
29
- modifier._computed.description
30
- ) {
31
- label = modifier._computed.description;
32
- }
33
-
34
- const modifierValue = {
35
- label,
36
- value: _id,
37
- data: modifier,
38
- quantity: 1,
39
- };
40
-
41
- if (selectedOverrideOptions) {
42
- modifierValue.label = `${name} ${compute.amount} ${selectedOverrideOptions.selectedUnit}`;
43
- modifierValue.quantity = 0;
44
- }
45
- return modifierValue;
46
- });
47
- if (groupModifiers) {
48
- description = modifierActions.getGroupedModifiers(description);
49
- }
50
-
51
- const descriptions = modifierActions.getNotesToModifierTags({
52
- notes: item.notes,
53
- modifierTags: description,
54
- });
55
- return descriptions;
56
- };
@@ -1,8 +0,0 @@
1
- module.exports = ({ constants }) => {
2
- const { Modifier } = constants;
3
- return function isComputedOverride(modifier) {
4
- const computeAction =
5
- modifier && modifier.compute && modifier.compute.action;
6
- return computeAction === Modifier.Attributes.OVERRIDE;
7
- };
8
- };