shopoflex-types 1.0.227 → 1.0.229
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/common.d.ts +5 -0
- package/dist/productCart.d.ts +41 -0
- package/package.json +1 -1
package/dist/common.d.ts
CHANGED
|
@@ -139,6 +139,10 @@ export interface AdditionalPrice {
|
|
|
139
139
|
name: string;
|
|
140
140
|
price: number;
|
|
141
141
|
}
|
|
142
|
+
export interface BranchPricing {
|
|
143
|
+
price?: number;
|
|
144
|
+
additionalPrices?: AdditionalPrice[];
|
|
145
|
+
}
|
|
142
146
|
export interface PriceModel {
|
|
143
147
|
price: number;
|
|
144
148
|
discountedPrice?: number;
|
|
@@ -149,6 +153,7 @@ export interface PriceModel {
|
|
|
149
153
|
unit: UnitTypeValue;
|
|
150
154
|
packaging?: PackagingOption[];
|
|
151
155
|
additionalPrices?: AdditionalPrice[];
|
|
156
|
+
priceByBranch?: Record<string, BranchPricing>;
|
|
152
157
|
}
|
|
153
158
|
export interface Dimensions {
|
|
154
159
|
active: boolean;
|
package/dist/productCart.d.ts
CHANGED
|
@@ -7,6 +7,39 @@ export type NameType = {
|
|
|
7
7
|
} & {
|
|
8
8
|
[key: string]: string;
|
|
9
9
|
};
|
|
10
|
+
export type OptionListType = "radio" | "select" | "checkbox" | "split";
|
|
11
|
+
export interface OptionChoice {
|
|
12
|
+
id: string;
|
|
13
|
+
label: NameType;
|
|
14
|
+
}
|
|
15
|
+
export interface OptionList {
|
|
16
|
+
_id?: string;
|
|
17
|
+
vendorId: string | any;
|
|
18
|
+
name: NameType;
|
|
19
|
+
/** radio/select = pick one · checkbox = pick several · split = several, auto-equal portions */
|
|
20
|
+
type: OptionListType;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
minSelect?: number;
|
|
23
|
+
maxSelect?: number;
|
|
24
|
+
choices: OptionChoice[];
|
|
25
|
+
isActive?: boolean;
|
|
26
|
+
createdAt?: Date;
|
|
27
|
+
updatedAt?: Date;
|
|
28
|
+
}
|
|
29
|
+
export interface sOptionChoice {
|
|
30
|
+
label: NameType;
|
|
31
|
+
portion?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ProductOptionListRef {
|
|
34
|
+
listId: string;
|
|
35
|
+
variantIds?: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface sOption {
|
|
38
|
+
listId?: string;
|
|
39
|
+
name: NameType;
|
|
40
|
+
type?: OptionListType;
|
|
41
|
+
choices: sOptionChoice[];
|
|
42
|
+
}
|
|
10
43
|
export interface CompositionType {
|
|
11
44
|
componentId: string;
|
|
12
45
|
variantId: string;
|
|
@@ -23,6 +56,7 @@ export interface VariantType {
|
|
|
23
56
|
attributes?: VariantAttribute[];
|
|
24
57
|
files?: FileType[];
|
|
25
58
|
barcode?: string;
|
|
59
|
+
barcodes?: string[];
|
|
26
60
|
plu?: string;
|
|
27
61
|
isActive?: boolean;
|
|
28
62
|
sortOrder?: number;
|
|
@@ -69,6 +103,11 @@ export interface ProductType {
|
|
|
69
103
|
branchesIds?: string[];
|
|
70
104
|
modifiers?: Modifier[];
|
|
71
105
|
hasModifiers?: boolean;
|
|
106
|
+
/** Reusable option lists (flavors, predefined notes) attached by reference,
|
|
107
|
+
* each optionally scoped to specific variants. Legacy plain-id strings are
|
|
108
|
+
* still accepted and treated as "applies to all variants". */
|
|
109
|
+
optionListIds?: (ProductOptionListRef | string)[];
|
|
110
|
+
hasOptions?: boolean;
|
|
72
111
|
isSellable?: boolean;
|
|
73
112
|
usageTypes?: Array<"main_product" | "addon">;
|
|
74
113
|
notes?: ProductNotes;
|
|
@@ -119,6 +158,8 @@ export interface CartItem {
|
|
|
119
158
|
unit: UnitTypeValue;
|
|
120
159
|
name?: NameType;
|
|
121
160
|
selectedModifiers?: sModifier[];
|
|
161
|
+
/** Picked option-list choices (flavors, notes) — label-only, no price. */
|
|
162
|
+
selectedOptions?: sOption[];
|
|
122
163
|
selectedVariant: VariantType | null;
|
|
123
164
|
files?: FileType[];
|
|
124
165
|
quantity: number;
|