shopoflex-types 1.0.228 → 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.
@@ -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;
@@ -70,6 +103,11 @@ export interface ProductType {
70
103
  branchesIds?: string[];
71
104
  modifiers?: Modifier[];
72
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;
73
111
  isSellable?: boolean;
74
112
  usageTypes?: Array<"main_product" | "addon">;
75
113
  notes?: ProductNotes;
@@ -120,6 +158,8 @@ export interface CartItem {
120
158
  unit: UnitTypeValue;
121
159
  name?: NameType;
122
160
  selectedModifiers?: sModifier[];
161
+ /** Picked option-list choices (flavors, notes) — label-only, no price. */
162
+ selectedOptions?: sOption[];
123
163
  selectedVariant: VariantType | null;
124
164
  files?: FileType[];
125
165
  quantity: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopoflex-types",
3
- "version": "1.0.228",
3
+ "version": "1.0.229",
4
4
  "description": "Shared TypeScript types for Shopoflex applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",