addio-admin-sdk 1.7.22 → 1.7.23

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