addio-admin-sdk 1.7.85 → 1.7.87

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 (563) hide show
  1. package/.babelrc +17 -17
  2. package/.env +14 -0
  3. package/.env.dev +14 -14
  4. package/.github/workflows/publish_coverage.yam_ +69 -69
  5. package/addio-sdk-doc.md +1473 -1473
  6. package/changelog.md +537 -537
  7. package/dist/Interfaces/Address/index.d.ts +21 -21
  8. package/dist/Interfaces/Address/index.js +16 -16
  9. package/dist/Interfaces/Algolia/index.d.ts +164 -164
  10. package/dist/Interfaces/Algolia/index.js +2 -2
  11. package/dist/Interfaces/Attachement/index.d.ts +5 -5
  12. package/dist/Interfaces/Attachement/index.js +2 -2
  13. package/dist/Interfaces/Attribute/index.d.ts +52 -52
  14. package/dist/Interfaces/Attribute/index.js +10 -10
  15. package/dist/Interfaces/BGJob/index.d.ts +56 -56
  16. package/dist/Interfaces/BGJob/index.js +25 -25
  17. package/dist/Interfaces/BaseClass/index.d.ts +8 -8
  18. package/dist/Interfaces/BaseClass/index.js +2 -2
  19. package/dist/Interfaces/Blog/IBlogArticle.d.ts +18 -18
  20. package/dist/Interfaces/Blog/IBlogArticle.js +2 -2
  21. package/dist/Interfaces/Blog/IBlogAuthor.d.ts +7 -7
  22. package/dist/Interfaces/Blog/IBlogAuthor.js +2 -2
  23. package/dist/Interfaces/Blog/IBlogCategory.d.ts +9 -9
  24. package/dist/Interfaces/Blog/IBlogCategory.js +2 -2
  25. package/dist/Interfaces/Blog/IBlogComment.d.ts +13 -13
  26. package/dist/Interfaces/Blog/IBlogComment.js +2 -2
  27. package/dist/Interfaces/Blog/IBlogKeywords.d.ts +9 -9
  28. package/dist/Interfaces/Blog/IBlogKeywords.js +2 -2
  29. package/dist/Interfaces/Booking/index.d.ts +74 -74
  30. package/dist/Interfaces/Booking/index.js +17 -17
  31. package/dist/Interfaces/Brand/index.d.ts +15 -15
  32. package/dist/Interfaces/Brand/index.js +2 -2
  33. package/dist/Interfaces/CMS/index.d.ts +25 -25
  34. package/dist/Interfaces/CMS/index.js +2 -2
  35. package/dist/Interfaces/Cart/IElavonPayload.d.ts +93 -93
  36. package/dist/Interfaces/Cart/IElavonPayload.js +17 -17
  37. package/dist/Interfaces/Cart/IPandaPayload.d.ts +64 -64
  38. package/dist/Interfaces/Cart/IPandaPayload.js +18 -18
  39. package/dist/Interfaces/Cart/IPaymentCard.d.ts +22 -22
  40. package/dist/Interfaces/Cart/IPaymentCard.js +44 -44
  41. package/dist/Interfaces/Cart/IPaypalPayload.d.ts +9 -9
  42. package/dist/Interfaces/Cart/IPaypalPayload.js +2 -2
  43. package/dist/Interfaces/Cart/IPaysafePayload.d.ts +72 -72
  44. package/dist/Interfaces/Cart/IPaysafePayload.js +2 -2
  45. package/dist/Interfaces/Cart/IStripePayload.d.ts +66 -66
  46. package/dist/Interfaces/Cart/IStripePayload.js +2 -2
  47. package/dist/Interfaces/Cart/index.d.ts +424 -424
  48. package/dist/Interfaces/Cart/index.js +192 -192
  49. package/dist/Interfaces/Catalogue/index.d.ts +68 -68
  50. package/dist/Interfaces/Catalogue/index.js +37 -37
  51. package/dist/Interfaces/Category/index.d.ts +33 -33
  52. package/dist/Interfaces/Category/index.js +2 -2
  53. package/dist/Interfaces/Chart/index.d.ts +11 -11
  54. package/dist/Interfaces/Chart/index.js +2 -2
  55. package/dist/Interfaces/Class/index.d.ts +8 -8
  56. package/dist/Interfaces/Class/index.js +2 -2
  57. package/dist/Interfaces/Consent/index.d.ts +6 -6
  58. package/dist/Interfaces/Consent/index.js +2 -2
  59. package/dist/Interfaces/Context/IContextProps.d.ts +4 -4
  60. package/dist/Interfaces/Context/IContextProps.js +2 -2
  61. package/dist/Interfaces/Context/IContextState.d.ts +15 -15
  62. package/dist/Interfaces/Context/IContextState.js +2 -2
  63. package/dist/Interfaces/Customer/ICustomerBadge.d.ts +2 -2
  64. package/dist/Interfaces/Customer/ICustomerBadge.js +2 -2
  65. package/dist/Interfaces/Customer/ICustomerRating.d.ts +10 -10
  66. package/dist/Interfaces/Customer/ICustomerRating.js +2 -2
  67. package/dist/Interfaces/Customer/IStoreCredit.d.ts +12 -12
  68. package/dist/Interfaces/Customer/IStoreCredit.js +2 -2
  69. package/dist/Interfaces/Customer/index.d.ts +97 -97
  70. package/dist/Interfaces/Customer/index.js +141 -141
  71. package/dist/Interfaces/Declination/index.d.ts +114 -114
  72. package/dist/Interfaces/Declination/index.js +60 -60
  73. package/dist/Interfaces/Document/index.d.ts +8 -8
  74. package/dist/Interfaces/Document/index.js +2 -2
  75. package/dist/Interfaces/Elastic/index.d.ts +89 -89
  76. package/dist/Interfaces/Elastic/index.js +2 -2
  77. package/dist/Interfaces/Email/CustomGR/I3DPrintEmail.d.ts +11 -11
  78. package/dist/Interfaces/Email/CustomGR/I3DPrintEmail.js +2 -2
  79. package/dist/Interfaces/Email/CustomGR/IBorrowToolsEmail.d.ts +15 -15
  80. package/dist/Interfaces/Email/CustomGR/IBorrowToolsEmail.js +2 -2
  81. package/dist/Interfaces/Email/CustomGR/IPickupMaterialsEmail.d.ts +12 -12
  82. package/dist/Interfaces/Email/CustomGR/IPickupMaterialsEmail.js +2 -2
  83. package/dist/Interfaces/Email/CustomGR/IPreMeetingFormEmail.d.ts +36 -36
  84. package/dist/Interfaces/Email/CustomGR/IPreMeetingFormEmail.js +2 -2
  85. package/dist/Interfaces/Email/CustomGR/ISponsorRequestEmail.d.ts +12 -12
  86. package/dist/Interfaces/Email/CustomGR/ISponsorRequestEmail.js +2 -2
  87. package/dist/Interfaces/Email/CustomGR/ITransportEmail.d.ts +12 -12
  88. package/dist/Interfaces/Email/CustomGR/ITransportEmail.js +2 -2
  89. package/dist/Interfaces/Email/CustomGR/ITransportQuoteEmail.d.ts +12 -12
  90. package/dist/Interfaces/Email/CustomGR/ITransportQuoteEmail.js +2 -2
  91. package/dist/Interfaces/Email/CustomGR/IVegetalsEmail.d.ts +16 -16
  92. package/dist/Interfaces/Email/CustomGR/IVegetalsEmail.js +2 -2
  93. package/dist/Interfaces/Email/CustomGR/IWishlistEmail.d.ts +15 -15
  94. package/dist/Interfaces/Email/CustomGR/IWishlistEmail.js +2 -2
  95. package/dist/Interfaces/Email/IAbandonnedCartEmail.d.ts +29 -29
  96. package/dist/Interfaces/Email/IAbandonnedCartEmail.js +2 -2
  97. package/dist/Interfaces/Email/IAccountConfirmationEmail.d.ts +22 -22
  98. package/dist/Interfaces/Email/IAccountConfirmationEmail.js +2 -2
  99. package/dist/Interfaces/Email/IApplicationEmail.d.ts +19 -19
  100. package/dist/Interfaces/Email/IApplicationEmail.js +2 -2
  101. package/dist/Interfaces/Email/IBackInStockEmail.d.ts +21 -21
  102. package/dist/Interfaces/Email/IBackInStockEmail.js +2 -2
  103. package/dist/Interfaces/Email/IContactEmail.d.ts +20 -20
  104. package/dist/Interfaces/Email/IContactEmail.js +2 -2
  105. package/dist/Interfaces/Email/ICustomerBookingAdminEmail.d.ts +15 -15
  106. package/dist/Interfaces/Email/ICustomerBookingAdminEmail.js +2 -2
  107. package/dist/Interfaces/Email/ICustomerBookingEmail.d.ts +14 -14
  108. package/dist/Interfaces/Email/ICustomerBookingEmail.js +2 -2
  109. package/dist/Interfaces/Email/IEmail.d.ts +20 -20
  110. package/dist/Interfaces/Email/IEmail.js +56 -56
  111. package/dist/Interfaces/Email/IOrderConfirmationEmail.d.ts +47 -47
  112. package/dist/Interfaces/Email/IOrderConfirmationEmail.js +2 -2
  113. package/dist/Interfaces/Email/IPasswordResetEmail.d.ts +17 -17
  114. package/dist/Interfaces/Email/IPasswordResetEmail.js +2 -2
  115. package/dist/Interfaces/Email/IPhotoShootEmail.d.ts +14 -14
  116. package/dist/Interfaces/Email/IPhotoShootEmail.js +2 -2
  117. package/dist/Interfaces/Email/IPickupConfirmation.d.ts +23 -23
  118. package/dist/Interfaces/Email/IPickupConfirmation.js +2 -2
  119. package/dist/Interfaces/Email/IShippingConfirmation.d.ts +23 -23
  120. package/dist/Interfaces/Email/IShippingConfirmation.js +2 -2
  121. package/dist/Interfaces/Email/IWelcomeEmail.d.ts +19 -19
  122. package/dist/Interfaces/Email/IWelcomeEmail.js +2 -2
  123. package/dist/Interfaces/ExportSchema/index.d.ts +7 -7
  124. package/dist/Interfaces/ExportSchema/index.js +2 -2
  125. package/dist/Interfaces/ExternalService/BaseExternalService.d.ts +12 -12
  126. package/dist/Interfaces/ExternalService/BaseExternalService.js +2 -2
  127. package/dist/Interfaces/ExternalService/ExternalProductsService.d.ts +4 -4
  128. package/dist/Interfaces/ExternalService/ExternalProductsService.js +2 -2
  129. package/dist/Interfaces/ExternalService/index.d.ts +9 -9
  130. package/dist/Interfaces/ExternalService/index.js +2 -2
  131. package/dist/Interfaces/FirstOrderTracking/index.d.ts +5 -5
  132. package/dist/Interfaces/FirstOrderTracking/index.js +2 -2
  133. package/dist/Interfaces/G2/index.d.ts +556 -556
  134. package/dist/Interfaces/G2/index.js +36 -36
  135. package/dist/Interfaces/Indexed/Product/IIndexedLastSavedProduct.d.ts +20 -20
  136. package/dist/Interfaces/Indexed/Product/IIndexedLastSavedProduct.js +2 -2
  137. package/dist/Interfaces/Indexed/Product/index.d.ts +97 -97
  138. package/dist/Interfaces/Indexed/Product/index.js +212 -212
  139. package/dist/Interfaces/Inventory/index.d.ts +19 -19
  140. package/dist/Interfaces/Inventory/index.js +8 -8
  141. package/dist/Interfaces/Invoice/index.d.ts +4 -4
  142. package/dist/Interfaces/Invoice/index.js +2 -2
  143. package/dist/Interfaces/MarketplacePublication/MarketplaceOrderData.d.ts +3 -3
  144. package/dist/Interfaces/MarketplacePublication/MarketplaceOrderData.js +2 -2
  145. package/dist/Interfaces/MarketplacePublication/index.d.ts +23 -23
  146. package/dist/Interfaces/MarketplacePublication/index.js +22 -22
  147. package/dist/Interfaces/Menu/index.d.ts +23 -23
  148. package/dist/Interfaces/Menu/index.js +10 -10
  149. package/dist/Interfaces/Note/index.d.ts +10 -0
  150. package/dist/Interfaces/Note/index.js +8 -0
  151. package/dist/Interfaces/Note/index.js.map +1 -0
  152. package/dist/Interfaces/Operations/ICreatedBy.d.ts +6 -6
  153. package/dist/Interfaces/Operations/ICreatedBy.js +2 -2
  154. package/dist/Interfaces/Operations/IUpdate.d.ts +5 -5
  155. package/dist/Interfaces/Operations/IUpdate.js +2 -2
  156. package/dist/Interfaces/Order/index.d.ts +4 -4
  157. package/dist/Interfaces/Order/index.js +2 -2
  158. package/dist/Interfaces/Org/IRelUser.d.ts +9 -9
  159. package/dist/Interfaces/Org/IRelUser.js +2 -2
  160. package/dist/Interfaces/Org/index.d.ts +29 -29
  161. package/dist/Interfaces/Org/index.js +12 -12
  162. package/dist/Interfaces/Payment/index.d.ts +13 -13
  163. package/dist/Interfaces/Payment/index.js +2 -2
  164. package/dist/Interfaces/Product/IAttributeFamily.d.ts +6 -6
  165. package/dist/Interfaces/Product/IAttributeFamily.js +2 -2
  166. package/dist/Interfaces/Product/IImportProduct.d.ts +42 -42
  167. package/dist/Interfaces/Product/IImportProduct.js +791 -791
  168. package/dist/Interfaces/Product/IInventoryItem.d.ts +84 -84
  169. package/dist/Interfaces/Product/IInventoryItem.js +36 -36
  170. package/dist/Interfaces/Product/IPricing.d.ts +177 -177
  171. package/dist/Interfaces/Product/IPricing.js +174 -174
  172. package/dist/Interfaces/Product/index.d.ts +127 -127
  173. package/dist/Interfaces/Product/index.js +56 -56
  174. package/dist/Interfaces/ProductAttribute/index.d.ts +11 -11
  175. package/dist/Interfaces/ProductAttribute/index.js +2 -2
  176. package/dist/Interfaces/PromiseToPurchase/BankType.d.ts +41 -41
  177. package/dist/Interfaces/PromiseToPurchase/BankType.js +41 -41
  178. package/dist/Interfaces/PromiseToPurchase/IIndexedBankUsed.d.ts +33 -33
  179. package/dist/Interfaces/PromiseToPurchase/IIndexedBankUsed.js +15 -15
  180. package/dist/Interfaces/PromiseToPurchase/IIndexedCustomerPromiseToPurchase.d.ts +19 -19
  181. package/dist/Interfaces/PromiseToPurchase/IIndexedCustomerPromiseToPurchase.js +2 -2
  182. package/dist/Interfaces/PromiseToPurchase/index.d.ts +50 -50
  183. package/dist/Interfaces/PromiseToPurchase/index.js +13 -13
  184. package/dist/Interfaces/PurchaseOrder/index.d.ts +17 -17
  185. package/dist/Interfaces/PurchaseOrder/index.js +2 -2
  186. package/dist/Interfaces/Query/IBrandQueryOptions.d.ts +11 -11
  187. package/dist/Interfaces/Query/IBrandQueryOptions.js +2 -2
  188. package/dist/Interfaces/Query/ICategoryQueryOptions.d.ts +11 -11
  189. package/dist/Interfaces/Query/ICategoryQueryOptions.js +2 -2
  190. package/dist/Interfaces/Query/IProductQueryOptions.d.ts +16 -16
  191. package/dist/Interfaces/Query/IProductQueryOptions.js +2 -2
  192. package/dist/Interfaces/Quote/index.d.ts +5 -5
  193. package/dist/Interfaces/Quote/index.js +2 -2
  194. package/dist/Interfaces/Refunds/index.d.ts +106 -106
  195. package/dist/Interfaces/Refunds/index.js +2 -2
  196. package/dist/Interfaces/Rules/IDiscountRule.d.ts +137 -137
  197. package/dist/Interfaces/Rules/IDiscountRule.js +95 -95
  198. package/dist/Interfaces/Schedule/index.d.ts +48 -48
  199. package/dist/Interfaces/Schedule/index.js +2 -2
  200. package/dist/Interfaces/Services/IAddServiceResponse.d.ts +4 -4
  201. package/dist/Interfaces/Services/IAddServiceResponse.js +2 -2
  202. package/dist/Interfaces/Services/IService.d.ts +12 -12
  203. package/dist/Interfaces/Services/IService.js +2 -2
  204. package/dist/Interfaces/Services/IServiceSecret.d.ts +8 -8
  205. package/dist/Interfaces/Services/IServiceSecret.js +2 -2
  206. package/dist/Interfaces/Shipping/Shipstation/carriers.d.ts +10 -10
  207. package/dist/Interfaces/Shipping/Shipstation/carriers.js +2 -2
  208. package/dist/Interfaces/Shipping/Shipstation/order.d.ts +227 -227
  209. package/dist/Interfaces/Shipping/Shipstation/order.js +2 -2
  210. package/dist/Interfaces/Shipping/Shipstation/quote.d.ts +31 -31
  211. package/dist/Interfaces/Shipping/Shipstation/quote.js +2 -2
  212. package/dist/Interfaces/Shipping/Shiptime/order.d.ts +54 -54
  213. package/dist/Interfaces/Shipping/Shiptime/order.js +48 -48
  214. package/dist/Interfaces/Shipping/Shiptime/quote.d.ts +111 -111
  215. package/dist/Interfaces/Shipping/Shiptime/quote.js +2 -2
  216. package/dist/Interfaces/Slider/GR.d.ts +114 -114
  217. package/dist/Interfaces/Slider/GR.js +271 -271
  218. package/dist/Interfaces/Slider/index.d.ts +30 -30
  219. package/dist/Interfaces/Slider/index.js +2 -2
  220. package/dist/Interfaces/Space/IExternalService.d.ts +52 -52
  221. package/dist/Interfaces/Space/IExternalService.js +43 -43
  222. package/dist/Interfaces/Space/IMember.d.ts +16 -16
  223. package/dist/Interfaces/Space/IMember.js +9 -9
  224. package/dist/Interfaces/Space/index.d.ts +385 -385
  225. package/dist/Interfaces/Space/index.js +159 -159
  226. package/dist/Interfaces/Specials/gr.d.ts +61 -61
  227. package/dist/Interfaces/Specials/gr.js +2 -2
  228. package/dist/Interfaces/StockNotification/index.d.ts +7 -7
  229. package/dist/Interfaces/StockNotification/index.js +2 -2
  230. package/dist/Interfaces/Store/index.d.ts +62 -62
  231. package/dist/Interfaces/Store/index.js +27 -27
  232. package/dist/Interfaces/Supplier/ICommand.d.ts +11 -11
  233. package/dist/Interfaces/Supplier/ICommand.js +2 -2
  234. package/dist/Interfaces/Supplier/index.d.ts +36 -36
  235. package/dist/Interfaces/Supplier/index.js +24 -24
  236. package/dist/Interfaces/TCG/index.d.ts +110 -110
  237. package/dist/Interfaces/TCG/index.js +27 -27
  238. package/dist/Interfaces/Tag/index.d.ts +18 -18
  239. package/dist/Interfaces/Tag/index.js +2 -2
  240. package/dist/Interfaces/Tax/index.d.ts +13 -13
  241. package/dist/Interfaces/Tax/index.js +2 -2
  242. package/dist/Interfaces/TransferRequest/index.d.ts +103 -103
  243. package/dist/Interfaces/TransferRequest/index.js +43 -43
  244. package/dist/Interfaces/Translation/index.d.ts +8 -8
  245. package/dist/Interfaces/Translation/index.js +5 -5
  246. package/dist/Interfaces/Update/index.d.ts +10 -10
  247. package/dist/Interfaces/Update/index.js +2 -2
  248. package/dist/Interfaces/User/IUser.d.ts +65 -65
  249. package/dist/Interfaces/User/IUser.js +8 -8
  250. package/dist/Interfaces/Version/index.d.ts +11 -11
  251. package/dist/Interfaces/Version/index.js +2 -2
  252. package/dist/Interfaces/Wishlist/index.d.ts +7 -7
  253. package/dist/Interfaces/Wishlist/index.js +2 -2
  254. package/dist/constants/Interfaces/IBaseApi.d.ts +15 -15
  255. package/dist/constants/Interfaces/IBaseApi.js +2 -2
  256. package/dist/constants/Interfaces/IEndpointResult.d.ts +9 -9
  257. package/dist/constants/Interfaces/IEndpointResult.js +2 -2
  258. package/dist/constants/enums.d.ts +6 -6
  259. package/dist/constants/enums.js +10 -10
  260. package/dist/constants/services.d.ts +2 -2
  261. package/dist/constants/services.js +111 -111
  262. package/dist/constants/version.d.ts +2 -2
  263. package/dist/constants/version.js +5 -5
  264. package/dist/index.d.ts +32 -32
  265. package/dist/index.js +242 -242
  266. package/dist/lib/Attribute/index.d.ts +14 -14
  267. package/dist/lib/Attribute/index.js +143 -143
  268. package/dist/lib/BGJob/index.d.ts +9 -9
  269. package/dist/lib/BGJob/index.js +212 -212
  270. package/dist/lib/BackgroundWorker/index.d.ts +34 -34
  271. package/dist/lib/BackgroundWorker/index.js +59 -59
  272. package/dist/lib/Blog/BlogArticle.d.ts +5 -5
  273. package/dist/lib/Blog/BlogArticle.js +10 -10
  274. package/dist/lib/Blog/BlogAuthor.d.ts +5 -5
  275. package/dist/lib/Blog/BlogAuthor.js +10 -10
  276. package/dist/lib/Blog/BlogCategory.d.ts +5 -5
  277. package/dist/lib/Blog/BlogCategory.js +10 -10
  278. package/dist/lib/Blog/BlogKeyword.d.ts +5 -5
  279. package/dist/lib/Blog/BlogKeyword.js +10 -10
  280. package/dist/lib/Booking/index.d.ts +70 -70
  281. package/dist/lib/Booking/index.js +576 -576
  282. package/dist/lib/Brand/index.d.ts +17 -17
  283. package/dist/lib/Brand/index.js +113 -113
  284. package/dist/lib/Cart/index.d.ts +206 -206
  285. package/dist/lib/Cart/index.js +3164 -3164
  286. package/dist/lib/Catalogue/index.d.ts +9 -9
  287. package/dist/lib/Catalogue/index.js +69 -69
  288. package/dist/lib/Category/index.d.ts +27 -27
  289. package/dist/lib/Category/index.js +190 -190
  290. package/dist/lib/Class/index.d.ts +12 -12
  291. package/dist/lib/Class/index.js +58 -58
  292. package/dist/lib/Consent/index.d.ts +4 -4
  293. package/dist/lib/Consent/index.js +29 -29
  294. package/dist/lib/Customer/index.d.ts +11 -11
  295. package/dist/lib/Customer/index.js +68 -68
  296. package/dist/lib/Declination/index.d.ts +9 -9
  297. package/dist/lib/Declination/index.js +24 -24
  298. package/dist/lib/Discount/index.d.ts +18 -18
  299. package/dist/lib/Discount/index.js +470 -470
  300. package/dist/lib/ElasticSearch/index.d.ts +8 -8
  301. package/dist/lib/ElasticSearch/index.js +45 -45
  302. package/dist/lib/Elavon/index.d.ts +18 -18
  303. package/dist/lib/Elavon/index.js +130 -130
  304. package/dist/lib/Email/AbandonedCartEmail.d.ts +8 -8
  305. package/dist/lib/Email/AbandonedCartEmail.js +16 -16
  306. package/dist/lib/Email/AccountConfirmationEmail.d.ts +11 -11
  307. package/dist/lib/Email/AccountConfirmationEmail.js +22 -22
  308. package/dist/lib/Email/AdminOrderConfirmationEmail.d.ts +8 -8
  309. package/dist/lib/Email/AdminOrderConfirmationEmail.js +16 -16
  310. package/dist/lib/Email/ApplicationEmail.d.ts +8 -8
  311. package/dist/lib/Email/ApplicationEmail.js +16 -16
  312. package/dist/lib/Email/BackInStockEmail.d.ts +8 -8
  313. package/dist/lib/Email/BackInStockEmail.js +16 -16
  314. package/dist/lib/Email/ContactEmail.d.ts +8 -8
  315. package/dist/lib/Email/ContactEmail.js +16 -16
  316. package/dist/lib/Email/CustomerBookingAdminEmail.d.ts +8 -8
  317. package/dist/lib/Email/CustomerBookingAdminEmail.js +16 -16
  318. package/dist/lib/Email/CustomerBookingEmail.d.ts +8 -8
  319. package/dist/lib/Email/CustomerBookingEmail.js +16 -16
  320. package/dist/lib/Email/OrderConfirmationEmail.d.ts +8 -8
  321. package/dist/lib/Email/OrderConfirmationEmail.js +16 -16
  322. package/dist/lib/Email/OrderDenounciationEmail.d.ts +8 -8
  323. package/dist/lib/Email/OrderDenounciationEmail.js +16 -16
  324. package/dist/lib/Email/OrderSampleEmail.d.ts +8 -8
  325. package/dist/lib/Email/OrderSampleEmail.js +16 -16
  326. package/dist/lib/Email/OtherTypeEmails.d.ts +8 -8
  327. package/dist/lib/Email/OtherTypeEmails.js +19 -19
  328. package/dist/lib/Email/PasswordResetEmail.d.ts +8 -8
  329. package/dist/lib/Email/PasswordResetEmail.js +16 -16
  330. package/dist/lib/Email/PhotoShootEmail.d.ts +8 -8
  331. package/dist/lib/Email/PhotoShootEmail.js +16 -16
  332. package/dist/lib/Email/PickUpConfirmation.d.ts +8 -8
  333. package/dist/lib/Email/PickUpConfirmation.js +16 -16
  334. package/dist/lib/Email/ShippingConfirmation.d.ts +8 -8
  335. package/dist/lib/Email/ShippingConfirmation.js +16 -16
  336. package/dist/lib/Email/WelcomeEmail.d.ts +8 -8
  337. package/dist/lib/Email/WelcomeEmail.js +16 -16
  338. package/dist/lib/Email/index.d.ts +8 -8
  339. package/dist/lib/Email/index.js +23 -23
  340. package/dist/lib/ExternalService/Ebay.d.ts +62 -62
  341. package/dist/lib/ExternalService/Ebay.js +102 -102
  342. package/dist/lib/ExternalService/index.d.ts +5 -5
  343. package/dist/lib/ExternalService/index.js +10 -10
  344. package/dist/lib/FirstOrderTracking/index.d.ts +5 -5
  345. package/dist/lib/FirstOrderTracking/index.js +10 -10
  346. package/dist/lib/Indexed/IndexedCart.d.ts +13 -13
  347. package/dist/lib/Indexed/IndexedCart.js +86 -86
  348. package/dist/lib/Indexed/Product.d.ts +17 -17
  349. package/dist/lib/Indexed/Product.js +48 -48
  350. package/dist/lib/Inventory/index.d.ts +49 -49
  351. package/dist/lib/Inventory/index.js +314 -314
  352. package/dist/lib/Invoice/index.d.ts +5 -5
  353. package/dist/lib/Invoice/index.js +10 -10
  354. package/dist/lib/MarketplacePublication/index.d.ts +9 -9
  355. package/dist/lib/MarketplacePublication/index.js +118 -118
  356. package/dist/lib/Menu/index.d.ts +11 -11
  357. package/dist/lib/Menu/index.js +103 -103
  358. package/dist/lib/MongoDB/BaseAPI.d.ts +18 -18
  359. package/dist/lib/MongoDB/BaseAPI.js +200 -200
  360. package/dist/lib/Note/index.d.ts +4 -0
  361. package/dist/lib/Note/index.js +7 -0
  362. package/dist/lib/Note/index.js.map +1 -0
  363. package/dist/lib/Order/index.d.ts +7 -7
  364. package/dist/lib/Order/index.js +33 -33
  365. package/dist/lib/Org/index.d.ts +27 -27
  366. package/dist/lib/Org/index.js +175 -175
  367. package/dist/lib/PandaPay/index.d.ts +16 -16
  368. package/dist/lib/PandaPay/index.js +170 -170
  369. package/dist/lib/Paysafe/index.d.ts +11 -11
  370. package/dist/lib/Paysafe/index.js +40 -40
  371. package/dist/lib/Product/index.d.ts +154 -154
  372. package/dist/lib/Product/index.js +793 -793
  373. package/dist/lib/ProductAttribute/index.d.ts +15 -15
  374. package/dist/lib/ProductAttribute/index.js +45 -45
  375. package/dist/lib/PromiseToPurchase/index.d.ts +37 -37
  376. package/dist/lib/PromiseToPurchase/index.js +264 -264
  377. package/dist/lib/PurchaseOrder/index.d.ts +9 -9
  378. package/dist/lib/PurchaseOrder/index.js +16 -16
  379. package/dist/lib/Schedule/index.d.ts +5 -5
  380. package/dist/lib/Schedule/index.js +12 -12
  381. package/dist/lib/Service/Enum/ServiceEnum.d.ts +3 -3
  382. package/dist/lib/Service/Enum/ServiceEnum.js +7 -7
  383. package/dist/lib/Service/index.d.ts +5 -5
  384. package/dist/lib/Service/index.js +13 -13
  385. package/dist/lib/Shipment/index.d.ts +28 -28
  386. package/dist/lib/Shipment/index.js +357 -357
  387. package/dist/lib/Slider/index.d.ts +16 -16
  388. package/dist/lib/Slider/index.js +113 -113
  389. package/dist/lib/Space/index.d.ts +873 -873
  390. package/dist/lib/Space/index.js +5094 -5094
  391. package/dist/lib/StockNotification/index.d.ts +4 -4
  392. package/dist/lib/StockNotification/index.js +6 -6
  393. package/dist/lib/Store/index.d.ts +5 -5
  394. package/dist/lib/Store/index.js +12 -12
  395. package/dist/lib/Supplier/Command.d.ts +5 -5
  396. package/dist/lib/Supplier/Command.js +10 -10
  397. package/dist/lib/Supplier/index.d.ts +25 -25
  398. package/dist/lib/Supplier/index.js +22 -22
  399. package/dist/lib/Tags/index.d.ts +6 -6
  400. package/dist/lib/Tags/index.js +21 -21
  401. package/dist/lib/Tax/index.d.ts +8 -8
  402. package/dist/lib/Tax/index.js +54 -54
  403. package/dist/lib/TransferRequest/index.d.ts +112 -112
  404. package/dist/lib/TransferRequest/index.js +794 -794
  405. package/dist/lib/Update/index.d.ts +10 -10
  406. package/dist/lib/Update/index.js +22 -22
  407. package/dist/lib/User/index.d.ts +35 -35
  408. package/dist/lib/User/index.js +248 -248
  409. package/dist/lib/Wishlist/index.d.ts +5 -5
  410. package/dist/lib/Wishlist/index.js +10 -10
  411. package/dist/lib/base.d.ts +14 -14
  412. package/dist/lib/base.js +62 -62
  413. package/dist/lib/baseService.d.ts +17 -17
  414. package/dist/lib/baseService.js +43 -43
  415. package/dist/rules/GR/constants/data.d.ts +26 -26
  416. package/dist/rules/GR/constants/data.js +55 -55
  417. package/dist/rules/GR/constants/products.d.ts +8 -8
  418. package/dist/rules/GR/constants/products.js +234 -234
  419. package/dist/rules/GR/interfaces/cart.d.ts +84 -83
  420. package/dist/rules/GR/interfaces/cart.js +41 -40
  421. package/dist/rules/GR/interfaces/cart.js.map +1 -1
  422. package/dist/rules/GR/interfaces/data.d.ts +97 -97
  423. package/dist/rules/GR/interfaces/data.js +104 -104
  424. package/dist/rules/GR/interfaces/products.d.ts +61 -61
  425. package/dist/rules/GR/interfaces/products.js +10 -10
  426. package/dist/rules/GR/utils/cart.d.ts +53 -53
  427. package/dist/rules/GR/utils/cart.js +637 -631
  428. package/dist/rules/GR/utils/cart.js.map +1 -1
  429. package/dist/rules/GR/utils/data.d.ts +3 -3
  430. package/dist/rules/GR/utils/data.js +25 -25
  431. package/dist/rules/GR/utils/expedition.d.ts +71 -71
  432. package/dist/rules/GR/utils/expedition.js +1542 -1542
  433. package/dist/rules/GR/utils/g2.d.ts +176 -176
  434. package/dist/rules/GR/utils/g2.js +845 -845
  435. package/dist/rules/GR/utils/invoices.d.ts +24 -24
  436. package/dist/rules/GR/utils/invoices.js +174 -171
  437. package/dist/rules/GR/utils/invoices.js.map +1 -1
  438. package/dist/rules/GR/utils/products.d.ts +104 -104
  439. package/dist/rules/GR/utils/products.js +984 -984
  440. package/dist/rules/GR/utils/upsells.d.ts +79 -79
  441. package/dist/rules/GR/utils/upsells.js +183 -183
  442. package/dist/services/database/BaseProvider.d.ts +29 -29
  443. package/dist/services/database/BaseProvider.js +28 -28
  444. package/dist/services/database/BatchUtils.d.ts +14 -14
  445. package/dist/services/database/BatchUtils.js +43 -43
  446. package/dist/services/database/Config.d.ts +2 -2
  447. package/dist/services/database/Config.js +5 -5
  448. package/dist/services/database/DatabaseService.d.ts +41 -41
  449. package/dist/services/database/DatabaseService.js +152 -152
  450. package/dist/services/database/FirebaseProvider.d.ts +17 -17
  451. package/dist/services/database/FirebaseProvider.js +218 -218
  452. package/dist/services/database/NotFirebaseProvider.d.ts +35 -35
  453. package/dist/services/database/NotFirebaseProvider.js +243 -243
  454. package/dist/services/g2/G2OrderSlip.d.ts +42 -42
  455. package/dist/services/g2/G2OrderSlip.js +210 -210
  456. package/dist/services/g2/utils.d.ts +9 -9
  457. package/dist/services/g2/utils.js +703 -695
  458. package/dist/services/g2/utils.js.map +1 -1
  459. package/dist/services/logs/index.d.ts +20 -20
  460. package/dist/services/logs/index.js +61 -61
  461. package/dist/services/products/BaseClass.d.ts +50 -50
  462. package/dist/services/products/BaseClass.js +64 -64
  463. package/dist/services/products/TCGService.d.ts +29 -29
  464. package/dist/services/products/TCGService.js +499 -499
  465. package/dist/services/products/utils.d.ts +9 -9
  466. package/dist/services/products/utils.js +94 -94
  467. package/dist/utils/algolia.d.ts +6 -6
  468. package/dist/utils/algolia.js +21 -21
  469. package/dist/utils/anonymisation.d.ts +30 -30
  470. package/dist/utils/anonymisation.js +250 -250
  471. package/dist/utils/array.d.ts +5 -5
  472. package/dist/utils/array.js +14 -14
  473. package/dist/utils/aws.d.ts +14 -14
  474. package/dist/utils/aws.js +126 -126
  475. package/dist/utils/booking.d.ts +22 -22
  476. package/dist/utils/booking.js +118 -118
  477. package/dist/utils/cart.d.ts +103 -102
  478. package/dist/utils/cart.js +690 -652
  479. package/dist/utils/cart.js.map +1 -1
  480. package/dist/utils/categories.d.ts +2 -2
  481. package/dist/utils/categories.js +54 -54
  482. package/dist/utils/cmv.d.ts +10 -10
  483. package/dist/utils/cmv.js +107 -107
  484. package/dist/utils/console.d.ts +6 -6
  485. package/dist/utils/console.js +59 -59
  486. package/dist/utils/context.d.ts +20 -20
  487. package/dist/utils/context.js +61 -61
  488. package/dist/utils/currency.d.ts +6 -6
  489. package/dist/utils/currency.js +61 -61
  490. package/dist/utils/data.d.ts +31 -31
  491. package/dist/utils/data.js +293 -293
  492. package/dist/utils/date.d.ts +1 -1
  493. package/dist/utils/date.js +16 -16
  494. package/dist/utils/dimensions.d.ts +3 -3
  495. package/dist/utils/dimensions.js +16 -16
  496. package/dist/utils/discount.d.ts +46 -46
  497. package/dist/utils/discount.js +934 -934
  498. package/dist/utils/errors.d.ts +113 -113
  499. package/dist/utils/errors.js +113 -113
  500. package/dist/utils/file-admin.d.ts +8 -8
  501. package/dist/utils/file-admin.js +38 -38
  502. package/dist/utils/file.d.ts +38 -38
  503. package/dist/utils/file.js +200 -200
  504. package/dist/utils/firebase-admin.d.ts +2 -2
  505. package/dist/utils/firebase-admin.js +61 -61
  506. package/dist/utils/firebase.d.ts +41 -41
  507. package/dist/utils/firebase.js +131 -131
  508. package/dist/utils/import.d.ts +1 -1
  509. package/dist/utils/import.js +21 -21
  510. package/dist/utils/inventories.d.ts +49 -49
  511. package/dist/utils/inventories.js +392 -392
  512. package/dist/utils/locale.d.ts +15 -15
  513. package/dist/utils/locale.js +78 -78
  514. package/dist/utils/mailchimp.d.ts +58 -58
  515. package/dist/utils/mailchimp.js +495 -495
  516. package/dist/utils/mathUtils.d.ts +17 -17
  517. package/dist/utils/mathUtils.js +315 -315
  518. package/dist/utils/mongodb.d.ts +1 -1
  519. package/dist/utils/mongodb.js +22 -22
  520. package/dist/utils/object.d.ts +13 -13
  521. package/dist/utils/object.js +115 -115
  522. package/dist/utils/payment.d.ts +10 -10
  523. package/dist/utils/payment.js +23 -23
  524. package/dist/utils/products.d.ts +32 -32
  525. package/dist/utils/products.js +186 -186
  526. package/dist/utils/promiseToPurchase.d.ts +56 -56
  527. package/dist/utils/promiseToPurchase.js +195 -195
  528. package/dist/utils/prosprsearch.d.ts +26 -26
  529. package/dist/utils/prosprsearch.js +182 -182
  530. package/dist/utils/refunds.d.ts +2 -2
  531. package/dist/utils/refunds.js +21 -21
  532. package/dist/utils/sdc.d.ts +10 -10
  533. package/dist/utils/sdc.js +1302 -1302
  534. package/dist/utils/searchIndexes.d.ts +21 -21
  535. package/dist/utils/searchIndexes.js +210 -210
  536. package/dist/utils/services.d.ts +42 -42
  537. package/dist/utils/services.js +409 -409
  538. package/dist/utils/shipment.d.ts +110 -110
  539. package/dist/utils/shipment.js +345 -345
  540. package/dist/utils/simpletexting.d.ts +2 -2
  541. package/dist/utils/simpletexting.js +45 -45
  542. package/dist/utils/sliders.d.ts +4 -4
  543. package/dist/utils/sliders.js +24 -24
  544. package/dist/utils/string.d.ts +16 -16
  545. package/dist/utils/string.js +191 -191
  546. package/dist/utils/tcgService.d.ts +2 -2
  547. package/dist/utils/tcgService.js +8 -8
  548. package/dist/utils/tools.d.ts +1 -1
  549. package/dist/utils/tools.js +9 -9
  550. package/dist/utils/transferRequests.d.ts +19 -19
  551. package/dist/utils/transferRequests.js +43 -43
  552. package/dist/utils/update.d.ts +7 -7
  553. package/dist/utils/update.js +125 -125
  554. package/dist/utils/weight.d.ts +3 -3
  555. package/dist/utils/weight.js +16 -16
  556. package/dist/utils/zones.d.ts +11 -11
  557. package/dist/utils/zones.js +218 -218
  558. package/package.json +110 -110
  559. package/publish.sh +143 -143
  560. package/readme.md +182 -182
  561. package/dist/lib/Queue/index.d.ts +0 -40
  562. package/dist/lib/Queue/index.js +0 -255
  563. package/dist/lib/Queue/index.js.map +0 -1
