meemup-library 1.0.11 → 1.0.13

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.
Files changed (251) hide show
  1. package/lib/controllers/ApiController.d.ts +19 -0
  2. package/lib/controllers/ApiController.js +92 -0
  3. package/lib/controllers/DashboardController.d.ts +20 -0
  4. package/lib/controllers/DashboardController.js +150 -0
  5. package/lib/controllers/DateTimeController.d.ts +20 -0
  6. package/lib/controllers/DateTimeController.js +301 -0
  7. package/lib/controllers/LogController.d.ts +14 -0
  8. package/lib/controllers/LogController.js +99 -0
  9. package/lib/controllers/LogScreenController.d.ts +10 -0
  10. package/lib/controllers/LogScreenController.js +63 -0
  11. package/lib/controllers/MoneyController.d.ts +10 -0
  12. package/lib/controllers/MoneyController.js +40 -0
  13. package/lib/controllers/OrderScreenController.d.ts +14 -0
  14. package/lib/controllers/OrderScreenController.js +67 -0
  15. package/lib/controllers/PhoneController.d.ts +6 -0
  16. package/lib/controllers/PhoneController.js +35 -0
  17. package/lib/controllers/PrintContentController.d.ts +25 -0
  18. package/lib/controllers/PrintContentController.js +510 -0
  19. package/lib/controllers/ProductModalController.d.ts +36 -0
  20. package/lib/controllers/ProductModalController.js +440 -0
  21. package/lib/controllers/ToolController.d.ts +6 -0
  22. package/lib/controllers/ToolController.js +22 -0
  23. package/lib/controllers/ZoneController.d.ts +13 -0
  24. package/lib/controllers/ZoneController.js +22 -0
  25. package/lib/enums/EnumBasketStep.d.ts +5 -0
  26. package/lib/enums/EnumBasketStep.js +6 -0
  27. package/lib/enums/EnumCategoryAvailableIn.d.ts +7 -0
  28. package/lib/enums/EnumCategoryAvailableIn.js +8 -0
  29. package/lib/enums/EnumChannels.d.ts +9 -0
  30. package/lib/enums/EnumChannels.js +10 -0
  31. package/lib/enums/EnumDashboardSort.d.ts +7 -0
  32. package/lib/enums/EnumDashboardSort.js +8 -0
  33. package/lib/enums/EnumDiscountType.d.ts +6 -0
  34. package/lib/enums/EnumDiscountType.js +7 -0
  35. package/lib/enums/EnumFeeCalculationMode.d.ts +7 -0
  36. package/lib/enums/EnumFeeCalculationMode.js +8 -0
  37. package/lib/enums/EnumFeeType.d.ts +5 -0
  38. package/lib/enums/EnumFeeType.js +6 -0
  39. package/lib/enums/EnumGender.d.ts +6 -0
  40. package/lib/enums/EnumGender.js +7 -0
  41. package/lib/enums/EnumLogType.d.ts +7 -0
  42. package/lib/enums/EnumLogType.js +8 -0
  43. package/lib/enums/EnumNewOrderWarning.d.ts +6 -0
  44. package/lib/enums/EnumNewOrderWarning.js +7 -0
  45. package/lib/enums/EnumOpenCashDrawer.d.ts +5 -0
  46. package/lib/enums/EnumOpenCashDrawer.js +6 -0
  47. package/lib/enums/EnumOrderScreenTab.d.ts +6 -0
  48. package/lib/enums/EnumOrderScreenTab.js +7 -0
  49. package/lib/enums/EnumOrderState.d.ts +12 -0
  50. package/lib/enums/EnumOrderState.js +13 -0
  51. package/lib/enums/EnumOrderType.d.ts +6 -0
  52. package/lib/enums/EnumOrderType.js +7 -0
  53. package/lib/enums/EnumPaymentState.d.ts +6 -0
  54. package/lib/enums/EnumPaymentState.js +7 -0
  55. package/lib/enums/EnumPaymentType.d.ts +12 -0
  56. package/lib/enums/EnumPaymentType.js +13 -0
  57. package/lib/enums/EnumPizzaSide.d.ts +7 -0
  58. package/lib/enums/EnumPizzaSide.js +8 -0
  59. package/lib/enums/EnumPriceMidpointRounding.d.ts +13 -0
  60. package/lib/enums/EnumPriceMidpointRounding.js +56 -0
  61. package/lib/enums/EnumPrintCommand.d.ts +6 -0
  62. package/lib/enums/EnumPrintCommand.js +7 -0
  63. package/lib/enums/EnumProductAvailableMode.d.ts +8 -0
  64. package/lib/enums/EnumProductAvailableMode.js +9 -0
  65. package/lib/enums/EnumShowOrderMode.d.ts +6 -0
  66. package/lib/enums/EnumShowOrderMode.js +7 -0
  67. package/lib/enums/EnumSortMode.d.ts +5 -0
  68. package/lib/enums/EnumSortMode.js +6 -0
  69. package/lib/enums/EnumTipType.d.ts +6 -0
  70. package/lib/enums/EnumTipType.js +7 -0
  71. package/lib/index.d.ts +102 -0
  72. package/lib/index.js +102 -0
  73. package/lib/interfaces/IAccount.d.ts +12 -0
  74. package/lib/interfaces/IAccount.js +10 -0
  75. package/lib/interfaces/IAction.d.ts +6 -0
  76. package/lib/interfaces/IAction.js +1 -0
  77. package/lib/interfaces/IAllergicStuffs.d.ts +7 -0
  78. package/lib/interfaces/IAllergicStuffs.js +1 -0
  79. package/lib/interfaces/IAnswer.d.ts +9 -0
  80. package/lib/interfaces/IAnswer.js +7 -0
  81. package/lib/interfaces/IApiAllOrder.d.ts +7 -0
  82. package/lib/interfaces/IApiAllOrder.js +4 -0
  83. package/lib/interfaces/IApiEstimatedTimeBody.d.ts +6 -0
  84. package/lib/interfaces/IApiEstimatedTimeBody.js +1 -0
  85. package/lib/interfaces/IApiPayOnTerminalBody.d.ts +7 -0
  86. package/lib/interfaces/IApiPayOnTerminalBody.js +5 -0
  87. package/lib/interfaces/IApiShop.d.ts +32 -0
  88. package/lib/interfaces/IApiShop.js +22 -0
  89. package/lib/interfaces/ICalculateFeeResult.d.ts +6 -0
  90. package/lib/interfaces/ICalculateFeeResult.js +1 -0
  91. package/lib/interfaces/ICard.d.ts +9 -0
  92. package/lib/interfaces/ICard.js +1 -0
  93. package/lib/interfaces/ICategory.d.ts +31 -0
  94. package/lib/interfaces/ICategory.js +28 -0
  95. package/lib/interfaces/ICheckoutOption.d.ts +39 -0
  96. package/lib/interfaces/ICheckoutOption.js +36 -0
  97. package/lib/interfaces/ICompanyFee.d.ts +21 -0
  98. package/lib/interfaces/ICompanyFee.js +1 -0
  99. package/lib/interfaces/ICompanyInvoiceDetail.d.ts +14 -0
  100. package/lib/interfaces/ICompanyInvoiceDetail.js +1 -0
  101. package/lib/interfaces/IConfigTodayReport.d.ts +11 -0
  102. package/lib/interfaces/IConfigTodayReport.js +9 -0
  103. package/lib/interfaces/ICustomer.d.ts +12 -0
  104. package/lib/interfaces/ICustomer.js +15 -0
  105. package/lib/interfaces/ICustomerAddress.d.ts +17 -0
  106. package/lib/interfaces/ICustomerAddress.js +1 -0
  107. package/lib/interfaces/IDailyReportOtherData.d.ts +16 -0
  108. package/lib/interfaces/IDailyReportOtherData.js +1 -0
  109. package/lib/interfaces/IDashboardScreenState.d.ts +6 -0
  110. package/lib/interfaces/IDashboardScreenState.js +7 -0
  111. package/lib/interfaces/IExtra.d.ts +29 -0
  112. package/lib/interfaces/IExtra.js +1 -0
  113. package/lib/interfaces/IExtraItem.d.ts +18 -0
  114. package/lib/interfaces/IExtraItem.js +16 -0
  115. package/lib/interfaces/IGeneralInformation.d.ts +33 -0
  116. package/lib/interfaces/IGeneralInformation.js +43 -0
  117. package/lib/interfaces/IGeneralItems.d.ts +36 -0
  118. package/lib/interfaces/IGeneralItems.js +34 -0
  119. package/lib/interfaces/IKitchenScreenSetting.d.ts +8 -0
  120. package/lib/interfaces/IKitchenScreenSetting.js +6 -0
  121. package/lib/interfaces/ILocalSetting.d.ts +18 -0
  122. package/lib/interfaces/ILocalSetting.js +16 -0
  123. package/lib/interfaces/ILocation.d.ts +6 -0
  124. package/lib/interfaces/ILocation.js +4 -0
  125. package/lib/interfaces/ILog.d.ts +11 -0
  126. package/lib/interfaces/ILog.js +9 -0
  127. package/lib/interfaces/ILogin.d.ts +5 -0
  128. package/lib/interfaces/ILogin.js +1 -0
  129. package/lib/interfaces/IOnlineOrderItem.d.ts +33 -0
  130. package/lib/interfaces/IOnlineOrderItem.js +1 -0
  131. package/lib/interfaces/IOrderDetailOrderItem.d.ts +6 -0
  132. package/lib/interfaces/IOrderDetailOrderItem.js +1 -0
  133. package/lib/interfaces/IOrderScreenState.d.ts +11 -0
  134. package/lib/interfaces/IOrderScreenState.js +9 -0
  135. package/lib/interfaces/IOrderState.d.ts +6 -0
  136. package/lib/interfaces/IOrderState.js +1 -0
  137. package/lib/interfaces/IOrderTypeModal.d.ts +19 -0
  138. package/lib/interfaces/IOrderTypeModal.js +1 -0
  139. package/lib/interfaces/IPaymentStatusChanged.d.ts +8 -0
  140. package/lib/interfaces/IPaymentStatusChanged.js +5 -0
  141. package/lib/interfaces/IPreviuosOrder.d.ts +30 -0
  142. package/lib/interfaces/IPreviuosOrder.js +1 -0
  143. package/lib/interfaces/IPrintTemplate.d.ts +54 -0
  144. package/lib/interfaces/IPrintTemplate.js +53 -0
  145. package/lib/interfaces/IPrinterAndPrintCount.d.ts +5 -0
  146. package/lib/interfaces/IPrinterAndPrintCount.js +1 -0
  147. package/lib/interfaces/IProduct.d.ts +47 -0
  148. package/lib/interfaces/IProduct.js +1 -0
  149. package/lib/interfaces/IProductExtra.d.ts +16 -0
  150. package/lib/interfaces/IProductExtra.js +1 -0
  151. package/lib/interfaces/IProductModalState.d.ts +14 -0
  152. package/lib/interfaces/IProductModalState.js +10 -0
  153. package/lib/interfaces/ISaveOrder.d.ts +74 -0
  154. package/lib/interfaces/ISaveOrder.js +1 -0
  155. package/lib/interfaces/ISearchAddressDetail.d.ts +11 -0
  156. package/lib/interfaces/ISearchAddressDetail.js +1 -0
  157. package/lib/interfaces/ISelectedExtraItem.d.ts +7 -0
  158. package/lib/interfaces/ISelectedExtraItem.js +6 -0
  159. package/lib/interfaces/ISelectedProductExtra.d.ts +7 -0
  160. package/lib/interfaces/ISelectedProductExtra.js +4 -0
  161. package/lib/interfaces/ISetting.d.ts +31 -0
  162. package/lib/interfaces/ISetting.js +31 -0
  163. package/lib/interfaces/ISignalOrderChanged.d.ts +5 -0
  164. package/lib/interfaces/ISignalOrderChanged.js +1 -0
  165. package/lib/interfaces/ISpecificPayment.d.ts +8 -0
  166. package/lib/interfaces/ISpecificPayment.js +6 -0
  167. package/lib/interfaces/IStarMicronicPrintTask.d.ts +11 -0
  168. package/lib/interfaces/IStarMicronicPrintTask.js +1 -0
  169. package/lib/interfaces/IStarMicronicPrinter.d.ts +7 -0
  170. package/lib/interfaces/IStarMicronicPrinter.js +1 -0
  171. package/lib/interfaces/IStorageControler.d.ts +6 -0
  172. package/lib/interfaces/IStorageControler.js +1 -0
  173. package/lib/interfaces/IStore.d.ts +54 -0
  174. package/lib/interfaces/IStore.js +1 -0
  175. package/lib/interfaces/ISystem.d.ts +64 -0
  176. package/lib/interfaces/ISystem.js +58 -0
  177. package/lib/interfaces/ITask.d.ts +8 -0
  178. package/lib/interfaces/ITask.js +6 -0
  179. package/lib/interfaces/ITextValue.d.ts +5 -0
  180. package/lib/interfaces/ITextValue.js +1 -0
  181. package/lib/interfaces/ITodayOrderCount.d.ts +5 -0
  182. package/lib/interfaces/ITodayOrderCount.js +1 -0
  183. package/lib/interfaces/IUdpPacket.d.ts +7 -0
  184. package/lib/interfaces/IUdpPacket.js +5 -0
  185. package/lib/interfaces/IWebMessage.d.ts +5 -0
  186. package/lib/interfaces/IWebMessage.js +1 -0
  187. package/lib/interfaces/IWorkScreen.d.ts +10 -0
  188. package/lib/interfaces/IWorkScreen.js +7 -0
  189. package/lib/interfaces/IZone.d.ts +13 -0
  190. package/lib/interfaces/IZone.js +1 -0
  191. package/lib/interfaces/IZoneCost.d.ts +6 -0
  192. package/lib/interfaces/IZoneCost.js +1 -0
  193. package/lib/interfaces/agent/IPrintOrder.d.ts +10 -0
  194. package/lib/interfaces/agent/IPrintOrder.js +0 -0
  195. package/lib/interfaces/database/IDExtra.d.ts +14 -0
  196. package/lib/interfaces/database/IDExtra.js +1 -0
  197. package/lib/interfaces/database/IDExtraItem.d.ts +17 -0
  198. package/lib/interfaces/database/IDExtraItem.js +1 -0
  199. package/lib/interfaces/database/IDProduct.d.ts +48 -0
  200. package/lib/interfaces/database/IDProduct.js +1 -0
  201. package/lib/interfaces/database/IDProductDefaultExtra.d.ts +6 -0
  202. package/lib/interfaces/database/IDProductDefaultExtra.js +1 -0
  203. package/lib/interfaces/database/IDProductDefaultExtraItem.d.ts +7 -0
  204. package/lib/interfaces/database/IDProductDefaultExtraItem.js +1 -0
  205. package/lib/interfaces/database/IDProductExtra.d.ts +12 -0
  206. package/lib/interfaces/database/IDProductExtra.js +10 -0
  207. package/lib/interfaces/order/IOrder.d.ts +75 -0
  208. package/lib/interfaces/order/IOrder.js +82 -0
  209. package/lib/interfaces/order/IOrderExtraItem.d.ts +14 -0
  210. package/lib/interfaces/order/IOrderExtraItem.js +1 -0
  211. package/lib/interfaces/order/IOrderItem.d.ts +22 -0
  212. package/lib/interfaces/order/IOrderItem.js +1 -0
  213. package/lib/interfaces/print/IModifiedDetails.d.ts +7 -0
  214. package/lib/interfaces/print/IModifiedDetails.js +1 -0
  215. package/lib/interfaces/print/IModifiedDetailsItem.d.ts +6 -0
  216. package/lib/interfaces/print/IModifiedDetailsItem.js +1 -0
  217. package/lib/interfaces/print/IOrderDetailCustomer.d.ts +16 -0
  218. package/lib/interfaces/print/IOrderDetailCustomer.js +14 -0
  219. package/lib/interfaces/print/IOrderDetailDriver.d.ts +4 -0
  220. package/lib/interfaces/print/IOrderDetailDriver.js +1 -0
  221. package/lib/interfaces/print/IOrderDetailOrder.d.ts +50 -0
  222. package/lib/interfaces/print/IOrderDetailOrder.js +49 -0
  223. package/lib/interfaces/print/IOrderDetailPaymentInfo.d.ts +7 -0
  224. package/lib/interfaces/print/IOrderDetailPaymentInfo.js +1 -0
  225. package/lib/interfaces/print/IOrderDetailProduct.d.ts +17 -0
  226. package/lib/interfaces/print/IOrderDetailProduct.js +1 -0
  227. package/lib/interfaces/print/IOrderDetailProductsExtra.d.ts +14 -0
  228. package/lib/interfaces/print/IOrderDetailProductsExtra.js +1 -0
  229. package/lib/interfaces/print/IOrderDetails.d.ts +22 -0
  230. package/lib/interfaces/print/IOrderDetails.js +15 -0
  231. package/lib/regx/CreditCardRegx.d.ts +2 -0
  232. package/lib/regx/CreditCardRegx.js +3 -0
  233. package/lib/regx/DomainRegx.d.ts +2 -0
  234. package/lib/regx/DomainRegx.js +2 -0
  235. package/lib/regx/EmailRegx.d.ts +2 -0
  236. package/lib/regx/EmailRegx.js +2 -0
  237. package/lib/regx/MoneyRegx.d.ts +2 -0
  238. package/lib/regx/MoneyRegx.js +2 -0
  239. package/lib/regx/PhoneRegx.d.ts +2 -0
  240. package/lib/regx/PhoneRegx.js +3 -0
  241. package/lib/regx/PostalCodeRegx.d.ts +2 -0
  242. package/lib/regx/PostalCodeRegx.js +2 -0
  243. package/lib/statics.d.ts +6 -0
  244. package/lib/statics.js +8 -0
  245. package/lib/types/IOrderPayStatus.d.ts +1 -0
  246. package/lib/types/IOrderPayStatus.js +1 -0
  247. package/lib/types/TAnswer.d.ts +2 -0
  248. package/lib/types/TAnswer.js +1 -0
  249. package/lib/types/TBaseExtra.d.ts +3 -0
  250. package/lib/types/TBaseExtra.js +1 -0
  251. package/package.json +22 -24
