addio-admin-sdk 1.7.102 → 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/Algolia/index.d.ts +1 -0
- 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.d.ts +1 -0
- 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 +175 -10
- 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 +16 -0
- package/dist/utils/prosprsearch.js +34 -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
|
@@ -64,6 +64,10 @@ import { MenuPositionEnum } from '../../Interfaces/Menu';
|
|
|
64
64
|
import Menu from '../../lib/Menu';
|
|
65
65
|
import Note from '../Note';
|
|
66
66
|
import { NoteTypeEnum } from '../../Interfaces/Note';
|
|
67
|
+
/**
|
|
68
|
+
* Class Space
|
|
69
|
+
* A Space represent a company.
|
|
70
|
+
*/
|
|
67
71
|
export default class Space {
|
|
68
72
|
private _space_ref;
|
|
69
73
|
private _user;
|
|
@@ -74,7 +78,14 @@ export default class Space {
|
|
|
74
78
|
static getCurrentSpace: (childCollection: string, refUser: string) => Promise<Space>;
|
|
75
79
|
static getCurrentSpaceWithRef: (childCollection: string, refUser: string) => Promise<Space>;
|
|
76
80
|
initCurrencies: () => Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Create the actual space
|
|
83
|
+
*/
|
|
77
84
|
create: () => Promise<IDatabaseRef>;
|
|
85
|
+
/**
|
|
86
|
+
* Update current space with a partial space pass as parameters.
|
|
87
|
+
* @param updates Updates to be made on the space - Partial<Space>
|
|
88
|
+
*/
|
|
78
89
|
update: (updates: Partial<ISpace>) => Promise<boolean>;
|
|
79
90
|
getDefaultTax: () => string | undefined;
|
|
80
91
|
getCurrencies: () => ICurrencies | undefined;
|
|
@@ -132,11 +143,23 @@ export default class Space {
|
|
|
132
143
|
details?: undefined;
|
|
133
144
|
}>;
|
|
134
145
|
private _fetchServices;
|
|
146
|
+
/**
|
|
147
|
+
* Fetch the external service for the name provided
|
|
148
|
+
* @param serviceName
|
|
149
|
+
* @param returnInactiveService Optionnal, defaults to false. Must be set if service should be returned even if it is inactive
|
|
150
|
+
*/
|
|
135
151
|
private _getSpecificServiceByName;
|
|
136
152
|
private _getAllServicesByType;
|
|
137
153
|
private _getServiceBySlug;
|
|
138
154
|
private _setExternalServiceValues;
|
|
155
|
+
/**
|
|
156
|
+
* Check if external_value fields should be shown for space
|
|
157
|
+
*/
|
|
139
158
|
private _showExternalValueFieldsForSpace;
|
|
159
|
+
/**
|
|
160
|
+
* Get array of field data nesessary to show space's external_values per objet type
|
|
161
|
+
* @param objType The object type to check for external_values
|
|
162
|
+
*/
|
|
140
163
|
private _getExternalFieldsToShowForPageType;
|
|
141
164
|
private _getAllTaxes;
|
|
142
165
|
private _getTaxes;
|
|
@@ -157,10 +180,28 @@ export default class Space {
|
|
|
157
180
|
_deleteCataloguesById: (ids: string[]) => Promise<boolean>;
|
|
158
181
|
private _categoriesListener;
|
|
159
182
|
private _getCategories;
|
|
183
|
+
/**
|
|
184
|
+
* Get full category tree
|
|
185
|
+
* @deprecated use new _getTreeNew function instead
|
|
186
|
+
* @param categories
|
|
187
|
+
* @param level
|
|
188
|
+
* @param parent
|
|
189
|
+
*/
|
|
160
190
|
private _getTree;
|
|
191
|
+
/**
|
|
192
|
+
* Get array of ordered categories
|
|
193
|
+
* @param categories
|
|
194
|
+
* @param parentID
|
|
195
|
+
*/
|
|
161
196
|
private _getTreeNew;
|
|
162
197
|
private _getCategoryUrl;
|
|
163
198
|
private _resetInventories;
|
|
199
|
+
/**
|
|
200
|
+
* Private function to save a bulk of document to a collection
|
|
201
|
+
* @param obj an array of documents
|
|
202
|
+
* @param collection the collection name where to save
|
|
203
|
+
* @returns the amount of save vs errors
|
|
204
|
+
*/
|
|
164
205
|
private _batchSaveCollection;
|
|
165
206
|
private _batchSaveCategories;
|
|
166
207
|
private _batchSaveBrands;
|
|
@@ -187,7 +228,17 @@ export default class Space {
|
|
|
187
228
|
}) => Promise<void>;
|
|
188
229
|
private _getExternalProductBySlug;
|
|
189
230
|
private _getExternalProductsSlugToTry;
|
|
231
|
+
/**
|
|
232
|
+
* Fetch all options with - optionnal - query
|
|
233
|
+
* @param options Query options - optionnal
|
|
234
|
+
*/
|
|
190
235
|
private _getProducts;
|
|
236
|
+
/**
|
|
237
|
+
* Obtenir une partie des produits à partir de l'indentifiant fournis
|
|
238
|
+
* @param from le id du dernier document ou continuer ou undefine si on veut le premier
|
|
239
|
+
* @param limit la taille max à lire, idéalement 500 ou moins
|
|
240
|
+
* @returns la liste de produits récupéré
|
|
241
|
+
*/
|
|
191
242
|
private _getProductsPage;
|
|
192
243
|
private _getAllProducts;
|
|
193
244
|
fetchSizeBasedOnCategoryAndAttribute: (category: string, attribute?: string) => IPredefinedBox | IPredefinedBox[] | undefined;
|
|
@@ -209,8 +260,21 @@ export default class Space {
|
|
|
209
260
|
private _getAllIndexedProducts;
|
|
210
261
|
private _saveAllIndexedCategories;
|
|
211
262
|
private _fetchIndexedVariations;
|
|
263
|
+
/**
|
|
264
|
+
* Finds indexed declination corresponding to parent slug and sku provided
|
|
265
|
+
* @param space
|
|
266
|
+
* @param parentSlug - The parent product slug (to search space indexed products)
|
|
267
|
+
* @param sku - The specific sku for the declination
|
|
268
|
+
* @param customPriceList - Optionnal. If provided, indexed decli is returned with adjusted prices from price list
|
|
269
|
+
*/
|
|
212
270
|
private _fetchIndexedDecliBySlugAndSku;
|
|
213
271
|
private _getAllInventoryItems;
|
|
272
|
+
/**
|
|
273
|
+
* Obtenir une partie des inventaires à partir de l'indentifiant fournis
|
|
274
|
+
* @param from le id du dernier document ou continuer ou undefine si on veut le premier
|
|
275
|
+
* @param limit la taille max à lire, idéalement 500 ou moins
|
|
276
|
+
* @returns la liste de l'inventaires récupéré
|
|
277
|
+
*/
|
|
214
278
|
private _getInventoryPage;
|
|
215
279
|
private _getAllInventoryItemsByPages;
|
|
216
280
|
private _getInventoryItemsSnapshot;
|
|
@@ -256,6 +320,12 @@ export default class Space {
|
|
|
256
320
|
private _invoicesListener;
|
|
257
321
|
private _getUnknownCartItem;
|
|
258
322
|
private _importInvoices;
|
|
323
|
+
/**
|
|
324
|
+
* Generate the next unique ID for a customers new promise to purchase. Recursive function : always checks if ID exists in database before returning ID.
|
|
325
|
+
* @param customerId - The customer for whom we're creating a new promise
|
|
326
|
+
* @param useNextSeason - If we should check the values for next season instead of current one
|
|
327
|
+
* @param idToIncrement - Optionnal. Only set when calling the function recursively.
|
|
328
|
+
*/
|
|
259
329
|
private _generateNewPromiseId;
|
|
260
330
|
private _getNextInvoiceRef;
|
|
261
331
|
private _incrementGeneralInvoiceRef;
|
|
@@ -295,15 +365,47 @@ export default class Space {
|
|
|
295
365
|
private _batchCustomerAlertCreate;
|
|
296
366
|
private _batchCustomersCreate;
|
|
297
367
|
private _fetchIndexedCustomers;
|
|
368
|
+
/**
|
|
369
|
+
* Fetches and returns all promises to purchase associated with a customer ID.
|
|
370
|
+
* @param customerID - The customer ID to check
|
|
371
|
+
* @param onlyActive - Optionnal. If true, function only returns currently active promises
|
|
372
|
+
*/
|
|
298
373
|
private _getCustomerPromisesToPurchase;
|
|
374
|
+
/**
|
|
375
|
+
* For all possible bank types for space, checks all active promises for customer and returns an object containing currently active bank applicable.
|
|
376
|
+
* @param customerID - The customer ID to check
|
|
377
|
+
* @param promisesToCheck - Optionnal. If defined, uses provided array of promises instead of calling DB.
|
|
378
|
+
*/
|
|
299
379
|
private _getPossibleActiveBanksForCustomer;
|
|
300
380
|
private _updateCustomerLastActivity;
|
|
381
|
+
/**
|
|
382
|
+
* Function that adjusts store and / or web inventories for a cart depending on it's state
|
|
383
|
+
* @param items an array of ICartItem objects through which we will loop to adjust their inventories
|
|
384
|
+
* @param cartState the state of the cart for which we are adjusting the inventory, this affects what inventory actions will be made
|
|
385
|
+
* @param cartType type of the cart
|
|
386
|
+
* @param options.currentStoreId the store at which we are doing the inventory manipulation
|
|
387
|
+
* @param options.onlyWeb if the inventory should only be adjusted for WEB or also for the current store
|
|
388
|
+
* @param options.fromStoreId the store at which the inventories were initially modified, it is only used in the context of a refund, where we might return items to a different store than where they were taken.
|
|
389
|
+
* @param options.associatedTransferForCart Optionnal. Array of TransferRequest objects associated to order (used in 'cancelled' cart state)
|
|
390
|
+
* @param options.previousItems Optionnal. Array of ICartItem corresponding to prevState in cart
|
|
391
|
+
* @param options.inventoryItemsDataToUse Optionnal. Array of inventoryItem data to use instead of calling Db twice.
|
|
392
|
+
* @param options.shouldCheckReservedQte Optionnal. If reserved quantities should be check for inventory or not
|
|
393
|
+
*/
|
|
301
394
|
private _ajustInventoryWithCart;
|
|
302
395
|
private _checkIfSpaceHasMinInventoryOption;
|
|
303
396
|
private _addTag;
|
|
304
397
|
private _getAllTags;
|
|
305
398
|
private _deleteAllTags;
|
|
399
|
+
/**
|
|
400
|
+
* Fetches user from database by unique ID.
|
|
401
|
+
* @param uid - The users unique ID (same as the email)
|
|
402
|
+
*/
|
|
306
403
|
private _getUser;
|
|
404
|
+
/**
|
|
405
|
+
* Fetches user from database by external ID
|
|
406
|
+
* @param externalID - The user's external ID
|
|
407
|
+
* @param userEmail - The user's email
|
|
408
|
+
*/
|
|
307
409
|
private _getUserByExternalID;
|
|
308
410
|
private _disableUser;
|
|
309
411
|
private _enableUser;
|
|
@@ -357,9 +459,20 @@ export default class Space {
|
|
|
357
459
|
private _addBankType;
|
|
358
460
|
private _updateBankType;
|
|
359
461
|
private _getPromiseBankRules;
|
|
462
|
+
/**
|
|
463
|
+
* Synchronizes the customers with the list of promise to purchase.
|
|
464
|
+
* @param associations - Record dont la clé est l'id d'un customer et la valeur est un record de promesses d'achats avec leur id et leurs infos
|
|
465
|
+
*/
|
|
360
466
|
private _syncCustomerPromiseToPurchaseAssoc;
|
|
467
|
+
/**
|
|
468
|
+
* Retrieves and returns only the customers who have a PA.
|
|
469
|
+
*/
|
|
361
470
|
private _getAllWithActivePromises;
|
|
362
471
|
private _getBanksUsedHistoryForCustomer;
|
|
472
|
+
/**
|
|
473
|
+
* Checks for currently active banks, and returns their available amount, as well as the ones for all previous PAs with same bank type.
|
|
474
|
+
* @param customerID
|
|
475
|
+
*/
|
|
363
476
|
private _getAvailableBankAmountsByBankType;
|
|
364
477
|
private _getPromisesToPurchase;
|
|
365
478
|
private _getPromiseToPurchaseEmails;
|
|
@@ -370,10 +483,26 @@ export default class Space {
|
|
|
370
483
|
private _openSeasonPromisesToPurchase;
|
|
371
484
|
private _endSeasonPromisesToPurchase;
|
|
372
485
|
private _getEscompteItems;
|
|
486
|
+
/**
|
|
487
|
+
* Retrieves and returns all the carts containing a specific promise ID.
|
|
488
|
+
* @param promiseID - The ID to check
|
|
489
|
+
* @param options - Optionnal. Additionnal query options
|
|
490
|
+
*/
|
|
373
491
|
private _getPromiseAssociatedCarts;
|
|
374
492
|
private _getBanksUsedHistory;
|
|
375
493
|
private _getAvailableBankAmountForApplicableBanks;
|
|
494
|
+
/**
|
|
495
|
+
* Returns all available amounts for banks found in specific promise.
|
|
496
|
+
* @param promiseID The ID of the promise to check
|
|
497
|
+
* @param promiseObj Optionnal. If provided, saves a call to the DB.
|
|
498
|
+
*/
|
|
376
499
|
private _getAvailableBankAmountsForPromise;
|
|
500
|
+
/**
|
|
501
|
+
* Returns remaining amount and other info for a specific bank of a specific PA.
|
|
502
|
+
* @param promiseID - The promise to purchase ID
|
|
503
|
+
* @param bankID - The bank type ID
|
|
504
|
+
* @param promiseObj - Optionnal. If provided, removes one fetch from database
|
|
505
|
+
*/
|
|
377
506
|
private _getSpecificAvailableBankAmount;
|
|
378
507
|
private _getJobs;
|
|
379
508
|
private _jobsListener;
|
|
@@ -419,13 +548,53 @@ export default class Space {
|
|
|
419
548
|
private _getFirstOrders;
|
|
420
549
|
private _getAllDocuments;
|
|
421
550
|
private _saveDocument;
|
|
551
|
+
/**
|
|
552
|
+
* Apply a credit change, the value is negative for a purchasse
|
|
553
|
+
* @param customerId The id of the customer
|
|
554
|
+
* @param creditSlug The credit *slug name as configured in the space
|
|
555
|
+
* @param amount The amount to add or remove
|
|
556
|
+
* @param comment The reason for this change
|
|
557
|
+
* @param user The user doing the action
|
|
558
|
+
* @returns
|
|
559
|
+
*/
|
|
422
560
|
private _modifyStoreCredit;
|
|
561
|
+
/**
|
|
562
|
+
* Get the latess credit amount for a customer
|
|
563
|
+
* @param customerId The customer ID
|
|
564
|
+
* @param creditSlug The slug of the credit to get
|
|
565
|
+
* @returns The amount
|
|
566
|
+
*/
|
|
423
567
|
private _getStoreCredit;
|
|
568
|
+
/**
|
|
569
|
+
* Get the full history of credit for a customer
|
|
570
|
+
* @param customerId The customer ID
|
|
571
|
+
* @param creditSlug The slug of the credit to get
|
|
572
|
+
* @returns A list of IStoreCreditHistory
|
|
573
|
+
*/
|
|
424
574
|
private _getStoreCreditHistory;
|
|
575
|
+
/**
|
|
576
|
+
* Validate if an amount can be deducted from the credit of a customer
|
|
577
|
+
* @param customerId The customer ID
|
|
578
|
+
* @param creditSlug The credit slug to verify
|
|
579
|
+
* @param amount The amount to deduct
|
|
580
|
+
* @returns True if the amount is less or equal to the customer credit
|
|
581
|
+
*/
|
|
425
582
|
private _validateCredit;
|
|
583
|
+
/**
|
|
584
|
+
* Get the space available credits
|
|
585
|
+
*/
|
|
426
586
|
private _getSpaceCredits;
|
|
587
|
+
/**
|
|
588
|
+
* Retourne tous les menus du space
|
|
589
|
+
*/
|
|
427
590
|
private _getMenus;
|
|
591
|
+
/**
|
|
592
|
+
* Retourne le menu actif pour un slug
|
|
593
|
+
*/
|
|
428
594
|
private _getActiveMenuBySlug;
|
|
595
|
+
/**
|
|
596
|
+
* Retourne tous les menus actifs
|
|
597
|
+
*/
|
|
429
598
|
private _getAllActiveMenus;
|
|
430
599
|
attributes: {
|
|
431
600
|
get: (options?: IQueryOptions) => Promise<Attribute[]>;
|
|
@@ -870,8 +1039,17 @@ export default class Space {
|
|
|
870
1039
|
getActiveBySlug: (slug: MenuPositionEnum) => Promise<Menu | undefined>;
|
|
871
1040
|
getAllActive: () => Promise<Menu[]>;
|
|
872
1041
|
};
|
|
1042
|
+
/**
|
|
1043
|
+
* Get all space properties
|
|
1044
|
+
*/
|
|
873
1045
|
data: () => ISpace;
|
|
1046
|
+
/**
|
|
1047
|
+
* Get the space name
|
|
1048
|
+
*/
|
|
874
1049
|
getName: () => string;
|
|
1050
|
+
/**
|
|
1051
|
+
* Get the space ID
|
|
1052
|
+
*/
|
|
875
1053
|
getId: () => string;
|
|
876
1054
|
isMultiPromo: () => boolean;
|
|
877
1055
|
private _getNotes;
|