addio-admin-sdk 1.6.61 → 1.6.63-canary-1
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 +9 -0
- package/dist/Interfaces/Cart/index.d.ts +2 -0
- package/dist/Interfaces/Cart/index.js.map +1 -1
- package/dist/Interfaces/Declination/index.d.ts +2 -1
- package/dist/Interfaces/Declination/index.js +18 -2
- package/dist/Interfaces/Declination/index.js.map +1 -1
- package/dist/Interfaces/G2/index.d.ts +8 -0
- package/dist/Interfaces/Product/IInventoryItem.d.ts +3 -0
- package/dist/Interfaces/Product/IInventoryItem.js.map +1 -1
- package/dist/Interfaces/Rules/IDiscountRule.d.ts +6 -1
- package/dist/Interfaces/Rules/IDiscountRule.js +28 -16
- package/dist/Interfaces/Rules/IDiscountRule.js.map +1 -1
- package/dist/Interfaces/Space/index.d.ts +32 -0
- package/dist/Interfaces/Space/index.js +31 -1
- package/dist/Interfaces/Space/index.js.map +1 -1
- package/dist/lib/Space/index.d.ts +18 -1
- package/dist/lib/Space/index.js +90 -1
- package/dist/lib/Space/index.js.map +1 -1
- package/dist/rules/GR/utils/expedition.js +2 -1
- package/dist/rules/GR/utils/expedition.js.map +1 -1
- package/dist/rules/GR/utils/g2.d.ts +2 -5
- package/dist/rules/GR/utils/g2.js +4 -4
- package/dist/rules/GR/utils/g2.js.map +1 -1
- package/dist/rules/GR/utils/invoices.d.ts +4 -1
- package/dist/rules/GR/utils/invoices.js +20 -13
- package/dist/rules/GR/utils/invoices.js.map +1 -1
- package/dist/utils/cart.d.ts +3 -0
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [05-09-2024]
|
|
2
|
+
|
|
3
|
+
### Frais par palette - Ajustement
|
|
4
|
+
|
|
5
|
+
- **Added**
|
|
6
|
+
- **Changed**
|
|
7
|
+
- In function `getPalletQtyPalletFee`, now removes all accessories from items before calculating quantity
|
|
8
|
+
- **Fixed**
|
|
9
|
+
|
|
1
10
|
## [26-08-2024]
|
|
2
11
|
|
|
3
12
|
### Booking - Ajustments
|
|
@@ -16,6 +16,7 @@ import IMarketplaceOrderData from '../MarketplacePublication/MarketplaceOrderDat
|
|
|
16
16
|
import IPayment from '../Payment';
|
|
17
17
|
import IBaseClass from '../BaseClass';
|
|
18
18
|
import { IBank } from '../PromiseToPurchase';
|
|
19
|
+
import { IG2OrderExternalValues } from '../G2';
|
|
19
20
|
export declare enum PaymentTypeEnum {
|
|
20
21
|
CREDIT = "credit",
|
|
21
22
|
DEBIT = "debit",
|
|
@@ -149,6 +150,7 @@ export default interface ICart extends IBaseClass {
|
|
|
149
150
|
readonly is_from_web?: boolean;
|
|
150
151
|
readonly updated_by?: ICartAssignedUser[];
|
|
151
152
|
readonly canceled_by?: ICartAssignedUser;
|
|
153
|
+
readonly external_values?: IG2OrderExternalValues;
|
|
152
154
|
}
|
|
153
155
|
export interface ICartPromiseToPurchase {
|
|
154
156
|
ids: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Cart/index.ts"],"names":[],"mappings":";;;AAGA,8CAA+G;AAe/G,6CAAmD;AACnD,6CAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Cart/index.ts"],"names":[],"mappings":";;;AAGA,8CAA+G;AAe/G,6CAAmD;AACnD,6CAAkD;AAIlD,IAAY,eAYX;AAZD,WAAY,eAAe;IAC1B,oCAAiB,CAAA;IACjB,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,kDAA+B,CAAA;IAC/B,oCAAiB,CAAA;IACjB,6CAA0B,CAAA;IAC1B,wCAAqB,CAAA;IACrB,mDAAgC,CAAA;IAChC,uDAAoC,CAAA;IACpC,kCAAe,CAAA;AAChB,CAAC,EAZW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAY1B;AAED,IAAY,qBA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M,EAAE,IAAI;KACZ,CAAA;AACF,CAAC,CAAA;AAxBY,QAAA,cAAc,kBAwB1B;AAEM,IAAM,kBAAkB,GAAG;IACjC,OAAO;QACN,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,GAAG,EAAE,CAAC;QACN,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,aAAa,EAAE;YACd,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,CAAC;SACT;QACD,aAAa,EAAE,EAAE;QACjB,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE,IAAA,oCAAsB,GAAE;QACvC,aAAa,EAAE;YACd,eAAe,EAAE,EAAE;YACnB,gBAAgB,EAAE,EAAE;SACpB;QACD,iBAAiB,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,gBAAgB,EAAE,EAAE;SACpB;QACD,0BAA0B,EAAE,KAAK;KAKjC,CAAA;AACF,CAAC,CAAA;AA/BY,QAAA,kBAAkB,sBA+B9B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Space from '../../lib/Space';
|
|
2
2
|
import { IImageInfo } from '../../utils/file';
|
|
3
3
|
import { IAttributeValue } from '../Attribute';
|
|
4
|
+
import { IG2ProductExternalValues } from '../G2';
|
|
4
5
|
import IInventory from '../Inventory';
|
|
5
6
|
import IPricing, { IPricingVariable, PricingCurrency } from '../Product/IPricing';
|
|
6
7
|
import IDiscountRule from '../Rules/IDiscountRule';
|
|
@@ -30,7 +31,7 @@ export default interface IDeclination {
|
|
|
30
31
|
readonly sample_shipping_info?: IShippingInfo;
|
|
31
32
|
readonly other_units?: IFilledDimensionUnits[];
|
|
32
33
|
readonly hide_inventory?: boolean;
|
|
33
|
-
readonly external_values?:
|
|
34
|
+
readonly external_values?: IG2ProductExternalValues;
|
|
34
35
|
readonly promise_to_purchase_association_ids?: string[];
|
|
35
36
|
}
|
|
36
37
|
export interface IFilledDimensionUnits {
|
|
@@ -13,6 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getDefaultPrice = exports.getDefaultShippingInfo = exports.emptyDeclination = void 0;
|
|
15
15
|
var IPricing_1 = require("../Product/IPricing");
|
|
16
|
+
var Space_1 = require("../Space");
|
|
16
17
|
var emptyDeclination = function (currency, baseInfo, space, keepUnitsEmpty) {
|
|
17
18
|
if (currency === void 0) { currency = IPricing_1.PricingCurrency.CAD; }
|
|
18
19
|
if (baseInfo === void 0) { baseInfo = {
|
|
@@ -21,9 +22,24 @@ var emptyDeclination = function (currency, baseInfo, space, keepUnitsEmpty) {
|
|
|
21
22
|
name: [],
|
|
22
23
|
slug: ''
|
|
23
24
|
}; }
|
|
24
|
-
|
|
25
|
+
var constructExternalValues = function () {
|
|
26
|
+
if (!!!space)
|
|
27
|
+
return {};
|
|
28
|
+
var foundExternalValues = space.externalServices
|
|
29
|
+
.getExternalFieldsToShow(Space_1.spaceCollectionNames.PRODUCTS)
|
|
30
|
+
.map(function (f) { return f.fieldName; });
|
|
31
|
+
if (!!!foundExternalValues.length)
|
|
32
|
+
return {};
|
|
33
|
+
var allValues = {};
|
|
34
|
+
for (var _i = 0, foundExternalValues_1 = foundExternalValues; _i < foundExternalValues_1.length; _i++) {
|
|
35
|
+
var value = foundExternalValues_1[_i];
|
|
36
|
+
allValues[value] = '';
|
|
37
|
+
}
|
|
38
|
+
return { external_values: allValues };
|
|
39
|
+
};
|
|
40
|
+
return __assign(__assign(__assign({ price: (0, exports.getDefaultPrice)(!!space ? space.preferences.default.currency() : currency) }, baseInfo), { disabled: false, image_files: [], sku: '', upc: '', attributes: [], discount_rules: [], shipping_info: (0, exports.getDefaultShippingInfo)(space), other_units: !!!space || !!!space.preferences.shipping.units.get().length || !!keepUnitsEmpty
|
|
25
41
|
? []
|
|
26
|
-
: [{ unit_slug: '', fitting_unit: 1, is_inventory_unit: true, is_sale_unit: true }] }));
|
|
42
|
+
: [{ unit_slug: '', fitting_unit: 1, is_inventory_unit: true, is_sale_unit: true }] }), constructExternalValues());
|
|
27
43
|
};
|
|
28
44
|
exports.emptyDeclination = emptyDeclination;
|
|
29
45
|
var getDefaultShippingInfo = function (space) { return ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Declination/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Declination/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,gDAAiF;AAEjF,kCAA+C;AA6ExC,IAAM,gBAAgB,GAAG,UAC/B,QAA+C,EAE/C,QAUC,EACD,KAAa,EACb,cAAwB;IAdxB,yBAAA,EAAA,WAA4B,0BAAe,CAAC,GAAG;IAE/C,yBAAA,EAAA;QAMC,WAAW,EAAE,EAAE;QACf,EAAE,EAAE,EAAE;QACN,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACR;IAID,IAAM,uBAAuB,GAAG;QAC/B,IAAI,CAAC,CAAC,CAAC,KAAK;YAAE,OAAO,EAAE,CAAA;QACvB,IAAM,mBAAmB,GAAG,KAAK,CAAC,gBAAgB;aAChD,uBAAuB,CAAC,4BAAoB,CAAC,QAAQ,CAAC;aACtD,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,SAAS,EAAX,CAAW,CAAC,CAAA;QAEzB,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM;YAAE,OAAO,EAAE,CAAA;QAE5C,IAAI,SAAS,GAA8B,EAAE,CAAA;QAC7C,KAAkB,UAAmB,EAAnB,2CAAmB,EAAnB,iCAAmB,EAAnB,IAAmB,EAAE;YAAlC,IAAI,KAAK,4BAAA;YACb,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;SACrB;Q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;IAE9E,MAAM,EAAE,CAAC;CACT,CAAC,EAVuD,CAUvD,CAAA;AAVW,QAAA,sBAAsB,0BAUjC;AAEK,IAAM,eAAe,GAAG,UAAC,QAA+C;IAA/C,yBAAA,EAAA,WAA4B,0BAAe,CAAC,GAAG;IAAK,OAAA,CAAC;QACpF,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE;YACR,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,IAAI;SACb;QACD,aAAa,EAAE;YACd,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,CAAC;SACR;QACD,IAAI,EAAE;YACL,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,IAAI;SACb;KACD,CAAC;AAhBkF,CAgBlF,CAAA;AAhBW,QAAA,eAAe,mBAgB1B"}
|
|
@@ -284,3 +284,11 @@ export declare enum EscomptesDeclinationSkusEnum {
|
|
|
284
284
|
ESCINSTALL = "ESCINSTALL",
|
|
285
285
|
ESCACC = "ESCACC"
|
|
286
286
|
}
|
|
287
|
+
export interface IG2ProductExternalValues {
|
|
288
|
+
catégorie1?: string;
|
|
289
|
+
catégorie2?: string;
|
|
290
|
+
noArticle?: string;
|
|
291
|
+
}
|
|
292
|
+
export interface IG2OrderExternalValues {
|
|
293
|
+
noCommande?: string;
|
|
294
|
+
}
|
|
@@ -41,6 +41,9 @@ export default interface IInventoryItem extends IBaseClass {
|
|
|
41
41
|
readonly last_update_by?: string;
|
|
42
42
|
readonly decli_sku_associated_to_sample?: string;
|
|
43
43
|
readonly hide_inventory?: boolean;
|
|
44
|
+
readonly inventory_minimums?: {
|
|
45
|
+
[key: string]: number;
|
|
46
|
+
};
|
|
44
47
|
}
|
|
45
48
|
export interface IInventoryItemHistory {
|
|
46
49
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IInventoryItem.js","sourceRoot":"","sources":["../../../src/Interfaces/Product/IInventoryItem.ts"],"names":[],"mappings":";;;AAKA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,qCAAW,CAAA;IACX,8CAAoB,CAAA;AACrB,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;
|
|
1
|
+
{"version":3,"file":"IInventoryItem.js","sourceRoot":"","sources":["../../../src/Interfaces/Product/IInventoryItem.ts"],"names":[],"mappings":";;;AAKA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,qCAAW,CAAA;IACX,8CAAoB,CAAA;AACrB,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;AAoDM,IAAM,6BAA6B,GAAG,cAAM,OAAA,CAAC;IACnD,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,CAAC;CACZ,CAAC,EALiD,CAKjD,CAAA;AALW,QAAA,6BAA6B,iCAKxC;AAEK,IAAM,uBAAuB,GAAG,UAAC,MAAgB,EAAE,MAAc;IACvE,OAAO;QACN,GAAG,EAAE,EAAE;QACP,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;gBACvB,QAAQ,EAAE,KAAK,CAAC,EAAY;gBAC5B,GAAG,EAAE,IAAA,qCAA6B,GAAE;gBACpC,EAAE,EAAE,IAAI,IAAI,EAAE;gBACd,eAAe,EAAE,KAAK,CAAC,eAAe;gBACtC,IAAI,EAAE,MAAM;aACX,CAAC,EANoB,CAMpB,CAAC;KACN,CAAA;AACF,CAAC,CAAA;AAnBY,QAAA,uBAAuB,2BAmBnC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IG2ProductExternalValues } from '../G2';
|
|
1
2
|
import ITranslation from '../Translation';
|
|
2
3
|
export default interface IDiscountRule {
|
|
3
4
|
readonly id?: string;
|
|
@@ -38,6 +39,7 @@ export default interface IDiscountRule {
|
|
|
38
39
|
readonly note: string;
|
|
39
40
|
}[];
|
|
40
41
|
readonly overridden?: boolean;
|
|
42
|
+
readonly external_values?: IG2ProductExternalValues;
|
|
41
43
|
}
|
|
42
44
|
export declare enum AppliesToEnum {
|
|
43
45
|
ALLPRODUCTS = "allproducts",
|
|
@@ -97,7 +99,10 @@ export interface IRuleDetails {
|
|
|
97
99
|
value: any[];
|
|
98
100
|
condition?: RuleConditionEnum;
|
|
99
101
|
}
|
|
100
|
-
export declare const getDefaultDiscountRule: (discountRule_type: any) => {
|
|
102
|
+
export declare const getDefaultDiscountRule: (discountRule_type: any, addExternalValues?: string[]) => {
|
|
103
|
+
external_values?: {
|
|
104
|
+
[key: string]: string;
|
|
105
|
+
} | undefined;
|
|
101
106
|
draft: boolean;
|
|
102
107
|
name: never[];
|
|
103
108
|
discountRule_type: any;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.getDefaultDiscountRule = exports.RuleConditionEnum = exports.RuleFieldEnum = exports.ResultActionEnum = exports.AppliesToEnum = void 0;
|
|
4
15
|
var AppliesToEnum;
|
|
@@ -53,26 +64,25 @@ var RuleConditionEnum;
|
|
|
53
64
|
RuleConditionEnum["AND"] = "AND";
|
|
54
65
|
RuleConditionEnum["OR"] = "OR";
|
|
55
66
|
})(RuleConditionEnum = exports.RuleConditionEnum || (exports.RuleConditionEnum = {}));
|
|
56
|
-
var getDefaultDiscountRule = function (discountRule_type) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
var getDefaultDiscountRule = function (discountRule_type, addExternalValues) {
|
|
68
|
+
var constructExternalValues = function (valuesToAdd) {
|
|
69
|
+
var allValues = {};
|
|
70
|
+
for (var _i = 0, valuesToAdd_1 = valuesToAdd; _i < valuesToAdd_1.length; _i++) {
|
|
71
|
+
var value = valuesToAdd_1[_i];
|
|
72
|
+
allValues[value] = '';
|
|
73
|
+
}
|
|
74
|
+
return allValues;
|
|
75
|
+
};
|
|
76
|
+
return __assign({ draft: false, name: [], discountRule_type: discountRule_type, is_stackable: false, description: [], appliesTo: {
|
|
64
77
|
value: '',
|
|
65
78
|
check_attribute: false,
|
|
66
79
|
check_attribute_value: '',
|
|
67
80
|
check_other_items_category: ''
|
|
68
|
-
},
|
|
69
|
-
promo_code: {
|
|
81
|
+
}, promo_code: {
|
|
70
82
|
disabled: false,
|
|
71
83
|
code: '',
|
|
72
84
|
once_per_client: true
|
|
73
|
-
},
|
|
74
|
-
noExtraRules: false,
|
|
75
|
-
rules: [
|
|
85
|
+
}, noExtraRules: false, rules: [
|
|
76
86
|
{
|
|
77
87
|
ruleDetails: [
|
|
78
88
|
{
|
|
@@ -84,13 +94,15 @@ var getDefaultDiscountRule = function (discountRule_type) {
|
|
|
84
94
|
condition: RuleConditionEnum.AND,
|
|
85
95
|
field: RuleFieldEnum.DATE
|
|
86
96
|
}
|
|
87
|
-
],
|
|
88
|
-
result: {
|
|
97
|
+
], result: {
|
|
89
98
|
action: '',
|
|
90
99
|
action_value: '',
|
|
91
100
|
action_sku: ''
|
|
101
|
+
} }, (!!addExternalValues
|
|
102
|
+
? {
|
|
103
|
+
external_values: constructExternalValues(addExternalValues)
|
|
92
104
|
}
|
|
93
|
-
|
|
105
|
+
: {}));
|
|
94
106
|
};
|
|
95
107
|
exports.getDefaultDiscountRule = getDefaultDiscountRule;
|
|
96
108
|
//# sourceMappingURL=IDiscountRule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDiscountRule.js","sourceRoot":"","sources":["../../../src/Interfaces/Rules/IDiscountRule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IDiscountRule.js","sourceRoot":"","sources":["../../../src/Interfaces/Rules/IDiscountRule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AA6CA,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,4CAA2B,CAAA;IAC3B,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;AACd,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAED,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC3B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,mDAA+B,CAAA;IAC/B,4DAAwC,CAAA;IACxC,6CAAyB,CAAA;IACzB,+CAA2B,CAAA;IAC3B,uDAAmC,CAAA;IACnC,yDAAqC,CAAA;IACrC,6DAAyC,CAAA;IACzC,+DAA2C,CAAA;AAC5C,CAAC,EAZW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAY3B;AAED,IAAY,aAyBX;AAzBD,WAAY,aAAa;IACxB,sCAAqB,CAAA;IACrB,gDAA+B,CAAA;IAC/B,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,mDAAkC,CAAA;IAClC,yCAAwB,CAAA;IACxB,gDAA+B,C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E,EAAE;wBACT,SAAS,EAAE,iBAAiB,CAAC,GAAG;qBAChC;iBACD;gBACD,SAAS,EAAE,iBAAiB,CAAC,GAAG;gBAChC,KAAK,EAAE,aAAa,CAAC,IAAI;aACzB;SACD,EACD,MAAM,EAAE;YACP,MAAM,EAAE,EAAS;YACjB,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;SACd,IACE,CAAC,CAAC,CAAC,iBAAiB;QACtB,CAAC,CAAC;YACA,eAAe,EAAE,uBAAuB,CAAC,iBAAiB,CAAC;SAC1D;QACH,CAAC,CAAC,EAAE,CAAC,EACN;AACF,CAAC,CAAA;AAnDY,QAAA,sBAAsB,0BAmDlC"}
|
|
@@ -248,10 +248,39 @@ export interface IBlockedDates {
|
|
|
248
248
|
readonly unique_id: string;
|
|
249
249
|
}[];
|
|
250
250
|
}
|
|
251
|
+
export declare enum spaceCollectionNames {
|
|
252
|
+
DISCOUNTS = "discountRules",
|
|
253
|
+
PURCHASE_ORDERS = "purchaseOrders",
|
|
254
|
+
ATTR_FAMILIES = "classes",
|
|
255
|
+
SUPPLIERS = "suppliers",
|
|
256
|
+
CARTS = "carts",
|
|
257
|
+
ORDERS = "orders",
|
|
258
|
+
INVOICES = "invoices",
|
|
259
|
+
CUSTOMERS = "customers",
|
|
260
|
+
INVENTORIES = "inventories",
|
|
261
|
+
PRODUCTS = "products",
|
|
262
|
+
TAGS = "tags",
|
|
263
|
+
BOOKINGS = "bookings",
|
|
264
|
+
PROMISES = "promises_to_purchase",
|
|
265
|
+
BG_JOBS = "bg_jobs",
|
|
266
|
+
SLIDERS = "sliders",
|
|
267
|
+
EXTERNAL_SERVICES = "external_services",
|
|
268
|
+
BRANDS = "brands",
|
|
269
|
+
CATEGORIES = "categories",
|
|
270
|
+
BLOG_ARTICLES = "blog_articles",
|
|
271
|
+
BLOG_CATEGORIES = "blog_categories",
|
|
272
|
+
BLOG_KEYWORDS = "blog_keywords",
|
|
273
|
+
CATALOGUES = "catalogues",
|
|
274
|
+
ATTRIBUTES = "attributes",
|
|
275
|
+
TRANSFER_REQUESTS = "transfer_requests"
|
|
276
|
+
}
|
|
251
277
|
export interface ISpaceOptions {
|
|
252
278
|
readonly products: {
|
|
253
279
|
readonly last_saved: boolean;
|
|
254
280
|
};
|
|
281
|
+
readonly inventory?: {
|
|
282
|
+
readonly minimum_inventory_per_sku: boolean;
|
|
283
|
+
};
|
|
255
284
|
readonly tags: {
|
|
256
285
|
readonly available: boolean;
|
|
257
286
|
readonly auto_generated: boolean;
|
|
@@ -278,6 +307,9 @@ export declare const getDefaultSpaceOptions: () => {
|
|
|
278
307
|
products: {
|
|
279
308
|
last_saved: boolean;
|
|
280
309
|
};
|
|
310
|
+
inventory: {
|
|
311
|
+
minimum_inventory_per_sku: boolean;
|
|
312
|
+
};
|
|
281
313
|
tags: {
|
|
282
314
|
available: boolean;
|
|
283
315
|
auto_generated: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultSpace = exports.getDefaultSpaceOptions = exports.ExternalServiceTypeEnum = void 0;
|
|
3
|
+
exports.defaultSpace = exports.getDefaultSpaceOptions = exports.spaceCollectionNames = exports.ExternalServiceTypeEnum = void 0;
|
|
4
4
|
var ExternalServiceTypeEnum;
|
|
5
5
|
(function (ExternalServiceTypeEnum) {
|
|
6
6
|
ExternalServiceTypeEnum["SHIPPING"] = "shipping";
|
|
@@ -16,10 +16,40 @@ var ExternalServiceTypeEnum;
|
|
|
16
16
|
ExternalServiceTypeEnum["MARKETING"] = "marketing";
|
|
17
17
|
ExternalServiceTypeEnum["TICKET"] = "ticket";
|
|
18
18
|
})(ExternalServiceTypeEnum = exports.ExternalServiceTypeEnum || (exports.ExternalServiceTypeEnum = {}));
|
|
19
|
+
var spaceCollectionNames;
|
|
20
|
+
(function (spaceCollectionNames) {
|
|
21
|
+
spaceCollectionNames["DISCOUNTS"] = "discountRules";
|
|
22
|
+
spaceCollectionNames["PURCHASE_ORDERS"] = "purchaseOrders";
|
|
23
|
+
spaceCollectionNames["ATTR_FAMILIES"] = "classes";
|
|
24
|
+
spaceCollectionNames["SUPPLIERS"] = "suppliers";
|
|
25
|
+
spaceCollectionNames["CARTS"] = "carts";
|
|
26
|
+
spaceCollectionNames["ORDERS"] = "orders";
|
|
27
|
+
spaceCollectionNames["INVOICES"] = "invoices";
|
|
28
|
+
spaceCollectionNames["CUSTOMERS"] = "customers";
|
|
29
|
+
spaceCollectionNames["INVENTORIES"] = "inventories";
|
|
30
|
+
spaceCollectionNames["PRODUCTS"] = "products";
|
|
31
|
+
spaceCollectionNames["TAGS"] = "tags";
|
|
32
|
+
spaceCollectionNames["BOOKINGS"] = "bookings";
|
|
33
|
+
spaceCollectionNames["PROMISES"] = "promises_to_purchase";
|
|
34
|
+
spaceCollectionNames["BG_JOBS"] = "bg_jobs";
|
|
35
|
+
spaceCollectionNames["SLIDERS"] = "sliders";
|
|
36
|
+
spaceCollectionNames["EXTERNAL_SERVICES"] = "external_services";
|
|
37
|
+
spaceCollectionNames["BRANDS"] = "brands";
|
|
38
|
+
spaceCollectionNames["CATEGORIES"] = "categories";
|
|
39
|
+
spaceCollectionNames["BLOG_ARTICLES"] = "blog_articles";
|
|
40
|
+
spaceCollectionNames["BLOG_CATEGORIES"] = "blog_categories";
|
|
41
|
+
spaceCollectionNames["BLOG_KEYWORDS"] = "blog_keywords";
|
|
42
|
+
spaceCollectionNames["CATALOGUES"] = "catalogues";
|
|
43
|
+
spaceCollectionNames["ATTRIBUTES"] = "attributes";
|
|
44
|
+
spaceCollectionNames["TRANSFER_REQUESTS"] = "transfer_requests";
|
|
45
|
+
})(spaceCollectionNames = exports.spaceCollectionNames || (exports.spaceCollectionNames = {}));
|
|
19
46
|
var getDefaultSpaceOptions = function () { return ({
|
|
20
47
|
products: {
|
|
21
48
|
last_saved: false
|
|
22
49
|
},
|
|
50
|
+
inventory: {
|
|
51
|
+
minimum_inventory_per_sku: false
|
|
52
|
+
},
|
|
23
53
|
tags: {
|
|
24
54
|
available: false,
|
|
25
55
|
auto_generated: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Space/index.ts"],"names":[],"mappings":";;;AAwNA,IAAY,uBAaX;AAbD,WAAY,uBAAuB;IAClC,gDAAqB,CAAA;IACrB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,0CAAe,CAAA;IACf,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,iDAAsB,CAAA;IACtB,8CAAmB,CAAA;IACnB,kDAAuB,CAAA;IACvB,4CAAiB,CAAA;AAClB,CAAC,EAbW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAalC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Interfaces/Space/index.ts"],"names":[],"mappings":";;;AAwNA,IAAY,uBAaX;AAbD,WAAY,uBAAuB;IAClC,gDAAqB,CAAA;IACrB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,0CAAe,CAAA;IACf,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,iDAAsB,CAAA;IACtB,8CAAmB,CAAA;IACnB,kDAAuB,CAAA;IACvB,4CAAiB,CAAA;AAClB,CAAC,EAbW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAalC;AA2DD,IAAY,oBAyBX;AAzBD,WAAY,oBAAoB;IAC/B,mDAA2B,CAAA;IAC3B,0DAAkC,CAAA;IAClC,iDAAyB,CAAA;IACzB,+CAAuB,CAAA;IACvB,uCAAe,CAAA;IACf,yCAAiB,CAAA;IACjB,6CAAqB,CAAA;IACrB,+CAAuB,CAAA;IACvB,mDAA2B,CAAA;IAC3B,6CAAqB,CAAA;IACrB,qCAAa,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AC1B,kCAAkC,EAAE;YACnC,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,EAAE;SACV;QACD,2CAA2C,EAAE;YAC5C,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,EAAE;SACV;KACD;IACD,SAAS,EAAE,CAAC,IAAI,CAAC;IACjB,IAAI,EAAE,EAAE;IACR,GAAG,EAAE;QACJ,sBAAsB,EAAE,KAAK;QAC7B,OAAO,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACrG,iBAAiB,EAAE,CAAC,QAAQ,CAAC;IAC7B,iBAAiB,EAAE,EAAE;IACrB,qBAAqB,EAAE,EAAE;IACzB,mBAAmB,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;IACpC,mBAAmB,EAAE,IAAI;CACzB,CAAC,EA/BwC,CA+BxC,CAAA;AA/BW,QAAA,YAAY,gBA+BvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IDeclination from '../../Interfaces/Declination';
|
|
2
2
|
import ICart, { CartTypeEnum, IApplicablePromiseBank, ICartItem, IIndexedDeclination } from '../../Interfaces/Cart';
|
|
3
3
|
import IQueryOptions from '../../Interfaces/Query/IProductQueryOptions';
|
|
4
|
-
import ISpace, { IBlockedDates, ICurrencies, IDimensionUnit, IBucketDocument, IExternalServices, IFixedPromoBanner, IG2Calls, IPredefinedBox, IShippingRangeRestrictions, ISpaceOptions } from '../../Interfaces/Space';
|
|
4
|
+
import ISpace, { IBlockedDates, ICurrencies, IDimensionUnit, IBucketDocument, IExternalServices, IFixedPromoBanner, IG2Calls, IPredefinedBox, IShippingRangeRestrictions, ISpaceOptions, spaceCollectionNames } from '../../Interfaces/Space';
|
|
5
5
|
import IBrand from '../../Interfaces/Brand';
|
|
6
6
|
import IProduct, { IQueryProps } from '../../Interfaces/Product';
|
|
7
7
|
import IDiscountRule from '../../Interfaces/Rules/IDiscountRule';
|
|
@@ -56,6 +56,7 @@ import Slider from '../Slider';
|
|
|
56
56
|
import IIndexedBankUsed, { BankUpdateTypeEnum, IRemainingBankAmount } from '../../Interfaces/PromiseToPurchase/IIndexedBankUsed';
|
|
57
57
|
import { IDatabaseRef, IRefObject } from '../../services/database/DatabaseService';
|
|
58
58
|
import { ICustomPriceItem } from '../../Interfaces/G2';
|
|
59
|
+
import ILang from '../../utils/string';
|
|
59
60
|
export default class Space {
|
|
60
61
|
private _space_ref;
|
|
61
62
|
private _user;
|
|
@@ -119,6 +120,8 @@ export default class Space {
|
|
|
119
120
|
details?: undefined;
|
|
120
121
|
}>;
|
|
121
122
|
private _fetchServices;
|
|
123
|
+
private _showExternalValueFieldsForSpace;
|
|
124
|
+
private _getExternalFieldsToShowForPageType;
|
|
122
125
|
private _getAllTaxes;
|
|
123
126
|
private _getTaxes;
|
|
124
127
|
private _getMostRecentConsentForm;
|
|
@@ -270,6 +273,7 @@ export default class Space {
|
|
|
270
273
|
private _getPossibleActiveBanksForCustomer;
|
|
271
274
|
private _updateCustomerLastActivity;
|
|
272
275
|
private _ajustInventoryWithCart;
|
|
276
|
+
private _checkIfSpaceHasMinInventoryOption;
|
|
273
277
|
private _addTag;
|
|
274
278
|
private _getAllTags;
|
|
275
279
|
private _deleteAllTags;
|
|
@@ -571,6 +575,18 @@ export default class Space {
|
|
|
571
575
|
get: () => Promise<ExternalService[]>;
|
|
572
576
|
};
|
|
573
577
|
};
|
|
578
|
+
externalServices: {
|
|
579
|
+
getPageTypesWithExternalFields: () => {
|
|
580
|
+
serviceType: string;
|
|
581
|
+
pages: spaceCollectionNames[];
|
|
582
|
+
} | undefined;
|
|
583
|
+
getExternalFieldsToShow: (objType: spaceCollectionNames) => {
|
|
584
|
+
fieldName: string;
|
|
585
|
+
fieldLabel: ILang;
|
|
586
|
+
readOnly?: boolean;
|
|
587
|
+
requiredStr?: ILang;
|
|
588
|
+
}[];
|
|
589
|
+
};
|
|
574
590
|
taxes: {
|
|
575
591
|
get: (taxCode: string, version?: string) => Promise<ITax>;
|
|
576
592
|
getAll: () => Promise<ITax[]>;
|
|
@@ -693,6 +709,7 @@ export default class Space {
|
|
|
693
709
|
services: (query: any) => IExternalServices[];
|
|
694
710
|
inventory: {
|
|
695
711
|
ajust: (items: ICartItem[], cartState: 'paid' | 'shipped' | 'delivery' | 'delivered' | 'picked' | 'cancelled' | 'modified' | 'refunded', cartType: CartTypeEnum, currentStoreId?: string | undefined, onlyWeb?: boolean, fromStoreId?: string | undefined) => Promise<void>;
|
|
712
|
+
showMinInventoryOption: () => boolean;
|
|
696
713
|
};
|
|
697
714
|
tags: {
|
|
698
715
|
add: (declination: IDeclination, product: IProduct, category_slug: string, inventory: IInventoryItem, currentStoreId: string, maxQte: number, isOtherCategory?: boolean) => Promise<string | boolean | undefined>;
|
package/dist/lib/Space/index.js
CHANGED
|
@@ -808,6 +808,86 @@ var Space = (function () {
|
|
|
808
808
|
var currentExternalServices = (_b = _this.data().external_services) !== null && _b !== void 0 ? _b : [];
|
|
809
809
|
return currentExternalServices.filter(function (s) { return !!s.is_active && !!s[query.field] && s[query.field] === query.value; });
|
|
810
810
|
};
|
|
811
|
+
this._showExternalValueFieldsForSpace = function () {
|
|
812
|
+
var spaceID = _this._space.id;
|
|
813
|
+
switch (true) {
|
|
814
|
+
case spaceID === services_1.SpaceIdEnum.GR:
|
|
815
|
+
return {
|
|
816
|
+
serviceType: 'G2',
|
|
817
|
+
pages: [Space_1.spaceCollectionNames.DISCOUNTS, Space_1.spaceCollectionNames.PRODUCTS, Space_1.spaceCollectionNames.CARTS]
|
|
818
|
+
};
|
|
819
|
+
default:
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
this._getExternalFieldsToShowForPageType = function (objType) {
|
|
824
|
+
var allTypesForSpace = _this._showExternalValueFieldsForSpace();
|
|
825
|
+
if (!!!allTypesForSpace || allTypesForSpace.pages.every(function (t) { return t !== objType; }))
|
|
826
|
+
return [];
|
|
827
|
+
switch (objType) {
|
|
828
|
+
case Space_1.spaceCollectionNames.DISCOUNTS:
|
|
829
|
+
if (allTypesForSpace.serviceType == 'G2')
|
|
830
|
+
return [
|
|
831
|
+
{
|
|
832
|
+
fieldName: 'noArticle',
|
|
833
|
+
fieldLabel: {
|
|
834
|
+
fr: "No. d'article",
|
|
835
|
+
en: "No. d'article"
|
|
836
|
+
},
|
|
837
|
+
requiredStr: {
|
|
838
|
+
fr: "Vous devez fournir le no. d'article G2 correspondant à la règle de prix",
|
|
839
|
+
en: "Please provide the corresponding G2 no. d'article for this discount rule"
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
];
|
|
843
|
+
return [];
|
|
844
|
+
case Space_1.spaceCollectionNames.PRODUCTS:
|
|
845
|
+
if (allTypesForSpace.serviceType == 'G2')
|
|
846
|
+
return [
|
|
847
|
+
{
|
|
848
|
+
fieldName: 'noArticle',
|
|
849
|
+
fieldLabel: {
|
|
850
|
+
fr: "No. d'article",
|
|
851
|
+
en: "No. d'article"
|
|
852
|
+
},
|
|
853
|
+
requiredStr: {
|
|
854
|
+
fr: "Vous devez fournir le no. d'article G2 correspondant à cette variation",
|
|
855
|
+
en: "Please provide the corresponding G2 no. d'article for this variation"
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
fieldName: 'catégorie1',
|
|
860
|
+
fieldLabel: {
|
|
861
|
+
fr: 'Catégorie1',
|
|
862
|
+
en: 'Catégorie1'
|
|
863
|
+
},
|
|
864
|
+
requiredStr: {
|
|
865
|
+
fr: 'Vous devez fournir la valeur de catégorie1 G2 correspondante à cette variation',
|
|
866
|
+
en: 'Please provide the corresponding G2 catégorie1 for this variation'
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
fieldName: 'catégorie2',
|
|
871
|
+
fieldLabel: {
|
|
872
|
+
fr: 'Catégorie2',
|
|
873
|
+
en: 'Catégorie2'
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
];
|
|
877
|
+
return [];
|
|
878
|
+
case Space_1.spaceCollectionNames.CARTS:
|
|
879
|
+
if (allTypesForSpace.serviceType == 'G2')
|
|
880
|
+
return [
|
|
881
|
+
{
|
|
882
|
+
fieldName: 'noCommande',
|
|
883
|
+
fieldLabel: { fr: 'Numéro du bon de commande', en: 'Order slip number' },
|
|
884
|
+
readOnly: true
|
|
885
|
+
}
|
|
886
|
+
];
|
|
887
|
+
default:
|
|
888
|
+
return [];
|
|
889
|
+
}
|
|
890
|
+
};
|
|
811
891
|
this._getAllTaxes = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
812
892
|
return __generator(this, function (_b) {
|
|
813
893
|
switch (_b.label) {
|
|
@@ -4544,6 +4624,10 @@ var Space = (function () {
|
|
|
4544
4624
|
}
|
|
4545
4625
|
});
|
|
4546
4626
|
}); };
|
|
4627
|
+
this._checkIfSpaceHasMinInventoryOption = function () {
|
|
4628
|
+
var spaceOptions = _this.options.get();
|
|
4629
|
+
return !!(0, object_1.recursiveCheckObject)(spaceOptions, 'inventory.minimum_inventory_per_sku');
|
|
4630
|
+
};
|
|
4547
4631
|
this._addTag = function (declination, product, category_slug, inventory, currentStoreId, maxQte, isOtherCategory) { return __awaiter(_this, void 0, void 0, function () {
|
|
4548
4632
|
var qty, sameStoreInventory, stockToSub, attrEtatJeuValue, attrTypeValue, decliAttributes, foundAttrEtatJeu, foundAttrType, existingTag, eTag, trueMaxQte, trueQteToAdd, newQuantities, attrCode, _p, productObj, _loop_4, this_3, _i, _b, d, error_58, tag, error_59;
|
|
4549
4633
|
var _c, _f;
|
|
@@ -6437,6 +6521,10 @@ var Space = (function () {
|
|
|
6437
6521
|
get: this._getExternalServices
|
|
6438
6522
|
}
|
|
6439
6523
|
};
|
|
6524
|
+
this.externalServices = {
|
|
6525
|
+
getPageTypesWithExternalFields: this._showExternalValueFieldsForSpace,
|
|
6526
|
+
getExternalFieldsToShow: this._getExternalFieldsToShowForPageType
|
|
6527
|
+
};
|
|
6440
6528
|
this.taxes = {
|
|
6441
6529
|
get: this._getTaxes,
|
|
6442
6530
|
getAll: this._getAllTaxes
|
|
@@ -6551,7 +6639,8 @@ var Space = (function () {
|
|
|
6551
6639
|
};
|
|
6552
6640
|
this.services = this._fetchServices;
|
|
6553
6641
|
this.inventory = {
|
|
6554
|
-
ajust: this._ajustInventoryWithCart
|
|
6642
|
+
ajust: this._ajustInventoryWithCart,
|
|
6643
|
+
showMinInventoryOption: this._checkIfSpaceHasMinInventoryOption
|
|
6555
6644
|
};
|
|
6556
6645
|
this.tags = {
|
|
6557
6646
|
add: this._addTag,
|