b23-lib 3.9.0 → 3.9.2
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/Classes/Address.d.mts +1 -1
- package/dist/Classes/Address.d.ts +1 -1
- package/dist/Classes/Base.d.mts +1 -1
- package/dist/Classes/Base.d.ts +1 -1
- package/dist/Classes/Cart.d.mts +2 -2
- package/dist/Classes/Cart.d.ts +2 -2
- package/dist/Classes/Charge.d.mts +1 -1
- package/dist/Classes/Charge.d.ts +1 -1
- package/dist/Classes/Common.d.mts +1 -1
- package/dist/Classes/Common.d.ts +1 -1
- package/dist/Classes/Coupon.d.mts +1 -1
- package/dist/Classes/Coupon.d.ts +1 -1
- package/dist/Classes/Customer.d.mts +1 -1
- package/dist/Classes/Customer.d.ts +1 -1
- package/dist/Classes/CustomerAddress.d.mts +1 -1
- package/dist/Classes/CustomerAddress.d.ts +1 -1
- package/dist/Classes/Inventory.d.mts +2 -2
- package/dist/Classes/Inventory.d.ts +2 -2
- package/dist/Classes/Invoice.d.mts +2 -2
- package/dist/Classes/Invoice.d.ts +2 -2
- package/dist/Classes/LineItem.d.mts +2 -2
- package/dist/Classes/LineItem.d.ts +2 -2
- package/dist/Classes/Order.d.mts +2 -2
- package/dist/Classes/Order.d.ts +2 -2
- package/dist/Classes/Payment.d.mts +1 -1
- package/dist/Classes/Payment.d.ts +1 -1
- package/dist/Classes/Price.d.mts +1 -1
- package/dist/Classes/Price.d.ts +1 -1
- package/dist/Classes/Product.d.mts +2 -2
- package/dist/Classes/Product.d.ts +2 -2
- package/dist/Classes/ShoppingContainer.d.mts +2 -2
- package/dist/Classes/ShoppingContainer.d.ts +2 -2
- package/dist/Classes/TaxRule.d.mts +1 -1
- package/dist/Classes/TaxRule.d.ts +1 -1
- package/dist/Classes/TieredPrice.d.mts +2 -2
- package/dist/Classes/TieredPrice.d.ts +2 -2
- package/dist/{Common-BtMFh79I.d.ts → Price-CM028BEC.d.ts} +80 -80
- package/dist/{Common-BqhQxCq8.d.mts → Price-DhE6HC9v.d.mts} +80 -80
- package/dist/{Product-mtVUKzNI.d.ts → TieredPrice-BYCsK-r6.d.ts} +113 -113
- package/dist/{Product-BywRotdH.d.mts → TieredPrice-Da5vsB_9.d.mts} +113 -113
- package/dist/index.d.mts +94 -2
- package/dist/index.d.ts +94 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
import { OperationalCountry, OperationalCountryCurrency, OperationalLocale, OperationalLanguage } from './Classes/Enum.mjs';
|
|
2
2
|
|
|
3
|
+
type Prettify<T> = {
|
|
4
|
+
[K in keyof T]: T[K];
|
|
5
|
+
} & {};
|
|
6
|
+
/**
|
|
7
|
+
* Represents a ISO 3166-1 alpha-2 country code (e.g., 'US', 'IN').
|
|
8
|
+
*/
|
|
9
|
+
type CountryCode = keyof typeof OperationalCountry;
|
|
10
|
+
/**
|
|
11
|
+
* Represents a ISO 4217 currency code (e.g., 'INR', 'USD').
|
|
12
|
+
*/
|
|
13
|
+
type CurrencyCode = keyof typeof OperationalCountryCurrency;
|
|
14
|
+
/**
|
|
15
|
+
* /**
|
|
16
|
+
* Represents a value that can be localized into multiple languages.
|
|
17
|
+
* The 'en' property is mandatory and serves as the default English translation.
|
|
18
|
+
* Additional properties can be added for other locales using their respective locale codes.
|
|
19
|
+
*/
|
|
20
|
+
type LocalizedValue<T> = Prettify<{
|
|
21
|
+
en: T;
|
|
22
|
+
} & {
|
|
23
|
+
[locale in Exclude<LocaleCode | LanguageCode, 'en'>]?: T;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* /**
|
|
27
|
+
* Represents a string that can be localized into multiple languages.
|
|
28
|
+
* The 'en' property is mandatory and serves as the default English translation.
|
|
29
|
+
* Additional properties can be added for other locales using their respective locale codes.
|
|
30
|
+
*/
|
|
31
|
+
type LocalizedString = LocalizedValue<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Represents a BCP 47 language tag (e.g., 'en-US', 'fr-FR').
|
|
34
|
+
* Used to identify languages and regional variations.
|
|
35
|
+
*/
|
|
36
|
+
type LocaleCode = keyof typeof OperationalLocale;
|
|
37
|
+
type LanguageCode = keyof typeof OperationalLanguage;
|
|
38
|
+
type Color = {
|
|
39
|
+
name: string;
|
|
40
|
+
hex?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Represents a date and time string formatted according to the ISO 8601 standard.
|
|
44
|
+
* Example: "2023-10-27T10:30:00.000Z"
|
|
45
|
+
*/
|
|
46
|
+
type ISODateTimeUTC = string;
|
|
47
|
+
/**
|
|
48
|
+
* Represents a phone number in E.164 format (e.g., '+1234567890').
|
|
49
|
+
* Example: "+9122334455"
|
|
50
|
+
*/
|
|
51
|
+
type E164Phone = string;
|
|
52
|
+
type RegionalPrice = {
|
|
53
|
+
[country in CountryCode]?: PriceData;
|
|
54
|
+
};
|
|
55
|
+
interface ShippingDetails {
|
|
56
|
+
courierName: string;
|
|
57
|
+
courierId?: string;
|
|
58
|
+
serviceType?: string;
|
|
59
|
+
rating?: number;
|
|
60
|
+
estimatedDeliveryDays?: number;
|
|
61
|
+
cost: number;
|
|
62
|
+
currency?: string;
|
|
63
|
+
isFallback: boolean;
|
|
64
|
+
trackingUrl?: string;
|
|
65
|
+
deliveryType?: string;
|
|
66
|
+
insuranceAmount?: number;
|
|
67
|
+
weight?: number;
|
|
68
|
+
dimensions?: {
|
|
69
|
+
length: number;
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
unit?: string;
|
|
73
|
+
};
|
|
74
|
+
pickupDate?: string;
|
|
75
|
+
deliveryDate?: string;
|
|
76
|
+
status?: string;
|
|
77
|
+
rawApiData?: any;
|
|
78
|
+
codCharges?: number;
|
|
79
|
+
[key: string]: any;
|
|
80
|
+
}
|
|
81
|
+
|
|
3
82
|
type PriceAttributes = {
|
|
4
83
|
amount: number;
|
|
5
84
|
currency: CurrencyCode;
|
|
@@ -155,83 +234,4 @@ declare class PriceModel {
|
|
|
155
234
|
static getSmallestUnit(currency: CurrencyCode): number;
|
|
156
235
|
}
|
|
157
236
|
|
|
158
|
-
type Prettify
|
|
159
|
-
[K in keyof T]: T[K];
|
|
160
|
-
} & {};
|
|
161
|
-
/**
|
|
162
|
-
* Represents a ISO 3166-1 alpha-2 country code (e.g., 'US', 'IN').
|
|
163
|
-
*/
|
|
164
|
-
type CountryCode = keyof typeof OperationalCountry;
|
|
165
|
-
/**
|
|
166
|
-
* Represents a ISO 4217 currency code (e.g., 'INR', 'USD').
|
|
167
|
-
*/
|
|
168
|
-
type CurrencyCode = keyof typeof OperationalCountryCurrency;
|
|
169
|
-
/**
|
|
170
|
-
* /**
|
|
171
|
-
* Represents a value that can be localized into multiple languages.
|
|
172
|
-
* The 'en' property is mandatory and serves as the default English translation.
|
|
173
|
-
* Additional properties can be added for other locales using their respective locale codes.
|
|
174
|
-
*/
|
|
175
|
-
type LocalizedValue<T> = Prettify<{
|
|
176
|
-
en: T;
|
|
177
|
-
} & {
|
|
178
|
-
[locale in Exclude<LocaleCode | LanguageCode, 'en'>]?: T;
|
|
179
|
-
}>;
|
|
180
|
-
/**
|
|
181
|
-
* /**
|
|
182
|
-
* Represents a string that can be localized into multiple languages.
|
|
183
|
-
* The 'en' property is mandatory and serves as the default English translation.
|
|
184
|
-
* Additional properties can be added for other locales using their respective locale codes.
|
|
185
|
-
*/
|
|
186
|
-
type LocalizedString = LocalizedValue<string>;
|
|
187
|
-
/**
|
|
188
|
-
* Represents a BCP 47 language tag (e.g., 'en-US', 'fr-FR').
|
|
189
|
-
* Used to identify languages and regional variations.
|
|
190
|
-
*/
|
|
191
|
-
type LocaleCode = keyof typeof OperationalLocale;
|
|
192
|
-
type LanguageCode = keyof typeof OperationalLanguage;
|
|
193
|
-
type Color = {
|
|
194
|
-
name: string;
|
|
195
|
-
hex?: string;
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* Represents a date and time string formatted according to the ISO 8601 standard.
|
|
199
|
-
* Example: "2023-10-27T10:30:00.000Z"
|
|
200
|
-
*/
|
|
201
|
-
type ISODateTimeUTC = string;
|
|
202
|
-
/**
|
|
203
|
-
* Represents a phone number in E.164 format (e.g., '+1234567890').
|
|
204
|
-
* Example: "+9122334455"
|
|
205
|
-
*/
|
|
206
|
-
type E164Phone = string;
|
|
207
|
-
type RegionalPrice = {
|
|
208
|
-
[country in CountryCode]?: PriceData;
|
|
209
|
-
};
|
|
210
|
-
interface ShippingDetails {
|
|
211
|
-
courierName: string;
|
|
212
|
-
courierId?: string;
|
|
213
|
-
serviceType?: string;
|
|
214
|
-
rating?: number;
|
|
215
|
-
estimatedDeliveryDays?: number;
|
|
216
|
-
cost: number;
|
|
217
|
-
currency?: string;
|
|
218
|
-
isFallback: boolean;
|
|
219
|
-
trackingUrl?: string;
|
|
220
|
-
deliveryType?: string;
|
|
221
|
-
insuranceAmount?: number;
|
|
222
|
-
weight?: number;
|
|
223
|
-
dimensions?: {
|
|
224
|
-
length: number;
|
|
225
|
-
width: number;
|
|
226
|
-
height: number;
|
|
227
|
-
unit?: string;
|
|
228
|
-
};
|
|
229
|
-
pickupDate?: string;
|
|
230
|
-
deliveryDate?: string;
|
|
231
|
-
status?: string;
|
|
232
|
-
rawApiData?: any;
|
|
233
|
-
codCharges?: number;
|
|
234
|
-
[key: string]: any;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export { type CountryCode as C, type E164Phone as E, type ISODateTimeUTC as I, type LocaleCode as L, type PriceData as P, type RegionalPrice as R, type ShippingDetails as S, PriceModel as a, type Prettify as b, type CurrencyCode as c, type LocalizedString as d, type LocalizedValue as e, type Color as f, type PriceAttributes as g, type LanguageCode as h };
|
|
237
|
+
export { type CountryCode as C, type E164Phone as E, type ISODateTimeUTC as I, type LocaleCode as L, type PriceData as P, type RegionalPrice as R, type ShippingDetails as S, PriceModel as a, type Prettify as b, type CurrencyCode as c, type LocalizedString as d, type LocalizedValue as e, type Color as f, type LanguageCode as g, type PriceAttributes as h };
|
|
@@ -1,119 +1,8 @@
|
|
|
1
|
+
import { b as Prettify, f as Color, d as LocalizedString, C as CountryCode, e as LocalizedValue, L as LocaleCode, a as PriceModel, P as PriceData, c as CurrencyCode } from './Price-CM028BEC.js';
|
|
1
2
|
import BaseModel, { BaseAttributes } from './Classes/Base.js';
|
|
2
|
-
import { a as PriceModel, P as PriceData, b as Prettify, c as CurrencyCode, f as Color, d as LocalizedString, C as CountryCode, e as LocalizedValue, L as LocaleCode } from './Common-BtMFh79I.js';
|
|
3
3
|
import { GenderCategory, ProductType, ImageCategory } from './Classes/Enum.js';
|
|
4
4
|
import ImageInfoModel, { ImageInfoData } from './Classes/ImageInfo.js';
|
|
5
5
|
|
|
6
|
-
declare enum PricingType {
|
|
7
|
-
VOLUME = "volume",
|
|
8
|
-
SELECTION = "selection"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Represents a pricing tier based on a minimum purchase quantity.
|
|
12
|
-
*/
|
|
13
|
-
type PriceTier = {
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
minQuantity: number;
|
|
16
|
-
unitPrice: PriceModel;
|
|
17
|
-
};
|
|
18
|
-
type PriceTierData = {
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
minQuantity: number;
|
|
21
|
-
unitPrice: PriceData;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Represents the configuration for a specific selection variant.
|
|
25
|
-
*/
|
|
26
|
-
type SelectionPricingData = {
|
|
27
|
-
selectionAttributes: SelectionAttributes;
|
|
28
|
-
baseUnitPrice: PriceData;
|
|
29
|
-
tiers?: PriceTierData[];
|
|
30
|
-
};
|
|
31
|
-
type SelectionPricing = {
|
|
32
|
-
selectionAttributes: SelectionAttributes;
|
|
33
|
-
baseUnitPrice: PriceModel;
|
|
34
|
-
tiers: PriceTier[];
|
|
35
|
-
};
|
|
36
|
-
type PriceTierAttributes = Prettify<Omit<PriceTierData, 'enabled'> & {
|
|
37
|
-
enabled?: boolean;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Represents the attributes required for tiered pricing.
|
|
41
|
-
*/
|
|
42
|
-
type TieredPriceAttributes = Prettify<{
|
|
43
|
-
taxCategory: string;
|
|
44
|
-
isTaxInclusive?: boolean;
|
|
45
|
-
} & ({
|
|
46
|
-
currency?: CurrencyCode;
|
|
47
|
-
type?: PricingType.VOLUME;
|
|
48
|
-
baseUnitPrice: PriceData;
|
|
49
|
-
tiers?: PriceTierAttributes[];
|
|
50
|
-
} | {
|
|
51
|
-
currency: CurrencyCode;
|
|
52
|
-
type: PricingType.SELECTION;
|
|
53
|
-
selections: (Omit<SelectionPricingData, 'tiers'> & {
|
|
54
|
-
tiers?: PriceTierAttributes[];
|
|
55
|
-
})[];
|
|
56
|
-
})>;
|
|
57
|
-
type TieredPriceData = Prettify<{
|
|
58
|
-
taxCategory: string;
|
|
59
|
-
isTaxInclusive: boolean;
|
|
60
|
-
currency: CurrencyCode;
|
|
61
|
-
} & ({
|
|
62
|
-
type?: PricingType.VOLUME;
|
|
63
|
-
baseUnitPrice: PriceData;
|
|
64
|
-
tiers: PriceTierData[];
|
|
65
|
-
} | {
|
|
66
|
-
type: PricingType.SELECTION;
|
|
67
|
-
selections: SelectionPricingData[];
|
|
68
|
-
})>;
|
|
69
|
-
declare abstract class TieredPriceModel {
|
|
70
|
-
protected type: PricingType;
|
|
71
|
-
protected taxCategory: string;
|
|
72
|
-
protected isTaxInclusive: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Factory method to instantiate the correct concrete TieredPriceModel implementation.
|
|
75
|
-
*/
|
|
76
|
-
static create(data: TieredPriceAttributes): TieredPriceModel;
|
|
77
|
-
constructor(data: TieredPriceAttributes);
|
|
78
|
-
getType(): PricingType;
|
|
79
|
-
getTaxCategory(): string;
|
|
80
|
-
getIsTaxInclusive(): boolean;
|
|
81
|
-
abstract getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
82
|
-
abstract getDetails(): TieredPriceData;
|
|
83
|
-
abstract getCurrency(): string;
|
|
84
|
-
abstract getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
85
|
-
abstract getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
86
|
-
abstract getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
87
|
-
}
|
|
88
|
-
declare class VolumeTieredPriceModel extends TieredPriceModel {
|
|
89
|
-
protected baseUnitPrice: PriceModel;
|
|
90
|
-
protected tiers: PriceTier[];
|
|
91
|
-
protected currency: CurrencyCode;
|
|
92
|
-
constructor(data: Extract<TieredPriceAttributes, {
|
|
93
|
-
type?: PricingType.VOLUME;
|
|
94
|
-
}>);
|
|
95
|
-
getBaseUnitPrice(): PriceModel;
|
|
96
|
-
getCurrency(): string;
|
|
97
|
-
getApplicableUnitPrice(quantity: number): PriceModel;
|
|
98
|
-
getMinQuantity(): number;
|
|
99
|
-
getMaxDiscountPercent(): number;
|
|
100
|
-
getDetails(): TieredPriceData;
|
|
101
|
-
}
|
|
102
|
-
declare class SelectionTieredPriceModel extends TieredPriceModel {
|
|
103
|
-
protected currency: CurrencyCode;
|
|
104
|
-
protected selections: SelectionPricing[];
|
|
105
|
-
constructor(data: Extract<TieredPriceAttributes, {
|
|
106
|
-
type: PricingType.SELECTION;
|
|
107
|
-
}>);
|
|
108
|
-
protected findMatch(selectionAttributes: SelectionAttributes): SelectionPricing;
|
|
109
|
-
getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
110
|
-
getCurrency(): string;
|
|
111
|
-
getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
112
|
-
getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
113
|
-
getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
114
|
-
getDetails(): TieredPriceData;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
6
|
type ProductSelectionAttributes = Prettify<{
|
|
118
7
|
color: Color[];
|
|
119
8
|
size: string[];
|
|
@@ -364,4 +253,115 @@ declare class ProductModel extends BaseModel {
|
|
|
364
253
|
validateSize(size: string): boolean;
|
|
365
254
|
}
|
|
366
255
|
|
|
367
|
-
|
|
256
|
+
declare enum PricingType {
|
|
257
|
+
VOLUME = "volume",
|
|
258
|
+
SELECTION = "selection"
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Represents a pricing tier based on a minimum purchase quantity.
|
|
262
|
+
*/
|
|
263
|
+
type PriceTier = {
|
|
264
|
+
enabled: boolean;
|
|
265
|
+
minQuantity: number;
|
|
266
|
+
unitPrice: PriceModel;
|
|
267
|
+
};
|
|
268
|
+
type PriceTierData = {
|
|
269
|
+
enabled: boolean;
|
|
270
|
+
minQuantity: number;
|
|
271
|
+
unitPrice: PriceData;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Represents the configuration for a specific selection variant.
|
|
275
|
+
*/
|
|
276
|
+
type SelectionPricingData = {
|
|
277
|
+
selectionAttributes: SelectionAttributes;
|
|
278
|
+
baseUnitPrice: PriceData;
|
|
279
|
+
tiers?: PriceTierData[];
|
|
280
|
+
};
|
|
281
|
+
type SelectionPricing = {
|
|
282
|
+
selectionAttributes: SelectionAttributes;
|
|
283
|
+
baseUnitPrice: PriceModel;
|
|
284
|
+
tiers: PriceTier[];
|
|
285
|
+
};
|
|
286
|
+
type PriceTierAttributes = Prettify<Omit<PriceTierData, 'enabled'> & {
|
|
287
|
+
enabled?: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
/**
|
|
290
|
+
* Represents the attributes required for tiered pricing.
|
|
291
|
+
*/
|
|
292
|
+
type TieredPriceAttributes = Prettify<{
|
|
293
|
+
taxCategory: string;
|
|
294
|
+
isTaxInclusive?: boolean;
|
|
295
|
+
} & ({
|
|
296
|
+
currency?: CurrencyCode;
|
|
297
|
+
type?: PricingType.VOLUME;
|
|
298
|
+
baseUnitPrice: PriceData;
|
|
299
|
+
tiers?: PriceTierAttributes[];
|
|
300
|
+
} | {
|
|
301
|
+
currency: CurrencyCode;
|
|
302
|
+
type: PricingType.SELECTION;
|
|
303
|
+
selections: (Omit<SelectionPricingData, 'tiers'> & {
|
|
304
|
+
tiers?: PriceTierAttributes[];
|
|
305
|
+
})[];
|
|
306
|
+
})>;
|
|
307
|
+
type TieredPriceData = Prettify<{
|
|
308
|
+
taxCategory: string;
|
|
309
|
+
isTaxInclusive: boolean;
|
|
310
|
+
currency: CurrencyCode;
|
|
311
|
+
} & ({
|
|
312
|
+
type?: PricingType.VOLUME;
|
|
313
|
+
baseUnitPrice: PriceData;
|
|
314
|
+
tiers: PriceTierData[];
|
|
315
|
+
} | {
|
|
316
|
+
type: PricingType.SELECTION;
|
|
317
|
+
selections: SelectionPricingData[];
|
|
318
|
+
})>;
|
|
319
|
+
declare abstract class TieredPriceModel {
|
|
320
|
+
protected type: PricingType;
|
|
321
|
+
protected taxCategory: string;
|
|
322
|
+
protected isTaxInclusive: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Factory method to instantiate the correct concrete TieredPriceModel implementation.
|
|
325
|
+
*/
|
|
326
|
+
static create(data: TieredPriceAttributes): TieredPriceModel;
|
|
327
|
+
constructor(data: TieredPriceAttributes);
|
|
328
|
+
getType(): PricingType;
|
|
329
|
+
getTaxCategory(): string;
|
|
330
|
+
getIsTaxInclusive(): boolean;
|
|
331
|
+
abstract getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
332
|
+
abstract getDetails(): TieredPriceData;
|
|
333
|
+
abstract getCurrency(): string;
|
|
334
|
+
abstract getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
335
|
+
abstract getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
336
|
+
abstract getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
337
|
+
}
|
|
338
|
+
declare class VolumeTieredPriceModel extends TieredPriceModel {
|
|
339
|
+
protected baseUnitPrice: PriceModel;
|
|
340
|
+
protected tiers: PriceTier[];
|
|
341
|
+
protected currency: CurrencyCode;
|
|
342
|
+
constructor(data: Extract<TieredPriceAttributes, {
|
|
343
|
+
type?: PricingType.VOLUME;
|
|
344
|
+
}>);
|
|
345
|
+
getBaseUnitPrice(): PriceModel;
|
|
346
|
+
getCurrency(): string;
|
|
347
|
+
getApplicableUnitPrice(quantity: number): PriceModel;
|
|
348
|
+
getMinQuantity(): number;
|
|
349
|
+
getMaxDiscountPercent(): number;
|
|
350
|
+
getDetails(): TieredPriceData;
|
|
351
|
+
}
|
|
352
|
+
declare class SelectionTieredPriceModel extends TieredPriceModel {
|
|
353
|
+
protected currency: CurrencyCode;
|
|
354
|
+
protected selections: SelectionPricing[];
|
|
355
|
+
constructor(data: Extract<TieredPriceAttributes, {
|
|
356
|
+
type: PricingType.SELECTION;
|
|
357
|
+
}>);
|
|
358
|
+
protected findMatch(selectionAttributes: SelectionAttributes): SelectionPricing;
|
|
359
|
+
getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
360
|
+
getCurrency(): string;
|
|
361
|
+
getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
362
|
+
getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
363
|
+
getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
364
|
+
getDetails(): TieredPriceData;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export { PricingType as P, type SelectionAttributes as S, type TieredPriceData as T, type VariantData as V, ProductModel as a, TieredPriceModel as b, type ProductSpecification as c, type ProductSelectionAttributes as d, type VariantModel as e, type ProductAttributes as f, type ProductData as g, type PriceTier as h, type PriceTierData as i, type SelectionPricingData as j, type SelectionPricing as k, type PriceTierAttributes as l, type TieredPriceAttributes as m, VolumeTieredPriceModel as n, SelectionTieredPriceModel as o };
|
|
@@ -1,119 +1,8 @@
|
|
|
1
|
+
import { b as Prettify, f as Color, d as LocalizedString, C as CountryCode, e as LocalizedValue, L as LocaleCode, a as PriceModel, P as PriceData, c as CurrencyCode } from './Price-DhE6HC9v.mjs';
|
|
1
2
|
import BaseModel, { BaseAttributes } from './Classes/Base.mjs';
|
|
2
|
-
import { a as PriceModel, P as PriceData, b as Prettify, c as CurrencyCode, f as Color, d as LocalizedString, C as CountryCode, e as LocalizedValue, L as LocaleCode } from './Common-BqhQxCq8.mjs';
|
|
3
3
|
import { GenderCategory, ProductType, ImageCategory } from './Classes/Enum.mjs';
|
|
4
4
|
import ImageInfoModel, { ImageInfoData } from './Classes/ImageInfo.mjs';
|
|
5
5
|
|
|
6
|
-
declare enum PricingType {
|
|
7
|
-
VOLUME = "volume",
|
|
8
|
-
SELECTION = "selection"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Represents a pricing tier based on a minimum purchase quantity.
|
|
12
|
-
*/
|
|
13
|
-
type PriceTier = {
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
minQuantity: number;
|
|
16
|
-
unitPrice: PriceModel;
|
|
17
|
-
};
|
|
18
|
-
type PriceTierData = {
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
minQuantity: number;
|
|
21
|
-
unitPrice: PriceData;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Represents the configuration for a specific selection variant.
|
|
25
|
-
*/
|
|
26
|
-
type SelectionPricingData = {
|
|
27
|
-
selectionAttributes: SelectionAttributes;
|
|
28
|
-
baseUnitPrice: PriceData;
|
|
29
|
-
tiers?: PriceTierData[];
|
|
30
|
-
};
|
|
31
|
-
type SelectionPricing = {
|
|
32
|
-
selectionAttributes: SelectionAttributes;
|
|
33
|
-
baseUnitPrice: PriceModel;
|
|
34
|
-
tiers: PriceTier[];
|
|
35
|
-
};
|
|
36
|
-
type PriceTierAttributes = Prettify<Omit<PriceTierData, 'enabled'> & {
|
|
37
|
-
enabled?: boolean;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Represents the attributes required for tiered pricing.
|
|
41
|
-
*/
|
|
42
|
-
type TieredPriceAttributes = Prettify<{
|
|
43
|
-
taxCategory: string;
|
|
44
|
-
isTaxInclusive?: boolean;
|
|
45
|
-
} & ({
|
|
46
|
-
currency?: CurrencyCode;
|
|
47
|
-
type?: PricingType.VOLUME;
|
|
48
|
-
baseUnitPrice: PriceData;
|
|
49
|
-
tiers?: PriceTierAttributes[];
|
|
50
|
-
} | {
|
|
51
|
-
currency: CurrencyCode;
|
|
52
|
-
type: PricingType.SELECTION;
|
|
53
|
-
selections: (Omit<SelectionPricingData, 'tiers'> & {
|
|
54
|
-
tiers?: PriceTierAttributes[];
|
|
55
|
-
})[];
|
|
56
|
-
})>;
|
|
57
|
-
type TieredPriceData = Prettify<{
|
|
58
|
-
taxCategory: string;
|
|
59
|
-
isTaxInclusive: boolean;
|
|
60
|
-
currency: CurrencyCode;
|
|
61
|
-
} & ({
|
|
62
|
-
type?: PricingType.VOLUME;
|
|
63
|
-
baseUnitPrice: PriceData;
|
|
64
|
-
tiers: PriceTierData[];
|
|
65
|
-
} | {
|
|
66
|
-
type: PricingType.SELECTION;
|
|
67
|
-
selections: SelectionPricingData[];
|
|
68
|
-
})>;
|
|
69
|
-
declare abstract class TieredPriceModel {
|
|
70
|
-
protected type: PricingType;
|
|
71
|
-
protected taxCategory: string;
|
|
72
|
-
protected isTaxInclusive: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Factory method to instantiate the correct concrete TieredPriceModel implementation.
|
|
75
|
-
*/
|
|
76
|
-
static create(data: TieredPriceAttributes): TieredPriceModel;
|
|
77
|
-
constructor(data: TieredPriceAttributes);
|
|
78
|
-
getType(): PricingType;
|
|
79
|
-
getTaxCategory(): string;
|
|
80
|
-
getIsTaxInclusive(): boolean;
|
|
81
|
-
abstract getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
82
|
-
abstract getDetails(): TieredPriceData;
|
|
83
|
-
abstract getCurrency(): string;
|
|
84
|
-
abstract getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
85
|
-
abstract getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
86
|
-
abstract getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
87
|
-
}
|
|
88
|
-
declare class VolumeTieredPriceModel extends TieredPriceModel {
|
|
89
|
-
protected baseUnitPrice: PriceModel;
|
|
90
|
-
protected tiers: PriceTier[];
|
|
91
|
-
protected currency: CurrencyCode;
|
|
92
|
-
constructor(data: Extract<TieredPriceAttributes, {
|
|
93
|
-
type?: PricingType.VOLUME;
|
|
94
|
-
}>);
|
|
95
|
-
getBaseUnitPrice(): PriceModel;
|
|
96
|
-
getCurrency(): string;
|
|
97
|
-
getApplicableUnitPrice(quantity: number): PriceModel;
|
|
98
|
-
getMinQuantity(): number;
|
|
99
|
-
getMaxDiscountPercent(): number;
|
|
100
|
-
getDetails(): TieredPriceData;
|
|
101
|
-
}
|
|
102
|
-
declare class SelectionTieredPriceModel extends TieredPriceModel {
|
|
103
|
-
protected currency: CurrencyCode;
|
|
104
|
-
protected selections: SelectionPricing[];
|
|
105
|
-
constructor(data: Extract<TieredPriceAttributes, {
|
|
106
|
-
type: PricingType.SELECTION;
|
|
107
|
-
}>);
|
|
108
|
-
protected findMatch(selectionAttributes: SelectionAttributes): SelectionPricing;
|
|
109
|
-
getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
110
|
-
getCurrency(): string;
|
|
111
|
-
getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
112
|
-
getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
113
|
-
getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
114
|
-
getDetails(): TieredPriceData;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
6
|
type ProductSelectionAttributes = Prettify<{
|
|
118
7
|
color: Color[];
|
|
119
8
|
size: string[];
|
|
@@ -364,4 +253,115 @@ declare class ProductModel extends BaseModel {
|
|
|
364
253
|
validateSize(size: string): boolean;
|
|
365
254
|
}
|
|
366
255
|
|
|
367
|
-
|
|
256
|
+
declare enum PricingType {
|
|
257
|
+
VOLUME = "volume",
|
|
258
|
+
SELECTION = "selection"
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Represents a pricing tier based on a minimum purchase quantity.
|
|
262
|
+
*/
|
|
263
|
+
type PriceTier = {
|
|
264
|
+
enabled: boolean;
|
|
265
|
+
minQuantity: number;
|
|
266
|
+
unitPrice: PriceModel;
|
|
267
|
+
};
|
|
268
|
+
type PriceTierData = {
|
|
269
|
+
enabled: boolean;
|
|
270
|
+
minQuantity: number;
|
|
271
|
+
unitPrice: PriceData;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Represents the configuration for a specific selection variant.
|
|
275
|
+
*/
|
|
276
|
+
type SelectionPricingData = {
|
|
277
|
+
selectionAttributes: SelectionAttributes;
|
|
278
|
+
baseUnitPrice: PriceData;
|
|
279
|
+
tiers?: PriceTierData[];
|
|
280
|
+
};
|
|
281
|
+
type SelectionPricing = {
|
|
282
|
+
selectionAttributes: SelectionAttributes;
|
|
283
|
+
baseUnitPrice: PriceModel;
|
|
284
|
+
tiers: PriceTier[];
|
|
285
|
+
};
|
|
286
|
+
type PriceTierAttributes = Prettify<Omit<PriceTierData, 'enabled'> & {
|
|
287
|
+
enabled?: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
/**
|
|
290
|
+
* Represents the attributes required for tiered pricing.
|
|
291
|
+
*/
|
|
292
|
+
type TieredPriceAttributes = Prettify<{
|
|
293
|
+
taxCategory: string;
|
|
294
|
+
isTaxInclusive?: boolean;
|
|
295
|
+
} & ({
|
|
296
|
+
currency?: CurrencyCode;
|
|
297
|
+
type?: PricingType.VOLUME;
|
|
298
|
+
baseUnitPrice: PriceData;
|
|
299
|
+
tiers?: PriceTierAttributes[];
|
|
300
|
+
} | {
|
|
301
|
+
currency: CurrencyCode;
|
|
302
|
+
type: PricingType.SELECTION;
|
|
303
|
+
selections: (Omit<SelectionPricingData, 'tiers'> & {
|
|
304
|
+
tiers?: PriceTierAttributes[];
|
|
305
|
+
})[];
|
|
306
|
+
})>;
|
|
307
|
+
type TieredPriceData = Prettify<{
|
|
308
|
+
taxCategory: string;
|
|
309
|
+
isTaxInclusive: boolean;
|
|
310
|
+
currency: CurrencyCode;
|
|
311
|
+
} & ({
|
|
312
|
+
type?: PricingType.VOLUME;
|
|
313
|
+
baseUnitPrice: PriceData;
|
|
314
|
+
tiers: PriceTierData[];
|
|
315
|
+
} | {
|
|
316
|
+
type: PricingType.SELECTION;
|
|
317
|
+
selections: SelectionPricingData[];
|
|
318
|
+
})>;
|
|
319
|
+
declare abstract class TieredPriceModel {
|
|
320
|
+
protected type: PricingType;
|
|
321
|
+
protected taxCategory: string;
|
|
322
|
+
protected isTaxInclusive: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Factory method to instantiate the correct concrete TieredPriceModel implementation.
|
|
325
|
+
*/
|
|
326
|
+
static create(data: TieredPriceAttributes): TieredPriceModel;
|
|
327
|
+
constructor(data: TieredPriceAttributes);
|
|
328
|
+
getType(): PricingType;
|
|
329
|
+
getTaxCategory(): string;
|
|
330
|
+
getIsTaxInclusive(): boolean;
|
|
331
|
+
abstract getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
332
|
+
abstract getDetails(): TieredPriceData;
|
|
333
|
+
abstract getCurrency(): string;
|
|
334
|
+
abstract getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
335
|
+
abstract getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
336
|
+
abstract getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
337
|
+
}
|
|
338
|
+
declare class VolumeTieredPriceModel extends TieredPriceModel {
|
|
339
|
+
protected baseUnitPrice: PriceModel;
|
|
340
|
+
protected tiers: PriceTier[];
|
|
341
|
+
protected currency: CurrencyCode;
|
|
342
|
+
constructor(data: Extract<TieredPriceAttributes, {
|
|
343
|
+
type?: PricingType.VOLUME;
|
|
344
|
+
}>);
|
|
345
|
+
getBaseUnitPrice(): PriceModel;
|
|
346
|
+
getCurrency(): string;
|
|
347
|
+
getApplicableUnitPrice(quantity: number): PriceModel;
|
|
348
|
+
getMinQuantity(): number;
|
|
349
|
+
getMaxDiscountPercent(): number;
|
|
350
|
+
getDetails(): TieredPriceData;
|
|
351
|
+
}
|
|
352
|
+
declare class SelectionTieredPriceModel extends TieredPriceModel {
|
|
353
|
+
protected currency: CurrencyCode;
|
|
354
|
+
protected selections: SelectionPricing[];
|
|
355
|
+
constructor(data: Extract<TieredPriceAttributes, {
|
|
356
|
+
type: PricingType.SELECTION;
|
|
357
|
+
}>);
|
|
358
|
+
protected findMatch(selectionAttributes: SelectionAttributes): SelectionPricing;
|
|
359
|
+
getBaseUnitPrice(selectionAttributes?: SelectionAttributes): PriceModel;
|
|
360
|
+
getCurrency(): string;
|
|
361
|
+
getApplicableUnitPrice(quantity: number, selectionAttributes?: SelectionAttributes): PriceModel;
|
|
362
|
+
getMinQuantity(selectionAttributes?: SelectionAttributes): number;
|
|
363
|
+
getMaxDiscountPercent(selectionAttributes?: SelectionAttributes): number;
|
|
364
|
+
getDetails(): TieredPriceData;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export { PricingType as P, type SelectionAttributes as S, type TieredPriceData as T, type VariantData as V, ProductModel as a, TieredPriceModel as b, type ProductSpecification as c, type ProductSelectionAttributes as d, type VariantModel as e, type ProductAttributes as f, type ProductData as g, type PriceTier as h, type PriceTierData as i, type SelectionPricingData as j, type SelectionPricing as k, type PriceTierAttributes as l, type TieredPriceAttributes as m, VolumeTieredPriceModel as n, SelectionTieredPriceModel as o };
|