addio-admin-sdk 1.7.103 → 1.7.104
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.
- package/dist/Interfaces/Attribute/index.d.ts +1 -0
- package/dist/Interfaces/CMS/index.d.ts +3 -0
- package/dist/Interfaces/CMS/index.js +3 -0
- package/dist/Interfaces/CMS/index.js.map +1 -1
- package/dist/Interfaces/Cart/index.js +6 -2
- package/dist/Interfaces/Cart/index.js.map +1 -1
- package/dist/Interfaces/CartReservedQuantities/index.d.ts +2 -0
- package/dist/Interfaces/Customer/IStoreCredit.d.ts +1 -0
- package/dist/Interfaces/Customer/index.d.ts +7 -0
- package/dist/Interfaces/Customer/index.js +7 -0
- package/dist/Interfaces/Customer/index.js.map +1 -1
- package/dist/Interfaces/Declination/index.js +8 -2
- package/dist/Interfaces/Declination/index.js.map +1 -1
- package/dist/Interfaces/Email/IEmail.js +7 -3
- package/dist/Interfaces/Email/IEmail.js.map +1 -1
- package/dist/Interfaces/G2/index.js +2 -0
- package/dist/Interfaces/G2/index.js.map +1 -1
- package/dist/Interfaces/Indexed/Product/index.d.ts +3 -0
- package/dist/Interfaces/Indexed/Product/index.js +43 -2
- package/dist/Interfaces/Indexed/Product/index.js.map +1 -1
- package/dist/Interfaces/Menu/index.d.ts +11 -0
- package/dist/Interfaces/Product/IImportProduct.js +94 -3
- package/dist/Interfaces/Product/IImportProduct.js.map +1 -1
- package/dist/Interfaces/Product/IInventoryItem.d.ts +11 -27
- package/dist/Interfaces/Product/IInventoryItem.js +13 -4
- package/dist/Interfaces/Product/IInventoryItem.js.map +1 -1
- package/dist/Interfaces/Product/IPricing.js +6 -0
- package/dist/Interfaces/Product/IPricing.js.map +1 -1
- package/dist/Interfaces/Product/index.d.ts +8 -0
- package/dist/Interfaces/Product/index.js +8 -0
- package/dist/Interfaces/Product/index.js.map +1 -1
- package/dist/Interfaces/PromiseToPurchase/IIndexedBankUsed.js +1 -1
- package/dist/Interfaces/PromiseToPurchase/IIndexedBankUsed.js.map +1 -1
- package/dist/Interfaces/Rules/IDiscountRule.d.ts +18 -0
- package/dist/Interfaces/Rules/IDiscountRule.js +19 -0
- package/dist/Interfaces/Rules/IDiscountRule.js.map +1 -1
- package/dist/Interfaces/Services/IService.d.ts +4 -0
- package/dist/Interfaces/Shipping/Shiptime/order.js +23 -0
- package/dist/Interfaces/Shipping/Shiptime/order.js.map +1 -1
- package/dist/Interfaces/Space/index.d.ts +8 -0
- package/dist/Interfaces/Space/index.js +9 -0
- package/dist/Interfaces/Space/index.js.map +1 -1
- package/dist/Interfaces/TCG/index.d.ts +12 -1
- package/dist/Interfaces/TCG/index.js +11 -0
- package/dist/Interfaces/TCG/index.js.map +1 -1
- package/dist/Interfaces/TransferRequest/index.js +3 -0
- package/dist/Interfaces/TransferRequest/index.js.map +1 -1
- package/dist/constants/services.js +1 -0
- package/dist/constants/services.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/Attribute/index.js +43 -0
- package/dist/lib/Attribute/index.js.map +1 -1
- package/dist/lib/BGJob/index.js +5 -1
- package/dist/lib/BGJob/index.js.map +1 -1
- package/dist/lib/Booking/index.d.ts +15 -0
- package/dist/lib/Booking/index.js +20 -0
- package/dist/lib/Booking/index.js.map +1 -1
- package/dist/lib/Brand/index.d.ts +9 -0
- package/dist/lib/Brand/index.js +18 -0
- package/dist/lib/Brand/index.js.map +1 -1
- package/dist/lib/Cart/index.d.ts +99 -0
- package/dist/lib/Cart/index.js +498 -9
- package/dist/lib/Cart/index.js.map +1 -1
- package/dist/lib/CartReservedQuantities/index.d.ts +29 -0
- package/dist/lib/CartReservedQuantities/index.js +41 -0
- package/dist/lib/CartReservedQuantities/index.js.map +1 -1
- package/dist/lib/Catalogue/index.d.ts +6 -0
- package/dist/lib/Catalogue/index.js +9 -0
- package/dist/lib/Catalogue/index.js.map +1 -1
- package/dist/lib/Category/index.d.ts +6 -0
- package/dist/lib/Category/index.js +15 -0
- package/dist/lib/Category/index.js.map +1 -1
- package/dist/lib/Class/index.d.ts +4 -0
- package/dist/lib/Class/index.js +8 -0
- package/dist/lib/Class/index.js.map +1 -1
- package/dist/lib/Customer/index.d.ts +12 -0
- package/dist/lib/Customer/index.js +13 -0
- package/dist/lib/Customer/index.js.map +1 -1
- package/dist/lib/Declination/index.js +2 -0
- package/dist/lib/Declination/index.js.map +1 -1
- package/dist/lib/Discount/index.d.ts +9 -0
- package/dist/lib/Discount/index.js +23 -0
- package/dist/lib/Discount/index.js.map +1 -1
- package/dist/lib/ElasticSearch/index.d.ts +5 -0
- package/dist/lib/ElasticSearch/index.js +5 -0
- package/dist/lib/ElasticSearch/index.js.map +1 -1
- package/dist/lib/Elavon/index.js +5 -0
- package/dist/lib/Elavon/index.js.map +1 -1
- package/dist/lib/Email/AbandonedCartEmail.d.ts +8 -0
- package/dist/lib/Email/AbandonedCartEmail.js +8 -0
- package/dist/lib/Email/AbandonedCartEmail.js.map +1 -1
- package/dist/lib/Email/AccountConfirmationEmail.d.ts +8 -0
- package/dist/lib/Email/AccountConfirmationEmail.js +8 -0
- package/dist/lib/Email/AccountConfirmationEmail.js.map +1 -1
- package/dist/lib/Email/AdminOrderConfirmationEmail.d.ts +8 -0
- package/dist/lib/Email/AdminOrderConfirmationEmail.js +8 -0
- package/dist/lib/Email/AdminOrderConfirmationEmail.js.map +1 -1
- package/dist/lib/Email/ApplicationEmail.d.ts +8 -0
- package/dist/lib/Email/ApplicationEmail.js +8 -0
- package/dist/lib/Email/ApplicationEmail.js.map +1 -1
- package/dist/lib/Email/BackInStockEmail.d.ts +8 -0
- package/dist/lib/Email/BackInStockEmail.js +8 -0
- package/dist/lib/Email/BackInStockEmail.js.map +1 -1
- package/dist/lib/Email/ContactEmail.d.ts +8 -0
- package/dist/lib/Email/ContactEmail.js +8 -0
- package/dist/lib/Email/ContactEmail.js.map +1 -1
- package/dist/lib/Email/CustomerBookingAdminEmail.d.ts +8 -0
- package/dist/lib/Email/CustomerBookingAdminEmail.js +8 -0
- package/dist/lib/Email/CustomerBookingAdminEmail.js.map +1 -1
- package/dist/lib/Email/CustomerBookingEmail.d.ts +8 -0
- package/dist/lib/Email/CustomerBookingEmail.js +8 -0
- package/dist/lib/Email/CustomerBookingEmail.js.map +1 -1
- package/dist/lib/Email/OrderConfirmationEmail.d.ts +8 -0
- package/dist/lib/Email/OrderConfirmationEmail.js +8 -0
- package/dist/lib/Email/OrderConfirmationEmail.js.map +1 -1
- package/dist/lib/Email/OrderDenounciationEmail.d.ts +8 -0
- package/dist/lib/Email/OrderDenounciationEmail.js +8 -0
- package/dist/lib/Email/OrderDenounciationEmail.js.map +1 -1
- package/dist/lib/Email/OrderSampleEmail.d.ts +8 -0
- package/dist/lib/Email/OrderSampleEmail.js +8 -0
- package/dist/lib/Email/OrderSampleEmail.js.map +1 -1
- package/dist/lib/Email/OtherTypeEmails.d.ts +8 -0
- package/dist/lib/Email/OtherTypeEmails.js +8 -0
- package/dist/lib/Email/OtherTypeEmails.js.map +1 -1
- package/dist/lib/Email/PasswordResetEmail.d.ts +8 -0
- package/dist/lib/Email/PasswordResetEmail.js +8 -0
- package/dist/lib/Email/PasswordResetEmail.js.map +1 -1
- package/dist/lib/Email/PhotoShootEmail.d.ts +8 -0
- package/dist/lib/Email/PhotoShootEmail.js +8 -0
- package/dist/lib/Email/PhotoShootEmail.js.map +1 -1
- package/dist/lib/Email/PickUpConfirmation.d.ts +8 -0
- package/dist/lib/Email/PickUpConfirmation.js +8 -0
- package/dist/lib/Email/PickUpConfirmation.js.map +1 -1
- package/dist/lib/Email/ShippingConfirmation.d.ts +8 -0
- package/dist/lib/Email/ShippingConfirmation.js +8 -0
- package/dist/lib/Email/ShippingConfirmation.js.map +1 -1
- package/dist/lib/Email/WelcomeEmail.d.ts +8 -0
- package/dist/lib/Email/WelcomeEmail.js +8 -0
- package/dist/lib/Email/WelcomeEmail.js.map +1 -1
- package/dist/lib/Email/index.d.ts +8 -0
- package/dist/lib/Email/index.js +8 -0
- package/dist/lib/Email/index.js.map +1 -1
- package/dist/lib/ExternalService/Ebay.d.ts +12 -0
- package/dist/lib/ExternalService/Ebay.js +22 -0
- package/dist/lib/ExternalService/Ebay.js.map +1 -1
- package/dist/lib/Indexed/IndexedCart.js +5 -0
- package/dist/lib/Indexed/IndexedCart.js.map +1 -1
- package/dist/lib/Indexed/Product.js +50 -0
- package/dist/lib/Indexed/Product.js.map +1 -1
- package/dist/lib/Inventory/index.d.ts +59 -0
- package/dist/lib/Inventory/index.js +157 -9
- package/dist/lib/Inventory/index.js.map +1 -1
- package/dist/lib/Invoice/index.d.ts +11 -0
- package/dist/lib/Invoice/index.js +11 -0
- package/dist/lib/Invoice/index.js.map +1 -1
- package/dist/lib/MarketplacePublication/index.js +308 -0
- package/dist/lib/MarketplacePublication/index.js.map +1 -1
- package/dist/lib/Menu/index.js +2 -0
- package/dist/lib/Menu/index.js.map +1 -1
- package/dist/lib/Order/index.d.ts +20 -0
- package/dist/lib/Order/index.js +23 -0
- package/dist/lib/Order/index.js.map +1 -1
- package/dist/lib/Org/index.d.ts +41 -0
- package/dist/lib/Org/index.js +41 -0
- package/dist/lib/Org/index.js.map +1 -1
- package/dist/lib/PandaPay/index.js +6 -0
- package/dist/lib/PandaPay/index.js.map +1 -1
- package/dist/lib/Paysafe/index.js +1 -0
- package/dist/lib/Paysafe/index.js.map +1 -1
- package/dist/lib/Product/index.d.ts +25 -0
- package/dist/lib/Product/index.js +55 -1
- package/dist/lib/Product/index.js.map +1 -1
- package/dist/lib/PromiseToPurchase/index.d.ts +72 -0
- package/dist/lib/PromiseToPurchase/index.js +79 -0
- package/dist/lib/PromiseToPurchase/index.js.map +1 -1
- package/dist/lib/PurchaseOrder/index.d.ts +11 -0
- package/dist/lib/PurchaseOrder/index.js +12 -0
- package/dist/lib/PurchaseOrder/index.js.map +1 -1
- package/dist/lib/Service/index.d.ts +8 -0
- package/dist/lib/Service/index.js +8 -0
- package/dist/lib/Service/index.js.map +1 -1
- package/dist/lib/Shipment/index.js +13 -0
- package/dist/lib/Shipment/index.js.map +1 -1
- package/dist/lib/Slider/index.d.ts +6 -0
- package/dist/lib/Slider/index.js +6 -0
- package/dist/lib/Slider/index.js.map +1 -1
- package/dist/lib/Space/index.d.ts +178 -0
- package/dist/lib/Space/index.js +495 -6
- package/dist/lib/Space/index.js.map +1 -1
- package/dist/lib/Supplier/index.js +5 -0
- package/dist/lib/Supplier/index.js.map +1 -1
- package/dist/lib/Tags/index.js +5 -0
- package/dist/lib/Tags/index.js.map +1 -1
- package/dist/lib/TransferRequest/index.d.ts +178 -0
- package/dist/lib/TransferRequest/index.js +236 -4
- package/dist/lib/TransferRequest/index.js.map +1 -1
- package/dist/lib/User/index.d.ts +54 -0
- package/dist/lib/User/index.js +101 -21
- package/dist/lib/User/index.js.map +1 -1
- package/dist/lib/baseService.js +26 -0
- package/dist/lib/baseService.js.map +1 -1
- package/dist/rules/GR/constants/data.js +22 -0
- package/dist/rules/GR/constants/data.js.map +1 -1
- package/dist/rules/GR/constants/products.d.ts +3 -0
- package/dist/rules/GR/constants/products.js +16 -0
- package/dist/rules/GR/constants/products.js.map +1 -1
- package/dist/rules/GR/interfaces/data.js +7 -1
- package/dist/rules/GR/interfaces/data.js.map +1 -1
- package/dist/rules/GR/utils/cart.d.ts +41 -0
- package/dist/rules/GR/utils/cart.js +107 -1
- package/dist/rules/GR/utils/cart.js.map +1 -1
- package/dist/rules/GR/utils/data.js +4 -1
- package/dist/rules/GR/utils/data.js.map +1 -1
- package/dist/rules/GR/utils/expedition.d.ts +69 -0
- package/dist/rules/GR/utils/expedition.js +399 -11
- package/dist/rules/GR/utils/expedition.js.map +1 -1
- package/dist/rules/GR/utils/g2.d.ts +33 -0
- package/dist/rules/GR/utils/g2.js +135 -3
- package/dist/rules/GR/utils/g2.js.map +1 -1
- package/dist/rules/GR/utils/invoices.d.ts +27 -0
- package/dist/rules/GR/utils/invoices.js +41 -0
- package/dist/rules/GR/utils/invoices.js.map +1 -1
- package/dist/rules/GR/utils/products.d.ts +161 -0
- package/dist/rules/GR/utils/products.js +272 -1
- package/dist/rules/GR/utils/products.js.map +1 -1
- package/dist/rules/GR/utils/upsells.d.ts +32 -0
- package/dist/rules/GR/utils/upsells.js +32 -0
- package/dist/rules/GR/utils/upsells.js.map +1 -1
- package/dist/services/database/DatabaseService.d.ts +84 -0
- package/dist/services/database/DatabaseService.js +85 -0
- package/dist/services/database/DatabaseService.js.map +1 -1
- package/dist/services/database/FirebaseProvider.js +17 -0
- package/dist/services/database/FirebaseProvider.js.map +1 -1
- package/dist/services/database/NotFirebaseProvider.d.ts +14 -0
- package/dist/services/database/NotFirebaseProvider.js +19 -0
- package/dist/services/database/NotFirebaseProvider.js.map +1 -1
- package/dist/services/g2/G2OrderSlip.d.ts +7 -0
- package/dist/services/g2/G2OrderSlip.js +18 -0
- package/dist/services/g2/G2OrderSlip.js.map +1 -1
- package/dist/services/g2/utils.d.ts +10 -0
- package/dist/services/g2/utils.js +189 -3
- package/dist/services/g2/utils.js.map +1 -1
- package/dist/services/logs/index.d.ts +3 -0
- package/dist/services/logs/index.js +6 -1
- package/dist/services/logs/index.js.map +1 -1
- package/dist/services/products/BaseClass.js +2 -0
- package/dist/services/products/BaseClass.js.map +1 -1
- package/dist/services/products/TCGService.js +17 -1
- package/dist/services/products/TCGService.js.map +1 -1
- package/dist/services/products/utils.d.ts +22 -0
- package/dist/services/products/utils.js +50 -0
- package/dist/services/products/utils.js.map +1 -1
- package/dist/utils/anonymisation.d.ts +24 -0
- package/dist/utils/anonymisation.js +30 -0
- package/dist/utils/anonymisation.js.map +1 -1
- package/dist/utils/aws.d.ts +22 -0
- package/dist/utils/aws.js +28 -0
- package/dist/utils/aws.js.map +1 -1
- package/dist/utils/booking.d.ts +8 -0
- package/dist/utils/booking.js +9 -0
- package/dist/utils/booking.js.map +1 -1
- package/dist/utils/cart.d.ts +81 -0
- package/dist/utils/cart.js +172 -9
- package/dist/utils/cart.js.map +1 -1
- package/dist/utils/context.js +2 -2
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/currency.js +31 -1
- package/dist/utils/currency.js.map +1 -1
- package/dist/utils/data.js +2 -0
- package/dist/utils/data.js.map +1 -1
- package/dist/utils/discount.d.ts +118 -0
- package/dist/utils/discount.js +178 -1
- package/dist/utils/discount.js.map +1 -1
- package/dist/utils/file-admin.js +1 -0
- package/dist/utils/file-admin.js.map +1 -1
- package/dist/utils/file.js +9 -1
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/firebase-admin.d.ts +9 -0
- package/dist/utils/firebase-admin.js +12 -0
- package/dist/utils/firebase-admin.js.map +1 -1
- package/dist/utils/firebase.d.ts +17 -0
- package/dist/utils/firebase.js +17 -0
- package/dist/utils/firebase.js.map +1 -1
- package/dist/utils/inventories.d.ts +52 -0
- package/dist/utils/inventories.js +77 -2
- package/dist/utils/inventories.js.map +1 -1
- package/dist/utils/locale.d.ts +9 -0
- package/dist/utils/locale.js +9 -0
- package/dist/utils/locale.js.map +1 -1
- package/dist/utils/mailchimp.js +36 -0
- package/dist/utils/mailchimp.js.map +1 -1
- package/dist/utils/mathUtils.js +9 -0
- package/dist/utils/mathUtils.js.map +1 -1
- package/dist/utils/object.d.ts +19 -0
- package/dist/utils/object.js +21 -3
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/products.d.ts +7 -0
- package/dist/utils/products.js +9 -0
- package/dist/utils/products.js.map +1 -1
- package/dist/utils/promiseToPurchase.d.ts +32 -0
- package/dist/utils/promiseToPurchase.js +34 -0
- package/dist/utils/promiseToPurchase.js.map +1 -1
- package/dist/utils/prosprsearch.d.ts +15 -0
- package/dist/utils/prosprsearch.js +15 -0
- package/dist/utils/prosprsearch.js.map +1 -1
- package/dist/utils/sdc.js +7 -0
- package/dist/utils/sdc.js.map +1 -1
- package/dist/utils/searchIndexes.d.ts +37 -0
- package/dist/utils/searchIndexes.js +37 -0
- package/dist/utils/searchIndexes.js.map +1 -1
- package/dist/utils/string.js +7 -6
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/tools.d.ts +4 -0
- package/dist/utils/tools.js +4 -0
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/transferRequests.d.ts +24 -0
- package/dist/utils/transferRequests.js +24 -0
- package/dist/utils/transferRequests.js.map +1 -1
- package/dist/utils/update.js +12 -0
- package/dist/utils/update.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,8 +10,11 @@ exports.installationProSpecSkus = {
|
|
|
10
10
|
pentes: '310040000',
|
|
11
11
|
nivellement_necessaire: '310050000'
|
|
12
12
|
};
|
|
13
|
+
// SKU for installation all-inclusive
|
|
13
14
|
exports.installationAllInclusiveSku = 'INSTALL-1';
|
|
15
|
+
// Catégorie 2 pour les services inclus dans l'installation tout-inclus
|
|
14
16
|
exports.allInclusiveCategory = 'ALLINC';
|
|
17
|
+
// Frais de transport (livraison gazon) SKUS
|
|
15
18
|
exports.sodDeliverySkus = ['17000000T', '170000160', '170000000'];
|
|
16
19
|
exports.installationProductsSlugs = [
|
|
17
20
|
'frais_extra_pro_installation',
|
|
@@ -22,8 +25,12 @@ exports.installationProductsSlugs = [
|
|
|
22
25
|
'frais-minimum-gazon-pour-installation',
|
|
23
26
|
'installation-gazon'
|
|
24
27
|
];
|
|
28
|
+
/**
|
|
29
|
+
* Contains all necessary elements for extra questions if adding grass product to cart
|
|
30
|
+
*/
|
|
25
31
|
exports.otherGrassSubQuestions = [
|
|
26
32
|
{
|
|
33
|
+
// frais installation
|
|
27
34
|
type: 'radio',
|
|
28
35
|
label: {
|
|
29
36
|
fr: '',
|
|
@@ -42,6 +49,7 @@ exports.otherGrassSubQuestions = [
|
|
|
42
49
|
group: { fr: 'Installation', en: 'Installation' }
|
|
43
50
|
},
|
|
44
51
|
{
|
|
52
|
+
// frais engrais gazon
|
|
45
53
|
type: 'radio',
|
|
46
54
|
label: {
|
|
47
55
|
fr: 'Voulez-vous que notre équipe applique un engrais enracineur (préengazonneur 10-25-10)?',
|
|
@@ -62,6 +70,7 @@ exports.otherGrassSubQuestions = [
|
|
|
62
70
|
installOnly: true
|
|
63
71
|
},
|
|
64
72
|
{
|
|
73
|
+
// frais installation
|
|
65
74
|
type: 'radio',
|
|
66
75
|
label: {
|
|
67
76
|
fr: "Voulez-vous que l'équipe se charge de rouler le gazon après la pose?",
|
|
@@ -82,6 +91,7 @@ exports.otherGrassSubQuestions = [
|
|
|
82
91
|
installOnly: true
|
|
83
92
|
},
|
|
84
93
|
{
|
|
94
|
+
// pro_terrainReady
|
|
85
95
|
type: 'radio',
|
|
86
96
|
label: {
|
|
87
97
|
fr: 'Est-ce que le terrain est prêt en ce moment ?',
|
|
@@ -99,6 +109,7 @@ exports.otherGrassSubQuestions = [
|
|
|
99
109
|
saveInCartProps: 'shipping_payload.pro_installation_info.terrain_pret'
|
|
100
110
|
},
|
|
101
111
|
{
|
|
112
|
+
// pro_typeTerrain
|
|
102
113
|
type: 'radio',
|
|
103
114
|
label: {
|
|
104
115
|
fr: "De quel type de terrain s'agit t'il ?",
|
|
@@ -116,6 +127,7 @@ exports.otherGrassSubQuestions = [
|
|
|
116
127
|
saveInCartProps: 'shipping_payload.pro_installation_info.type_terrain'
|
|
117
128
|
},
|
|
118
129
|
{
|
|
130
|
+
// pro_projectSpecs
|
|
119
131
|
type: 'checkbox-multiple',
|
|
120
132
|
label: {
|
|
121
133
|
fr: "Veuillez cocher tout ce qui s'applique à votre projet :",
|
|
@@ -171,6 +183,7 @@ exports.otherGrassSubQuestions = [
|
|
|
171
183
|
saveInCartProps: 'shipping_payload.pro_installation_info.specs'
|
|
172
184
|
},
|
|
173
185
|
{
|
|
186
|
+
// pro_isAllGrass
|
|
174
187
|
type: 'radio',
|
|
175
188
|
label: {
|
|
176
189
|
fr: 'Est-ce que cette commande représente la totalité du gazon à installer sur ce projet ?',
|
|
@@ -188,6 +201,7 @@ exports.otherGrassSubQuestions = [
|
|
|
188
201
|
saveInCartProps: 'shipping_payload.pro_installation_info.commande_egale_superficie'
|
|
189
202
|
},
|
|
190
203
|
{
|
|
204
|
+
// pro_onlyOneAddress
|
|
191
205
|
type: 'radio',
|
|
192
206
|
label: {
|
|
193
207
|
fr: 'Est-ce que cette commande est pour une seule adresse civique ?',
|
|
@@ -205,6 +219,7 @@ exports.otherGrassSubQuestions = [
|
|
|
205
219
|
saveInCartProps: 'shipping_payload.pro_installation_info.un_seule_adresse'
|
|
206
220
|
},
|
|
207
221
|
{
|
|
222
|
+
// pro_onlyOneAddress
|
|
208
223
|
type: 'radio',
|
|
209
224
|
label: {
|
|
210
225
|
fr: 'Chantier avec carte ASP ?',
|
|
@@ -222,6 +237,7 @@ exports.otherGrassSubQuestions = [
|
|
|
222
237
|
saveInCartProps: 'shipping_payload.pro_installation_info.carte_asp'
|
|
223
238
|
},
|
|
224
239
|
{
|
|
240
|
+
// pro_otherNotes
|
|
225
241
|
type: 'text',
|
|
226
242
|
label: {
|
|
227
243
|
fr: "Autres détails à nous mentionner en lien avec l'installation:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../../src/rules/GR/constants/products.ts"],"names":[],"mappings":";;;AAEa,QAAA,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAA;AAClE,QAAA,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAA;AAElE,QAAA,uBAAuB,GAA8B;IACjE,QAAQ,EAAE,WAAW;IACrB,cAAc,EAAE,WAAW;IAC3B,YAAY,EAAE,WAAW;IACzB,MAAM,EAAE,WAAW;IACnB,sBAAsB,EAAE,WAAW;CACnC,CAAA;
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../../src/rules/GR/constants/products.ts"],"names":[],"mappings":";;;AAEa,QAAA,QAAQ,GAAG,CAAC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,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;YAChD,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;SAChD;QACD,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE;QACtC,eAAe,EAAE,eAAe;QAChC,eAAe,EAAE,kDAAkD;KACnE;IACD;QACC,iBAAiB;QACjB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACN,EAAE,EAAE,+DAA+D;YACnE,EAAE,EAAE,gEAAgE;SACpE;QACD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;QACnC,eAAe,EAAE,aAAa;QAC9B,eAAe,EAAE,gDAAgD;KACjE;CACD,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MailchimpListIds = exports.GRBrandsEnum = exports.GRCategoriesEnum = exports.AttributesIdEnumGR = void 0;
|
|
4
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
5
|
+
// #region IDS
|
|
4
6
|
var AttributesIdEnumGR;
|
|
5
7
|
(function (AttributesIdEnumGR) {
|
|
6
8
|
AttributesIdEnumGR["TYPE"] = "IZ3aFc07KwuLtTRq2tfw";
|
|
@@ -97,9 +99,13 @@ var GRBrandsEnum;
|
|
|
97
99
|
GRBrandsEnum["OAKS_TEST"] = "2YowRMl8HBo5XGt0vjyr";
|
|
98
100
|
GRBrandsEnum["OAKS"] = "CstKSHJNJtn168pQIM7H";
|
|
99
101
|
})(GRBrandsEnum = exports.GRBrandsEnum || (exports.GRBrandsEnum = {}));
|
|
102
|
+
// #endregion
|
|
103
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
104
|
+
// #region MAILCHIMP
|
|
100
105
|
var MailchimpListIds;
|
|
101
106
|
(function (MailchimpListIds) {
|
|
102
107
|
MailchimpListIds["CLIENTS_PARTICULIER"] = "e3ac558182";
|
|
103
|
-
MailchimpListIds["CLIENTS_PRO"] = "39300ee54c";
|
|
108
|
+
MailchimpListIds["CLIENTS_PRO"] = "39300ee54c"; // ou 401089
|
|
104
109
|
})(MailchimpListIds = exports.MailchimpListIds || (exports.MailchimpListIds = {}));
|
|
110
|
+
//# endregion
|
|
105
111
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../src/rules/GR/interfaces/data.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../src/rules/GR/interfaces/data.ts"],"names":[],"mappings":";;;AAAA,8GAA8G;AAC9G,cAAc;AACd,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC7B,mDAA6B,CAAA;IAC7B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,2DAAqC,CAAA;IACrC,gEAA0C,CAAA;IAC1C,sEAAgD,CAAA;IAChD,0DAAoC,CAAA;IACpC,sDAAgC,CAAA;IAChC,wDAAkC,CAAA;IAClC,0DAAoC,CAAA;IACpC,oDAA8B,CAAA;IAC9B,oDAA8B,CAAA;IAC9B,yDAAmC,CAAA;IACnC,0DAAoC,CAAA;IACpC,qEAA+C,CAAA;IAC/C,qDAA+B,CAAA;AAChC,CAAC,EAjBW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAiB7B;AACD,IAAY,gBAsDX;AAtDD,WAAY,gBAAgB;IAC3B,+DAA2C,CAAA;IAC3C,oEAAgD,CAAA;IAChD,k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AC/B,iDAAiC,CAAA;IACjC,gDAAgC,CAAA;IAChC,oDAAoC,CAAA;IACpC,+CAA+B,CAAA;IAC/B,qDAAqC,CAAA;IACrC,mDAAmC,CAAA;IACnC,8CAA8B,CAAA;IAC9B,+CAA+B,CAAA;IAC/B,qDAAqC,CAAA;IACrC,sDAAsC,CAAA;IACtC,2CAA2B,CAAA;IAC3B,qDAAqC,CAAA;IACrC,+CAA+B,CAAA;IAC/B,kDAAkC,CAAA;IAClC,6CAA6B,CAAA;AAC9B,CAAC,EAnBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAmBvB;AACD,aAAa;AAEb,8GAA8G;AAC9G,oBAAoB;AACpB,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,sDAAkC,CAAA;IAClC,8CAA0B,CAAA,CAAC,YAAY;AACxC,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AACD,aAAa"}
|
|
@@ -22,6 +22,10 @@ export declare const handleAddGrassItemsCart: (cart: ICart, chosenDeclination: I
|
|
|
22
22
|
newShippingPayload: any;
|
|
23
23
|
error?: undefined;
|
|
24
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Replaces ventilated installation with installation tout inclus and applies Kentucky overrides.
|
|
27
|
+
* Used during cart verification when a pro customer has installation tout inclus but cart has ventilated installation.
|
|
28
|
+
*/
|
|
25
29
|
export declare const applyInstallationToutInclusToVerifiedItems: (verifiedItems: ICartItem[], customPriceList: ICustomPriceItem[] | undefined, isPro: boolean, installationParent?: IIndexedProduct) => ICartItem[];
|
|
26
30
|
export declare const checkIfCartContainsType: (type: CartGeneralTypeEnum, cartData: ICart, excludeUndefinedForAccessories?: boolean, excludeUndefinedForBeton?: boolean) => boolean;
|
|
27
31
|
export declare const checkIfItemCanBeAddedToCart: (prod: IIndexedProduct, parentProdType: 'gazon' | 'beton' | 'vrac' | 'other', cartData: ICart | undefined, addToCart?: boolean, declination?: IIndexedDeclination | undefined, useParent?: boolean, autoAdd?: boolean) => {
|
|
@@ -33,20 +37,57 @@ export declare const checkIfItemCanBeAddedToCart: (prod: IIndexedProduct, parent
|
|
|
33
37
|
export declare const checkIfDecliIsOkForMixedSale: (decli: IIndexedDeclination, typeToCheck: 'gazon' | 'beton' | 'vrac' | 'accessoires') => boolean;
|
|
34
38
|
export declare const checkCartTypeBeforeAddingItem: (prod: IIndexedProduct, declination: IIndexedDeclination | undefined, cartData: ICart | undefined, forceCartType?: CartGeneralTypeEnum) => boolean;
|
|
35
39
|
export declare const getCartType: (cartData: ICart) => CartGeneralTypeEnum.VRAC | CartGeneralTypeEnum.SAMPLE | CartGeneralTypeEnum.ONLY_ACCESSORIES | CartGeneralTypeEnum.GRASS | CartGeneralTypeEnum.BETON | CartGeneralTypeEnum.BOOKING | CartGeneralTypeEnum.BOOKING_BETON | CartGeneralTypeEnum.RETURN_PALLETS;
|
|
40
|
+
/**
|
|
41
|
+
* Finds out if a cart is for a pro customer or not
|
|
42
|
+
* @param {ICart} invoice The cart to test
|
|
43
|
+
* @return Returns true if the cart is pro, false if not
|
|
44
|
+
*/
|
|
36
45
|
export declare const isPro: (invoice: ICart) => boolean;
|
|
37
46
|
export declare const getProTitleFromCart: (invoice: ICart) => string | undefined;
|
|
38
47
|
export declare const orderCartItems: (cart: ICart) => ICartItem[];
|
|
39
48
|
export declare const getConcreteCartInfo: (cartData: ICart, fetchInventoryItem: (sku: string) => Promise<IInventoryItem | undefined>, pickupStoreId?: string, inventoryItemsArray?: IInventoryItem[]) => Promise<IConcreteOrder>;
|
|
49
|
+
/**
|
|
50
|
+
* Function getGrassProduct
|
|
51
|
+
* @description - Create the essential info needed when checking a grass type product for cart
|
|
52
|
+
* @param item
|
|
53
|
+
*/
|
|
40
54
|
export declare const getGrassProductForCart: (item: ICartItem | undefined) => IGrassProduct | undefined;
|
|
41
55
|
export declare const getRecursiveItems: (cartItems: ICartItem[], cartContainsGrass?: boolean, keepFees?: boolean) => ICartItemWithSubItem[];
|
|
42
56
|
export declare const getRecursiveItemsFromSubItems: (item: ICartItemWithSubItem) => ICartItemWithSubItem[];
|
|
57
|
+
/**
|
|
58
|
+
* Get price applied for item in cart. Corresponds to the unit price that the customer paid.
|
|
59
|
+
* @param {Space} space
|
|
60
|
+
* @param {ICartItem} item
|
|
61
|
+
* @param {ICart} cartData
|
|
62
|
+
* @param {boolean} options.isBookingBeton Optionnal. Always returns regular price if true (additionnal check)
|
|
63
|
+
* @param {boolean} options.getLowest Optionnal. If true, always returns the lowest amount found between all cart item prices, with no other checks.
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
43
66
|
export declare const getAppliedPrice: (item: ICartItem, options?: {
|
|
44
67
|
isBookingBeton?: boolean;
|
|
45
68
|
getLowest?: boolean;
|
|
46
69
|
}) => number;
|
|
47
70
|
export declare const getLowestAppliedPrice: (item: ICartItem) => import("../../../Interfaces/Cart").ICartItemPrices;
|
|
71
|
+
/**
|
|
72
|
+
* Checks if the specific item price contains an "escompte"
|
|
73
|
+
* @param {ICartItemCustomPrices} price The price to check, Either the discount_price of promo_price of a cart item.
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
48
76
|
export declare const checkPriceForEscompte: (price: ICartItemCustomPrices) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Calculates the percent applied from a discount on a cart item. If promo_price set, checks promo_price, else checks discount_price.
|
|
79
|
+
* @param {ICartItem} item
|
|
80
|
+
* @param {boolean} isPro
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
49
83
|
export declare const getPercentFromReducedPrice: (item: ICartItem, isPro: boolean) => number | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Returns the customer's Client Number to show in order slip and invoice.
|
|
86
|
+
* @param cartData
|
|
87
|
+
* @param space - Must be defined to check if grass promise to purchase bank was applied to cart
|
|
88
|
+
* @param options.isQuote - Optionnal. If current cart is a quote cart
|
|
89
|
+
* @param options.checkIfEscPaApplied - Optionnal. If true, will only add PA suffix if some reduce PA price or item is found in cart
|
|
90
|
+
*/
|
|
50
91
|
export declare const getClientNumberForCart: (cartData: ICart | undefined, space: Space | undefined, options?: {
|
|
51
92
|
isQuote?: boolean;
|
|
52
93
|
checkIfEscPaApplied?: boolean;
|
|
@@ -21,7 +21,9 @@ const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
|
|
|
21
21
|
const toNumber_1 = __importDefault(require("lodash/toNumber"));
|
|
22
22
|
const round_1 = __importDefault(require("lodash/round"));
|
|
23
23
|
const moment_1 = __importDefault(require("moment"));
|
|
24
|
+
// Rule specific interfaces
|
|
24
25
|
const cart_1 = require("../interfaces/cart");
|
|
26
|
+
// Rule specific functions/constants
|
|
25
27
|
const products_1 = require("./products");
|
|
26
28
|
const upsells_1 = require("./upsells");
|
|
27
29
|
const expedition_1 = require("./expedition");
|
|
@@ -61,6 +63,8 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
61
63
|
removeTierPricing: chosenDeclination.sku === products_2.kentucky
|
|
62
64
|
});
|
|
63
65
|
}
|
|
66
|
+
// --------------------------------------------------------------------------------
|
|
67
|
+
// Ajout gazon aux items
|
|
64
68
|
if (isUpdating && !!cart.items.find((i) => i.sku === chosenDeclination.sku)) {
|
|
65
69
|
itemsToUpdate.push({
|
|
66
70
|
sku: chosenDeclination.sku,
|
|
@@ -72,11 +76,16 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
72
76
|
}
|
|
73
77
|
if (!!!isRecommendedUpsell) {
|
|
74
78
|
let baseGrass = parentProduct;
|
|
79
|
+
// --------------------------------------------------------------------------------
|
|
80
|
+
// If gazon de spécialité, il aura en upsell le gazon de base (Kentucky)...
|
|
81
|
+
// (parent_slug: kentucky, sku (declinaison): 010010000)
|
|
75
82
|
if (!!prodUpsell && !!prodUpsell.find((anUpsell) => anUpsell.recommendation_sku === products_2.kentucky)) {
|
|
76
83
|
const baseGrassProd = kentuckyBaseGrass;
|
|
77
84
|
if (!!baseGrassProd)
|
|
78
85
|
baseGrass = baseGrassProd;
|
|
79
86
|
}
|
|
87
|
+
// --------------------------------------------------------------------------------
|
|
88
|
+
// Check if grass has any other auto_add upsells to add
|
|
80
89
|
if (!!prodUpsell) {
|
|
81
90
|
for (let anUpsell of prodUpsell) {
|
|
82
91
|
if (!!!anUpsell.auto_add)
|
|
@@ -107,6 +116,8 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
107
116
|
}
|
|
108
117
|
}
|
|
109
118
|
}
|
|
119
|
+
// --------------------------------------------------------------------------------
|
|
120
|
+
// If installation...
|
|
110
121
|
const currentInstallItem = cart.items.find((i) => i.parent_slug === 'installation-gazon');
|
|
111
122
|
if (!!formValues.installation) {
|
|
112
123
|
const upsell = baseGrass.product_upsells;
|
|
@@ -129,20 +140,31 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
129
140
|
}
|
|
130
141
|
}
|
|
131
142
|
const minQteInstall = (0, expedition_1.getMinQteInstall)(!!isPro);
|
|
143
|
+
// ================================================================================
|
|
144
|
+
// Check to delete existing items if necessary
|
|
145
|
+
// --------------------------------------------------------------------------------
|
|
146
|
+
// If min qty install...
|
|
132
147
|
if (typeof formValues.qte === 'number' && formValues.qte >= minQteInstall) {
|
|
133
148
|
const minInstall = cart.items.find((item) => item.parent_slug === 'frais-minimum-gazon-pour-installation');
|
|
134
149
|
if (!!minInstall) {
|
|
135
150
|
itemsToDelete.push(minInstall.sku);
|
|
136
151
|
}
|
|
137
152
|
}
|
|
153
|
+
// --------------------------------------------------------------------------------
|
|
154
|
+
// If engrais...
|
|
138
155
|
const fertilisationItem = cart.items.find((i) => i.parent_slug === 'installation-fertilisation');
|
|
139
156
|
if (isUpdating && !!!formValues.engrais && !!fertilisationItem) {
|
|
140
157
|
itemsToDelete.push(fertilisationItem.sku);
|
|
141
158
|
}
|
|
159
|
+
// --------------------------------------------------------------------------------
|
|
160
|
+
// If roulage...
|
|
142
161
|
const roulageItem = cart.items.find((i) => i.parent_slug === 'installation-roulage');
|
|
143
162
|
if (isUpdating && !!!formValues.roulage && !!roulageItem) {
|
|
144
163
|
itemsToDelete.push(roulageItem.sku);
|
|
145
164
|
}
|
|
165
|
+
// --------------------------------------------------------------------------------
|
|
166
|
+
// If cart already has installation item...
|
|
167
|
+
// --> Utile pour la modification des items du cart, vu que la props is_upsell_of_sku ne peut pas se modifier on update
|
|
146
168
|
const otherInstall = !!installIsDifferent ? currentInstallItem : undefined;
|
|
147
169
|
if (!!otherInstall) {
|
|
148
170
|
itemsToDelete.push(otherInstall.sku);
|
|
@@ -151,6 +173,8 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
151
173
|
...cart.items.filter((i) => i.is_upsell_of_sku === otherInstall.sku).map((i) => i.sku)
|
|
152
174
|
];
|
|
153
175
|
}
|
|
176
|
+
// ==================================================================================
|
|
177
|
+
// If isPro, check for corresponding pro extra installation fees
|
|
154
178
|
if (!!isPro) {
|
|
155
179
|
newShippingPayload = Object.assign(Object.assign({}, newShippingPayload), { pro_installation_info: formValues.pro });
|
|
156
180
|
const feeProduct = await fetchProduct('frais_extra_pro_installation', locale, undefined, true);
|
|
@@ -203,6 +227,7 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
203
227
|
newShippingPayload = Object.assign({}, rest);
|
|
204
228
|
}
|
|
205
229
|
itemsToDelete = [...itemsToDelete, ...(0, products_1.getAllInstallFromItems)(cart.items).map((i) => i.sku)];
|
|
230
|
+
// Restore price of kentucky when overriden by all-inclusive installation
|
|
206
231
|
if (!!isPro && !!(0, products_1.getInstallationAllInclusiveFromPriceList)(customPriceList)) {
|
|
207
232
|
const kentuckyIdx = cart.items.findIndex((i) => !!i.price_override && i.sku === products_2.kentucky);
|
|
208
233
|
if (kentuckyIdx !== -1) {
|
|
@@ -244,8 +269,10 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
244
269
|
}
|
|
245
270
|
}
|
|
246
271
|
}
|
|
272
|
+
// When installation all-inclusive, force kentucky and frais de livraison to 0$
|
|
247
273
|
if ((0, products_1.isInstallAllInclusiveActive)(!!formValues.installation, isPro, customPriceList)) {
|
|
248
274
|
itemsToAdd = itemsToAdd.map((item) => (0, products_1.applyAllInclusiveOverrides)(item));
|
|
275
|
+
// Also override existing Kentucky items that are in the cart but not yet at $0
|
|
249
276
|
if (!!isUpdating) {
|
|
250
277
|
const kentuckyIdx = cart.items.findIndex((i) => !i.price_override && i.sku === products_2.kentucky);
|
|
251
278
|
if (kentuckyIdx !== -1) {
|
|
@@ -263,6 +290,10 @@ const handleAddGrassItemsCart = async (cart, chosenDeclination, parentProduct, i
|
|
|
263
290
|
};
|
|
264
291
|
};
|
|
265
292
|
exports.handleAddGrassItemsCart = handleAddGrassItemsCart;
|
|
293
|
+
/**
|
|
294
|
+
* Replaces ventilated installation with installation tout inclus and applies Kentucky overrides.
|
|
295
|
+
* Used during cart verification when a pro customer has installation tout inclus but cart has ventilated installation.
|
|
296
|
+
*/
|
|
266
297
|
const applyInstallationToutInclusToVerifiedItems = (verifiedItems, customPriceList, isPro, installationParent) => {
|
|
267
298
|
var _a;
|
|
268
299
|
const currentInstall = verifiedItems.find((i) => i.parent_slug === 'installation-gazon');
|
|
@@ -287,6 +318,8 @@ const applyInstallationToutInclusToVerifiedItems = (verifiedItems, customPriceLi
|
|
|
287
318
|
return result;
|
|
288
319
|
};
|
|
289
320
|
exports.applyInstallationToutInclusToVerifiedItems = applyInstallationToutInclusToVerifiedItems;
|
|
321
|
+
// -----------------------------------------------------------------------------------------
|
|
322
|
+
// #region CART SPECIFIC VERIFICATIONS AND DATA
|
|
290
323
|
const checkIfCartContainsType = (type, cartData, excludeUndefinedForAccessories = true, excludeUndefinedForBeton = true) => {
|
|
291
324
|
switch (type) {
|
|
292
325
|
case cart_1.CartGeneralTypeEnum.RETURN_PALLETS:
|
|
@@ -315,6 +348,8 @@ const checkIfCartContainsType = (type, cartData, excludeUndefinedForAccessories
|
|
|
315
348
|
};
|
|
316
349
|
exports.checkIfCartContainsType = checkIfCartContainsType;
|
|
317
350
|
const checkIfItemCanBeAddedToCart = (prod, parentProdType, cartData, addToCart = false, declination = undefined, useParent = false, autoAdd = false) => {
|
|
351
|
+
// -----------------------------------------------------------------------------------------------
|
|
352
|
+
// If... product can not be added to cart, show error and return false.
|
|
318
353
|
const addItToCart = !!autoAdd ? true : (0, exports.checkCartTypeBeforeAddingItem)(prod, declination, cartData);
|
|
319
354
|
if (!!!addItToCart) {
|
|
320
355
|
return {
|
|
@@ -325,7 +360,9 @@ const checkIfItemCanBeAddedToCart = (prod, parentProdType, cartData, addToCart =
|
|
|
325
360
|
}
|
|
326
361
|
};
|
|
327
362
|
}
|
|
328
|
-
|
|
363
|
+
// -----------------------------------------------------------------------------------------------
|
|
364
|
+
// Set parentProduct type variable depending on product category
|
|
365
|
+
let prodDeclination = declination; // If prodDeclination is set, means customer chose spécific sku and is trying to add to cart.
|
|
329
366
|
if (!!!useParent) {
|
|
330
367
|
switch (parentProdType) {
|
|
331
368
|
case 'gazon':
|
|
@@ -343,6 +380,10 @@ const checkIfItemCanBeAddedToCart = (prod, parentProdType, cartData, addToCart =
|
|
|
343
380
|
}
|
|
344
381
|
}
|
|
345
382
|
const decliIsSample = !!prodDeclination && !!prodDeclination.is_sample;
|
|
383
|
+
// --------------------------------------------------------------------------------------------------
|
|
384
|
+
// If... prodDeclination is sample, check if max qte (4) is met or sample already in cart before.
|
|
385
|
+
// If so, show error and return false.
|
|
386
|
+
// Else if... product is of any type other than grass, set addToCart to true.
|
|
346
387
|
if (!!decliIsSample) {
|
|
347
388
|
if (!!cartData && !!cartData.items.length) {
|
|
348
389
|
switch (true) {
|
|
@@ -395,21 +436,32 @@ const checkCartTypeBeforeAddingItem = (prod, declination, cartData, forceCartTyp
|
|
|
395
436
|
if (!!!cartType)
|
|
396
437
|
return true;
|
|
397
438
|
const items = !!cartData ? cartData.items : [];
|
|
439
|
+
// Can't add items to cart if ...
|
|
440
|
+
// -----------------------------------------
|
|
441
|
+
// ... cart is of type booking
|
|
398
442
|
if (!!cartData && !!cartData.is_booking)
|
|
399
443
|
return false;
|
|
444
|
+
// --------------------------------------------------------------------------------------------------
|
|
445
|
+
// ... if new item is NOT a sample or does NOT contain samples in declinations && cart already contains samples
|
|
400
446
|
if ((!!!prod.declinations.find((decli) => !!decli.is_sample) || (!!declination && !declination.is_sample)) &&
|
|
401
447
|
cartType === cart_1.CartGeneralTypeEnum.SAMPLE) {
|
|
402
448
|
return false;
|
|
403
449
|
}
|
|
450
|
+
// --------------------------------------------------------------------------------------------------
|
|
451
|
+
// ... if new item is a sample && cart has items that are NOT samples
|
|
404
452
|
if (!!declination && !!declination.is_sample && cartType !== cart_1.CartGeneralTypeEnum.SAMPLE) {
|
|
405
453
|
return false;
|
|
406
454
|
}
|
|
455
|
+
// ----------------------------------------------------------
|
|
456
|
+
// ... new item is of type grass and cart already contains grass or items that cannot be sold with grass
|
|
407
457
|
if (!!(0, products_1.checkIfProductIsOfType)(prod, 'gazon') && cartType !== cart_1.CartGeneralTypeEnum.SAMPLE) {
|
|
408
458
|
if (!!items.some((i) => !!(0, products_1.checkIfProductIsOfType)(i, 'gazon')))
|
|
409
459
|
return false;
|
|
410
460
|
if (!!items.some((i) => !!!(0, exports.checkIfDecliIsOkForMixedSale)(i, 'gazon')))
|
|
411
461
|
return false;
|
|
412
462
|
}
|
|
463
|
+
// --------------------------------------------------------------------------------------------------
|
|
464
|
+
// ... if cart already has a grass product
|
|
413
465
|
let currentCartUpsells = [];
|
|
414
466
|
try {
|
|
415
467
|
currentCartUpsells = (0, uniqBy_1.default)((0, flatten_1.default)(items.map((i) => i.product_upsells || [])), (i) => !!i.recommendation_sku ? i.recommendation_sku : i.recommendation_parent_slug);
|
|
@@ -438,12 +490,16 @@ const checkCartTypeBeforeAddingItem = (prod, declination, cartData, forceCartTyp
|
|
|
438
490
|
else {
|
|
439
491
|
}
|
|
440
492
|
}
|
|
493
|
+
// --------------------------------------------------------------------------------------------------
|
|
494
|
+
// ... if new item is of type vrac and cart contains anything else
|
|
441
495
|
if (cartType !== cart_1.CartGeneralTypeEnum.VRAC &&
|
|
442
496
|
(prod.declinations.every((decli) => !!(0, products_1.checkIfProductIsOfType)(decli, 'vrac')) ||
|
|
443
497
|
(!!declination && !!(0, products_1.checkIfProductIsOfType)(declination, 'vrac'))) &&
|
|
444
498
|
items.some((i) => !!!(0, exports.checkIfDecliIsOkForMixedSale)(i, 'vrac'))) {
|
|
445
499
|
return false;
|
|
446
500
|
}
|
|
501
|
+
// --------------------------------------------------------------------------------------------------
|
|
502
|
+
// ... if new item is of any other type than vrac and cart contains vrac
|
|
447
503
|
if (cartType === cart_1.CartGeneralTypeEnum.VRAC &&
|
|
448
504
|
(!!!prod.declinations.some((decli) => !!(0, products_1.checkIfProductIsOfType)(decli, 'vrac') || !!(0, exports.checkIfDecliIsOkForMixedSale)(decli, 'vrac')) ||
|
|
449
505
|
(!!declination &&
|
|
@@ -473,6 +529,11 @@ const getCartType = (cartData) => {
|
|
|
473
529
|
}
|
|
474
530
|
};
|
|
475
531
|
exports.getCartType = getCartType;
|
|
532
|
+
/**
|
|
533
|
+
* Finds out if a cart is for a pro customer or not
|
|
534
|
+
* @param {ICart} invoice The cart to test
|
|
535
|
+
* @return Returns true if the cart is pro, false if not
|
|
536
|
+
*/
|
|
476
537
|
const isPro = (invoice) => {
|
|
477
538
|
return !!(0, exports.getProTitleFromCart)(invoice);
|
|
478
539
|
};
|
|
@@ -497,6 +558,9 @@ const orderCartItems = (cart) => {
|
|
|
497
558
|
});
|
|
498
559
|
};
|
|
499
560
|
exports.orderCartItems = orderCartItems;
|
|
561
|
+
// #endregion
|
|
562
|
+
// -----------------------------------------------------------------------------------------
|
|
563
|
+
// #region FORMAT CART VALUES
|
|
500
564
|
const getConcreteCartInfo = async (cartData, fetchInventoryItem, pickupStoreId, inventoryItemsArray) => {
|
|
501
565
|
const containsYellowProduct = (0, products_1.getConcreteItemsByAvailability)(cartData, 'delais-a-prevoir');
|
|
502
566
|
const containsGreenProduct = (0, products_1.getConcreteItemsByAvailability)(cartData, 'en-stock', true);
|
|
@@ -527,6 +591,11 @@ const getConcreteCartInfo = async (cartData, fetchInventoryItem, pickupStoreId,
|
|
|
527
591
|
};
|
|
528
592
|
};
|
|
529
593
|
exports.getConcreteCartInfo = getConcreteCartInfo;
|
|
594
|
+
/**
|
|
595
|
+
* Function getGrassProduct
|
|
596
|
+
* @description - Create the essential info needed when checking a grass type product for cart
|
|
597
|
+
* @param item
|
|
598
|
+
*/
|
|
530
599
|
const getGrassProductForCart = (item) => {
|
|
531
600
|
if (!!!item)
|
|
532
601
|
return;
|
|
@@ -563,6 +632,15 @@ const getRecursiveItemsFromSubItems = (item) => {
|
|
|
563
632
|
return !!item.sub_items ? [item, ...(0, flatten_1.default)(item.sub_items.map((i) => getRecusiveItem(i)))] : [item];
|
|
564
633
|
};
|
|
565
634
|
exports.getRecursiveItemsFromSubItems = getRecursiveItemsFromSubItems;
|
|
635
|
+
/**
|
|
636
|
+
* Get price applied for item in cart. Corresponds to the unit price that the customer paid.
|
|
637
|
+
* @param {Space} space
|
|
638
|
+
* @param {ICartItem} item
|
|
639
|
+
* @param {ICart} cartData
|
|
640
|
+
* @param {boolean} options.isBookingBeton Optionnal. Always returns regular price if true (additionnal check)
|
|
641
|
+
* @param {boolean} options.getLowest Optionnal. If true, always returns the lowest amount found between all cart item prices, with no other checks.
|
|
642
|
+
* @returns
|
|
643
|
+
*/
|
|
566
644
|
const getAppliedPrice = (item, options = {}) => {
|
|
567
645
|
const applied = (0, exports.getLowestAppliedPrice)(item);
|
|
568
646
|
if (!!options.getLowest) {
|
|
@@ -597,6 +675,11 @@ const getLowestAppliedPrice = (item) => {
|
|
|
597
675
|
return regular;
|
|
598
676
|
};
|
|
599
677
|
exports.getLowestAppliedPrice = getLowestAppliedPrice;
|
|
678
|
+
/**
|
|
679
|
+
* Checks if the specific item price contains an "escompte"
|
|
680
|
+
* @param {ICartItemCustomPrices} price The price to check, Either the discount_price of promo_price of a cart item.
|
|
681
|
+
* @returns
|
|
682
|
+
*/
|
|
600
683
|
const checkPriceForEscompte = (price) => {
|
|
601
684
|
const priceType = price.price_type;
|
|
602
685
|
const posUnitPrice = `pos_custom_${Cart_1.CustomPromoType.UNIT_PRICE}`;
|
|
@@ -610,6 +693,12 @@ const checkPriceForEscompte = (price) => {
|
|
|
610
693
|
return !!isEscompteType;
|
|
611
694
|
};
|
|
612
695
|
exports.checkPriceForEscompte = checkPriceForEscompte;
|
|
696
|
+
/**
|
|
697
|
+
* Calculates the percent applied from a discount on a cart item. If promo_price set, checks promo_price, else checks discount_price.
|
|
698
|
+
* @param {ICartItem} item
|
|
699
|
+
* @param {boolean} isPro
|
|
700
|
+
* @returns
|
|
701
|
+
*/
|
|
613
702
|
const getPercentFromReducedPrice = (item, isPro) => {
|
|
614
703
|
const typeToCheck = !!item.promo_price && !!item.promo_price.price_type ? 'promo' : 'discount';
|
|
615
704
|
const priceToCheck = typeToCheck === 'promo' ? item.promo_price : item.discount_price;
|
|
@@ -622,11 +711,22 @@ const getPercentFromReducedPrice = (item, isPro) => {
|
|
|
622
711
|
return (0, round_1.default)((0, cart_2.getActualDiscountPrice)(item, '%'), 2);
|
|
623
712
|
};
|
|
624
713
|
exports.getPercentFromReducedPrice = getPercentFromReducedPrice;
|
|
714
|
+
// #endregion
|
|
715
|
+
// -----------------------------------------------------------------------------------------
|
|
716
|
+
// #region PDF AND LAYOUT FUNCTIONS
|
|
717
|
+
/**
|
|
718
|
+
* Returns the customer's Client Number to show in order slip and invoice.
|
|
719
|
+
* @param cartData
|
|
720
|
+
* @param space - Must be defined to check if grass promise to purchase bank was applied to cart
|
|
721
|
+
* @param options.isQuote - Optionnal. If current cart is a quote cart
|
|
722
|
+
* @param options.checkIfEscPaApplied - Optionnal. If true, will only add PA suffix if some reduce PA price or item is found in cart
|
|
723
|
+
*/
|
|
625
724
|
const getClientNumberForCart = (cartData, space, options = {}) => {
|
|
626
725
|
if (!!!cartData)
|
|
627
726
|
return '';
|
|
628
727
|
const proTitle = (0, object_1.recursiveCheckObject)(cartData, 'customer_info.pro_title');
|
|
629
728
|
const isWebCart = cartData.cart_type === Cart_1.CartTypeEnum.WEB || !!cartData.is_from_web;
|
|
729
|
+
// If checkIfEscPaApplied option is passed to function, will only set cart as isPA if at least one esc. supp item is found
|
|
630
730
|
const paFoundInCart = (0, object_1.recursiveCheckObject)(cartData, 'promise_to_purchase');
|
|
631
731
|
let isPA = !!((0, object_1.recursiveCheckObject)(paFoundInCart, 'ids') || []).length;
|
|
632
732
|
if (!!paFoundInCart && !!options.checkIfEscPaApplied) {
|
|
@@ -638,15 +738,19 @@ const getClientNumberForCart = (cartData, space, options = {}) => {
|
|
|
638
738
|
cartData.items.some((i) => i.sku == products_2.kentucky));
|
|
639
739
|
isPA = atLeastOneEscPaApplied;
|
|
640
740
|
}
|
|
741
|
+
// a. If pro customer, return pro ID + PA if promise banks applied
|
|
641
742
|
if (!!proTitle && !!cartData.customer_id) {
|
|
642
743
|
return `${cartData.customer_id}${!!isPA ? 'PA' : ''}`;
|
|
643
744
|
}
|
|
745
|
+
// b. If cart from Web, construct code from expedition type, current date and WEB string
|
|
644
746
|
if (!!isWebCart) {
|
|
645
747
|
return `${!!cartData.is_pickup ? 'COM' : 'LIV'}${!!cartData.paid_at ? (0, moment_1.default)((0, data_1.formatDate)(cartData.paid_at)).format('YY') : '00'}WEB`;
|
|
646
748
|
}
|
|
749
|
+
// c. If PDF made for an order quote (soumission), simply show customer type if no customer id set
|
|
647
750
|
if (!!options.isQuote) {
|
|
648
751
|
return proTitle === 'anonymous-pos-pro' ? 'Paysagiste' : 'Détail';
|
|
649
752
|
}
|
|
753
|
+
// d. Construct POS specific code from expedition type, assigned store, current date and customer type
|
|
650
754
|
return _getPOSCustomerTypeForCart(cartData);
|
|
651
755
|
};
|
|
652
756
|
exports.getClientNumberForCart = getClientNumberForCart;
|
|
@@ -655,6 +759,7 @@ const _getPOSCustomerTypeForCart = (cartData) => {
|
|
|
655
759
|
const isPro = !!cartData.customer_info && !!cartData.customer_info.pro_title;
|
|
656
760
|
const currentYear = !!cartData.paid_at ? (0, moment_1.default)((0, data_1.formatDate)(cartData.paid_at)).format('YY') : '00';
|
|
657
761
|
const storeNb = !!cartData.created_by && !!cartData.created_by.at_store_number ? cartData.created_by.at_store_number : 0;
|
|
762
|
+
// Check if store number is a number
|
|
658
763
|
const aNumber = (0, toNumber_1.default)(storeNb);
|
|
659
764
|
let endOfCode = '';
|
|
660
765
|
if (!!!aNumber) {
|
|
@@ -688,4 +793,5 @@ const getLabelForCartType = (value) => {
|
|
|
688
793
|
}
|
|
689
794
|
};
|
|
690
795
|
exports.getLabelForCartType = getLabelForCartType;
|
|
796
|
+
// #endregion
|
|
691
797
|
//# sourceMappingURL=cart.js.map
|