@@ -0,0 +1,510 @@
1
+ import PhoneController from "./PhoneController";
2
+ export default new class {
3
+ constructor() {
4
+ this.createAddressText = (customer) => {
5
+ let text = "";
6
+ if (customer === null || customer === undefined)
7
+ return ["", ""];
8
+ if (customer.buzzer !== "") {
9
+ text += `buzzer ${customer.buzzer}, `;
10
+ }
11
+ if (customer.apartment !== "") {
12
+ text += `Apt ${customer.apartment}, `;
13
+ }
14
+ if (customer.houseNo !== "") {
15
+ text += `houseNo: ${customer.houseNo}, `;
16
+ }
17
+ if (customer.address !== "") {
18
+ if (customer.city === "")
19
+ text += `${customer.address} `;
20
+ else {
21
+ const address = customer.address
22
+ .split(customer.city)[0]
23
+ .split(customer.postalCode)[0];
24
+ text += `${address} `;
25
+ text += ` ${customer.city},`;
26
+ }
27
+ }
28
+ if (text === "")
29
+ return null;
30
+ if (text.substring(text.length - 1) === ",") {
31
+ text = text.substring(0, text.length - 1);
32
+ }
33
+ return [text, customer.postalCode];
34
+ };
35
+ this.ccyFormat = (num, pre = "") => {
36
+ return `${pre}${num.toFixed(2)}`;
37
+ };
38
+ this.calculatePaperSize = (paper, width) => {
39
+ switch (paper) {
40
+ case 1:
41
+ return width + "mm";
42
+ case 2:
43
+ return "210mm";
44
+ case 3:
45
+ return "148mm";
46
+ case 4:
47
+ return "105mm";
48
+ default:
49
+ return width + "mm";
50
+ }
51
+ };
52
+ this.sortProduct = (products, sortType) => {
53
+ const new_product = [];
54
+ if (sortType === 1) {
55
+ return products;
56
+ }
57
+ else if (sortType === 2) {
58
+ products.sort((a, b) => {
59
+ let nameA = a.title.toUpperCase(); // ignore upper and lowercase
60
+ let nameB = b.title.toUpperCase(); // ignore upper and lowercase
61
+ if (nameA < nameB) {
62
+ return -1;
63
+ }
64
+ if (nameA > nameB) {
65
+ return 1;
66
+ }
67
+ // names must be equal
68
+ return 0;
69
+ }).forEach((row) => new_product.push(row));
70
+ }
71
+ else if (sortType === 3) {
72
+ products.sort(function (a, b) {
73
+ let nameA = a.title.toUpperCase(); // ignore upper and lowercase
74
+ let nameB = b.title.toUpperCase(); // ignore upper and lowercase
75
+ if (nameA > nameB) {
76
+ return -1;
77
+ }
78
+ if (nameA < nameB) {
79
+ return 1;
80
+ }
81
+ // names must be equal
82
+ return 0;
83
+ }).forEach((row) => new_product.push(row));
84
+ }
85
+ else if (sortType === 4) {
86
+ products.sort((a, b) => a.totalAmount > b.totalAmount ? 1 : -1).forEach((row) => new_product.push(row));
87
+ }
88
+ else if (sortType === 5) {
89
+ products.sort((a, b) => a.totalAmount < b.totalAmount ? 1 : -1).forEach((row) => new_product.push(row));
90
+ }
91
+ return new_product;
92
+ };
93
+ this.filterByCategoryList = (products, catList, onlyListCategory, productList, onlyListProduct) => {
94
+ if (!onlyListCategory && !onlyListProduct) {
95
+ return products;
96
+ }
97
+ const new_product = [];
98
+ if (onlyListCategory && !onlyListProduct) {
99
+ products.filter(x => catList.find(element => element === x.categoryId)).forEach((row) => new_product.push(row));
100
+ }
101
+ else if (!onlyListCategory && onlyListProduct) {
102
+ products.filter(x => productList.find(element => element === x.productId)).forEach((row) => new_product.push(row));
103
+ }
104
+ else {
105
+ const arr = [];
106
+ products.filter(x => catList.find(element => element === x.categoryId)).forEach((row) => arr.push(row));
107
+ arr.filter(x => productList.find(element => element === x.productId)).forEach((row) => {
108
+ new_product.push(row);
109
+ });
110
+ }
111
+ return new_product;
112
+ };
113
+ }
114
+ sum(values) {
115
+ let sum = 0;
116
+ values.forEach(value => sum += value);
117
+ return sum;
118
+ }
119
+ convertTimeStringToDateByT(data = null) {
120
+ if (data instanceof Date) {
121
+ return data;
122
+ }
123
+ else if (typeof data === "string" && data.length > 0) {
124
+ try {
125
+ const time_ = data.split("T");
126
+ const parts = time_[1].split(":");
127
+ let dd = new Date();
128
+ dd.setHours(isNaN(Number(parts[0])) ? 0 : Number(parts[0]));
129
+ dd.setMinutes(isNaN(Number(parts[1])) ? 0 : Number(parts[1]));
130
+ dd.setSeconds(isNaN(Number(parts[2])) ? 0 : Number(parts[2]));
131
+ return dd;
132
+ }
133
+ catch (e) {
134
+ return null;
135
+ }
136
+ }
137
+ else {
138
+ return null;
139
+ }
140
+ }
141
+ formatAMPMDate(date) {
142
+ let datetime = this.convertTimeStringToDateByT(date);
143
+ if (datetime instanceof Date) {
144
+ let hours = datetime.getHours();
145
+ let minutes = datetime.getMinutes();
146
+ let ampm = hours >= 12 ? "PM" : "AM";
147
+ hours = hours % 12;
148
+ hours = hours ? hours : 12;
149
+ minutes = minutes < 10 ? "0" + minutes : minutes;
150
+ return (hours < 10 ? "0" + hours : hours) + ":" + minutes + " " + ampm;
151
+ }
152
+ else {
153
+ return "";
154
+ }
155
+ }
156
+ formatDateTime(dateTime, mode = "full") {
157
+ try {
158
+ let dt = Date.parse(dateTime);
159
+ let time_ = this.formatAMPMDate(dateTime);
160
+ if (mode !== "full") {
161
+ return time_;
162
+ }
163
+ return (new Intl.DateTimeFormat("en-GB", {
164
+ weekday: "short",
165
+ year: "2-digit",
166
+ month: "short",
167
+ day: "2-digit"
168
+ // hour: "2-digit",
169
+ // minute: "2-digit"
170
+ }).format(dt ? dt : Date.now()) +
171
+ " " +
172
+ time_);
173
+ }
174
+ catch (e) {
175
+ return dateTime;
176
+ }
177
+ }
178
+ weekDayName(date) {
179
+ const days = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
180
+ try {
181
+ return days[new Date(date).getDay()];
182
+ }
183
+ catch (e) {
184
+ return days[0];
185
+ }
186
+ }
187
+ formatDate(date) {
188
+ let d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear();
189
+ if (month.length < 2)
190
+ month = "0" + month;
191
+ if (day.length < 2)
192
+ day = "0" + day;
193
+ return [year, month, day].join("-");
194
+ }
195
+ substring(value, start, end) {
196
+ try {
197
+ if (!value)
198
+ return "";
199
+ return value.substring(start, end);
200
+ }
201
+ catch (e) {
202
+ return "";
203
+ }
204
+ }
205
+ defaultLayout(account, detail, template, symbol = "$") {
206
+ var _a, _b;
207
+ const { rootUrl } = account;
208
+ const { order, company, customer, products, paymentInfo } = detail;
209
+ const { printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts, customerAddressFontSize, showCustomerInfo, orderInfo, showPrices, textAfterAddress, textAfterAddressCenter, nameAddressShow, nameAddressCenter, font, fontSize, marginBottom, marginLeft, marginRight, marginTop, logoAvailable, logoCenter, logoUrl, sortProducts, textBeforeProducts, textBeforeProductsCenter, customerOnlinePaymentAgrementSection, id, promotionCodeNote, promotionId, qrCodeOrderDetails, showCategoryTitle, showProductKitchenName, textEnd, textEndCenter, width, paper } = template;
210
+ const address = this.createAddressText(customer);
211
+ return (`
212
+ <div style="font-family: ${font}; font-weight: 500; font-size: ${fontSize + "px"}; min-width: ${this.calculatePaperSize(paper, width)}; width: ${this.calculatePaperSize(paper, width)}; padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
213
+ <img alt="" style=" display : ${logoAvailable ? "block" : "none"}; margin : ${logoCenter ? "auto" : "0"}; width: 200px; min-height : 50px;" src="${rootUrl}${company.id}/${logoUrl}" />
214
+ <p style=" margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
215
+ ${company.title}
216
+ </p>
217
+ <p style="margin:5px 0; display:${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
218
+ ${company.address}
219
+ </p>
220
+ <p style="margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
221
+ ${PhoneController.formatPhoneNumber(company.phone)}
222
+ </p>
223
+ <p style="margin: 5px 0; line-height: 1; display: ${textAfterAddress ? "block" : "none"}; text-align:${textAfterAddressCenter ? "center" : "start"};">
224
+ ${textAfterAddress}
225
+ </p>
226
+
227
+ <div style=" display:${order.orderTypeString ? "flex" : "none"}; flex-direction: column; align-items: center; justify-content: center; margin: 8px 0;" >
228
+
229
+ <p style=" font-size: x-large; font-weight: bold; text-align: center;line-height: 0.7; margin: 5px 0;"> #${order.orderNumber}&nbsp;&nbsp;&nbsp;${order.orderTypeString} </p>
230
+
231
+ <strong style="font-size: x-large; text-align: center;">
232
+ &#9201;${order.asSoonAsPossible && "ASAP"}&nbsp;${this.formatDateTime(order.desiredDate, "time")}
233
+ </strong>
234
+
235
+ ${order.estimatedTime ? `<strong style="display:block; font-size:x-large; text-align:center;">Est. Time ${this.substring(order.estimatedTime, 0, order.estimatedTime.length - 3)}</strong>` : ""}
236
+ </div>
237
+
238
+
239
+ <div style="display: ${showPrices ? "block" : "none"}; border-top: 1px solid black;">
240
+ <strong style="display : block; margin: 5px 0; line-height: 1;">PAY INFORMATION: </strong>
241
+ <strong style="font-size: large; margin: 0 0 16px 0; line-height: 1.5;">${order.paymentTypeString + (order.paymentType === 2 ? `: ${this.ccyFormat(order.totalAmount, symbol)} ` : " ") + " - " + order.paymentStateString}</strong>
242
+
243
+ <p style="margin: 5px 0; line-height: 1; display: ${order.paymentType === 1 ? "block" : "none"};">Credit Card : <strong>**** **** **** ${order.lastFourDigits}</strong></p>
244
+
245
+ </div>
246
+
247
+ <p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;"> Order number : <strong>#${order.orderNumber}</strong> </p>
248
+ <p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;">
249
+ ${order.orderTypeString}:<span style="font-size: x-large;">&#9201;</span><strong>on ${this.formatDateTime(order.desiredDate)}</strong>
250
+ </p>
251
+
252
+ ${order.estimatedTime ? `<p style="display: block; margin: 5px 0; line-height: 1;">Estimated Time : <strong>${(_a = order.estimatedTime) === null || _a === void 0 ? void 0 : _a.substring(0, order.estimatedTime.length - 3)}</strong></p>` : ""}
253
+
254
+ <p style="display:block; margin: 5px 0; line-height: 1;">Reg. Date:<strong>${this.formatDateTime(order.registrationDate)}</strong> </p>
255
+
256
+ <div style="border-top: 1px solid black;">
257
+
258
+ <div style="display:${showCustomerInfo ? "block" : "none"}">
259
+
260
+ <strong style="display:block; margin: 5px 0; line-height: 1;"> CUSTOMER DATA : </strong>
261
+ <p style="display:${customer.fullName ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.fullName}</p>
262
+ <p style="display:${customer.phoneNumber ? "block" : "none"}; margin: 5px 0; line-height: 1;">${PhoneController.formatPhoneNumber(customer.phoneNumber)}</p>
263
+ <p style="display:${address ? "block" : "none"}; font-size: ${customerAddressFontSize + "px"}; margin: 5px 0; line-height: 1;">
264
+ ${address !== null ? address[0] : null}
265
+ <br/>
266
+ ${address !== null ? address[1] : null}
267
+ </p>
268
+ <p style="display:${customer.email ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.email}</p>
269
+
270
+ </div>
271
+
272
+ <strong style="display:block; font-size: ${(fontSize * 1.2).toFixed(0) + "px"}; margin: 10px 0; line-height: 1;">
273
+ ${this.sum(this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => row.quantity))} ITEM
274
+ </strong>
275
+
276
+ <p style="display:${textBeforeProducts ? "block" : "none"}; margin: 5px 0; padding-left : 15px; text-align : ${textBeforeProductsCenter ? "center" : "start"}; line-height: 1;"> ${textBeforeProducts} </p>
277
+
278
+ </div>
279
+
280
+ <div style="border-top : 1px solid black;">
281
+
282
+ <div style="padding : 4px 1px; display : flex; flex-direction : row; border-bottom : 1px solid black; font-weight : bold;">
283
+
284
+ <div style="width : 40px; min-width : 40px; max-width : 40px;">#</div>
285
+ <div style="flex-wrap : wrap; word-wrap : break-word;">Products</div>
286
+ <div style="flex-grow : 1; text-align: end;">Price</div>
287
+
288
+ </div>
289
+
290
+
291
+ ${this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => (`<div style="border-bottom : 1px solid black; padding : 0 1px; display : flex; flex-direction : row; justify-content : flex-end;">
292
+
293
+ <div style="width : 40px; min-width : 40px; max-width : 40px">${row.quantity}X</div>
294
+
295
+ <div style="flex-wrap : wrap; word-wrap : break-word; text-align : left;">
296
+
297
+ ${(showCategoryTitle && row.categoryTitle !== "" && row.categoryTitle !== null) ? "[" + row.categoryTitle + "]" : ""} ${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
298
+ ${row.extrasNames ? row.extrasNames.split(" , ").map(i => `<div>+${i}</div>`).join("") : ""}
299
+ ${row.note ? `<div><span style="font-size: x-large;">&#128488;</span>{note}</div>` : ""}
300
+
301
+ </div>
302
+
303
+ <div style="flex-grow : 1; text-align : right;">${this.ccyFormat(row.totalAmount, symbol)}</div>
304
+ </div>`)).join("")}
305
+
306
+ <div style="display : ${showPrices ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
307
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">Order Amount :</div>
308
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.orderAmount, symbol)}</div>
309
+ </div>
310
+
311
+ <div style="display : ${order.orderType === 1 && order.deliveryCosts > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
312
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">Delivery costs : </div>
313
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.deliveryCosts, symbol)}</div>
314
+ </div>
315
+
316
+ <div style="display : ${order.discountAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
317
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">Discount : </div>
318
+ <div style="min-width : 100px; text-align: end;">${(order.discountAmount > 0 ? "- " : "") + this.ccyFormat(order.discountAmount, symbol)}</div>
319
+ </div>
320
+
321
+ <div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
322
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">Subtotal : </div>
323
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.subtotalAmount, symbol)}</div>
324
+ </div>
325
+
326
+ <div style="display : ${order.hstAmount > 0 && order.serviceFee < 1 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
327
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">HST(${this.ccyFormat(order.hstPercentage)}%) : </div>
328
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.hstAmount, symbol)}</div>
329
+ </div>
330
+
331
+ <div style="display : ${order.tipAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
332
+ <div style="min-width : 150px; flex-grow : 1; text-align: end;">Tip : </div>
333
+ <div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.tipAmount, symbol)}</div>
334
+ </div>
335
+
336
+ <div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px solid black;">
337
+ <strong style="min-width : 150px; flex-grow : 1; font-size: larger; text-align: end;">${order.paymentType === 1 ? "Total" : "Total & Still to pay"} : </strong>
338
+ <strong style="min-width : 100px; font-size: larger; text-align: end;">${this.ccyFormat(order.totalAmount, symbol)}</strong>
339
+ </div>
340
+
341
+ </div>
342
+
343
+ <div class="border-top : 1px solid black;">
344
+ <div style="margin : 5px 0; line-height: 1;">
345
+ <strong>Remarks customer:</strong>
346
+ <em style="display : ${!order.remarks ? "initial" : "none"}">There are no remarks</em>
347
+ </div>
348
+ <strong style="display : ${order.remarks ? "block" : "none"};">${order.remarks}</strong>
349
+ </div>
350
+
351
+ <div style="display : ${order.paymentType === 1 && customerOnlinePaymentAgrementSection ? "block" : "none"}; border-top : 1px solid black; text-align : center;">
352
+
353
+ <p style="margin : 5px 0; line-height: 1;"><strong>CREDIT CARD : </strong>**** **** **** ${order.lastFourDigits}</p>
354
+
355
+ <strong style="margin : 5px 0; line-height: 1;">
356
+ I agree to pay above total amount according to card issuer agreement
357
+ </strong>
358
+ <br/>
359
+ <br/>
360
+ <strong style="margin : 5px 0; line-height: 1;">SIGNATURE</strong>
361
+ </div>
362
+
363
+ <div style="display : ${promotionId ? "block" : "none"}; border-top : 1px solid black; margin : 5px 0; line-height: 1; text-align : ${textEndCenter ? "center" : "start"}">
364
+ ${promotionCodeNote}
365
+ </div>
366
+
367
+ <div style="margin : 0 16px; display : ${(paymentInfo !== null && order.paymentType === 8 && ((_b = paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata) === null || _b === void 0 ? void 0 : _b.length) > 0) ? "block" : "none"};">
368
+ ${paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata.map((item) => (`<div style="display : flex; flex-direction : row; align-items : center; justify-content : flex-start; margin-bottom : 8px;">
369
+ <strong style="margin : 0 16px 0 0; line-height: 1;"> ${item.text} </strong>
370
+ <strong style="margin : 0 16px 0 0; line-height: 1;" > ${item.value}</strong>
371
+ </div>`))}
372
+ </div>
373
+
374
+ <div style="display : ${qrCodeOrderDetails ? "flex" : "none"}; justify-content: center; align-items: center; border-top : 1px solid black; border-bottom : 1px solid black;">
375
+ <img alt="" style="width: 100px; height: 100px; margin: auto;" src="${order.qrCodeDetailUrl}" />
376
+ </div>
377
+
378
+ <p style="display : ${textEnd ? "block" : "none"}; text-align : ${textEndCenter ? "center" : "start"}; line-height: 1; margin-top: 4px;">${textEnd}</p>
379
+
380
+ <strong style="display: block; font-size : x-small; text-align : center; margin-top: 4px; ">fs-${company.id}-${order.id}-${id}</strong>
381
+
382
+
383
+ </div>
384
+ `);
385
+ }
386
+ labelLayout(detail, template) {
387
+ const { products, customer, order } = detail;
388
+ const { orderSummary } = template;
389
+ const { font, fontSize, marginBottom, marginLeft, marginRight, marginTop, showCategoryTitle, showProductKitchenName, width, paper } = template;
390
+ return (`
391
+ <div style="font-family : ${font};font-weight : normal;">
392
+ ${products.map((row) => (`<div>
393
+ <div
394
+ style="
395
+ display: block;
396
+ min-width: ${this.calculatePaperSize(paper, width)};
397
+ width: ${this.calculatePaperSize(paper, width)};
398
+ padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
399
+
400
+ ${orderSummary ?
401
+ `<p style="font-size:${fontSize - 2};">
402
+ #${order.orderNumber}&nbsp;&nbsp;- &nbsp;&nbsp;
403
+ ${order.orderTypeString}
404
+ </p>` : ""}
405
+
406
+ ${orderSummary ?
407
+ `<p style="font-size:${fontSize - 4};">
408
+ ${this.weekDayName(order.desiredDate)},&nbsp;
409
+ ${this.formatDate(order.desiredDate)}
410
+ &nbsp;&nbsp;&nbsp;
411
+ ${this.formatAMPMDate(order.desiredDate)}
412
+ </p>` : ""}
413
+
414
+ <p style="font-size:${fontSize - 2}; border-bottom : ${orderSummary ? "2px" : "0px"} dotted black; padding-bottom : 5px margin-bottom : 5px;">
415
+ ${customer.fullName}
416
+ </p>
417
+
418
+
419
+ <p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
420
+ ${row.quantity}X &nbsp;
421
+ ${showCategoryTitle && row.categoryTitle ? "[" + row.categoryTitle.toUpperCase() + "]" : ""}
422
+ ${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
423
+ ${row.extrasNames !== "" && `<div>${row.extrasNames}</div>`}
424
+ </p>
425
+
426
+
427
+ ${row.note !== "" ?
428
+ `<p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
429
+ ${row.note}
430
+ </p>` : ""}
431
+
432
+ </div>
433
+
434
+ <div style="clear: both; page-break-after: always;" ></div>
435
+ </div>
436
+ `)).join("")}
437
+ </div>
438
+
439
+ `);
440
+ }
441
+ paymentFailed(detail, currency) {
442
+ var _a, _b, _c;
443
+ return `<div style="padding-top: 16px; padding-bottom: 16px;">
444
+ <div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
445
+ <img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
446
+ style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
447
+ </div>
448
+ <div
449
+ style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 10%; margin-right: 10%; margin-top: 16px; padding-left: 16px; padding-right: 16px;">
450
+ <strong style="font-size: 18px;">AMOUNT</strong>
451
+ <strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
452
+ </div>
453
+ <div
454
+ style="display: flex; flex-direction: row; align-items: center; justify-content: center; border-bottom: 2px solid black; margin-left: 10%; margin-right: 10%; padding: 16px;">
455
+ <strong style="font-size: 18px; padding-right: 16px;"></strong>
456
+ <strong style="font-size: 18px;">#0</strong>
457
+ </div>
458
+ <div
459
+ style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
460
+ <strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
461
+ <p style="font-size: 12px; font-weight: bold; margin-top: 8px; padding-bottom: 16px;">${(_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.message}</p>
462
+ </div>
463
+ <div style="margin-left: 16px; margin-right: 16px;">
464
+ ${(_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata.map(i => (`<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 8px;">
465
+ <strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
466
+ <strong style="font-size: 12px;">${i.value}</strong>
467
+ </div>`))}
468
+
469
+ </div>
470
+ </div>`;
471
+ }
472
+ packageLabel(detail) {
473
+ return `<div style="padding: 16px;">
474
+ <div
475
+ style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 2px solid black;">
476
+ <strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
477
+ <strong style="font-size: 22px;">${detail.order.orderNumber}</strong>
478
+ </div>
479
+ <div style="border-bottom: 2px solid black; padding-top: 8px; padding-bottom: 8px;">
480
+ ${detail.products.map((i) => (`<strong style="font-size: 16px; padding-top: 2px; padding-bottom: 2px;">${i.quantity}X ${i.title}</strong>`))}
481
+ </div>
482
+ <div
483
+ style="margin-top: 16px; margin-bottom: 16px; padding-bottom: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 2px solid black;">
484
+ <strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
485
+ <strong style="font-size: 42px;">${detail.order.orderNumber}</strong>
486
+ <strong style="font-size: 16px;">${detail.customer.fullName}</strong>
487
+ </div>
488
+ <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 16px; margin-left: 10%; margin-right: 10%;">
489
+ <strong style="font-size: 16px;">${detail.order.desiredDate}</strong>
490
+ <div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
491
+ <img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
492
+ style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
493
+ </div>
494
+ </div>
495
+ </div>`;
496
+ }
497
+ preview(account, detail, template, symbol = "$") {
498
+ switch (template.layout) {
499
+ case 2:
500
+ return this.defaultLayout(account, detail, template, symbol);
501
+ case 4:
502
+ const products = this.filterByCategoryList(this.sortProduct(detail.products, template.sortProducts), template.printOnlyCertainCategoriesList, template.printOnlyCertainCategories, template.printOnlyCertainProductsList, template.printOnlyCertainProducts);
503
+ if (products.length === 0)
504
+ return `<div>no product </div>`;
505
+ return this.labelLayout(detail, template);
506
+ default:
507
+ return `<div> template.layout : ${template.layout}</div>`;
508
+ }
509
+ }
510
+ }();
@@ -0,0 +1,36 @@
1
+ import EnumOrderType from "../enums/EnumOrderType";
2
+ import IExtra from "../interfaces/IExtra";
3
+ import ISelectedExtraItem from "../interfaces/ISelectedExtraItem";
4
+ import ISelectedProductExtra from "../interfaces/ISelectedProductExtra";
5
+ import ITextValue from "../interfaces/ITextValue";
6
+ import IDExtraItem from "../interfaces/database/IDExtraItem";
7
+ import IDExtra from "../interfaces/database/IDExtra";
8
+ import { TBaseExtra } from "../types/TBaseExtra";
9
+ import IOrderItem from "../interfaces/order/IOrderItem";
10
+ import IDProduct from "../interfaces/database/IDProduct";
11
+ import IProduct from "../interfaces/IProduct";
12
+ import IDProductExtra from "../interfaces/database/IDProductExtra";
13
+ declare const _default: {
14
+ getExtraSelectedItems(list: ISelectedProductExtra[], extraId: number): ISelectedExtraItem[];
15
+ canAddToBasket(product: IDProduct, selected: ISelectedProductExtra[], extras: IDExtra[]): boolean;
16
+ productModalToBasketItem(product: IDProduct, selectedExtraList: ISelectedProductExtra[], extras: IDExtra[], count: number, price: number, note: string): IOrderItem;
17
+ productName(product: IDProduct | IProduct): string;
18
+ productImage(product: IDProduct | IProduct): string;
19
+ productPrice(product: IDProduct | IProduct, orderType: EnumOrderType): number;
20
+ baseItem(list: ISelectedProductExtra[], extraList: IDExtra[]): TBaseExtra;
21
+ defaultExtraOfProductToSelectedExtras(product: IDProduct, extras: IDExtra[]): ISelectedProductExtra[];
22
+ defaultExtraOfProductToBasketItem(product: IDProduct, extras: IDExtra[], orderType: EnumOrderType): IOrderItem;
23
+ singleSelectExtraItemPrice: (extra: IExtra, base: TBaseExtra, item: IDExtraItem) => number;
24
+ multiSelectExtraPrice: (extra: IDExtra, base: TBaseExtra, item: IDExtraItem, selectedList?: ISelectedExtraItem[]) => number;
25
+ multiSelectExtraItemOptions(item: IDExtraItem, max: number, selectedList: ISelectedExtraItem[]): ITextValue[];
26
+ scaleSum(array?: ISelectedExtraItem[]): number;
27
+ calculatePrice(orderType: EnumOrderType, product: any, list: ISelectedProductExtra[], base: TBaseExtra, extraList: IDExtra[]): number;
28
+ plusString(first: string, second: string): string;
29
+ getValidateExtras(extras: IDProductExtra[], extraSelected: ISelectedProductExtra[]): IDProductExtra[];
30
+ getProductExtras(pExtras: IDProductExtra[], sExtras: ISelectedProductExtra[], extras: IDExtra[]): IDExtra[];
31
+ quantitySum(array?: ISelectedExtraItem[]): number;
32
+ productMinAndMaxOptions(product: IDProduct): ITextValue[];
33
+ sortByKey(array: any[], key: string, conditionForSort?: boolean): any[];
34
+ extraItemsSortAction: (a: IDExtraItem, b: IDExtraItem) => 0 | 1 | -1;
35
+ };
36
+ export default _default;