addio-admin-sdk 1.7.211 → 1.7.213
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/changelog.md +1 -0
- package/dist/Interfaces/Algolia/index.d.ts +1 -0
- package/dist/lib/Cart/index.js +15 -6
- package/dist/lib/Cart/index.js.map +1 -1
- package/dist/rules/GR/utils/products.js +7 -1
- package/dist/rules/GR/utils/products.js.map +1 -1
- package/dist/utils/cart.js +2 -1
- package/dist/utils/cart.js.map +1 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
- **Added**
|
|
6
6
|
- **Changed**
|
|
7
7
|
- Ajout de deux skus hardcodés à vérifier pour l'inclusion dans l'installation "tout inclus" de Groupe Richer. Modifications dans la fonction `applyAllInclusiveOverrides` de l'utilitaire `rules/GR/utils/products.ts`. Détails dans la task [GR-437](https://studionumerique.atlassian.net/browse/GR-437)
|
|
8
|
+
- Mise à jour de la logique qui "cache" les items dans le cart lorsqu'il font parti de l'install tout inclus. Dans la fonction `shouldHideItemInCheckout`
|
|
8
9
|
- **Fixed**
|
|
9
10
|
|
|
10
11
|
## [26-10-2026]
|
|
@@ -108,6 +108,7 @@ export interface IIndexedCart {
|
|
|
108
108
|
readonly status: CartStatusEnum;
|
|
109
109
|
readonly cart_type: CartTypeEnum;
|
|
110
110
|
readonly cart_promos_applied?: ICartPromoApplied[] | null;
|
|
111
|
+
readonly has_discounted_items?: boolean | null;
|
|
111
112
|
readonly has_promos?: boolean | null;
|
|
112
113
|
readonly has_custom_discount?: boolean | null;
|
|
113
114
|
readonly customer_id?: string | null;
|
package/dist/lib/Cart/index.js
CHANGED
|
@@ -3882,6 +3882,7 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3882
3882
|
* @param newCartRef - Optionnal. If cart does not have ref saved to local object when calling function, will replace ref in data with value provided.
|
|
3883
3883
|
*/
|
|
3884
3884
|
this.setCartWithInvoiceRef = async (space, saveToDatabase, newCartRef) => {
|
|
3885
|
+
var _b;
|
|
3885
3886
|
let invoiceRef = undefined;
|
|
3886
3887
|
let newData = Object.assign(Object.assign({}, this.data()), (!!newCartRef && !!!this.data().ref ? { ref: newCartRef } : {}));
|
|
3887
3888
|
// 1. Check to set new invoice_ref in cart
|
|
@@ -3894,6 +3895,10 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3894
3895
|
}
|
|
3895
3896
|
catch (e) {
|
|
3896
3897
|
console.log('error on adding invoice_ref to cart: ', e.toString());
|
|
3898
|
+
await (0, logs_1.SystemLog)({
|
|
3899
|
+
clientName: `sdk-admin | Cart | setCartWithInvoiceRef, space: ${(0, services_1.getSpaceInitialsByID)(space.data().id)}`,
|
|
3900
|
+
clientToken: (_b = process.env.NEXT_PUBLIC_LOG_SYSTEM_KEY) !== null && _b !== void 0 ? _b : ''
|
|
3901
|
+
}, logs_1.LogType.ERROR, `error on adding invoice_ref to cart. Invoice ref generated : ${invoiceRef}, error : ${e.toString()}`);
|
|
3897
3902
|
return;
|
|
3898
3903
|
}
|
|
3899
3904
|
return invoiceRef;
|
|
@@ -3905,7 +3910,7 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3905
3910
|
* @param newlyCreatedCartRef
|
|
3906
3911
|
= */
|
|
3907
3912
|
this.setG2ExternalOrderRef = async (space, saveToDatabase = true, newlyCreatedCartData) => {
|
|
3908
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
3913
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3909
3914
|
// Check if space has G2 service set
|
|
3910
3915
|
const G2Service = space.services({ field: 'external_service_name', value: 'G2' });
|
|
3911
3916
|
if (!!!G2Service || !!!G2Service.length) {
|
|
@@ -3933,6 +3938,10 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3933
3938
|
},
|
|
3934
3939
|
body: JSON.stringify(cartDataToUse)
|
|
3935
3940
|
});
|
|
3941
|
+
await (0, logs_1.SystemLog)({
|
|
3942
|
+
clientName: `sdk-admin | Cart | setG2ExternalOrderRef | ${(0, services_1.getSpaceInitialsByID)(space.data().id)}`,
|
|
3943
|
+
clientToken: (_b = process.env.NEXT_PUBLIC_LOG_SYSTEM_KEY) !== null && _b !== void 0 ? _b : ''
|
|
3944
|
+
}, logs_1.LogType.INFO, `${__1.isTestEnv ? 'TESTENV - ' : ''}AFTER call to generate G2 order ref for cart ${this.data().ref} and invoice_ref ${this.data().invoice_ref}`);
|
|
3936
3945
|
if (!!savedCartInG2 && savedCartInG2.status < 300) {
|
|
3937
3946
|
break;
|
|
3938
3947
|
}
|
|
@@ -3942,7 +3951,7 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3942
3951
|
console.log(`G2 attempt ${attempt + 1} failed`, err);
|
|
3943
3952
|
await (0, logs_1.SystemLog)({
|
|
3944
3953
|
clientName: `sdk-admin | Cart | setG2ExternalOrderRef | ${(0, services_1.getSpaceInitialsByID)(space.data().id)}`,
|
|
3945
|
-
clientToken: (
|
|
3954
|
+
clientToken: (_c = process.env.NEXT_PUBLIC_LOG_SYSTEM_KEY) !== null && _c !== void 0 ? _c : ''
|
|
3946
3955
|
}, logs_1.LogType.ERROR, `${__1.isTestEnv ? 'TESTENV - ' : ''}G2 attempt %%${attempt + 1}%% failed %%${g2OrderRef}%%: ${err.toString()}`);
|
|
3947
3956
|
if (attempt === MAX_RETRIES - 1) {
|
|
3948
3957
|
throw err;
|
|
@@ -3957,11 +3966,11 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3957
3966
|
if (!!!response || !!!response.g2OrderRef)
|
|
3958
3967
|
throw new Error('No g2OrderRef was returned!');
|
|
3959
3968
|
g2OrderRef = response.g2OrderRef;
|
|
3960
|
-
console.log(`${__1.isTestEnv ? 'TESTENV - ' : ''}G2 ORDER REF GENERATED : ${g2OrderRef}, for cart ref ${(
|
|
3969
|
+
console.log(`${__1.isTestEnv ? 'TESTENV - ' : ''}G2 ORDER REF GENERATED : ${g2OrderRef}, for cart ref ${(_d = cartDataToUse.ref) !== null && _d !== void 0 ? _d : 'unknown'} / invoice-ref ${(_e = cartDataToUse.invoice_ref) !== null && _e !== void 0 ? _e : 'unknown'}`);
|
|
3961
3970
|
await (0, logs_1.SystemLog)({
|
|
3962
3971
|
clientName: `sdk-admin | Cart | setG2ExternalOrderRef | ${(0, services_1.getSpaceInitialsByID)(space.data().id)}`,
|
|
3963
|
-
clientToken: (
|
|
3964
|
-
}, logs_1.LogType.INFO, `${__1.isTestEnv ? 'TESTENV - ' : ''}G2 ORDER REF GENERATED : ${g2OrderRef}, for cart ref ${(
|
|
3972
|
+
clientToken: (_f = process.env.NEXT_PUBLIC_LOG_SYSTEM_KEY) !== null && _f !== void 0 ? _f : ''
|
|
3973
|
+
}, logs_1.LogType.INFO, `${__1.isTestEnv ? 'TESTENV - ' : ''}G2 ORDER REF GENERATED : ${g2OrderRef}, for cart ref ${(_g = cartDataToUse.ref) !== null && _g !== void 0 ? _g : 'unknown'} / invoice-ref ${(_h = cartDataToUse.invoice_ref) !== null && _h !== void 0 ? _h : 'unknown'}`);
|
|
3965
3974
|
await this.save({ id: cartDataToUse.id, external_values: { noCommande: g2OrderRef } }, undefined, saveToDatabase, true);
|
|
3966
3975
|
}
|
|
3967
3976
|
catch (e) {
|
|
@@ -3973,7 +3982,7 @@ class Cart extends baseService_1.BaseServiceClass {
|
|
|
3973
3982
|
// '%%' Will be used as seperator to deconstruct info from logs for daily recap
|
|
3974
3983
|
await (0, logs_1.SystemLog)({
|
|
3975
3984
|
clientName: `sdk-admin | Cart | setG2ExternalOrderRef | ${(0, services_1.getSpaceInitialsByID)(space.data().id)}`,
|
|
3976
|
-
clientToken: (
|
|
3985
|
+
clientToken: (_j = process.env.NEXT_PUBLIC_LOG_SYSTEM_KEY) !== null && _j !== void 0 ? _j : ''
|
|
3977
3986
|
}, logs_1.LogType.ERROR, `${__1.isTestEnv ? 'TESTENV - ' : ''}G2 ORDER BUG %%${this.data().ref}%%${g2OrderRef}%%${errorCode}%%${errorStr}: ${e.toString()}`);
|
|
3978
3987
|
return undefined;
|
|
3979
3988
|
}
|