package/addio-sdk-doc.md CHANGED
@@ -1,1473 +1,1473 @@
1
- ## Classes
2
-
3
- <dl>
4
- <dt><a href="#Brand">Brand</a></dt>
5
- <dd><p>Brand class</p></dd>
6
- <dt><a href="#Catalogue">Catalogue</a></dt>
7
- <dd><p>Catalogue class</p></dd>
8
- <dt><a href="#Customer">Customer</a></dt>
9
- <dd><p>Customer class</p></dd>
10
- <dt><a href="#Discount">Discount</a></dt>
11
- <dd><p>Brand class</p></dd>
12
- <dt><del><a href="#Invoice">Invoice</a></del></dt>
13
- <dd></dd>
14
- <dt><del><a href="#Order">Order</a></del></dt>
15
- <dd></dd>
16
- <dt><a href="#Org">Org</a></dt>
17
- <dd><p>Class Org - Organization
18
- Represent an organization created by a user. An organization can have multiple space.</p></dd>
19
- <dt><a href="#Product">Product</a></dt>
20
- <dd><p>Product class</p></dd>
21
- <dt><a href="#PurchaseOrder">PurchaseOrder</a></dt>
22
- <dd><p>Brand class</p></dd>
23
- <dt><a href="#Service">Service</a></dt>
24
- <dd><p>Service class</p></dd>
25
- <dt><a href="#Space">Space</a></dt>
26
- <dd><p>Class Space
27
- A Space represent a company.</p></dd>
28
- <dt><a href="#User">User</a></dt>
29
- <dd><p>User class</p></dd>
30
- <dt><a href="#ProsprSearch">ProsprSearch</a></dt>
31
- <dd><p>À NOTER - Prospr est l'ancien nom du ecomm, est depuis devenu Addio.
32
- Il faudra éventuellement faire le refactoring nécessaire pour remplacer toutes les appelations,
33
- mais en attendant, c'est normal qu'il y ait les deux noms à différents endroits.</p></dd>
34
- </dl>
35
-
36
- ## Members
37
-
38
- <dl>
39
- <dt><a href="#CustomerTypeEnum">CustomerTypeEnum</a></dt>
40
- <dd><p>ICustomer interface</p>
41
- <p>Représente un client (customer). Un client peut:</p>
42
- <ul>
43
- <li>Faire des recherches parmis les différents items du commerçant</li>
44
- <li>Afficher une fiche cliente</li>
45
- </ul></dd>
46
- <dt><a href="#getDefaultDiscountRule">getDefaultDiscountRule</a></dt>
47
- <dd><p>Exemple:</p>
48
- <p>Product = 5.00$</p>
49
- <p>Discount rule:
50
- quantity &gt;= 10 ? remove 2</p>
51
- <p>Result:
52
- If applied to cart:
53
- 11 Product = (before) 55.00$ (after) 53.00$</p>
54
- <p>attribute color == red ? percent 10
55
- 1 red Product = (before) 5.00$ (after) 4.50$</p>
56
- <p>attribute color == red ? percent -20
57
- 1 red Product = (before) 5.00$ (after) 6.00$</p></dd>
58
- <dt><a href="#installationProductsSlugs">installationProductsSlugs</a></dt>
59
- <dd><p>Contains all necessary elements for extra questions if adding grass product to cart</p></dd>
60
- <dt><a href="#getConcreteCartInfo">getConcreteCartInfo</a></dt>
61
- <dd><ul>
62
- <li>Create the essential info needed when checking a grass type product for cart</li>
63
- </ul></dd>
64
- <dt><a href="#getMinDateOffset">getMinDateOffset</a></dt>
65
- <dd><p>compares date with blockedDates from DB and blocked days (currently hardcoded in function)</p></dd>
66
- <dt><a href="#shouldDisableDate">shouldDisableDate</a></dt>
67
- <dd><p>checks if type of cart corresponds to a blockedDates array and if array has dates defined</p></dd>
68
- <dt><a href="#installationFeePalletTier">installationFeePalletTier</a></dt>
69
- <dd><p>Calculates fees that should be applied to provided cart, and fetches them from database or fee array if provided.
70
- Returns the items to add, update and delete, as well as other cart info to set after fees.
71
- ** Optimized version possible, where address zones and distance are calculated before and properties are sent directly to function
72
- ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p></dd>
73
- <dt><a href="#applyFeesToCart">applyFeesToCart</a></dt>
74
- <dd><p>Checks if sample shipping fee should be removed from cart depending on cart items found in cart.
75
- ** Optimized version possible using brand name instead of brand id, removing async check.
76
- ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p></dd>
77
- <dt><a href="#calculateShippingForVrac">calculateShippingForVrac</a> ⇒</dt>
78
- <dd><p>checks if cart expired using the updated_at date stored in the shipping_payload</p></dd>
79
- <dt><a href="#transformG2CustomerToCustomer">transformG2CustomerToCustomer</a></dt>
80
- <dd><p>Verifies if customer exists in G2.</p></dd>
81
- <dt><a href="#checkIfCustomerExistsInG2">checkIfCustomerExistsInG2</a></dt>
82
- <dd><p>Updates customer in database with new info found in G2.</p></dd>
83
- <dt><a href="#getCustomPriceList">getCustomPriceList</a></dt>
84
- <dd><p>Get promise to purchase additionnal escompte equivalent from customPriceList for specific cart item</p></dd>
85
- <dt><a href="#getFittingUnits">getFittingUnits</a> ⇒</dt>
86
- <dd><p>Returns string corresponding to provided cart's type.</p></dd>
87
- <dt><a href="#getProductSellUnitLabel">getProductSellUnitLabel</a> ⇒ <code>string</code></dt>
88
- <dd><p>Returns the plural unit label for a specific slug</p></dd>
89
- <dt><a href="#getDescriptionString">getDescriptionString</a></dt>
90
- <dd><p>Returns rounded product quantities depending on current value, value of secondary input if existant and sale unit per command step ratio found in product.</p></dd>
91
- <dt><a href="#splitOnDashes">splitOnDashes</a> ⇒ <code>Array.&lt;string&gt;</code></dt>
92
- <dd><p>Get product name as array. Array created mostly by splitting name on dash symbol (and variations).</p></dd>
93
- <dt><a href="#getProdName">getProdName</a></dt>
94
- <dd><p>Function getParentProductCategoryGroup</p></dd>
95
- <dt><a href="#getParentProductCategoryGroup">getParentProductCategoryGroup</a></dt>
96
- <dd><p>Function getProductFormOptions - Returns all AttributeValues for product to construct options in add to cart form</p></dd>
97
- <dt><a href="#getProductFormOptions">getProductFormOptions</a> ⇒</dt>
98
- <dd><p>Checks if product is of type by checking TYPE attribute value. Works with indexed product or cart item.</p></dd>
99
- <dt><a href="#checkIfProductIsInstallation">checkIfProductIsInstallation</a></dt>
100
- <dd><p>Returns array of installation items found in provided array</p></dd>
101
- <dt><a href="#getAllInstallFromItems">getAllInstallFromItems</a></dt>
102
- <dd><ul>
103
- <li>Returns items with only one apparent grass product (used for detail customers).
104
- ** FOR DISPLAY PURPOSES ONLY - Always save grass products separatly in ICart **</li>
105
- </ul></dd>
106
- <dt><a href="#getGrassSubQuestionsByType">getGrassSubQuestionsByType</a> ⇒</dt>
107
- <dd><p>For grass products. Over 1480pi2, if installation, quantities are rounded to rolls (10pi2) if pickup, and to half pal. if shipping</p></dd>
108
- <dt><a href="#handleGrassProductQtyRoundForShipping">handleGrassProductQtyRoundForShipping</a></dt>
109
- <dd><p>Returns rounded grass quantity depending on current qty, if customer selected installation and pallet unit (if defined)</p></dd>
110
- <dt><a href="#getConcreteQteText">getConcreteQteText</a></dt>
111
- <dd><p>returns all items in cart where attribute AVAILABILITY contains wanted type.</p></dd>
112
- <dt><a href="#getConcreteItemsByAvailability">getConcreteItemsByAvailability</a> ⇒</dt>
113
- <dd><p>Function getVracType - constructs vrac helper object is cart contains vrac or vrac associated items.</p></dd>
114
- <dt><a href="#fetchFeesBeforeCart">fetchFeesBeforeCart</a></dt>
115
- <dd><p>Check if pro custom promo info should be shown for customer for a specific product.</p></dd>
116
- <dt><a href="#calculateUpsellQte">calculateUpsellQte</a></dt>
117
- <dd><ul>
118
- <li>checks all upsells in product and returns those where associated quantities are found.</li>
119
- </ul></dd>
120
- <dt><a href="#getUpsellsToQuantify">getUpsellsToQuantify</a></dt>
121
- <dd><ul>
122
- <li>Returns upsell equivalence text</li>
123
- </ul></dd>
124
- <dt><a href="#getGeneralUpsellQteText">getGeneralUpsellQteText</a></dt>
125
- <dd><ul>
126
- <li>Returns quantity stinrg and upsell name to show in Upsell Quantity indicator</li>
127
- </ul></dd>
128
- <dt><a href="#checkIfCartContainsException">checkIfCartContainsException</a></dt>
129
- <dd><p>Function getCartItemsFromProdUpsells</p></dd>
130
- <dt><a href="#mockCustomPriceList">mockCustomPriceList</a></dt>
131
- <dd><p>Takes in a function and checks for error</p></dd>
132
- <dt><a href="#getRandomValue">getRandomValue</a> ⇒</dt>
133
- <dd><p>Get an object property value</p></dd>
134
- <dt><a href="#getObjectProperty">getObjectProperty</a> ⇒</dt>
135
- <dd><p>Set an object property to an anonymized value if it exists</p></dd>
136
- <dt><a href="#setObjectProperty">setObjectProperty</a> ⇒</dt>
137
- <dd><p>Anonymise the customer data if in test env</p></dd>
138
- <dt><a href="#getCurrentProvince">getCurrentProvince</a> ⇒</dt>
139
- <dd><p>Constructs and returns data for indexed cart (algolia or addio)</p></dd>
140
- <dt><a href="#getCartPromo">getCartPromo</a></dt>
141
- <dd><p>Check if current cart promos applied contain a promo_code type promotion</p></dd>
142
- <dt><a href="#shouldCheckPromoCode">shouldCheckPromoCode</a></dt>
143
- <dd><p>Check if a discount rule applies to a specific declination</p></dd>
144
- <dt><a href="#shouldApplyRuleToDeclination">shouldApplyRuleToDeclination</a></dt>
145
- <dd><p>Check if a specific rule of a discount rule is respected</p></dd>
146
- <dt><a href="#getResultRuleDetail">getResultRuleDetail</a></dt>
147
- <dd><p>Check if rule applied to product attributes is respected for specific declination attributes</p></dd>
148
- <dt><a href="#getCartPromoType">getCartPromoType</a></dt>
149
- <dd><p>Check if promo code can be applied to a specific cart</p></dd>
150
- <dt><a href="#checkPromoCodeEligibility">checkPromoCodeEligibility</a></dt>
151
- <dd><p>Returns tier pricing step that should be applied for provided quantity, or undefined if none should apply</p></dd>
152
- <dt><a href="#getTierPricingToApply">getTierPricingToApply</a></dt>
153
- <dd><p>Converts tier-pricing found in discount_rule to IIndexedTierPricing.</p></dd>
154
- <dt><a href="#applyTierPricing">applyTierPricing</a></dt>
155
- <dd><p>Calculate new discount_price object for cart item base on qte and tier_pricing</p></dd>
156
- <dt><a href="#getNewDiscountPriceFromTierPricing">getNewDiscountPriceFromTierPricing</a></dt>
157
- <dd><p>Get discounted price after applying discount rules to a provided price</p></dd>
158
- <dt><a href="#applyDiscountRulesOnProduct">applyDiscountRulesOnProduct</a></dt>
159
- <dd><p>Get result of discount rule discount on a provided amount</p></dd>
160
- <dt><a href="#applyDiscountToPrice">applyDiscountToPrice</a> ⇒</dt>
161
- <dd><p>Get sku(s) affected by a promo as an array of strings</p></dd>
162
- <dt><a href="#getSkuArrayForPromo">getSkuArrayForPromo</a> ⇒</dt>
163
- <dd><p>Returns a list of all skus where promo applied to specific products should apply. Check for both amount/percent_sku and amount/percent_category options.</p></dd>
164
- <dt><a href="#getResultAppliedDiscountSkus">getResultAppliedDiscountSkus</a> ⇒</dt>
165
- <dd><p>Creates array of all category level slugs for a cart item.</p></dd>
166
- <dt><a href="#getItemCategorySlugArray">getItemCategorySlugArray</a></dt>
167
- <dd><p>Apply all valid discounts found in a specific cart's discount_rules props to cart</p></dd>
168
- <dt><a href="#applyDiscountToCart">applyDiscountToCart</a></dt>
169
- <dd><p>Get the ICartPromoApplied object for a specified discount_rule. Only works for promos that do not apply to products of certain categories/skus.</p></dd>
170
- <dt><a href="#getStandardCartPromoFromDiscount">getStandardCartPromoFromDiscount</a> ⇒</dt>
171
- <dd><p>Calculates the cumulative subtotal for all service/fee type items in cart, including any applied promos. Usefull when calculating a promo's amount when all fees and services should be excluded.</p></dd>
172
- <dt><a href="#checkIfCouldApplyIncentivePromo">checkIfCouldApplyIncentivePromo</a></dt>
173
- <dd><p>Calculates amount to be removed for payment incentive type promos.</p></dd>
174
- <dt><a href="#getAfterTaxesPromosTotalAmount">getAfterTaxesPromosTotalAmount</a></dt>
175
- <dd><p>Returns cart_promos_applied corresponding to payment incentive, if found. Can also check in discount_rules if props provided</p></dd>
176
- <dt><a href="#getAfterTaxesPromoInCart">getAfterTaxesPromoInCart</a></dt>
177
- <dd><p>Returns the information regarding the payment incentive promo if found in cart's discount_rules</p></dd>
178
- <dt><a href="#unitShortDict">unitShortDict</a> ⇒ <code>ILang</code></dt>
179
- <dd><p>Returns the dictionnary containing the shortened version of unit labels in multiple languages</p></dd>
180
- <dt><a href="#getConvertedUnitQuantity">getConvertedUnitQuantity</a></dt>
181
- <dd><p>Constructs object with detailled inventory quantities by unit (based on other_units for product)</p></dd>
182
- <dt><a href="#getQty">getQty</a></dt>
183
- <dd><p>Calculates inventory unit quantity for function getQty</p></dd>
184
- <dt><a href="#recursiveCheckObject">recursiveCheckObject</a> ⇒</dt>
185
- <dd><p>Updates value of object by checking recursivly.</p></dd>
186
- <dt><a href="#getOrderedPromises">getOrderedPromises</a> ⇒</dt>
187
- <dd><p>Checks list of promises for applicable banks based on space bank types.</p></dd>
188
- <dt><a href="#checkForApplicableBanks">checkForApplicableBanks</a></dt>
189
- <dd><p>Returns if a promise is currently active. Promise is active if it is not archived, and if current date is same or after starting_date, and before ending_date (if defined).</p></dd>
190
- <dt><a href="#checkIfOtherBankOfSameTypeIsActive">checkIfOtherBankOfSameTypeIsActive</a></dt>
191
- <dd><p>Returns translated name for a provided bank type ID.</p></dd>
192
- <dt><a href="#getBankTypeName">getBankTypeName</a></dt>
193
- <dd><p>Calculates the remaining amount for a specific promise's bank</p></dd>
194
- <dt><a href="#getIndexedByCustomerPromiseValues">getIndexedByCustomerPromiseValues</a> ⇒</dt>
195
- <dd><p>Returns the most recently emptied bank of a given type</p></dd>
196
- <dt><a href="#getIndexServices">getIndexServices</a></dt>
197
- <dd><p>Save new entry objects to provided search index services</p></dd>
198
- <dt><a href="#saveNewEntryToIndex">saveNewEntryToIndex</a></dt>
199
- <dd><p>Save a partial object entry to provided search index services.</p></dd>
200
- <dt><a href="#partialSaveNewEntryToIndex">partialSaveNewEntryToIndex</a></dt>
201
- <dd><p>Returns an object with base info needed to call Algolia/AddioSearch with search query.</p></dd>
202
- <dt><a href="#getFetchInfoAlgoliaAddioSearch">getFetchInfoAlgoliaAddioSearch</a></dt>
203
- <dd><p>Fetch entries from either algolia or AddioSearch (prospr) for a provided index. Client-side only!</p></dd>
204
- <dt><a href="#fetchEntriesAlgoliaAddioSearch">fetchEntriesAlgoliaAddioSearch</a></dt>
205
- <dd><p>Returns search result from active search index service. Server-side friendly!</p></dd>
206
- </dl>
207
-
208
- ## Constants
209
-
210
- <dl>
211
- <dt><a href="#isTestEnv">isTestEnv</a></dt>
212
- <dd><p>TBSDK - SDK Manager</p>
213
- <p>Client SDK to access TheBEAST eCommerce</p></dd>
214
- <dt><a href="#spaceInitData">spaceInitData</a></dt>
215
- <dd><p>Use this object to change which space is being tested!</p></dd>
216
- </dl>
217
-
218
- ## Functions
219
-
220
- <dl>
221
- <dt><a href="#getMinDatePicker">getMinDatePicker()</a></dt>
222
- <dd><p>Sets the minimum shipping day for delivery</p></dd>
223
- <dt><a href="#getProductSellUnitLabel">getProductSellUnitLabel(otherUnits, locale, returnUnitForSlugs)</a> ⇒ <code>string</code></dt>
224
- <dd><p>Returns sell unit label in correct language for a specific product's other_units</p></dd>
225
- <dt><a href="#splitOnDashes">splitOnDashes(stringToSplit)</a> ⇒ <code>Array.&lt;string&gt;</code></dt>
226
- <dd></dd>
227
- <dt><a href="#getRandomValue">getRandomValue(val, type)</a> ⇒</dt>
228
- <dd><p>Replace a value with anonymized value</p></dd>
229
- <dt><a href="#getCartPromo">getCartPromo(cartData)</a></dt>
230
- <dd><p>Get formatted array of cart promos applied to a specific cart</p></dd>
231
- <dt><a href="#_checkRuleApplicationArray">_checkRuleApplicationArray(checkedRulesApplicationArray)</a> ⇒</dt>
232
- <dd><p>Checks if discount rule should be applied to cart based on each rule verification results.</p></dd>
233
- <dt><a href="#checkIfCouldApplyIncentivePromo">checkIfCouldApplyIncentivePromo(cartData, skipCheckFor)</a> ⇒</dt>
234
- <dd><p>Checks if an incentive discount could (in theory) by added to provided cart, by checking found incentive discount's rule array.</p></dd>
235
- <dt><a href="#getOrderedPromises">getOrderedPromises(promises)</a></dt>
236
- <dd><p>Get ordered array of promise data objects by starting date.</p></dd>
237
- <dt><a href="#getIndexServices">getIndexServices(space, partialIndexID)</a></dt>
238
- <dd><p>Returns objet with possible index service instances
239
- As of now, checks for Algolia and Addio Search</p></dd>
240
- </dl>
241
-
242
- <a name="Brand"></a>
243
-
244
- ## Brand
245
-
246
- <p>Brand class</p>
247
-
248
- **Kind**: global class
249
- <a name="Catalogue"></a>
250
-
251
- ## Catalogue
252
-
253
- <p>Catalogue class</p>
254
-
255
- **Kind**: global class
256
- <a name="Customer"></a>
257
-
258
- ## Customer
259
-
260
- <p>Customer class</p>
261
-
262
- **Kind**: global class
263
- <a name="Discount"></a>
264
-
265
- ## Discount
266
-
267
- <p>Brand class</p>
268
-
269
- **Kind**: global class
270
- <a name="Invoice"></a>
271
-
272
- ## ~~Invoice~~
273
-
274
- **_Deprecated_**
275
-
276
- **Kind**: global class
277
- <a name="Order"></a>
278
-
279
- ## ~~Order~~
280
-
281
- **_Deprecated_**
282
-
283
- **Kind**: global class
284
- <a name="Org"></a>
285
-
286
- ## Org
287
-
288
- <p>Class Org - Organization
289
- Represent an organization created by a user. An organization can have multiple space.</p>
290
-
291
- **Kind**: global class
292
- <a name="new_Org_new"></a>
293
-
294
- ### new Org(org, org_ref, user)
295
-
296
- <p>Organization constructor</p>
297
-
298
- | Param | Description |
299
- | ------- | ------------------------------------ |
300
- | org | <p>Organization to construct</p> |
301
- | org_ref | <p>Reference to the organization</p> |
302
- | user | <p>Authfificated user</p> |
303
-
304
- <a name="Product"></a>
305
-
306
- ## Product
307
-
308
- <p>Product class</p>
309
-
310
- **Kind**: global class
311
- <a name="PurchaseOrder"></a>
312
-
313
- ## PurchaseOrder
314
-
315
- <p>Brand class</p>
316
-
317
- **Kind**: global class
318
- <a name="Service"></a>
319
-
320
- ## Service
321
-
322
- <p>Service class</p>
323
-
324
- **Kind**: global class
325
- <a name="Service+add"></a>
326
-
327
- ### service.add(newService) ⇒
328
-
329
- <p>Add a new service</p>
330
-
331
- **Kind**: instance method of [<code>Service</code>](#Service)
332
- **Returns**: <p>IAddServiceResponse</p>
333
-
334
- | Param | Description |
335
- | ---------- | ------------------------------------ |
336
- | newService | <p>IService: new service to add.</p> |
337
-
338
- <a name="Space"></a>
339
-
340
- ## Space
341
-
342
- <p>Class Space
343
- A Space represent a company.</p>
344
-
345
- **Kind**: global class
346
- <a name="User"></a>
347
-
348
- ## User
349
-
350
- <p>User class</p>
351
-
352
- **Kind**: global class
353
- <a name="new_User_new"></a>
354
-
355
- ### new User(options, version, orgID)
356
-
357
- <p>Fetch user from database for current org</p>
358
-
359
- | Param | Description |
360
- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
361
- | options | <p>Parameters for database query. Only one will be checked at a time, in order of &quot;importance&quot; : email &gt; username &gt; external_id.</p> |
362
- | version | <p>The app version to check</p> |
363
- | orgID | <p>Optionnal, but must be provided if function is called from the backend (used to find user's organization).</p> |
364
-
365
- <a name="ProsprSearch"></a>
366
-
367
- ## ProsprSearch
368
-
369
- <p>À NOTER - Prospr est l'ancien nom du ecomm, est depuis devenu Addio.
370
- Il faudra éventuellement faire le refactoring nécessaire pour remplacer toutes les appelations,
371
- mais en attendant, c'est normal qu'il y ait les deux noms à différents endroits.</p>
372
-
373
- **Kind**: global class
374
- <a name="CustomerTypeEnum"></a>
375
-
376
- ## CustomerTypeEnum
377
-
378
- <p>ICustomer interface</p>
379
- <p>Représente un client (customer). Un client peut:</p>
380
- <ul>
381
- <li>Faire des recherches parmis les différents items du commerçant</li>
382
- <li>Afficher une fiche cliente</li>
383
- </ul>
384
-
385
- **Kind**: global variable
386
- <a name="getDefaultDiscountRule"></a>
387
-
388
- ## getDefaultDiscountRule
389
-
390
- <p>Exemple:</p>
391
- <p>Product = 5.00$</p>
392
- <p>Discount rule:
393
- quantity &gt;= 10 ? remove 2</p>
394
- <p>Result:
395
- If applied to cart:
396
- 11 Product = (before) 55.00$ (after) 53.00$</p>
397
- <p>attribute color == red ? percent 10
398
- 1 red Product = (before) 5.00$ (after) 4.50$</p>
399
- <p>attribute color == red ? percent -20
400
- 1 red Product = (before) 5.00$ (after) 6.00$</p>
401
-
402
- **Kind**: global variable
403
- <a name="installationProductsSlugs"></a>
404
-
405
- ## installationProductsSlugs
406
-
407
- <p>Contains all necessary elements for extra questions if adding grass product to cart</p>
408
-
409
- **Kind**: global variable
410
- <a name="getConcreteCartInfo"></a>
411
-
412
- ## getConcreteCartInfo
413
-
414
- <ul>
415
- <li>Create the essential info needed when checking a grass type product for cart</li>
416
- </ul>
417
-
418
- **Kind**: global variable
419
-
420
- | Param |
421
- | ----- |
422
- | item |
423
-
424
- <a name="getMinDateOffset"></a>
425
-
426
- ## getMinDateOffset
427
-
428
- <p>compares date with blockedDates from DB and blocked days (currently hardcoded in function)</p>
429
-
430
- **Kind**: global variable
431
-
432
- | Param | Description |
433
- | ---------------- | ---------------------------- |
434
- | date | <p>Date to check</p> |
435
- | blockedDates | <p>Blocked dates from DB</p> |
436
- | expeditionMethod | <p>pickup or shipping</p> |
437
- | cartData | |
438
-
439
- <a name="shouldDisableDate"></a>
440
-
441
- ## shouldDisableDate
442
-
443
- <p>checks if type of cart corresponds to a blockedDates array and if array has dates defined</p>
444
-
445
- **Kind**: global variable
446
-
447
- | Param |
448
- | ------------ |
449
- | cartData |
450
- | blockedDates |
451
-
452
- <a name="installationFeePalletTier"></a>
453
-
454
- ## installationFeePalletTier
455
-
456
- <p>Calculates fees that should be applied to provided cart, and fetches them from database or fee array if provided.
457
- Returns the items to add, update and delete, as well as other cart info to set after fees.
458
- ** Optimized version possible, where address zones and distance are calculated before and properties are sent directly to function
459
- ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p>
460
-
461
- **Kind**: global variable
462
-
463
- | Param |
464
- | --------------------------- |
465
- | fetchProduct |
466
- | getIfAddressIsInsideZones |
467
- | getDistanceFromAddress |
468
- | cart |
469
- | expeditionMethod |
470
- | grassProduct |
471
- | concreteOrder |
472
- | cartContainsInstallation |
473
- | cartContainsVrac |
474
- | isPro |
475
- | addOnePalletToPickup |
476
- | cartContainsSample |
477
- | saveToShippingPayload |
478
- | deliveryAddress |
479
- | locale |
480
- | expeditionDate |
481
- | equipmentPickupOnSite |
482
- | cartContainsOnlyAccessories |
483
- | pickupStore |
484
- | allStores |
485
- | customPriceList |
486
- | useFeeArray |
487
-
488
- <a name="applyFeesToCart"></a>
489
-
490
- ## applyFeesToCart
491
-
492
- <p>Checks if sample shipping fee should be removed from cart depending on cart items found in cart.
493
- ** Optimized version possible using brand name instead of brand id, removing async check.
494
- ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p>
495
-
496
- **Kind**: global variable
497
-
498
- | Param |
499
- | ------------ |
500
- | fetchProduct |
501
- | cart |
502
- | locale |
503
- | useFeeArray |
504
-
505
- <a name="calculateShippingForVrac"></a>
506
-
507
- ## calculateShippingForVrac ⇒
508
-
509
- <p>checks if cart expired using the updated_at date stored in the shipping_payload</p>
510
-
511
- **Kind**: global variable
512
- **Returns**: <p>boolean</p>
513
-
514
- | Param |
515
- | ------------- |
516
- | cartData |
517
- | grassProduct |
518
- | concreteOrder |
519
- | isPro |
520
- | isSample |
521
-
522
- <a name="transformG2CustomerToCustomer"></a>
523
-
524
- ## transformG2CustomerToCustomer
525
-
526
- <p>Verifies if customer exists in G2.</p>
527
-
528
- **Kind**: global variable
529
-
530
- | Param | Description |
531
- | ---------- | ------------------------------- |
532
- | customerID | <p>Customer ID for G2 fetch</p> |
533
- | space | <p>Space Object</p> |
534
- | org | <p>Org Object</p> |
535
-
536
- <a name="checkIfCustomerExistsInG2"></a>
537
-
538
- ## checkIfCustomerExistsInG2
539
-
540
- <p>Updates customer in database with new info found in G2.</p>
541
-
542
- **Kind**: global variable
543
-
544
- | Param | Description |
545
- | -------------- | ---------------------------------------------------------------------------- |
546
- | customerID | <p>Customer ID for G2 fetch</p> |
547
- | space | <p>Space Object</p> |
548
- | org | <p>Org Object</p> |
549
- | addToDB | <p>if updated customer should be saved to database (defaults to true)</p> |
550
- | skipEmailCheck | <p>if check for unique email should be skiped or not (defaults to false)</p> |
551
-
552
- <a name="getCustomPriceList"></a>
553
-
554
- ## getCustomPriceList
555
-
556
- <p>Get promise to purchase additionnal escompte equivalent from customPriceList for specific cart item</p>
557
-
558
- **Kind**: global variable
559
-
560
- | Param | Description |
561
- | --------------- | ------------------------------------------ |
562
- | customPriceList | <p>The pro customers custom price list</p> |
563
- | item | <p>The cart item to check</p> |
564
-
565
- <a name="getFittingUnits"></a>
566
-
567
- ## getFittingUnits ⇒
568
-
569
- <p>Returns string corresponding to provided cart's type.</p>
570
-
571
- **Kind**: global variable
572
- **Returns**: <p>a string containing the order type</p>
573
-
574
- | Param | Description |
575
- | -------- | --------------------------------------------------------------------------- |
576
- | cartData | <p>Corresponding cart</p> |
577
- | frOnly | <p>If true, forces french string,</p> |
578
- | slugSafe | <p>If true, will always return a slug-safe string (with string_to_slug)</p> |
579
-
580
- <a name="getProductSellUnitLabel"></a>
581
-
582
- ## getProductSellUnitLabel ⇒ <code>string</code>
583
-
584
- <p>Returns the plural unit label for a specific slug</p>
585
-
586
- **Kind**: global variable
587
- **Returns**: <code>string</code> - <p>The plural unit label</p>
588
-
589
- | Param | Type | Description |
590
- | ------------------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
591
- | unitSlug | <code>string</code> | <p>The slug of the unit for which we want to get the label</p> |
592
- | locale | <code>string</code> \| <code>undefined</code> | <p>The language in which we want to get the label</p> |
593
- | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | <p>The slugs for which we want to return a default value, in this case the unit slug for unit</p> |
594
-
595
- <a name="getDescriptionString"></a>
596
-
597
- ## getDescriptionString
598
-
599
- <p>Returns rounded product quantities depending on current value, value of secondary input if existant and sale unit per command step ratio found in product.</p>
600
-
601
- **Kind**: global variable
602
-
603
- | Param | Type | Description |
604
- | ---------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
605
- | value | <code>number</code> | <p>Current quantity as entered by user in first input</p> |
606
- | otherUnits | <code>Array.&lt;IFilledDimensionUnits&gt;</code> \| <code>undefined</code> | <p>FilledDimensionUnits found in product (possibly undefined)</p> |
607
- | value2 | <code>number</code> \| <code>undefined</code> | <p>Current quantity as entered by user in second input (possibly undefined)</p> |
608
- | targetIsSecondaryInput | <code>boolean</code> | <p>If action was triggered from secondary input (defaults to false)</p> |
609
-
610
- <a name="splitOnDashes"></a>
611
-
612
- ## splitOnDashes ⇒ <code>Array.&lt;string&gt;</code>
613
-
614
- <p>Get product name as array. Array created mostly by splitting name on dash symbol (and variations).</p>
615
-
616
- **Kind**: global variable
617
- **Returns**: <code>Array.&lt;string&gt;</code> - <ul>
618
-
619
- <li>Position 0 is the &quot;commum section&quot; of the name, and position 1 should contain all specifics (ex. color, size, etc...)</li>
620
- </ul>
621
-
622
- | Param | Type |
623
- | ------- | --------------------------------------------------------------------- |
624
- | product | <code>IIndexedVariationAlgolia</code> \| <code>IIndexedProduct</code> |
625
- | locale | <code>string</code> \| <code>undefined</code> |
626
-
627
- <a name="getProdName"></a>
628
-
629
- ## getProdName
630
-
631
- <p>Function getParentProductCategoryGroup</p>
632
-
633
- **Kind**: global variable
634
-
635
- | Param | Description |
636
- | ----- | ----------------------- |
637
- | prod | <p>Product to check</p> |
638
-
639
- <a name="getParentProductCategoryGroup"></a>
640
-
641
- ## getParentProductCategoryGroup
642
-
643
- <p>Function getProductFormOptions - Returns all AttributeValues for product to construct options in add to cart form</p>
644
-
645
- **Kind**: global variable
646
-
647
- | Param | Description |
648
- | ---------- | ---------------------------------------------- |
649
- | product | <p>Product to check</p> |
650
- | attributes | <p>Array of IAttributes to fetch info from</p> |
651
-
652
- <a name="getProductFormOptions"></a>
653
-
654
- ## getProductFormOptions ⇒
655
-
656
- <p>Checks if product is of type by checking TYPE attribute value. Works with indexed product or cart item.</p>
657
-
658
- **Kind**: global variable
659
- **Returns**: <p>boolean</p>
660
-
661
- | Param |
662
- | ---------------- |
663
- | product |
664
- | type |
665
- | excludeUndefined |
666
-
667
- <a name="checkIfProductIsInstallation"></a>
668
-
669
- ## checkIfProductIsInstallation
670
-
671
- <p>Returns array of installation items found in provided array</p>
672
-
673
- **Kind**: global variable
674
-
675
- | Param | Description |
676
- | ----- | ----------------------------------------------------------- |
677
- | items | <p>Array of cart items or IIndexedDeclinations to check</p> |
678
-
679
- <a name="getAllInstallFromItems"></a>
680
-
681
- ## getAllInstallFromItems
682
-
683
- <ul>
684
- <li>Returns items with only one apparent grass product (used for detail customers).
685
- ** FOR DISPLAY PURPOSES ONLY - Always save grass products separatly in ICart **</li>
686
- </ul>
687
-
688
- **Kind**: global variable
689
-
690
- | Param | Description |
691
- | -------------- | --------------------------------------------------------------------- |
692
- | recursiveItems | <p>ICartItems with subitems (object created for display purposes)</p> |
693
-
694
- <a name="getGrassSubQuestionsByType"></a>
695
-
696
- ## getGrassSubQuestionsByType ⇒
697
-
698
- <p>For grass products. Over 1480pi2, if installation, quantities are rounded to rolls (10pi2) if pickup, and to half pal. if shipping</p>
699
-
700
- **Kind**: global variable
701
- **Returns**: <p>quantity rounded to rolls with items to change or undefined</p>
702
-
703
- | Param |
704
- | ------------ |
705
- | grassProduct |
706
- | cartData |
707
-
708
- <a name="handleGrassProductQtyRoundForShipping"></a>
709
-
710
- ## handleGrassProductQtyRoundForShipping
711
-
712
- <p>Returns rounded grass quantity depending on current qty, if customer selected installation and pallet unit (if defined)</p>
713
-
714
- **Kind**: global variable
715
-
716
- | Param | Type | Description |
717
- | ---------- | ------------------------------------------------------------ | -------------------------------------------------------- |
718
- | currentQte | <code>number</code> | <p>Current quantity as entered by user in input</p> |
719
- | isShipping | <code>boolean</code> | <p>Whether customer has selected installation option</p> |
720
- | palUnit | <code>IFilledDimensionUnits</code> \| <code>undefined</code> | <p>Pallet FilledDimensionUnit (possibly undefined)</p> |
721
-
722
- <a name="getConcreteQteText"></a>
723
-
724
- ## getConcreteQteText
725
-
726
- <p>returns all items in cart where attribute AVAILABILITY contains wanted type.</p>
727
-
728
- **Kind**: global variable
729
-
730
- | Param |
731
- | ---------------- |
732
- | cartData |
733
- | availabilityType |
734
-
735
- <a name="getConcreteItemsByAvailability"></a>
736
-
737
- ## getConcreteItemsByAvailability ⇒
738
-
739
- <p>Function getVracType - constructs vrac helper object is cart contains vrac or vrac associated items.</p>
740
-
741
- **Kind**: global variable
742
- **Returns**: <p>IVracType object containing vrac_type enum value and vrac_store_ids where vrac items are available</p>
743
-
744
- | Param |
745
- | ------------------------ |
746
- | stores |
747
- | cartData |
748
- | getInventoryItemCallback |
749
-
750
- <a name="fetchFeesBeforeCart"></a>
751
-
752
- ## fetchFeesBeforeCart
753
-
754
- <p>Check if pro custom promo info should be shown for customer for a specific product.</p>
755
-
756
- **Kind**: global variable
757
-
758
- | Param |
759
- | -------------- |
760
- | userData |
761
- | isPro |
762
- | product |
763
- | customMinPrice |
764
-
765
- <a name="calculateUpsellQte"></a>
766
-
767
- ## calculateUpsellQte
768
-
769
- <ul>
770
- <li>checks all upsells in product and returns those where associated quantities are found.</li>
771
- </ul>
772
-
773
- **Kind**: global variable
774
-
775
- | Param | Description |
776
- | -------------- | ------------------------------------------------------------------------------- |
777
- | upsellProducts | <p>All upsells in product</p> |
778
- | cartItems | <p>All current cart items</p> |
779
- | checkQte | <p>If all upsells should be checked for quantity</p> |
780
- | alwaysShow | <p>If upsell should be considered even if it already exists in cart as item</p> |
781
-
782
- <a name="getUpsellsToQuantify"></a>
783
-
784
- ## getUpsellsToQuantify
785
-
786
- <ul>
787
- <li>Returns upsell equivalence text</li>
788
- </ul>
789
-
790
- **Kind**: global variable
791
-
792
- | Param | Description |
793
- | ----------------- | -------------------------------------------------------- |
794
- | upsellsToQuantify | <p>All upsells to show in text</p> |
795
- | qte | <p>Associated product quantity</p> |
796
- | specificProduct | <p>If upsell shown is a specific products</p> |
797
- | isMulti | <p>If upsell if shared by more than one item in cart</p> |
798
- | locale | <p>locale of string to return</p> |
799
-
800
- <a name="getGeneralUpsellQteText"></a>
801
-
802
- ## getGeneralUpsellQteText
803
-
804
- <ul>
805
- <li>Returns quantity stinrg and upsell name to show in Upsell Quantity indicator</li>
806
- </ul>
807
-
808
- **Kind**: global variable
809
-
810
- | Param | Description |
811
- | ---------- | ----------------------------------------------------------- |
812
- | upsell | <p>Upsell to show qyantity for</p> |
813
- | productQte | <p>Quantity of associated product for ratio calculation</p> |
814
- | locale | <p>locale of string to return</p> |
815
-
816
- <a name="checkIfCartContainsException"></a>
817
-
818
- ## checkIfCartContainsException
819
-
820
- <p>Function getCartItemsFromProdUpsells</p>
821
-
822
- **Kind**: global variable
823
-
824
- | Param | Type | Description |
825
- | ---------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------- |
826
- | qte | <code>number</code> | <p>Quantity of product to which upsell is associated</p> |
827
- | currentSku | <code>string</code> | <p>Sku of the declination selected by user for the product to which upsell is associated</p> |
828
- | prodUpsell | <code>Array.&lt;IProductRecommendation&gt;</code> | <p>Array of upsells found in product</p> |
829
- | getProduct | | <p>Callback function to fetch product from DB</p> |
830
- | locale | <code>string</code> | <p>locale for product fetch (defaults to 'fr')</p> |
831
-
832
- <a name="mockCustomPriceList"></a>
833
-
834
- ## mockCustomPriceList
835
-
836
- <p>Takes in a function and checks for error</p>
837
-
838
- **Kind**: global variable
839
-
840
- | Param | Type | Description |
841
- | ------- | ------------------------------ | --------------------------------------------------- |
842
- | method | <code>function</code> | <p>The function to check</p> |
843
- | params | <code>Array.&lt;any&gt;</code> | <p>The array of function parameters</p> |
844
- | message | <code>string</code> | <p>Optional message to match with error message</p> |
845
-
846
- <a name="getRandomValue"></a>
847
-
848
- ## getRandomValue ⇒
849
-
850
- <p>Get an object property value</p>
851
-
852
- **Kind**: global variable
853
- **Returns**: <p>the property value</p>
854
-
855
- | Param | Description |
856
- | ----- | -------------------------------------- |
857
- | obj | <p>The object to scan</p> |
858
- | props | <p>The path of the property to get</p> |
859
-
860
- <a name="getObjectProperty"></a>
861
-
862
- ## getObjectProperty ⇒
863
-
864
- <p>Set an object property to an anonymized value if it exists</p>
865
-
866
- **Kind**: global variable
867
- **Returns**: <p>The object with the edited value</p>
868
-
869
- | Param | Description |
870
- | ----- | ------------------------------------------------- |
871
- | obj | <p>The object to look into</p> |
872
- | props | <p>The property path</p> |
873
- | type | <p>The property type used to shuffle the data</p> |
874
-
875
- <a name="setObjectProperty"></a>
876
-
877
- ## setObjectProperty ⇒
878
-
879
- <p>Anonymise the customer data if in test env</p>
880
-
881
- **Kind**: global variable
882
- **Returns**: <p>The new customer data</p>
883
-
884
- | Param | Description |
885
- | ----- | ------------------------ |
886
- | c | <p>The customer data</p> |
887
-
888
- <a name="getCurrentProvince"></a>
889
-
890
- ## getCurrentProvince ⇒
891
-
892
- <p>Constructs and returns data for indexed cart (algolia or addio)</p>
893
-
894
- **Kind**: global variable
895
- **Returns**: <IIndexedCart>
896
-
897
- | Param | Description |
898
- | -------------------- | ------------------------------------------------------------------------- |
899
- | cartData | <p>Current cart data</p> |
900
- | space | <p>Space object</p> |
901
- | setPaidAtIfUndefined | <p>Optionnal - If true, will set paid_at with current date</p> |
902
- | customer | <p>Optionnal - If defined, adds info based on customer to indexedCart</p> |
903
-
904
- <a name="getCartPromo"></a>
905
-
906
- ## getCartPromo
907
-
908
- <p>Check if current cart promos applied contain a promo_code type promotion</p>
909
-
910
- **Kind**: global variable
911
-
912
- | Param |
913
- | -------- |
914
- | cartData |
915
-
916
- <a name="shouldCheckPromoCode"></a>
917
-
918
- ## shouldCheckPromoCode
919
-
920
- <p>Check if a discount rule applies to a specific declination</p>
921
-
922
- **Kind**: global variable
923
-
924
- | Param | Description |
925
- | ------------- | --------------------------------- |
926
- | discount_rule | <p>The discount rule to check</p> |
927
- | declination | <p>The declination to compare</p> |
928
-
929
- <a name="shouldApplyRuleToDeclination"></a>
930
-
931
- ## shouldApplyRuleToDeclination
932
-
933
- <p>Check if a specific rule of a discount rule is respected</p>
934
-
935
- **Kind**: global variable
936
-
937
- | Param | Description |
938
- | ---------- | ---------------------------------------------------- |
939
- | ruleDetail | <p>The rule details object to check</p> |
940
- | cartValue | <p>The value to compare with rule specifications</p> |
941
-
942
- <a name="getResultRuleDetail"></a>
943
-
944
- ## getResultRuleDetail
945
-
946
- <p>Check if rule applied to product attributes is respected for specific declination attributes</p>
947
-
948
- **Kind**: global variable
949
-
950
- | Param | Description |
951
- | ------------------------ | --------------------------------------------- |
952
- | attributeAndValues | <p>The rule details object to check</p> |
953
- | arrDeclinationAttributes | <p>The declinations attributes to compare</p> |
954
-
955
- <a name="getCartPromoType"></a>
956
-
957
- ## getCartPromoType
958
-
959
- <p>Check if promo code can be applied to a specific cart</p>
960
-
961
- **Kind**: global variable
962
-
963
- | Param | Description |
964
- | --------- | ------------------------------------------------- |
965
- | cart | <p>The cart to check</p> |
966
- | promoCode | <p>The discount rule with promo code to check</p> |
967
-
968
- <a name="checkPromoCodeEligibility"></a>
969
-
970
- ## checkPromoCodeEligibility
971
-
972
- <p>Returns tier pricing step that should be applied for provided quantity, or undefined if none should apply</p>
973
-
974
- **Kind**: global variable
975
-
976
- | Param | Description |
977
- | ------------------ | ---------------------------------------------- |
978
- | tierPricingToCheck | <p>the indexed tier-pricing array to check</p> |
979
- | qte | |
980
-
981
- <a name="getTierPricingToApply"></a>
982
-
983
- ## getTierPricingToApply
984
-
985
- <p>Converts tier-pricing found in discount_rule to IIndexedTierPricing.</p>
986
-
987
- **Kind**: global variable
988
-
989
- | Param | Description |
990
- | ------------ | ------------------------------------------------------------------------------ |
991
- | discountRule | <p>the tier-pricing tier discountRule to check</p> |
992
- | price | <p>declinations regular price from which tier-pricing result is calculated</p> |
993
- | space | |
994
- | decimals | <p>the amount of decimals to show on tier-pricing result</p> |
995
-
996
- <a name="applyTierPricing"></a>
997
-
998
- ## applyTierPricing
999
-
1000
- <p>Calculate new discount_price object for cart item base on qte and tier_pricing</p>
1001
-
1002
- **Kind**: global variable
1003
-
1004
- | Param | Description |
1005
- | ---------------- | ------------------------------------------------------------------------------------- |
1006
- | item | <p>the item to check</p> |
1007
- | setOriginalPrice | <p>if original_amount should be set instead of discount_price.amount</p> |
1008
- | originalDecli | <p>Optionnal. The IIndexedDeclination used to construct the cart item originally.</p> |
1009
-
1010
- <a name="getNewDiscountPriceFromTierPricing"></a>
1011
-
1012
- ## getNewDiscountPriceFromTierPricing
1013
-
1014
- <p>Get discounted price after applying discount rules to a provided price</p>
1015
-
1016
- **Kind**: global variable
1017
-
1018
- | Param | Description |
1019
- | -------------- | ----------------------------------------------------- |
1020
- | discount_rules | <p>The discount rules to apply</p> |
1021
- | amount | <p>The initial amount on which to apply discounts</p> |
1022
- | space | |
1023
-
1024
- <a name="applyDiscountRulesOnProduct"></a>
1025
-
1026
- ## applyDiscountRulesOnProduct
1027
-
1028
- <p>Get result of discount rule discount on a provided amount</p>
1029
-
1030
- **Kind**: global variable
1031
-
1032
- | Param | Description |
1033
- | ----------------- | ----------------------------------------------- |
1034
- | initial | <p>The price on which to apply the discount</p> |
1035
- | discountResultObj | <p>The discount rule result object</p> |
1036
-
1037
- <a name="applyDiscountToPrice"></a>
1038
-
1039
- ## applyDiscountToPrice ⇒
1040
-
1041
- <p>Get sku(s) affected by a promo as an array of strings</p>
1042
-
1043
- **Kind**: global variable
1044
- **Returns**: <p>And array of strings</p>
1045
-
1046
- | Param | Description |
1047
- | -------------- | ----------------------------------------------------- |
1048
- | valueToConvert | <p>The sku or sku array associated with the promo</p> |
1049
-
1050
- <a name="getSkuArrayForPromo"></a>
1051
-
1052
- ## getSkuArrayForPromo ⇒
1053
-
1054
- <p>Returns a list of all skus where promo applied to specific products should apply. Check for both amount/percent_sku and amount/percent_category options.</p>
1055
-
1056
- **Kind**: global variable
1057
- **Returns**: <p>An array of strings</p>
1058
-
1059
- | Param | Description |
1060
- | ------------ | ----------------------------- |
1061
- | cartItems | <p>The current cart items</p> |
1062
- | promoToCheck | <p>The promo to check</p> |
1063
-
1064
- <a name="getResultAppliedDiscountSkus"></a>
1065
-
1066
- ## getResultAppliedDiscountSkus ⇒
1067
-
1068
- <p>Creates array of all category level slugs for a cart item.</p>
1069
-
1070
- **Kind**: global variable
1071
- **Returns**: <p>An array of strings</p>
1072
-
1073
- | Param | Description |
1074
- | -------------- | ------------------------------------------- |
1075
- | itemCategories | <p>Value found in props cart.categories</p> |
1076
-
1077
- <a name="getItemCategorySlugArray"></a>
1078
-
1079
- ## getItemCategorySlugArray
1080
-
1081
- <p>Apply all valid discounts found in a specific cart's discount_rules props to cart</p>
1082
-
1083
- **Kind**: global variable
1084
-
1085
- | Param | Description |
1086
- | ------------- | --------------------------------------------------------------------------------- |
1087
- | cart | <p>The cart to check</p> |
1088
- | isMultiPromo | |
1089
- | forceShipping | <p>If cart should be considered as a shipping cart, even if is_pickup is true</p> |
1090
-
1091
- <a name="applyDiscountToCart"></a>
1092
-
1093
- ## applyDiscountToCart
1094
-
1095
- <p>Get the ICartPromoApplied object for a specified discount_rule. Only works for promos that do not apply to products of certain categories/skus.</p>
1096
-
1097
- **Kind**: global variable
1098
-
1099
- | Param |
1100
- | -------getConvertedUnitQuantity
1101
- | cart |
1102
- | discount |
1103
-
1104
- <a name="getStandardCartPromoFromDiscount"></a>
1105
-
1106
- ## getStandardCartPromoFromDiscount ⇒
1107
-
1108
- <p>Calculates the cumulative subtotal for all service/fee type items in cart, including any applied promos. Usefull when calculating a promo's amount when all fees and services should be excluded.</p>
1109
-
1110
- **Kind**: global variable
1111
- **Returns**: <p>A number</p>
1112
-
1113
- | Param | Description |
1114
- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
1115
- | cartData | <p>The cartData to check</p> |
1116
- | allCurrentAppliedToItemPromos | <p>All currently active cartPromos that apply to items in cart. Sent seperatly in case local state is different from current cartData.</p> |
1117
-
1118
- <a name="checkIfCouldApplyIncentivePromo"></a>
1119
-
1120
- ## checkIfCouldApplyIncentivePromo
1121
-
1122
- <p>Calculates amount to be removed for payment incentive type promos.</p>
1123
-
1124
- **Kind**: global variable
1125
-
1126
- | Param | Description |
1127
- | ------------------ | ---------------------------------------------------------------------------------------------------------- |
1128
- | cartData | |
1129
- | checkDiscountRules | <p>Optionnal. If cart discount_rules should be checked if cart_promos_applied does not have promo yet.</p> |
1130
-
1131
- <a name="getAfterTaxesPromosTotalAmount"></a>
1132
-
1133
- ## getAfterTaxesPromosTotalAmount
1134
-
1135
- <p>Returns cart_promos_applied corresponding to payment incentive, if found. Can also check in discount_rules if props provided</p>
1136
-
1137
- **Kind**: global variable
1138
-
1139
- | Param | Description |
1140
- | ------------------ | ------------------------------------------------------------------------------------------------------------- |
1141
- | cartData | |
1142
- | checkDiscountRules | <p>Optionnal. If the function should check in cart discount_rules if nothing found in cart_promos_applied</p> |
1143
-
1144
- <a name="getAfterTaxesPromoInCart"></a>
1145
-
1146
- ## getAfterTaxesPromoInCart
1147
-
1148
- <p>Returns the information regarding the payment incentive promo if found in cart's discount_rules</p>
1149
-
1150
- **Kind**: global variable
1151
-
1152
- | Param |
1153
- | -------- |
1154
- | cartData |
1155
-
1156
- <a name="unitShortDict"></a>
1157
-
1158
- ## unitShortDict ⇒ <code>ILang</code>
1159
-
1160
- <p>Returns the dictionnary containing the shortened version of unit labels in multiple languages</p>
1161
-
1162
- **Kind**: global variable
1163
- **Returns**: <code>ILang</code> - <p>The dictionnary containing the shortened unit label in multiple languages</p>
1164
-
1165
- | Param | Type | Description |
1166
- | ------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
1167
- | slug | <code>string</code> | <p>The slug for which we want to get the shortened dictionnary</p> |
1168
- | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | <p>An array of slugs that we want to return a default dictionnary for, in this case the unit dictionnary for unit</p> |
1169
-
1170
- <a name="getConvertedUnitQuantity"></a>
1171
-
1172
- ## getConvertedUnitQuantity
1173
-
1174
- <p>Constructs object with detailled inventory quantities by unit (based on other_units for product)</p>
1175
-
1176
- **Kind**: global variable
1177
-
1178
- | Param | Description |
1179
- | --------------------- | ---------------- |
1180
- | other_units | |
1181
- | inventoryQuantity | |
1182
- | isGrass | |
1183
- | showNegativeInventory | <p>optionnal</p> |
1184
-
1185
- <a name="getQty"></a>
1186
-
1187
- ## getQty
1188
-
1189
- <p>Calculates inventory unit quantity for function getQty</p>
1190
-
1191
- **Kind**: global variable
1192
-
1193
- | Param |
1194
- | ----------------- |
1195
- | value |
1196
- | isUnitFittingUnit |
1197
- | isNegativeQty |
1198
-
1199
- <a name="recursiveCheckObject"></a>
1200
-
1201
- ## recursiveCheckObject ⇒
1202
-
1203
- <p>Updates value of object by checking recursivly.</p>
1204
-
1205
- **Kind**: global variable
1206
- **Returns**: <p>updated object</p>
1207
-
1208
- | Param | Description |
1209
- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1210
- | allValues | <p>Full value object</p> |
1211
- | newValue | <p>New value to update</p> |
1212
- | propsToCheck | <p>Full key string associated to value to update, with nested keys seperated by dots (.). If the value to update is nested in an array, use square brackets with index between (ex. first_key.second_key[2].third_key)</p> |
1213
-
1214
- <a name="getOrderedPromises"></a>
1215
-
1216
- ## getOrderedPromises ⇒
1217
-
1218
- <p>Checks list of promises for applicable banks based on space bank types.</p>
1219
-
1220
- **Kind**: global variable
1221
- **Returns**: <p>An array of applicable banks. If no bank is active for a type, is not returned in array. If active bank of type is in a inactive promise, is returned with props pa_is_active: false.</p>
1222
-
1223
- | Param | Description |
1224
- | --------------- | ------------------------------------------------------------ |
1225
- | promisesToCheck | <p>The promise list to check</p> |
1226
- | possibleBanks | <p>the possible bank types (usually found in space data)</p> |
1227
-
1228
- <a name="checkForApplicableBanks"></a>
1229
-
1230
- ## checkForApplicableBanks
1231
-
1232
- <p>Returns if a promise is currently active. Promise is active if it is not archived, and if current date is same or after starting_date, and before ending_date (if defined).</p>
1233
-
1234
- **Kind**: global variable
1235
-
1236
- | Param | Description |
1237
- | ------- | -------------------------------- |
1238
- | promise | <p>the promise data to check</p> |
1239
-
1240
- <a name="checkIfOtherBankOfSameTypeIsActive"></a>
1241
-
1242
- ## checkIfOtherBankOfSameTypeIsActive
1243
-
1244
- <p>Returns translated name for a provided bank type ID.</p>
1245
-
1246
- **Kind**: global variable
1247
-
1248
- | Param | Description |
1249
- | ------------ | ------------------------------------------------ |
1250
- | allBankTypes | <p>The current bank types for space</p> |
1251
- | bankTypeID | <p>The bank type ID for which we want a name</p> |
1252
- | locale | <p>Optionnal. Defaults to 'fr'</p> |
1253
-
1254
- <a name="getBankTypeName"></a>
1255
-
1256
- ## getBankTypeName
1257
-
1258
- <p>Calculates the remaining amount for a specific promise's bank</p>
1259
-
1260
- **Kind**: global variable
1261
-
1262
- | Param | Description |
1263
- | ----------------- | ---------------------------------------------------------------------------------------------- |
1264
- | initialBankAmount | <p>the initial amount of the bank</p> |
1265
- | bankHistory | <p>array of all history entries for bank. Will be ordered by date before deducing amounts.</p> |
1266
-
1267
- <a name="getIndexedByCustomerPromiseValues"></a>
1268
-
1269
- ## getIndexedByCustomerPromiseValues ⇒
1270
-
1271
- <p>Returns the most recently emptied bank of a given type</p>
1272
-
1273
- **Kind**: global variable
1274
- **Returns**: <p>An IBank with a promise_unique_id</p>
1275
-
1276
- | Param | Description |
1277
- | ------------------ | ------------------------------------------------------------- |
1278
- | allCustomerPAsData | <p>the array of all promises to purchase we want to check</p> |
1279
- | type | <p>the bank_type_id to check</p> |
1280
- | promiseUniqueID | <p>the current promise unique id</p> |
1281
-
1282
- <a name="getIndexServices"></a>
1283
-
1284
- ## getIndexServices
1285
-
1286
- <p>Save new entry objects to provided search index services</p>
1287
-
1288
- **Kind**: global variable
1289
-
1290
- | Param | Description |
1291
- | ------------- | --------------------------------------------------------------- |
1292
- | services | <p>the services to check for save</p> |
1293
- | newEntry | <p>the object to save</p> |
1294
- | processLogStr | <p>the string to add to the log shown with service response</p> |
1295
-
1296
- <a name="saveNewEntryToIndex"></a>
1297
-
1298
- ## saveNewEntryToIndex
1299
-
1300
- <p>Save a partial object entry to provided search index services.</p>
1301
-
1302
- **Kind**: global variable
1303
-
1304
- | Param | Description |
1305
- | ---------------- | --------------------------------------------------------------------------------------- |
1306
- | services | <p>the services to check for save</p> |
1307
- | partialNewEntry | <p>the object to save</p> |
1308
- | processLogStr | <p>the string to add to the log shown with service response</p> |
1309
- | createIfNoExists | <p>= Optionnal. If should create entry if it does not already exist in search index</p> |
1310
-
1311
- <a name="partialSaveNewEntryToIndex"></a>
1312
-
1313
- ## partialSaveNewEntryToIndex
1314
-
1315
- <p>Returns an object with base info needed to call Algolia/AddioSearch with search query.</p>
1316
-
1317
- **Kind**: global variable
1318
-
1319
- | Param |
1320
- | ----- |
1321
- | space |
1322
-
1323
- <a name="getFetchInfoAlgoliaAddioSearch"></a>
1324
-
1325
- ## getFetchInfoAlgoliaAddioSearch
1326
-
1327
- <p>Fetch entries from either algolia or AddioSearch (prospr) for a provided index. Client-side only!</p>
1328
-
1329
- **Kind**: global variable
1330
-
1331
- | Param |
1332
- | ------ |
1333
- | param0 |
1334
-
1335
- <a name="fetchEntriesAlgoliaAddioSearch"></a>
1336
-
1337
- ## fetchEntriesAlgoliaAddioSearch
1338
-
1339
- <p>Returns search result from active search index service. Server-side friendly!</p>
1340
-
1341
- **Kind**: global variable
1342
-
1343
- | Param | Description |
1344
- | ---------- | ------------------------------------------------------------------------------------------------------ |
1345
- | parameters | <p>Parsed parameters of IQueryProps. Space and indice must be provided, other props are optionnal.</p> |
1346
-
1347
- <a name="isTestEnv"></a>
1348
-
1349
- ## isTestEnv
1350
-
1351
- <p>TBSDK - SDK Manager</p>
1352
- <p>Client SDK to access TheBEAST eCommerce</p>
1353
-
1354
- **Kind**: global constant
1355
- <a name="spaceInitData"></a>
1356
-
1357
- ## spaceInitData
1358
-
1359
- <p>Use this object to change which space is being tested!</p>
1360
-
1361
- **Kind**: global constant
1362
- <a name="getMinDatePicker"></a>
1363
-
1364
- ## getMinDatePicker()
1365
-
1366
- <p>Sets the minimum shipping day for delivery</p>
1367
-
1368
- **Kind**: global function
1369
- <a name="getProductSellUnitLabel"></a>
1370
-
1371
- ## getProductSellUnitLabel(otherUnits, locale, returnUnitForSlugs) ⇒ <code>string</code>
1372
-
1373
- <p>Returns sell unit label in correct language for a specific product's other_units</p>
1374
-
1375
- **Kind**: global function
1376
- **Returns**: <code>string</code> - <p>The sell unit label in the correct language</p>
1377
-
1378
- | Param | Type | Default | Description |
1379
- | ------------------ | -------------------------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------- |
1380
- | otherUnits | <code>Array.&lt;IFilledDimensionUnits&gt;</code> \| <code>undefined</code> | | <p>The unit array we have to check to get the sell unit</p> |
1381
- | locale | <code>string</code> \| <code>undefined</code> | <code>&quot;fr&quot;</code> | <p>The language in which we want to return the label</p> |
1382
- | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | | <p>An array of the slugs we want to return the unit label for</p> |
1383
-
1384
- <a name="splitOnDashes"></a>
1385
-
1386
- ## splitOnDashes(stringToSplit) ⇒ <code>Array.&lt;string&gt;</code>
1387
-
1388
- **Kind**: global function
1389
-
1390
- | Param | Type | Description |
1391
- | ---------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
1392
- | stringToSplit | <code>string</code> | |
1393
- | dummyStringToReplace.currentValue, | <code>string</code> | <p>optionnal, default : '%%-%%'. Used to provide general replace values for a specific string. Is applied to both sections of the splitted string.</p> |
1394
- | dummyStringToReplace.newValue, | <code>string</code> | <p>optionnal, default : ' - '. Used to provide general replace values for a specific string. Is applied to both sections of the splitted string.</p> |
1395
-
1396
- <a name="getRandomValue"></a>
1397
-
1398
- ## getRandomValue(val, type) ⇒
1399
-
1400
- <p>Replace a value with anonymized value</p>
1401
-
1402
- **Kind**: global function
1403
- **Returns**: <p>the new value</p>
1404
-
1405
- | Param | Description |
1406
- | ----- | ------------------------- |
1407
- | val | <p>The original value</p> |
1408
- | type | <p>The type of data</p> |
1409
-
1410
- <a name="getCartPromo"></a>
1411
-
1412
- ## getCartPromo(cartData)
1413
-
1414
- <p>Get formatted array of cart promos applied to a specific cart</p>
1415
-
1416
- **Kind**: global function
1417
-
1418
- | Param |
1419
- | -------- |
1420
- | cartData |
1421
-
1422
- <a name="_checkRuleApplicationArray"></a>
1423
-
1424
- ## \_checkRuleApplicationArray(checkedRulesApplicationArray) ⇒
1425
-
1426
- <p>Checks if discount rule should be applied to cart based on each rule verification results.</p>
1427
-
1428
- **Kind**: global function
1429
- **Returns**: <p>A boolean</p>
1430
-
1431
- | Param | Description |
1432
- | ---------------------------- | ------------------------------------------------------------------------------------------------------ |
1433
- | checkedRulesApplicationArray | <p>Array where each position is a verified rule result (condition with passed of failed (boolean))</p> |
1434
-
1435
- <a name="checkIfCouldApplyIncentivePromo"></a>
1436
-
1437
- ## checkIfCouldApplyIncentivePromo(cartData, skipCheckFor) ⇒
1438
-
1439
- <p>Checks if an incentive discount could (in theory) by added to provided cart, by checking found incentive discount's rule array.</p>
1440
-
1441
- **Kind**: global function
1442
- **Returns**: <p>a boolean</p>
1443
-
1444
- | Param | Description |
1445
- | ------------ | -------------------------------------------------------------- |
1446
- | cartData | <p>The cart to check (checks discount_rules for incentive)</p> |
1447
- | skipCheckFor | <p>If certain rules should be ignore for check</p> |
1448
-
1449
- <a name="getOrderedPromises"></a>
1450
-
1451
- ## getOrderedPromises(promises)
1452
-
1453
- <p>Get ordered array of promise data objects by starting date.</p>
1454
-
1455
- **Kind**: global function
1456
-
1457
- | Param |
1458
- | -------- |
1459
- | promises |
1460
-
1461
- <a name="getIndexServices"></a>
1462
-
1463
- ## getIndexServices(space, partialIndexID)
1464
-
1465
- <p>Returns objet with possible index service instances
1466
- As of now, checks for Algolia and Addio Search</p>
1467
-
1468
- **Kind**: global function
1469
-
1470
- | Param | Description |
1471
- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1472
- | space | <p>the spaceObj to check</p> |
1473
- | partialIndexID | <p>the partial index ID to consult for search, excluding the env. variable (prod* or test* will be added in function). \*\* Important to use index ID, not table ID!</p> |
1
+ ## Classes
2
+
3
+ <dl>
4
+ <dt><a href="#Brand">Brand</a></dt>
5
+ <dd><p>Brand class</p></dd>
6
+ <dt><a href="#Catalogue">Catalogue</a></dt>
7
+ <dd><p>Catalogue class</p></dd>
8
+ <dt><a href="#Customer">Customer</a></dt>
9
+ <dd><p>Customer class</p></dd>
10
+ <dt><a href="#Discount">Discount</a></dt>
11
+ <dd><p>Brand class</p></dd>
12
+ <dt><del><a href="#Invoice">Invoice</a></del></dt>
13
+ <dd></dd>
14
+ <dt><del><a href="#Order">Order</a></del></dt>
15
+ <dd></dd>
16
+ <dt><a href="#Org">Org</a></dt>
17
+ <dd><p>Class Org - Organization
18
+ Represent an organization created by a user. An organization can have multiple space.</p></dd>
19
+ <dt><a href="#Product">Product</a></dt>
20
+ <dd><p>Product class</p></dd>
21
+ <dt><a href="#PurchaseOrder">PurchaseOrder</a></dt>
22
+ <dd><p>Brand class</p></dd>
23
+ <dt><a href="#Service">Service</a></dt>
24
+ <dd><p>Service class</p></dd>
25
+ <dt><a href="#Space">Space</a></dt>
26
+ <dd><p>Class Space
27
+ A Space represent a company.</p></dd>
28
+ <dt><a href="#User">User</a></dt>
29
+ <dd><p>User class</p></dd>
30
+ <dt><a href="#ProsprSearch">ProsprSearch</a></dt>
31
+ <dd><p>À NOTER - Prospr est l'ancien nom du ecomm, est depuis devenu Addio.
32
+ Il faudra éventuellement faire le refactoring nécessaire pour remplacer toutes les appelations,
33
+ mais en attendant, c'est normal qu'il y ait les deux noms à différents endroits.</p></dd>
34
+ </dl>
35
+
36
+ ## Members
37
+
38
+ <dl>
39
+ <dt><a href="#CustomerTypeEnum">CustomerTypeEnum</a></dt>
40
+ <dd><p>ICustomer interface</p>
41
+ <p>Représente un client (customer). Un client peut:</p>
42
+ <ul>
43
+ <li>Faire des recherches parmis les différents items du commerçant</li>
44
+ <li>Afficher une fiche cliente</li>
45
+ </ul></dd>
46
+ <dt><a href="#getDefaultDiscountRule">getDefaultDiscountRule</a></dt>
47
+ <dd><p>Exemple:</p>
48
+ <p>Product = 5.00$</p>
49
+ <p>Discount rule:
50
+ quantity &gt;= 10 ? remove 2</p>
51
+ <p>Result:
52
+ If applied to cart:
53
+ 11 Product = (before) 55.00$ (after) 53.00$</p>
54
+ <p>attribute color == red ? percent 10
55
+ 1 red Product = (before) 5.00$ (after) 4.50$</p>
56
+ <p>attribute color == red ? percent -20
57
+ 1 red Product = (before) 5.00$ (after) 6.00$</p></dd>
58
+ <dt><a href="#installationProductsSlugs">installationProductsSlugs</a></dt>
59
+ <dd><p>Contains all necessary elements for extra questions if adding grass product to cart</p></dd>
60
+ <dt><a href="#getConcreteCartInfo">getConcreteCartInfo</a></dt>
61
+ <dd><ul>
62
+ <li>Create the essential info needed when checking a grass type product for cart</li>
63
+ </ul></dd>
64
+ <dt><a href="#getMinDateOffset">getMinDateOffset</a></dt>
65
+ <dd><p>compares date with blockedDates from DB and blocked days (currently hardcoded in function)</p></dd>
66
+ <dt><a href="#shouldDisableDate">shouldDisableDate</a></dt>
67
+ <dd><p>checks if type of cart corresponds to a blockedDates array and if array has dates defined</p></dd>
68
+ <dt><a href="#installationFeePalletTier">installationFeePalletTier</a></dt>
69
+ <dd><p>Calculates fees that should be applied to provided cart, and fetches them from database or fee array if provided.
70
+ Returns the items to add, update and delete, as well as other cart info to set after fees.
71
+ ** Optimized version possible, where address zones and distance are calculated before and properties are sent directly to function
72
+ ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p></dd>
73
+ <dt><a href="#applyFeesToCart">applyFeesToCart</a></dt>
74
+ <dd><p>Checks if sample shipping fee should be removed from cart depending on cart items found in cart.
75
+ ** Optimized version possible using brand name instead of brand id, removing async check.
76
+ ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p></dd>
77
+ <dt><a href="#calculateShippingForVrac">calculateShippingForVrac</a> ⇒</dt>
78
+ <dd><p>checks if cart expired using the updated_at date stored in the shipping_payload</p></dd>
79
+ <dt><a href="#transformG2CustomerToCustomer">transformG2CustomerToCustomer</a></dt>
80
+ <dd><p>Verifies if customer exists in G2.</p></dd>
81
+ <dt><a href="#checkIfCustomerExistsInG2">checkIfCustomerExistsInG2</a></dt>
82
+ <dd><p>Updates customer in database with new info found in G2.</p></dd>
83
+ <dt><a href="#getCustomPriceList">getCustomPriceList</a></dt>
84
+ <dd><p>Get promise to purchase additionnal escompte equivalent from customPriceList for specific cart item</p></dd>
85
+ <dt><a href="#getFittingUnits">getFittingUnits</a> ⇒</dt>
86
+ <dd><p>Returns string corresponding to provided cart's type.</p></dd>
87
+ <dt><a href="#getProductSellUnitLabel">getProductSellUnitLabel</a> ⇒ <code>string</code></dt>
88
+ <dd><p>Returns the plural unit label for a specific slug</p></dd>
89
+ <dt><a href="#getDescriptionString">getDescriptionString</a></dt>
90
+ <dd><p>Returns rounded product quantities depending on current value, value of secondary input if existant and sale unit per command step ratio found in product.</p></dd>
91
+ <dt><a href="#splitOnDashes">splitOnDashes</a> ⇒ <code>Array.&lt;string&gt;</code></dt>
92
+ <dd><p>Get product name as array. Array created mostly by splitting name on dash symbol (and variations).</p></dd>
93
+ <dt><a href="#getProdName">getProdName</a></dt>
94
+ <dd><p>Function getParentProductCategoryGroup</p></dd>
95
+ <dt><a href="#getParentProductCategoryGroup">getParentProductCategoryGroup</a></dt>
96
+ <dd><p>Function getProductFormOptions - Returns all AttributeValues for product to construct options in add to cart form</p></dd>
97
+ <dt><a href="#getProductFormOptions">getProductFormOptions</a> ⇒</dt>
98
+ <dd><p>Checks if product is of type by checking TYPE attribute value. Works with indexed product or cart item.</p></dd>
99
+ <dt><a href="#checkIfProductIsInstallation">checkIfProductIsInstallation</a></dt>
100
+ <dd><p>Returns array of installation items found in provided array</p></dd>
101
+ <dt><a href="#getAllInstallFromItems">getAllInstallFromItems</a></dt>
102
+ <dd><ul>
103
+ <li>Returns items with only one apparent grass product (used for detail customers).
104
+ ** FOR DISPLAY PURPOSES ONLY - Always save grass products separatly in ICart **</li>
105
+ </ul></dd>
106
+ <dt><a href="#getGrassSubQuestionsByType">getGrassSubQuestionsByType</a> ⇒</dt>
107
+ <dd><p>For grass products. Over 1480pi2, if installation, quantities are rounded to rolls (10pi2) if pickup, and to half pal. if shipping</p></dd>
108
+ <dt><a href="#handleGrassProductQtyRoundForShipping">handleGrassProductQtyRoundForShipping</a></dt>
109
+ <dd><p>Returns rounded grass quantity depending on current qty, if customer selected installation and pallet unit (if defined)</p></dd>
110
+ <dt><a href="#getConcreteQteText">getConcreteQteText</a></dt>
111
+ <dd><p>returns all items in cart where attribute AVAILABILITY contains wanted type.</p></dd>
112
+ <dt><a href="#getConcreteItemsByAvailability">getConcreteItemsByAvailability</a> ⇒</dt>
113
+ <dd><p>Function getVracType - constructs vrac helper object is cart contains vrac or vrac associated items.</p></dd>
114
+ <dt><a href="#fetchFeesBeforeCart">fetchFeesBeforeCart</a></dt>
115
+ <dd><p>Check if pro custom promo info should be shown for customer for a specific product.</p></dd>
116
+ <dt><a href="#calculateUpsellQte">calculateUpsellQte</a></dt>
117
+ <dd><ul>
118
+ <li>checks all upsells in product and returns those where associated quantities are found.</li>
119
+ </ul></dd>
120
+ <dt><a href="#getUpsellsToQuantify">getUpsellsToQuantify</a></dt>
121
+ <dd><ul>
122
+ <li>Returns upsell equivalence text</li>
123
+ </ul></dd>
124
+ <dt><a href="#getGeneralUpsellQteText">getGeneralUpsellQteText</a></dt>
125
+ <dd><ul>
126
+ <li>Returns quantity stinrg and upsell name to show in Upsell Quantity indicator</li>
127
+ </ul></dd>
128
+ <dt><a href="#checkIfCartContainsException">checkIfCartContainsException</a></dt>
129
+ <dd><p>Function getCartItemsFromProdUpsells</p></dd>
130
+ <dt><a href="#mockCustomPriceList">mockCustomPriceList</a></dt>
131
+ <dd><p>Takes in a function and checks for error</p></dd>
132
+ <dt><a href="#getRandomValue">getRandomValue</a> ⇒</dt>
133
+ <dd><p>Get an object property value</p></dd>
134
+ <dt><a href="#getObjectProperty">getObjectProperty</a> ⇒</dt>
135
+ <dd><p>Set an object property to an anonymized value if it exists</p></dd>
136
+ <dt><a href="#setObjectProperty">setObjectProperty</a> ⇒</dt>
137
+ <dd><p>Anonymise the customer data if in test env</p></dd>
138
+ <dt><a href="#getCurrentProvince">getCurrentProvince</a> ⇒</dt>
139
+ <dd><p>Constructs and returns data for indexed cart (algolia or addio)</p></dd>
140
+ <dt><a href="#getCartPromo">getCartPromo</a></dt>
141
+ <dd><p>Check if current cart promos applied contain a promo_code type promotion</p></dd>
142
+ <dt><a href="#shouldCheckPromoCode">shouldCheckPromoCode</a></dt>
143
+ <dd><p>Check if a discount rule applies to a specific declination</p></dd>
144
+ <dt><a href="#shouldApplyRuleToDeclination">shouldApplyRuleToDeclination</a></dt>
145
+ <dd><p>Check if a specific rule of a discount rule is respected</p></dd>
146
+ <dt><a href="#getResultRuleDetail">getResultRuleDetail</a></dt>
147
+ <dd><p>Check if rule applied to product attributes is respected for specific declination attributes</p></dd>
148
+ <dt><a href="#getCartPromoType">getCartPromoType</a></dt>
149
+ <dd><p>Check if promo code can be applied to a specific cart</p></dd>
150
+ <dt><a href="#checkPromoCodeEligibility">checkPromoCodeEligibility</a></dt>
151
+ <dd><p>Returns tier pricing step that should be applied for provided quantity, or undefined if none should apply</p></dd>
152
+ <dt><a href="#getTierPricingToApply">getTierPricingToApply</a></dt>
153
+ <dd><p>Converts tier-pricing found in discount_rule to IIndexedTierPricing.</p></dd>
154
+ <dt><a href="#applyTierPricing">applyTierPricing</a></dt>
155
+ <dd><p>Calculate new discount_price object for cart item base on qte and tier_pricing</p></dd>
156
+ <dt><a href="#getNewDiscountPriceFromTierPricing">getNewDiscountPriceFromTierPricing</a></dt>
157
+ <dd><p>Get discounted price after applying discount rules to a provided price</p></dd>
158
+ <dt><a href="#applyDiscountRulesOnProduct">applyDiscountRulesOnProduct</a></dt>
159
+ <dd><p>Get result of discount rule discount on a provided amount</p></dd>
160
+ <dt><a href="#applyDiscountToPrice">applyDiscountToPrice</a> ⇒</dt>
161
+ <dd><p>Get sku(s) affected by a promo as an array of strings</p></dd>
162
+ <dt><a href="#getSkuArrayForPromo">getSkuArrayForPromo</a> ⇒</dt>
163
+ <dd><p>Returns a list of all skus where promo applied to specific products should apply. Check for both amount/percent_sku and amount/percent_category options.</p></dd>
164
+ <dt><a href="#getResultAppliedDiscountSkus">getResultAppliedDiscountSkus</a> ⇒</dt>
165
+ <dd><p>Creates array of all category level slugs for a cart item.</p></dd>
166
+ <dt><a href="#getItemCategorySlugArray">getItemCategorySlugArray</a></dt>
167
+ <dd><p>Apply all valid discounts found in a specific cart's discount_rules props to cart</p></dd>
168
+ <dt><a href="#applyDiscountToCart">applyDiscountToCart</a></dt>
169
+ <dd><p>Get the ICartPromoApplied object for a specified discount_rule. Only works for promos that do not apply to products of certain categories/skus.</p></dd>
170
+ <dt><a href="#getStandardCartPromoFromDiscount">getStandardCartPromoFromDiscount</a> ⇒</dt>
171
+ <dd><p>Calculates the cumulative subtotal for all service/fee type items in cart, including any applied promos. Usefull when calculating a promo's amount when all fees and services should be excluded.</p></dd>
172
+ <dt><a href="#checkIfCouldApplyIncentivePromo">checkIfCouldApplyIncentivePromo</a></dt>
173
+ <dd><p>Calculates amount to be removed for payment incentive type promos.</p></dd>
174
+ <dt><a href="#getAfterTaxesPromosTotalAmount">getAfterTaxesPromosTotalAmount</a></dt>
175
+ <dd><p>Returns cart_promos_applied corresponding to payment incentive, if found. Can also check in discount_rules if props provided</p></dd>
176
+ <dt><a href="#getAfterTaxesPromoInCart">getAfterTaxesPromoInCart</a></dt>
177
+ <dd><p>Returns the information regarding the payment incentive promo if found in cart's discount_rules</p></dd>
178
+ <dt><a href="#unitShortDict">unitShortDict</a> ⇒ <code>ILang</code></dt>
179
+ <dd><p>Returns the dictionnary containing the shortened version of unit labels in multiple languages</p></dd>
180
+ <dt><a href="#getConvertedUnitQuantity">getConvertedUnitQuantity</a></dt>
181
+ <dd><p>Constructs object with detailled inventory quantities by unit (based on other_units for product)</p></dd>
182
+ <dt><a href="#getQty">getQty</a></dt>
183
+ <dd><p>Calculates inventory unit quantity for function getQty</p></dd>
184
+ <dt><a href="#recursiveCheckObject">recursiveCheckObject</a> ⇒</dt>
185
+ <dd><p>Updates value of object by checking recursivly.</p></dd>
186
+ <dt><a href="#getOrderedPromises">getOrderedPromises</a> ⇒</dt>
187
+ <dd><p>Checks list of promises for applicable banks based on space bank types.</p></dd>
188
+ <dt><a href="#checkForApplicableBanks">checkForApplicableBanks</a></dt>
189
+ <dd><p>Returns if a promise is currently active. Promise is active if it is not archived, and if current date is same or after starting_date, and before ending_date (if defined).</p></dd>
190
+ <dt><a href="#checkIfOtherBankOfSameTypeIsActive">checkIfOtherBankOfSameTypeIsActive</a></dt>
191
+ <dd><p>Returns translated name for a provided bank type ID.</p></dd>
192
+ <dt><a href="#getBankTypeName">getBankTypeName</a></dt>
193
+ <dd><p>Calculates the remaining amount for a specific promise's bank</p></dd>
194
+ <dt><a href="#getIndexedByCustomerPromiseValues">getIndexedByCustomerPromiseValues</a> ⇒</dt>
195
+ <dd><p>Returns the most recently emptied bank of a given type</p></dd>
196
+ <dt><a href="#getIndexServices">getIndexServices</a></dt>
197
+ <dd><p>Save new entry objects to provided search index services</p></dd>
198
+ <dt><a href="#saveNewEntryToIndex">saveNewEntryToIndex</a></dt>
199
+ <dd><p>Save a partial object entry to provided search index services.</p></dd>
200
+ <dt><a href="#partialSaveNewEntryToIndex">partialSaveNewEntryToIndex</a></dt>
201
+ <dd><p>Returns an object with base info needed to call Algolia/AddioSearch with search query.</p></dd>
202
+ <dt><a href="#getFetchInfoAlgoliaAddioSearch">getFetchInfoAlgoliaAddioSearch</a></dt>
203
+ <dd><p>Fetch entries from either algolia or AddioSearch (prospr) for a provided index. Client-side only!</p></dd>
204
+ <dt><a href="#fetchEntriesAlgoliaAddioSearch">fetchEntriesAlgoliaAddioSearch</a></dt>
205
+ <dd><p>Returns search result from active search index service. Server-side friendly!</p></dd>
206
+ </dl>
207
+
208
+ ## Constants
209
+
210
+ <dl>
211
+ <dt><a href="#isTestEnv">isTestEnv</a></dt>
212
+ <dd><p>TBSDK - SDK Manager</p>
213
+ <p>Client SDK to access TheBEAST eCommerce</p></dd>
214
+ <dt><a href="#spaceInitData">spaceInitData</a></dt>
215
+ <dd><p>Use this object to change which space is being tested!</p></dd>
216
+ </dl>
217
+
218
+ ## Functions
219
+
220
+ <dl>
221
+ <dt><a href="#getMinDatePicker">getMinDatePicker()</a></dt>
222
+ <dd><p>Sets the minimum shipping day for delivery</p></dd>
223
+ <dt><a href="#getProductSellUnitLabel">getProductSellUnitLabel(otherUnits, locale, returnUnitForSlugs)</a> ⇒ <code>string</code></dt>
224
+ <dd><p>Returns sell unit label in correct language for a specific product's other_units</p></dd>
225
+ <dt><a href="#splitOnDashes">splitOnDashes(stringToSplit)</a> ⇒ <code>Array.&lt;string&gt;</code></dt>
226
+ <dd></dd>
227
+ <dt><a href="#getRandomValue">getRandomValue(val, type)</a> ⇒</dt>
228
+ <dd><p>Replace a value with anonymized value</p></dd>
229
+ <dt><a href="#getCartPromo">getCartPromo(cartData)</a></dt>
230
+ <dd><p>Get formatted array of cart promos applied to a specific cart</p></dd>
231
+ <dt><a href="#_checkRuleApplicationArray">_checkRuleApplicationArray(checkedRulesApplicationArray)</a> ⇒</dt>
232
+ <dd><p>Checks if discount rule should be applied to cart based on each rule verification results.</p></dd>
233
+ <dt><a href="#checkIfCouldApplyIncentivePromo">checkIfCouldApplyIncentivePromo(cartData, skipCheckFor)</a> ⇒</dt>
234
+ <dd><p>Checks if an incentive discount could (in theory) by added to provided cart, by checking found incentive discount's rule array.</p></dd>
235
+ <dt><a href="#getOrderedPromises">getOrderedPromises(promises)</a></dt>
236
+ <dd><p>Get ordered array of promise data objects by starting date.</p></dd>
237
+ <dt><a href="#getIndexServices">getIndexServices(space, partialIndexID)</a></dt>
238
+ <dd><p>Returns objet with possible index service instances
239
+ As of now, checks for Algolia and Addio Search</p></dd>
240
+ </dl>
241
+
242
+ <a name="Brand"></a>
243
+
244
+ ## Brand
245
+
246
+ <p>Brand class</p>
247
+
248
+ **Kind**: global class
249
+ <a name="Catalogue"></a>
250
+
251
+ ## Catalogue
252
+
253
+ <p>Catalogue class</p>
254
+
255
+ **Kind**: global class
256
+ <a name="Customer"></a>
257
+
258
+ ## Customer
259
+
260
+ <p>Customer class</p>
261
+
262
+ **Kind**: global class
263
+ <a name="Discount"></a>
264
+
265
+ ## Discount
266
+
267
+ <p>Brand class</p>
268
+
269
+ **Kind**: global class
270
+ <a name="Invoice"></a>
271
+
272
+ ## ~~Invoice~~
273
+
274
+ **_Deprecated_**
275
+
276
+ **Kind**: global class
277
+ <a name="Order"></a>
278
+
279
+ ## ~~Order~~
280
+
281
+ **_Deprecated_**
282
+
283
+ **Kind**: global class
284
+ <a name="Org"></a>
285
+
286
+ ## Org
287
+
288
+ <p>Class Org - Organization
289
+ Represent an organization created by a user. An organization can have multiple space.</p>
290
+
291
+ **Kind**: global class
292
+ <a name="new_Org_new"></a>
293
+
294
+ ### new Org(org, org_ref, user)
295
+
296
+ <p>Organization constructor</p>
297
+
298
+ | Param | Description |
299
+ | ------- | ------------------------------------ |
300
+ | org | <p>Organization to construct</p> |
301
+ | org_ref | <p>Reference to the organization</p> |
302
+ | user | <p>Authfificated user</p> |
303
+
304
+ <a name="Product"></a>
305
+
306
+ ## Product
307
+
308
+ <p>Product class</p>
309
+
310
+ **Kind**: global class
311
+ <a name="PurchaseOrder"></a>
312
+
313
+ ## PurchaseOrder
314
+
315
+ <p>Brand class</p>
316
+
317
+ **Kind**: global class
318
+ <a name="Service"></a>
319
+
320
+ ## Service
321
+
322
+ <p>Service class</p>
323
+
324
+ **Kind**: global class
325
+ <a name="Service+add"></a>
326
+
327
+ ### service.add(newService) ⇒
328
+
329
+ <p>Add a new service</p>
330
+
331
+ **Kind**: instance method of [<code>Service</code>](#Service)
332
+ **Returns**: <p>IAddServiceResponse</p>
333
+
334
+ | Param | Description |
335
+ | ---------- | ------------------------------------ |
336
+ | newService | <p>IService: new service to add.</p> |
337
+
338
+ <a name="Space"></a>
339
+
340
+ ## Space
341
+
342
+ <p>Class Space
343
+ A Space represent a company.</p>
344
+
345
+ **Kind**: global class
346
+ <a name="User"></a>
347
+
348
+ ## User
349
+
350
+ <p>User class</p>
351
+
352
+ **Kind**: global class
353
+ <a name="new_User_new"></a>
354
+
355
+ ### new User(options, version, orgID)
356
+
357
+ <p>Fetch user from database for current org</p>
358
+
359
+ | Param | Description |
360
+ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
361
+ | options | <p>Parameters for database query. Only one will be checked at a time, in order of &quot;importance&quot; : email &gt; username &gt; external_id.</p> |
362
+ | version | <p>The app version to check</p> |
363
+ | orgID | <p>Optionnal, but must be provided if function is called from the backend (used to find user's organization).</p> |
364
+
365
+ <a name="ProsprSearch"></a>
366
+
367
+ ## ProsprSearch
368
+
369
+ <p>À NOTER - Prospr est l'ancien nom du ecomm, est depuis devenu Addio.
370
+ Il faudra éventuellement faire le refactoring nécessaire pour remplacer toutes les appelations,
371
+ mais en attendant, c'est normal qu'il y ait les deux noms à différents endroits.</p>
372
+
373
+ **Kind**: global class
374
+ <a name="CustomerTypeEnum"></a>
375
+
376
+ ## CustomerTypeEnum
377
+
378
+ <p>ICustomer interface</p>
379
+ <p>Représente un client (customer). Un client peut:</p>
380
+ <ul>
381
+ <li>Faire des recherches parmis les différents items du commerçant</li>
382
+ <li>Afficher une fiche cliente</li>
383
+ </ul>
384
+
385
+ **Kind**: global variable
386
+ <a name="getDefaultDiscountRule"></a>
387
+
388
+ ## getDefaultDiscountRule
389
+
390
+ <p>Exemple:</p>
391
+ <p>Product = 5.00$</p>
392
+ <p>Discount rule:
393
+ quantity &gt;= 10 ? remove 2</p>
394
+ <p>Result:
395
+ If applied to cart:
396
+ 11 Product = (before) 55.00$ (after) 53.00$</p>
397
+ <p>attribute color == red ? percent 10
398
+ 1 red Product = (before) 5.00$ (after) 4.50$</p>
399
+ <p>attribute color == red ? percent -20
400
+ 1 red Product = (before) 5.00$ (after) 6.00$</p>
401
+
402
+ **Kind**: global variable
403
+ <a name="installationProductsSlugs"></a>
404
+
405
+ ## installationProductsSlugs
406
+
407
+ <p>Contains all necessary elements for extra questions if adding grass product to cart</p>
408
+
409
+ **Kind**: global variable
410
+ <a name="getConcreteCartInfo"></a>
411
+
412
+ ## getConcreteCartInfo
413
+
414
+ <ul>
415
+ <li>Create the essential info needed when checking a grass type product for cart</li>
416
+ </ul>
417
+
418
+ **Kind**: global variable
419
+
420
+ | Param |
421
+ | ----- |
422
+ | item |
423
+
424
+ <a name="getMinDateOffset"></a>
425
+
426
+ ## getMinDateOffset
427
+
428
+ <p>compares date with blockedDates from DB and blocked days (currently hardcoded in function)</p>
429
+
430
+ **Kind**: global variable
431
+
432
+ | Param | Description |
433
+ | ---------------- | ---------------------------- |
434
+ | date | <p>Date to check</p> |
435
+ | blockedDates | <p>Blocked dates from DB</p> |
436
+ | expeditionMethod | <p>pickup or shipping</p> |
437
+ | cartData | |
438
+
439
+ <a name="shouldDisableDate"></a>
440
+
441
+ ## shouldDisableDate
442
+
443
+ <p>checks if type of cart corresponds to a blockedDates array and if array has dates defined</p>
444
+
445
+ **Kind**: global variable
446
+
447
+ | Param |
448
+ | ------------ |
449
+ | cartData |
450
+ | blockedDates |
451
+
452
+ <a name="installationFeePalletTier"></a>
453
+
454
+ ## installationFeePalletTier
455
+
456
+ <p>Calculates fees that should be applied to provided cart, and fetches them from database or fee array if provided.
457
+ Returns the items to add, update and delete, as well as other cart info to set after fees.
458
+ ** Optimized version possible, where address zones and distance are calculated before and properties are sent directly to function
459
+ ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p>
460
+
461
+ **Kind**: global variable
462
+
463
+ | Param |
464
+ | --------------------------- |
465
+ | fetchProduct |
466
+ | getIfAddressIsInsideZones |
467
+ | getDistanceFromAddress |
468
+ | cart |
469
+ | expeditionMethod |
470
+ | grassProduct |
471
+ | concreteOrder |
472
+ | cartContainsInstallation |
473
+ | cartContainsVrac |
474
+ | isPro |
475
+ | addOnePalletToPickup |
476
+ | cartContainsSample |
477
+ | saveToShippingPayload |
478
+ | deliveryAddress |
479
+ | locale |
480
+ | expeditionDate |
481
+ | equipmentPickupOnSite |
482
+ | cartContainsOnlyAccessories |
483
+ | pickupStore |
484
+ | allStores |
485
+ | customPriceList |
486
+ | useFeeArray |
487
+
488
+ <a name="applyFeesToCart"></a>
489
+
490
+ ## applyFeesToCart
491
+
492
+ <p>Checks if sample shipping fee should be removed from cart depending on cart items found in cart.
493
+ ** Optimized version possible using brand name instead of brand id, removing async check.
494
+ ** Optimized version reverted, logic found in commit here : [#2087b32](https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6)</p>
495
+
496
+ **Kind**: global variable
497
+
498
+ | Param |
499
+ | ------------ |
500
+ | fetchProduct |
501
+ | cart |
502
+ | locale |
503
+ | useFeeArray |
504
+
505
+ <a name="calculateShippingForVrac"></a>
506
+
507
+ ## calculateShippingForVrac ⇒
508
+
509
+ <p>checks if cart expired using the updated_at date stored in the shipping_payload</p>
510
+
511
+ **Kind**: global variable
512
+ **Returns**: <p>boolean</p>
513
+
514
+ | Param |
515
+ | ------------- |
516
+ | cartData |
517
+ | grassProduct |
518
+ | concreteOrder |
519
+ | isPro |
520
+ | isSample |
521
+
522
+ <a name="transformG2CustomerToCustomer"></a>
523
+
524
+ ## transformG2CustomerToCustomer
525
+
526
+ <p>Verifies if customer exists in G2.</p>
527
+
528
+ **Kind**: global variable
529
+
530
+ | Param | Description |
531
+ | ---------- | ------------------------------- |
532
+ | customerID | <p>Customer ID for G2 fetch</p> |
533
+ | space | <p>Space Object</p> |
534
+ | org | <p>Org Object</p> |
535
+
536
+ <a name="checkIfCustomerExistsInG2"></a>
537
+
538
+ ## checkIfCustomerExistsInG2
539
+
540
+ <p>Updates customer in database with new info found in G2.</p>
541
+
542
+ **Kind**: global variable
543
+
544
+ | Param | Description |
545
+ | -------------- | ---------------------------------------------------------------------------- |
546
+ | customerID | <p>Customer ID for G2 fetch</p> |
547
+ | space | <p>Space Object</p> |
548
+ | org | <p>Org Object</p> |
549
+ | addToDB | <p>if updated customer should be saved to database (defaults to true)</p> |
550
+ | skipEmailCheck | <p>if check for unique email should be skiped or not (defaults to false)</p> |
551
+
552
+ <a name="getCustomPriceList"></a>
553
+
554
+ ## getCustomPriceList
555
+
556
+ <p>Get promise to purchase additionnal escompte equivalent from customPriceList for specific cart item</p>
557
+
558
+ **Kind**: global variable
559
+
560
+ | Param | Description |
561
+ | --------------- | ------------------------------------------ |
562
+ | customPriceList | <p>The pro customers custom price list</p> |
563
+ | item | <p>The cart item to check</p> |
564
+
565
+ <a name="getFittingUnits"></a>
566
+
567
+ ## getFittingUnits ⇒
568
+
569
+ <p>Returns string corresponding to provided cart's type.</p>
570
+
571
+ **Kind**: global variable
572
+ **Returns**: <p>a string containing the order type</p>
573
+
574
+ | Param | Description |
575
+ | -------- | --------------------------------------------------------------------------- |
576
+ | cartData | <p>Corresponding cart</p> |
577
+ | frOnly | <p>If true, forces french string,</p> |
578
+ | slugSafe | <p>If true, will always return a slug-safe string (with string_to_slug)</p> |
579
+
580
+ <a name="getProductSellUnitLabel"></a>
581
+
582
+ ## getProductSellUnitLabel ⇒ <code>string</code>
583
+
584
+ <p>Returns the plural unit label for a specific slug</p>
585
+
586
+ **Kind**: global variable
587
+ **Returns**: <code>string</code> - <p>The plural unit label</p>
588
+
589
+ | Param | Type | Description |
590
+ | ------------------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
591
+ | unitSlug | <code>string</code> | <p>The slug of the unit for which we want to get the label</p> |
592
+ | locale | <code>string</code> \| <code>undefined</code> | <p>The language in which we want to get the label</p> |
593
+ | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | <p>The slugs for which we want to return a default value, in this case the unit slug for unit</p> |
594
+
595
+ <a name="getDescriptionString"></a>
596
+
597
+ ## getDescriptionString
598
+
599
+ <p>Returns rounded product quantities depending on current value, value of secondary input if existant and sale unit per command step ratio found in product.</p>
600
+
601
+ **Kind**: global variable
602
+
603
+ | Param | Type | Description |
604
+ | ---------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
605
+ | value | <code>number</code> | <p>Current quantity as entered by user in first input</p> |
606
+ | otherUnits | <code>Array.&lt;IFilledDimensionUnits&gt;</code> \| <code>undefined</code> | <p>FilledDimensionUnits found in product (possibly undefined)</p> |
607
+ | value2 | <code>number</code> \| <code>undefined</code> | <p>Current quantity as entered by user in second input (possibly undefined)</p> |
608
+ | targetIsSecondaryInput | <code>boolean</code> | <p>If action was triggered from secondary input (defaults to false)</p> |
609
+
610
+ <a name="splitOnDashes"></a>
611
+
612
+ ## splitOnDashes ⇒ <code>Array.&lt;string&gt;</code>
613
+
614
+ <p>Get product name as array. Array created mostly by splitting name on dash symbol (and variations).</p>
615
+
616
+ **Kind**: global variable
617
+ **Returns**: <code>Array.&lt;string&gt;</code> - <ul>
618
+
619
+ <li>Position 0 is the &quot;commum section&quot; of the name, and position 1 should contain all specifics (ex. color, size, etc...)</li>
620
+ </ul>
621
+
622
+ | Param | Type |
623
+ | ------- | --------------------------------------------------------------------- |
624
+ | product | <code>IIndexedVariationAlgolia</code> \| <code>IIndexedProduct</code> |
625
+ | locale | <code>string</code> \| <code>undefined</code> |
626
+
627
+ <a name="getProdName"></a>
628
+
629
+ ## getProdName
630
+
631
+ <p>Function getParentProductCategoryGroup</p>
632
+
633
+ **Kind**: global variable
634
+
635
+ | Param | Description |
636
+ | ----- | ----------------------- |
637
+ | prod | <p>Product to check</p> |
638
+
639
+ <a name="getParentProductCategoryGroup"></a>
640
+
641
+ ## getParentProductCategoryGroup
642
+
643
+ <p>Function getProductFormOptions - Returns all AttributeValues for product to construct options in add to cart form</p>
644
+
645
+ **Kind**: global variable
646
+
647
+ | Param | Description |
648
+ | ---------- | ---------------------------------------------- |
649
+ | product | <p>Product to check</p> |
650
+ | attributes | <p>Array of IAttributes to fetch info from</p> |
651
+
652
+ <a name="getProductFormOptions"></a>
653
+
654
+ ## getProductFormOptions ⇒
655
+
656
+ <p>Checks if product is of type by checking TYPE attribute value. Works with indexed product or cart item.</p>
657
+
658
+ **Kind**: global variable
659
+ **Returns**: <p>boolean</p>
660
+
661
+ | Param |
662
+ | ---------------- |
663
+ | product |
664
+ | type |
665
+ | excludeUndefined |
666
+
667
+ <a name="checkIfProductIsInstallation"></a>
668
+
669
+ ## checkIfProductIsInstallation
670
+
671
+ <p>Returns array of installation items found in provided array</p>
672
+
673
+ **Kind**: global variable
674
+
675
+ | Param | Description |
676
+ | ----- | ----------------------------------------------------------- |
677
+ | items | <p>Array of cart items or IIndexedDeclinations to check</p> |
678
+
679
+ <a name="getAllInstallFromItems"></a>
680
+
681
+ ## getAllInstallFromItems
682
+
683
+ <ul>
684
+ <li>Returns items with only one apparent grass product (used for detail customers).
685
+ ** FOR DISPLAY PURPOSES ONLY - Always save grass products separatly in ICart **</li>
686
+ </ul>
687
+
688
+ **Kind**: global variable
689
+
690
+ | Param | Description |
691
+ | -------------- | --------------------------------------------------------------------- |
692
+ | recursiveItems | <p>ICartItems with subitems (object created for display purposes)</p> |
693
+
694
+ <a name="getGrassSubQuestionsByType"></a>
695
+
696
+ ## getGrassSubQuestionsByType ⇒
697
+
698
+ <p>For grass products. Over 1480pi2, if installation, quantities are rounded to rolls (10pi2) if pickup, and to half pal. if shipping</p>
699
+
700
+ **Kind**: global variable
701
+ **Returns**: <p>quantity rounded to rolls with items to change or undefined</p>
702
+
703
+ | Param |
704
+ | ------------ |
705
+ | grassProduct |
706
+ | cartData |
707
+
708
+ <a name="handleGrassProductQtyRoundForShipping"></a>
709
+
710
+ ## handleGrassProductQtyRoundForShipping
711
+
712
+ <p>Returns rounded grass quantity depending on current qty, if customer selected installation and pallet unit (if defined)</p>
713
+
714
+ **Kind**: global variable
715
+
716
+ | Param | Type | Description |
717
+ | ---------- | ------------------------------------------------------------ | -------------------------------------------------------- |
718
+ | currentQte | <code>number</code> | <p>Current quantity as entered by user in input</p> |
719
+ | isShipping | <code>boolean</code> | <p>Whether customer has selected installation option</p> |
720
+ | palUnit | <code>IFilledDimensionUnits</code> \| <code>undefined</code> | <p>Pallet FilledDimensionUnit (possibly undefined)</p> |
721
+
722
+ <a name="getConcreteQteText"></a>
723
+
724
+ ## getConcreteQteText
725
+
726
+ <p>returns all items in cart where attribute AVAILABILITY contains wanted type.</p>
727
+
728
+ **Kind**: global variable
729
+
730
+ | Param |
731
+ | ---------------- |
732
+ | cartData |
733
+ | availabilityType |
734
+
735
+ <a name="getConcreteItemsByAvailability"></a>
736
+
737
+ ## getConcreteItemsByAvailability ⇒
738
+
739
+ <p>Function getVracType - constructs vrac helper object is cart contains vrac or vrac associated items.</p>
740
+
741
+ **Kind**: global variable
742
+ **Returns**: <p>IVracType object containing vrac_type enum value and vrac_store_ids where vrac items are available</p>
743
+
744
+ | Param |
745
+ | ------------------------ |
746
+ | stores |
747
+ | cartData |
748
+ | getInventoryItemCallback |
749
+
750
+ <a name="fetchFeesBeforeCart"></a>
751
+
752
+ ## fetchFeesBeforeCart
753
+
754
+ <p>Check if pro custom promo info should be shown for customer for a specific product.</p>
755
+
756
+ **Kind**: global variable
757
+
758
+ | Param |
759
+ | -------------- |
760
+ | userData |
761
+ | isPro |
762
+ | product |
763
+ | customMinPrice |
764
+
765
+ <a name="calculateUpsellQte"></a>
766
+
767
+ ## calculateUpsellQte
768
+
769
+ <ul>
770
+ <li>checks all upsells in product and returns those where associated quantities are found.</li>
771
+ </ul>
772
+
773
+ **Kind**: global variable
774
+
775
+ | Param | Description |
776
+ | -------------- | ------------------------------------------------------------------------------- |
777
+ | upsellProducts | <p>All upsells in product</p> |
778
+ | cartItems | <p>All current cart items</p> |
779
+ | checkQte | <p>If all upsells should be checked for quantity</p> |
780
+ | alwaysShow | <p>If upsell should be considered even if it already exists in cart as item</p> |
781
+
782
+ <a name="getUpsellsToQuantify"></a>
783
+
784
+ ## getUpsellsToQuantify
785
+
786
+ <ul>
787
+ <li>Returns upsell equivalence text</li>
788
+ </ul>
789
+
790
+ **Kind**: global variable
791
+
792
+ | Param | Description |
793
+ | ----------------- | -------------------------------------------------------- |
794
+ | upsellsToQuantify | <p>All upsells to show in text</p> |
795
+ | qte | <p>Associated product quantity</p> |
796
+ | specificProduct | <p>If upsell shown is a specific products</p> |
797
+ | isMulti | <p>If upsell if shared by more than one item in cart</p> |
798
+ | locale | <p>locale of string to return</p> |
799
+
800
+ <a name="getGeneralUpsellQteText"></a>
801
+
802
+ ## getGeneralUpsellQteText
803
+
804
+ <ul>
805
+ <li>Returns quantity stinrg and upsell name to show in Upsell Quantity indicator</li>
806
+ </ul>
807
+
808
+ **Kind**: global variable
809
+
810
+ | Param | Description |
811
+ | ---------- | ----------------------------------------------------------- |
812
+ | upsell | <p>Upsell to show qyantity for</p> |
813
+ | productQte | <p>Quantity of associated product for ratio calculation</p> |
814
+ | locale | <p>locale of string to return</p> |
815
+
816
+ <a name="checkIfCartContainsException"></a>
817
+
818
+ ## checkIfCartContainsException
819
+
820
+ <p>Function getCartItemsFromProdUpsells</p>
821
+
822
+ **Kind**: global variable
823
+
824
+ | Param | Type | Description |
825
+ | ---------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------- |
826
+ | qte | <code>number</code> | <p>Quantity of product to which upsell is associated</p> |
827
+ | currentSku | <code>string</code> | <p>Sku of the declination selected by user for the product to which upsell is associated</p> |
828
+ | prodUpsell | <code>Array.&lt;IProductRecommendation&gt;</code> | <p>Array of upsells found in product</p> |
829
+ | getProduct | | <p>Callback function to fetch product from DB</p> |
830
+ | locale | <code>string</code> | <p>locale for product fetch (defaults to 'fr')</p> |
831
+
832
+ <a name="mockCustomPriceList"></a>
833
+
834
+ ## mockCustomPriceList
835
+
836
+ <p>Takes in a function and checks for error</p>
837
+
838
+ **Kind**: global variable
839
+
840
+ | Param | Type | Description |
841
+ | ------- | ------------------------------ | --------------------------------------------------- |
842
+ | method | <code>function</code> | <p>The function to check</p> |
843
+ | params | <code>Array.&lt;any&gt;</code> | <p>The array of function parameters</p> |
844
+ | message | <code>string</code> | <p>Optional message to match with error message</p> |
845
+
846
+ <a name="getRandomValue"></a>
847
+
848
+ ## getRandomValue ⇒
849
+
850
+ <p>Get an object property value</p>
851
+
852
+ **Kind**: global variable
853
+ **Returns**: <p>the property value</p>
854
+
855
+ | Param | Description |
856
+ | ----- | -------------------------------------- |
857
+ | obj | <p>The object to scan</p> |
858
+ | props | <p>The path of the property to get</p> |
859
+
860
+ <a name="getObjectProperty"></a>
861
+
862
+ ## getObjectProperty ⇒
863
+
864
+ <p>Set an object property to an anonymized value if it exists</p>
865
+
866
+ **Kind**: global variable
867
+ **Returns**: <p>The object with the edited value</p>
868
+
869
+ | Param | Description |
870
+ | ----- | ------------------------------------------------- |
871
+ | obj | <p>The object to look into</p> |
872
+ | props | <p>The property path</p> |
873
+ | type | <p>The property type used to shuffle the data</p> |
874
+
875
+ <a name="setObjectProperty"></a>
876
+
877
+ ## setObjectProperty ⇒
878
+
879
+ <p>Anonymise the customer data if in test env</p>
880
+
881
+ **Kind**: global variable
882
+ **Returns**: <p>The new customer data</p>
883
+
884
+ | Param | Description |
885
+ | ----- | ------------------------ |
886
+ | c | <p>The customer data</p> |
887
+
888
+ <a name="getCurrentProvince"></a>
889
+
890
+ ## getCurrentProvince ⇒
891
+
892
+ <p>Constructs and returns data for indexed cart (algolia or addio)</p>
893
+
894
+ **Kind**: global variable
895
+ **Returns**: <IIndexedCart>
896
+
897
+ | Param | Description |
898
+ | -------------------- | ------------------------------------------------------------------------- |
899
+ | cartData | <p>Current cart data</p> |
900
+ | space | <p>Space object</p> |
901
+ | setPaidAtIfUndefined | <p>Optionnal - If true, will set paid_at with current date</p> |
902
+ | customer | <p>Optionnal - If defined, adds info based on customer to indexedCart</p> |
903
+
904
+ <a name="getCartPromo"></a>
905
+
906
+ ## getCartPromo
907
+
908
+ <p>Check if current cart promos applied contain a promo_code type promotion</p>
909
+
910
+ **Kind**: global variable
911
+
912
+ | Param |
913
+ | -------- |
914
+ | cartData |
915
+
916
+ <a name="shouldCheckPromoCode"></a>
917
+
918
+ ## shouldCheckPromoCode
919
+
920
+ <p>Check if a discount rule applies to a specific declination</p>
921
+
922
+ **Kind**: global variable
923
+
924
+ | Param | Description |
925
+ | ------------- | --------------------------------- |
926
+ | discount_rule | <p>The discount rule to check</p> |
927
+ | declination | <p>The declination to compare</p> |
928
+
929
+ <a name="shouldApplyRuleToDeclination"></a>
930
+
931
+ ## shouldApplyRuleToDeclination
932
+
933
+ <p>Check if a specific rule of a discount rule is respected</p>
934
+
935
+ **Kind**: global variable
936
+
937
+ | Param | Description |
938
+ | ---------- | ---------------------------------------------------- |
939
+ | ruleDetail | <p>The rule details object to check</p> |
940
+ | cartValue | <p>The value to compare with rule specifications</p> |
941
+
942
+ <a name="getResultRuleDetail"></a>
943
+
944
+ ## getResultRuleDetail
945
+
946
+ <p>Check if rule applied to product attributes is respected for specific declination attributes</p>
947
+
948
+ **Kind**: global variable
949
+
950
+ | Param | Description |
951
+ | ------------------------ | --------------------------------------------- |
952
+ | attributeAndValues | <p>The rule details object to check</p> |
953
+ | arrDeclinationAttributes | <p>The declinations attributes to compare</p> |
954
+
955
+ <a name="getCartPromoType"></a>
956
+
957
+ ## getCartPromoType
958
+
959
+ <p>Check if promo code can be applied to a specific cart</p>
960
+
961
+ **Kind**: global variable
962
+
963
+ | Param | Description |
964
+ | --------- | ------------------------------------------------- |
965
+ | cart | <p>The cart to check</p> |
966
+ | promoCode | <p>The discount rule with promo code to check</p> |
967
+
968
+ <a name="checkPromoCodeEligibility"></a>
969
+
970
+ ## checkPromoCodeEligibility
971
+
972
+ <p>Returns tier pricing step that should be applied for provided quantity, or undefined if none should apply</p>
973
+
974
+ **Kind**: global variable
975
+
976
+ | Param | Description |
977
+ | ------------------ | ---------------------------------------------- |
978
+ | tierPricingToCheck | <p>the indexed tier-pricing array to check</p> |
979
+ | qte | |
980
+
981
+ <a name="getTierPricingToApply"></a>
982
+
983
+ ## getTierPricingToApply
984
+
985
+ <p>Converts tier-pricing found in discount_rule to IIndexedTierPricing.</p>
986
+
987
+ **Kind**: global variable
988
+
989
+ | Param | Description |
990
+ | ------------ | ------------------------------------------------------------------------------ |
991
+ | discountRule | <p>the tier-pricing tier discountRule to check</p> |
992
+ | price | <p>declinations regular price from which tier-pricing result is calculated</p> |
993
+ | space | |
994
+ | decimals | <p>the amount of decimals to show on tier-pricing result</p> |
995
+
996
+ <a name="applyTierPricing"></a>
997
+
998
+ ## applyTierPricing
999
+
1000
+ <p>Calculate new discount_price object for cart item base on qte and tier_pricing</p>
1001
+
1002
+ **Kind**: global variable
1003
+
1004
+ | Param | Description |
1005
+ | ---------------- | ------------------------------------------------------------------------------------- |
1006
+ | item | <p>the item to check</p> |
1007
+ | setOriginalPrice | <p>if original_amount should be set instead of discount_price.amount</p> |
1008
+ | originalDecli | <p>Optionnal. The IIndexedDeclination used to construct the cart item originally.</p> |
1009
+
1010
+ <a name="getNewDiscountPriceFromTierPricing"></a>
1011
+
1012
+ ## getNewDiscountPriceFromTierPricing
1013
+
1014
+ <p>Get discounted price after applying discount rules to a provided price</p>
1015
+
1016
+ **Kind**: global variable
1017
+
1018
+ | Param | Description |
1019
+ | -------------- | ----------------------------------------------------- |
1020
+ | discount_rules | <p>The discount rules to apply</p> |
1021
+ | amount | <p>The initial amount on which to apply discounts</p> |
1022
+ | space | |
1023
+
1024
+ <a name="applyDiscountRulesOnProduct"></a>
1025
+
1026
+ ## applyDiscountRulesOnProduct
1027
+
1028
+ <p>Get result of discount rule discount on a provided amount</p>
1029
+
1030
+ **Kind**: global variable
1031
+
1032
+ | Param | Description |
1033
+ | ----------------- | ----------------------------------------------- |
1034
+ | initial | <p>The price on which to apply the discount</p> |
1035
+ | discountResultObj | <p>The discount rule result object</p> |
1036
+
1037
+ <a name="applyDiscountToPrice"></a>
1038
+
1039
+ ## applyDiscountToPrice ⇒
1040
+
1041
+ <p>Get sku(s) affected by a promo as an array of strings</p>
1042
+
1043
+ **Kind**: global variable
1044
+ **Returns**: <p>And array of strings</p>
1045
+
1046
+ | Param | Description |
1047
+ | -------------- | ----------------------------------------------------- |
1048
+ | valueToConvert | <p>The sku or sku array associated with the promo</p> |
1049
+
1050
+ <a name="getSkuArrayForPromo"></a>
1051
+
1052
+ ## getSkuArrayForPromo ⇒
1053
+
1054
+ <p>Returns a list of all skus where promo applied to specific products should apply. Check for both amount/percent_sku and amount/percent_category options.</p>
1055
+
1056
+ **Kind**: global variable
1057
+ **Returns**: <p>An array of strings</p>
1058
+
1059
+ | Param | Description |
1060
+ | ------------ | ----------------------------- |
1061
+ | cartItems | <p>The current cart items</p> |
1062
+ | promoToCheck | <p>The promo to check</p> |
1063
+
1064
+ <a name="getResultAppliedDiscountSkus"></a>
1065
+
1066
+ ## getResultAppliedDiscountSkus ⇒
1067
+
1068
+ <p>Creates array of all category level slugs for a cart item.</p>
1069
+
1070
+ **Kind**: global variable
1071
+ **Returns**: <p>An array of strings</p>
1072
+
1073
+ | Param | Description |
1074
+ | -------------- | ------------------------------------------- |
1075
+ | itemCategories | <p>Value found in props cart.categories</p> |
1076
+
1077
+ <a name="getItemCategorySlugArray"></a>
1078
+
1079
+ ## getItemCategorySlugArray
1080
+
1081
+ <p>Apply all valid discounts found in a specific cart's discount_rules props to cart</p>
1082
+
1083
+ **Kind**: global variable
1084
+
1085
+ | Param | Description |
1086
+ | ------------- | --------------------------------------------------------------------------------- |
1087
+ | cart | <p>The cart to check</p> |
1088
+ | isMultiPromo | |
1089
+ | forceShipping | <p>If cart should be considered as a shipping cart, even if is_pickup is true</p> |
1090
+
1091
+ <a name="applyDiscountToCart"></a>
1092
+
1093
+ ## applyDiscountToCart
1094
+
1095
+ <p>Get the ICartPromoApplied object for a specified discount_rule. Only works for promos that do not apply to products of certain categories/skus.</p>
1096
+
1097
+ **Kind**: global variable
1098
+
1099
+ | Param |
1100
+ | -------getConvertedUnitQuantity
1101
+ | cart |
1102
+ | discount |
1103
+
1104
+ <a name="getStandardCartPromoFromDiscount"></a>
1105
+
1106
+ ## getStandardCartPromoFromDiscount ⇒
1107
+
1108
+ <p>Calculates the cumulative subtotal for all service/fee type items in cart, including any applied promos. Usefull when calculating a promo's amount when all fees and services should be excluded.</p>
1109
+
1110
+ **Kind**: global variable
1111
+ **Returns**: <p>A number</p>
1112
+
1113
+ | Param | Description |
1114
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
1115
+ | cartData | <p>The cartData to check</p> |
1116
+ | allCurrentAppliedToItemPromos | <p>All currently active cartPromos that apply to items in cart. Sent seperatly in case local state is different from current cartData.</p> |
1117
+
1118
+ <a name="checkIfCouldApplyIncentivePromo"></a>
1119
+
1120
+ ## checkIfCouldApplyIncentivePromo
1121
+
1122
+ <p>Calculates amount to be removed for payment incentive type promos.</p>
1123
+
1124
+ **Kind**: global variable
1125
+
1126
+ | Param | Description |
1127
+ | ------------------ | ---------------------------------------------------------------------------------------------------------- |
1128
+ | cartData | |
1129
+ | checkDiscountRules | <p>Optionnal. If cart discount_rules should be checked if cart_promos_applied does not have promo yet.</p> |
1130
+
1131
+ <a name="getAfterTaxesPromosTotalAmount"></a>
1132
+
1133
+ ## getAfterTaxesPromosTotalAmount
1134
+
1135
+ <p>Returns cart_promos_applied corresponding to payment incentive, if found. Can also check in discount_rules if props provided</p>
1136
+
1137
+ **Kind**: global variable
1138
+
1139
+ | Param | Description |
1140
+ | ------------------ | ------------------------------------------------------------------------------------------------------------- |
1141
+ | cartData | |
1142
+ | checkDiscountRules | <p>Optionnal. If the function should check in cart discount_rules if nothing found in cart_promos_applied</p> |
1143
+
1144
+ <a name="getAfterTaxesPromoInCart"></a>
1145
+
1146
+ ## getAfterTaxesPromoInCart
1147
+
1148
+ <p>Returns the information regarding the payment incentive promo if found in cart's discount_rules</p>
1149
+
1150
+ **Kind**: global variable
1151
+
1152
+ | Param |
1153
+ | -------- |
1154
+ | cartData |
1155
+
1156
+ <a name="unitShortDict"></a>
1157
+
1158
+ ## unitShortDict ⇒ <code>ILang</code>
1159
+
1160
+ <p>Returns the dictionnary containing the shortened version of unit labels in multiple languages</p>
1161
+
1162
+ **Kind**: global variable
1163
+ **Returns**: <code>ILang</code> - <p>The dictionnary containing the shortened unit label in multiple languages</p>
1164
+
1165
+ | Param | Type | Description |
1166
+ | ------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
1167
+ | slug | <code>string</code> | <p>The slug for which we want to get the shortened dictionnary</p> |
1168
+ | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | <p>An array of slugs that we want to return a default dictionnary for, in this case the unit dictionnary for unit</p> |
1169
+
1170
+ <a name="getConvertedUnitQuantity"></a>
1171
+
1172
+ ## getConvertedUnitQuantity
1173
+
1174
+ <p>Constructs object with detailled inventory quantities by unit (based on other_units for product)</p>
1175
+
1176
+ **Kind**: global variable
1177
+
1178
+ | Param | Description |
1179
+ | --------------------- | ---------------- |
1180
+ | other_units | |
1181
+ | inventoryQuantity | |
1182
+ | isGrass | |
1183
+ | showNegativeInventory | <p>optionnal</p> |
1184
+
1185
+ <a name="getQty"></a>
1186
+
1187
+ ## getQty
1188
+
1189
+ <p>Calculates inventory unit quantity for function getQty</p>
1190
+
1191
+ **Kind**: global variable
1192
+
1193
+ | Param |
1194
+ | ----------------- |
1195
+ | value |
1196
+ | isUnitFittingUnit |
1197
+ | isNegativeQty |
1198
+
1199
+ <a name="recursiveCheckObject"></a>
1200
+
1201
+ ## recursiveCheckObject ⇒
1202
+
1203
+ <p>Updates value of object by checking recursivly.</p>
1204
+
1205
+ **Kind**: global variable
1206
+ **Returns**: <p>updated object</p>
1207
+
1208
+ | Param | Description |
1209
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1210
+ | allValues | <p>Full value object</p> |
1211
+ | newValue | <p>New value to update</p> |
1212
+ | propsToCheck | <p>Full key string associated to value to update, with nested keys seperated by dots (.). If the value to update is nested in an array, use square brackets with index between (ex. first_key.second_key[2].third_key)</p> |
1213
+
1214
+ <a name="getOrderedPromises"></a>
1215
+
1216
+ ## getOrderedPromises ⇒
1217
+
1218
+ <p>Checks list of promises for applicable banks based on space bank types.</p>
1219
+
1220
+ **Kind**: global variable
1221
+ **Returns**: <p>An array of applicable banks. If no bank is active for a type, is not returned in array. If active bank of type is in a inactive promise, is returned with props pa_is_active: false.</p>
1222
+
1223
+ | Param | Description |
1224
+ | --------------- | ------------------------------------------------------------ |
1225
+ | promisesToCheck | <p>The promise list to check</p> |
1226
+ | possibleBanks | <p>the possible bank types (usually found in space data)</p> |
1227
+
1228
+ <a name="checkForApplicableBanks"></a>
1229
+
1230
+ ## checkForApplicableBanks
1231
+
1232
+ <p>Returns if a promise is currently active. Promise is active if it is not archived, and if current date is same or after starting_date, and before ending_date (if defined).</p>
1233
+
1234
+ **Kind**: global variable
1235
+
1236
+ | Param | Description |
1237
+ | ------- | -------------------------------- |
1238
+ | promise | <p>the promise data to check</p> |
1239
+
1240
+ <a name="checkIfOtherBankOfSameTypeIsActive"></a>
1241
+
1242
+ ## checkIfOtherBankOfSameTypeIsActive
1243
+
1244
+ <p>Returns translated name for a provided bank type ID.</p>
1245
+
1246
+ **Kind**: global variable
1247
+
1248
+ | Param | Description |
1249
+ | ------------ | ------------------------------------------------ |
1250
+ | allBankTypes | <p>The current bank types for space</p> |
1251
+ | bankTypeID | <p>The bank type ID for which we want a name</p> |
1252
+ | locale | <p>Optionnal. Defaults to 'fr'</p> |
1253
+
1254
+ <a name="getBankTypeName"></a>
1255
+
1256
+ ## getBankTypeName
1257
+
1258
+ <p>Calculates the remaining amount for a specific promise's bank</p>
1259
+
1260
+ **Kind**: global variable
1261
+
1262
+ | Param | Description |
1263
+ | ----------------- | ---------------------------------------------------------------------------------------------- |
1264
+ | initialBankAmount | <p>the initial amount of the bank</p> |
1265
+ | bankHistory | <p>array of all history entries for bank. Will be ordered by date before deducing amounts.</p> |
1266
+
1267
+ <a name="getIndexedByCustomerPromiseValues"></a>
1268
+
1269
+ ## getIndexedByCustomerPromiseValues ⇒
1270
+
1271
+ <p>Returns the most recently emptied bank of a given type</p>
1272
+
1273
+ **Kind**: global variable
1274
+ **Returns**: <p>An IBank with a promise_unique_id</p>
1275
+
1276
+ | Param | Description |
1277
+ | ------------------ | ------------------------------------------------------------- |
1278
+ | allCustomerPAsData | <p>the array of all promises to purchase we want to check</p> |
1279
+ | type | <p>the bank_type_id to check</p> |
1280
+ | promiseUniqueID | <p>the current promise unique id</p> |
1281
+
1282
+ <a name="getIndexServices"></a>
1283
+
1284
+ ## getIndexServices
1285
+
1286
+ <p>Save new entry objects to provided search index services</p>
1287
+
1288
+ **Kind**: global variable
1289
+
1290
+ | Param | Description |
1291
+ | ------------- | --------------------------------------------------------------- |
1292
+ | services | <p>the services to check for save</p> |
1293
+ | newEntry | <p>the object to save</p> |
1294
+ | processLogStr | <p>the string to add to the log shown with service response</p> |
1295
+
1296
+ <a name="saveNewEntryToIndex"></a>
1297
+
1298
+ ## saveNewEntryToIndex
1299
+
1300
+ <p>Save a partial object entry to provided search index services.</p>
1301
+
1302
+ **Kind**: global variable
1303
+
1304
+ | Param | Description |
1305
+ | ---------------- | --------------------------------------------------------------------------------------- |
1306
+ | services | <p>the services to check for save</p> |
1307
+ | partialNewEntry | <p>the object to save</p> |
1308
+ | processLogStr | <p>the string to add to the log shown with service response</p> |
1309
+ | createIfNoExists | <p>= Optionnal. If should create entry if it does not already exist in search index</p> |
1310
+
1311
+ <a name="partialSaveNewEntryToIndex"></a>
1312
+
1313
+ ## partialSaveNewEntryToIndex
1314
+
1315
+ <p>Returns an object with base info needed to call Algolia/AddioSearch with search query.</p>
1316
+
1317
+ **Kind**: global variable
1318
+
1319
+ | Param |
1320
+ | ----- |
1321
+ | space |
1322
+
1323
+ <a name="getFetchInfoAlgoliaAddioSearch"></a>
1324
+
1325
+ ## getFetchInfoAlgoliaAddioSearch
1326
+
1327
+ <p>Fetch entries from either algolia or AddioSearch (prospr) for a provided index. Client-side only!</p>
1328
+
1329
+ **Kind**: global variable
1330
+
1331
+ | Param |
1332
+ | ------ |
1333
+ | param0 |
1334
+
1335
+ <a name="fetchEntriesAlgoliaAddioSearch"></a>
1336
+
1337
+ ## fetchEntriesAlgoliaAddioSearch
1338
+
1339
+ <p>Returns search result from active search index service. Server-side friendly!</p>
1340
+
1341
+ **Kind**: global variable
1342
+
1343
+ | Param | Description |
1344
+ | ---------- | ------------------------------------------------------------------------------------------------------ |
1345
+ | parameters | <p>Parsed parameters of IQueryProps. Space and indice must be provided, other props are optionnal.</p> |
1346
+
1347
+ <a name="isTestEnv"></a>
1348
+
1349
+ ## isTestEnv
1350
+
1351
+ <p>TBSDK - SDK Manager</p>
1352
+ <p>Client SDK to access TheBEAST eCommerce</p>
1353
+
1354
+ **Kind**: global constant
1355
+ <a name="spaceInitData"></a>
1356
+
1357
+ ## spaceInitData
1358
+
1359
+ <p>Use this object to change which space is being tested!</p>
1360
+
1361
+ **Kind**: global constant
1362
+ <a name="getMinDatePicker"></a>
1363
+
1364
+ ## getMinDatePicker()
1365
+
1366
+ <p>Sets the minimum shipping day for delivery</p>
1367
+
1368
+ **Kind**: global function
1369
+ <a name="getProductSellUnitLabel"></a>
1370
+
1371
+ ## getProductSellUnitLabel(otherUnits, locale, returnUnitForSlugs) ⇒ <code>string</code>
1372
+
1373
+ <p>Returns sell unit label in correct language for a specific product's other_units</p>
1374
+
1375
+ **Kind**: global function
1376
+ **Returns**: <code>string</code> - <p>The sell unit label in the correct language</p>
1377
+
1378
+ | Param | Type | Default | Description |
1379
+ | ------------------ | -------------------------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------- |
1380
+ | otherUnits | <code>Array.&lt;IFilledDimensionUnits&gt;</code> \| <code>undefined</code> | | <p>The unit array we have to check to get the sell unit</p> |
1381
+ | locale | <code>string</code> \| <code>undefined</code> | <code>&quot;fr&quot;</code> | <p>The language in which we want to return the label</p> |
1382
+ | returnUnitForSlugs | <code>Array.&lt;string&gt;</code> | | <p>An array of the slugs we want to return the unit label for</p> |
1383
+
1384
+ <a name="splitOnDashes"></a>
1385
+
1386
+ ## splitOnDashes(stringToSplit) ⇒ <code>Array.&lt;string&gt;</code>
1387
+
1388
+ **Kind**: global function
1389
+
1390
+ | Param | Type | Description |
1391
+ | ---------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
1392
+ | stringToSplit | <code>string</code> | |
1393
+ | dummyStringToReplace.currentValue, | <code>string</code> | <p>optionnal, default : '%%-%%'. Used to provide general replace values for a specific string. Is applied to both sections of the splitted string.</p> |
1394
+ | dummyStringToReplace.newValue, | <code>string</code> | <p>optionnal, default : ' - '. Used to provide general replace values for a specific string. Is applied to both sections of the splitted string.</p> |
1395
+
1396
+ <a name="getRandomValue"></a>
1397
+
1398
+ ## getRandomValue(val, type) ⇒
1399
+
1400
+ <p>Replace a value with anonymized value</p>
1401
+
1402
+ **Kind**: global function
1403
+ **Returns**: <p>the new value</p>
1404
+
1405
+ | Param | Description |
1406
+ | ----- | ------------------------- |
1407
+ | val | <p>The original value</p> |
1408
+ | type | <p>The type of data</p> |
1409
+
1410
+ <a name="getCartPromo"></a>
1411
+
1412
+ ## getCartPromo(cartData)
1413
+
1414
+ <p>Get formatted array of cart promos applied to a specific cart</p>
1415
+
1416
+ **Kind**: global function
1417
+
1418
+ | Param |
1419
+ | -------- |
1420
+ | cartData |
1421
+
1422
+ <a name="_checkRuleApplicationArray"></a>
1423
+
1424
+ ## \_checkRuleApplicationArray(checkedRulesApplicationArray) ⇒
1425
+
1426
+ <p>Checks if discount rule should be applied to cart based on each rule verification results.</p>
1427
+
1428
+ **Kind**: global function
1429
+ **Returns**: <p>A boolean</p>
1430
+
1431
+ | Param | Description |
1432
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------ |
1433
+ | checkedRulesApplicationArray | <p>Array where each position is a verified rule result (condition with passed of failed (boolean))</p> |
1434
+
1435
+ <a name="checkIfCouldApplyIncentivePromo"></a>
1436
+
1437
+ ## checkIfCouldApplyIncentivePromo(cartData, skipCheckFor) ⇒
1438
+
1439
+ <p>Checks if an incentive discount could (in theory) by added to provided cart, by checking found incentive discount's rule array.</p>
1440
+
1441
+ **Kind**: global function
1442
+ **Returns**: <p>a boolean</p>
1443
+
1444
+ | Param | Description |
1445
+ | ------------ | -------------------------------------------------------------- |
1446
+ | cartData | <p>The cart to check (checks discount_rules for incentive)</p> |
1447
+ | skipCheckFor | <p>If certain rules should be ignore for check</p> |
1448
+
1449
+ <a name="getOrderedPromises"></a>
1450
+
1451
+ ## getOrderedPromises(promises)
1452
+
1453
+ <p>Get ordered array of promise data objects by starting date.</p>
1454
+
1455
+ **Kind**: global function
1456
+
1457
+ | Param |
1458
+ | -------- |
1459
+ | promises |
1460
+
1461
+ <a name="getIndexServices"></a>
1462
+
1463
+ ## getIndexServices(space, partialIndexID)
1464
+
1465
+ <p>Returns objet with possible index service instances
1466
+ As of now, checks for Algolia and Addio Search</p>
1467
+
1468
+ **Kind**: global function
1469
+
1470
+ | Param | Description |
1471
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1472
+ | space | <p>the spaceObj to check</p> |
1473
+ | partialIndexID | <p>the partial index ID to consult for search, excluding the env. variable (prod* or test* will be added in function). \*\* Important to use index ID, not table ID!</p> |