@open-tender/utils 0.4.15 → 0.4.17
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.
|
@@ -44,19 +44,19 @@ const makeDiscountServiceType = (serviceType) => {
|
|
|
44
44
|
case 'DELIVERY':
|
|
45
45
|
return 'Delivery only';
|
|
46
46
|
default:
|
|
47
|
-
return
|
|
47
|
+
return '';
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const makeDiscountOrderType = (orderType) => {
|
|
51
51
|
switch (orderType) {
|
|
52
52
|
case 'OLO':
|
|
53
|
-
return
|
|
53
|
+
return '';
|
|
54
54
|
case 'CATERING':
|
|
55
55
|
return 'Catering only';
|
|
56
56
|
case 'MERCH':
|
|
57
57
|
return 'Merch only';
|
|
58
58
|
default:
|
|
59
|
-
return
|
|
59
|
+
return '';
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const makeChannelType = (channelType) => {
|
|
@@ -70,7 +70,7 @@ const makeChannelType = (channelType) => {
|
|
|
70
70
|
case 'KIOSK':
|
|
71
71
|
return 'Kiosk Only!';
|
|
72
72
|
default:
|
|
73
|
-
return
|
|
73
|
+
return '';
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
const makeLimitations = (item) => {
|
|
@@ -78,15 +78,15 @@ const makeLimitations = (item) => {
|
|
|
78
78
|
const serviceType = makeDiscountServiceType(service_type);
|
|
79
79
|
const orderType = makeDiscountOrderType(order_type);
|
|
80
80
|
const channelType = channel_type && makeChannelType(channel_type);
|
|
81
|
-
const comma = serviceType && orderType ? ', ' :
|
|
82
|
-
const dash = (serviceType || orderType) && channelType ? ' - ' :
|
|
81
|
+
const comma = serviceType && orderType ? ', ' : '';
|
|
82
|
+
const dash = (serviceType || orderType) && channelType ? ' - ' : '';
|
|
83
83
|
if (serviceType || orderType || channelType) {
|
|
84
84
|
return `
|
|
85
|
-
${serviceType}
|
|
85
|
+
${serviceType || ''}
|
|
86
86
|
${comma}
|
|
87
|
-
${orderType}
|
|
87
|
+
${orderType || ''}
|
|
88
88
|
${dash}
|
|
89
|
-
${channelType}
|
|
89
|
+
${channelType || ''}
|
|
90
90
|
`;
|
|
91
91
|
}
|
|
92
92
|
return 'Valid on all online & app orders';
|
|
@@ -40,19 +40,19 @@ const makeDiscountServiceType = (serviceType) => {
|
|
|
40
40
|
case 'DELIVERY':
|
|
41
41
|
return 'Delivery only';
|
|
42
42
|
default:
|
|
43
|
-
return
|
|
43
|
+
return '';
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
const makeDiscountOrderType = (orderType) => {
|
|
47
47
|
switch (orderType) {
|
|
48
48
|
case 'OLO':
|
|
49
|
-
return
|
|
49
|
+
return '';
|
|
50
50
|
case 'CATERING':
|
|
51
51
|
return 'Catering only';
|
|
52
52
|
case 'MERCH':
|
|
53
53
|
return 'Merch only';
|
|
54
54
|
default:
|
|
55
|
-
return
|
|
55
|
+
return '';
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
const makeChannelType = (channelType) => {
|
|
@@ -66,7 +66,7 @@ const makeChannelType = (channelType) => {
|
|
|
66
66
|
case 'KIOSK':
|
|
67
67
|
return 'Kiosk Only!';
|
|
68
68
|
default:
|
|
69
|
-
return
|
|
69
|
+
return '';
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
export const makeLimitations = (item) => {
|
|
@@ -74,15 +74,15 @@ export const makeLimitations = (item) => {
|
|
|
74
74
|
const serviceType = makeDiscountServiceType(service_type);
|
|
75
75
|
const orderType = makeDiscountOrderType(order_type);
|
|
76
76
|
const channelType = channel_type && makeChannelType(channel_type);
|
|
77
|
-
const comma = serviceType && orderType ? ', ' :
|
|
78
|
-
const dash = (serviceType || orderType) && channelType ? ' - ' :
|
|
77
|
+
const comma = serviceType && orderType ? ', ' : '';
|
|
78
|
+
const dash = (serviceType || orderType) && channelType ? ' - ' : '';
|
|
79
79
|
if (serviceType || orderType || channelType) {
|
|
80
80
|
return `
|
|
81
|
-
${serviceType}
|
|
81
|
+
${serviceType || ''}
|
|
82
82
|
${comma}
|
|
83
|
-
${orderType}
|
|
83
|
+
${orderType || ''}
|
|
84
84
|
${dash}
|
|
85
|
-
${channelType}
|
|
85
|
+
${channelType || ''}
|
|
86
86
|
`;
|
|
87
87
|
}
|
|
88
88
|
return 'Valid on all online & app orders';
|
package/package.json
CHANGED