@mohasinac/appkit 2.7.16 → 2.7.18
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/_internal/server/features/auctions/actions.js +1 -1
- package/dist/_internal/server/features/blog/actions.js +2 -2
- package/dist/_internal/server/features/brands/actions.js +2 -2
- package/dist/_internal/server/features/bundles/actions.d.ts +15 -0
- package/dist/_internal/server/features/bundles/actions.js +48 -0
- package/dist/_internal/server/features/bundles/index.d.ts +1 -0
- package/dist/_internal/server/features/bundles/index.js +1 -0
- package/dist/_internal/server/features/cart/actions.js +3 -3
- package/dist/_internal/server/features/checkout/actions.d.ts +4 -0
- package/dist/_internal/server/features/checkout/actions.js +23 -12
- package/dist/_internal/server/features/events/actions.js +3 -3
- package/dist/_internal/server/features/orders/actions.js +4 -4
- package/dist/_internal/server/features/payments/data.d.ts +5 -3
- package/dist/_internal/server/features/payments/data.js +13 -8
- package/dist/_internal/server/features/payments/index.d.ts +1 -1
- package/dist/_internal/server/features/payments/index.js +1 -1
- package/dist/_internal/server/features/pre-orders/actions.js +1 -1
- package/dist/_internal/server/features/products/actions.js +6 -6
- package/dist/_internal/server/features/promotions/actions.js +3 -3
- package/dist/_internal/shared/features/categories/bundle-config.d.ts +24 -0
- package/dist/_internal/shared/features/categories/bundle-config.js +28 -0
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +7 -0
- package/dist/_internal/shared/features/categories/bundle-copy.js +9 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +69 -19
- package/dist/_internal/shared/features/categories/bundle-schemas.js +20 -2
- package/dist/_internal/shared/features/checkout/config.d.ts +1 -1
- package/dist/_internal/shared/features/checkout/config.js +1 -1
- package/dist/_internal/shared/features/payments/config.d.ts +2 -1
- package/dist/_internal/shared/features/payments/config.js +2 -1
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/constants/field-names.d.ts +8 -1
- package/dist/constants/field-names.js +9 -2
- package/dist/constants/table-keys.d.ts +3 -0
- package/dist/constants/table-keys.js +3 -0
- package/dist/features/admin/components/AdminSiteSettingsView.js +17 -15
- package/dist/features/admin/components/DashboardStats.js +20 -12
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +18 -2
- package/dist/features/admin/components/analytics/AdminStatCard.d.ts +7 -1
- package/dist/features/admin/components/analytics/AdminStatCard.js +13 -2
- package/dist/features/admin/schemas/firestore.d.ts +18 -4
- package/dist/features/admin/schemas/firestore.js +11 -1
- package/dist/features/categories/components/BundleBuyNowCta.d.ts +3 -1
- package/dist/features/categories/components/BundleBuyNowCta.js +3 -3
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +1 -1
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +2 -1
- package/dist/features/categories/components/BundlesListView.d.ts +4 -1
- package/dist/features/categories/components/BundlesListView.js +2 -2
- package/dist/features/categories/components/CategoryBundlesListing.d.ts +4 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +9 -8
- package/dist/features/categories/schemas/firestore.d.ts +29 -1
- package/dist/features/checkout/actions/checkout-actions.d.ts +11 -0
- package/dist/features/checkout/actions/checkout-actions.js +26 -0
- package/dist/features/filters/FilterFacetSection.d.ts +6 -1
- package/dist/features/filters/FilterFacetSection.js +25 -2
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +4 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.js +9 -8
- package/dist/features/orders/actions/refund-actions.js +10 -7
- package/dist/features/orders/schemas/firestore.d.ts +16 -13
- package/dist/features/orders/schemas/firestore.js +6 -5
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +2 -1
- package/dist/features/products/components/AuctionsIndexListing.js +2 -1
- package/dist/features/products/components/ProductDetailPageView.js +3 -1
- package/dist/features/products/components/ProductDetailView.d.ts +3 -1
- package/dist/features/products/components/ProductDetailView.js +2 -2
- package/dist/features/products/components/ProductFilters.d.ts +10 -4
- package/dist/features/products/components/ProductFilters.js +20 -16
- package/dist/features/products/components/ProductGrid.js +3 -3
- package/dist/features/products/components/ProductsIndexListing.js +2 -1
- package/dist/features/products/constants/product-features.constants.js +5 -1
- package/dist/features/products/schemas/index.d.ts +2 -2
- package/dist/features/products/schemas/product-features.d.ts +1 -1
- package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
- package/dist/features/products/schemas/product-features.validators.js +4 -0
- package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +10 -4
- package/dist/features/shell/FormShell.js +1 -1
- package/dist/features/stores/components/StoreBundlesPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreBundlesPageView.js +2 -2
- package/dist/features/stores/components/StoresIndexListing.js +2 -1
- package/dist/features/wishlist/hooks/useWishlistCount.d.ts +2 -2
- package/dist/features/wishlist/hooks/useWishlistCount.js +5 -8
- package/dist/providers/db-firebase/admin-app-lite.js +8 -2
- package/dist/providers/db-firebase/admin.js +8 -2
- package/dist/seed/addresses-seed-data.js +24 -7
- package/dist/seed/cart-seed-data.d.ts +10 -10
- package/dist/seed/cart-seed-data.js +39 -2
- package/dist/seed/grouped-listings-seed-data.js +47 -0
- package/dist/seed/orders-seed-data.js +150 -0
- package/dist/seed/products-standard-seed-data.js +42 -0
- package/dist/seed/site-settings-seed-data.js +11 -4
- package/dist/seed/users-seed-data.js +1 -1
- package/dist/seed/wishlists-seed-data.js +7 -0
- package/dist/server-entry.d.ts +2 -1
- package/dist/server-entry.js +2 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +3 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Breadcrumb.style.css +1 -1
- package/dist/ui/components/ListingLayout.style.css +1 -1
- package/dist/ui/components/Select.style.css +1 -1
- package/dist/ui/components/SideDrawer.style.css +55 -12
- package/dist/ui/components/Typography.style.css +2 -2
- package/dist/ui/rich-text/RichText.style.css +4 -5
- package/package.json +1 -1
|
@@ -23,15 +23,16 @@ export declare const bundleQueryRuleSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
23
23
|
categorySlug: z.ZodOptional<z.ZodString>;
|
|
24
24
|
brandSlug: z.ZodOptional<z.ZodString>;
|
|
25
25
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
-
|
|
26
|
+
/** Eligible listing types for a dynamic bundle rule. */
|
|
27
|
+
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order", "prize-draw"]>>;
|
|
27
28
|
}, "strip", z.ZodTypeAny, {
|
|
28
29
|
tags?: string[] | undefined;
|
|
29
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
30
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
30
31
|
categorySlug?: string | undefined;
|
|
31
32
|
brandSlug?: string | undefined;
|
|
32
33
|
}, {
|
|
33
34
|
tags?: string[] | undefined;
|
|
34
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
35
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
35
36
|
categorySlug?: string | undefined;
|
|
36
37
|
brandSlug?: string | undefined;
|
|
37
38
|
}>;
|
|
@@ -40,7 +41,7 @@ export declare const bundleQueryRuleSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
40
41
|
}, "strip", z.ZodTypeAny, {
|
|
41
42
|
filter: {
|
|
42
43
|
tags?: string[] | undefined;
|
|
43
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
44
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
44
45
|
categorySlug?: string | undefined;
|
|
45
46
|
brandSlug?: string | undefined;
|
|
46
47
|
};
|
|
@@ -50,7 +51,7 @@ export declare const bundleQueryRuleSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
50
51
|
}, {
|
|
51
52
|
filter: {
|
|
52
53
|
tags?: string[] | undefined;
|
|
53
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
54
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
54
55
|
categorySlug?: string | undefined;
|
|
55
56
|
brandSlug?: string | undefined;
|
|
56
57
|
};
|
|
@@ -75,6 +76,11 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
75
76
|
name: z.ZodString;
|
|
76
77
|
slug: z.ZodOptional<z.ZodString>;
|
|
77
78
|
description: z.ZodOptional<z.ZodString>;
|
|
79
|
+
/**
|
|
80
|
+
* "special" — curated bundle; updates partOfBundleIds on member products.
|
|
81
|
+
* "brand" — brand discovery collection; does not touch product reverse pointers.
|
|
82
|
+
*/
|
|
83
|
+
bundleKind: z.ZodEnum<["special", "brand"]>;
|
|
78
84
|
bundlePriceInPaise: z.ZodNumber;
|
|
79
85
|
bundleQueryRule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
80
86
|
type: z.ZodLiteral<"static">;
|
|
@@ -91,15 +97,16 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
91
97
|
categorySlug: z.ZodOptional<z.ZodString>;
|
|
92
98
|
brandSlug: z.ZodOptional<z.ZodString>;
|
|
93
99
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
94
|
-
|
|
100
|
+
/** Eligible listing types for a dynamic bundle rule. */
|
|
101
|
+
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order", "prize-draw"]>>;
|
|
95
102
|
}, "strip", z.ZodTypeAny, {
|
|
96
103
|
tags?: string[] | undefined;
|
|
97
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
104
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
98
105
|
categorySlug?: string | undefined;
|
|
99
106
|
brandSlug?: string | undefined;
|
|
100
107
|
}, {
|
|
101
108
|
tags?: string[] | undefined;
|
|
102
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
109
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
103
110
|
categorySlug?: string | undefined;
|
|
104
111
|
brandSlug?: string | undefined;
|
|
105
112
|
}>;
|
|
@@ -108,7 +115,7 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
108
115
|
}, "strip", z.ZodTypeAny, {
|
|
109
116
|
filter: {
|
|
110
117
|
tags?: string[] | undefined;
|
|
111
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
118
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
112
119
|
categorySlug?: string | undefined;
|
|
113
120
|
brandSlug?: string | undefined;
|
|
114
121
|
};
|
|
@@ -118,7 +125,7 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
118
125
|
}, {
|
|
119
126
|
filter: {
|
|
120
127
|
tags?: string[] | undefined;
|
|
121
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
128
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
122
129
|
categorySlug?: string | undefined;
|
|
123
130
|
brandSlug?: string | undefined;
|
|
124
131
|
};
|
|
@@ -127,6 +134,17 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
127
134
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
128
135
|
}>]>;
|
|
129
136
|
bundleProductIds: z.ZodArray<z.ZodString, "many">;
|
|
137
|
+
/** Richer per-member metadata (draw counts for prize-draws). */
|
|
138
|
+
bundleItemDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
139
|
+
productId: z.ZodString;
|
|
140
|
+
drawCount: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
productId: string;
|
|
143
|
+
drawCount?: number | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
productId: string;
|
|
146
|
+
drawCount?: number | undefined;
|
|
147
|
+
}>, "many">>;
|
|
130
148
|
display: z.ZodOptional<z.ZodObject<{
|
|
131
149
|
coverImage: z.ZodOptional<z.ZodString>;
|
|
132
150
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -144,6 +162,7 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
144
162
|
}, "strip", z.ZodTypeAny, {
|
|
145
163
|
name: string;
|
|
146
164
|
bundleProductIds: string[];
|
|
165
|
+
bundleKind: "brand" | "special";
|
|
147
166
|
bundlePriceInPaise: number;
|
|
148
167
|
bundleQueryRule: {
|
|
149
168
|
type: "static";
|
|
@@ -151,7 +170,7 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
151
170
|
} | {
|
|
152
171
|
filter: {
|
|
153
172
|
tags?: string[] | undefined;
|
|
154
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
173
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
155
174
|
categorySlug?: string | undefined;
|
|
156
175
|
brandSlug?: string | undefined;
|
|
157
176
|
};
|
|
@@ -167,9 +186,14 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
167
186
|
isActive?: boolean | undefined;
|
|
168
187
|
description?: string | undefined;
|
|
169
188
|
slug?: string | undefined;
|
|
189
|
+
bundleItemDetails?: {
|
|
190
|
+
productId: string;
|
|
191
|
+
drawCount?: number | undefined;
|
|
192
|
+
}[] | undefined;
|
|
170
193
|
}, {
|
|
171
194
|
name: string;
|
|
172
195
|
bundleProductIds: string[];
|
|
196
|
+
bundleKind: "brand" | "special";
|
|
173
197
|
bundlePriceInPaise: number;
|
|
174
198
|
bundleQueryRule: {
|
|
175
199
|
type: "static";
|
|
@@ -177,7 +201,7 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
177
201
|
} | {
|
|
178
202
|
filter: {
|
|
179
203
|
tags?: string[] | undefined;
|
|
180
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
204
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
181
205
|
categorySlug?: string | undefined;
|
|
182
206
|
brandSlug?: string | undefined;
|
|
183
207
|
};
|
|
@@ -193,10 +217,15 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
193
217
|
isActive?: boolean | undefined;
|
|
194
218
|
description?: string | undefined;
|
|
195
219
|
slug?: string | undefined;
|
|
220
|
+
bundleItemDetails?: {
|
|
221
|
+
productId: string;
|
|
222
|
+
drawCount?: number | undefined;
|
|
223
|
+
}[] | undefined;
|
|
196
224
|
}>;
|
|
197
225
|
export declare const bundleUpdateSchema: z.ZodObject<{
|
|
198
226
|
name: z.ZodOptional<z.ZodString>;
|
|
199
227
|
description: z.ZodOptional<z.ZodString>;
|
|
228
|
+
bundleKind: z.ZodOptional<z.ZodEnum<["special", "brand"]>>;
|
|
200
229
|
bundlePriceInPaise: z.ZodOptional<z.ZodNumber>;
|
|
201
230
|
bundleQueryRule: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
202
231
|
type: z.ZodLiteral<"static">;
|
|
@@ -213,15 +242,16 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
213
242
|
categorySlug: z.ZodOptional<z.ZodString>;
|
|
214
243
|
brandSlug: z.ZodOptional<z.ZodString>;
|
|
215
244
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
216
|
-
|
|
245
|
+
/** Eligible listing types for a dynamic bundle rule. */
|
|
246
|
+
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order", "prize-draw"]>>;
|
|
217
247
|
}, "strip", z.ZodTypeAny, {
|
|
218
248
|
tags?: string[] | undefined;
|
|
219
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
249
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
220
250
|
categorySlug?: string | undefined;
|
|
221
251
|
brandSlug?: string | undefined;
|
|
222
252
|
}, {
|
|
223
253
|
tags?: string[] | undefined;
|
|
224
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
254
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
225
255
|
categorySlug?: string | undefined;
|
|
226
256
|
brandSlug?: string | undefined;
|
|
227
257
|
}>;
|
|
@@ -230,7 +260,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
230
260
|
}, "strip", z.ZodTypeAny, {
|
|
231
261
|
filter: {
|
|
232
262
|
tags?: string[] | undefined;
|
|
233
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
263
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
234
264
|
categorySlug?: string | undefined;
|
|
235
265
|
brandSlug?: string | undefined;
|
|
236
266
|
};
|
|
@@ -240,7 +270,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
240
270
|
}, {
|
|
241
271
|
filter: {
|
|
242
272
|
tags?: string[] | undefined;
|
|
243
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
273
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
244
274
|
categorySlug?: string | undefined;
|
|
245
275
|
brandSlug?: string | undefined;
|
|
246
276
|
};
|
|
@@ -249,6 +279,16 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
249
279
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
250
280
|
}>]>>;
|
|
251
281
|
bundleProductIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
282
|
+
bundleItemDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
283
|
+
productId: z.ZodString;
|
|
284
|
+
drawCount: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
productId: string;
|
|
287
|
+
drawCount?: number | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
productId: string;
|
|
290
|
+
drawCount?: number | undefined;
|
|
291
|
+
}>, "many">>;
|
|
252
292
|
display: z.ZodOptional<z.ZodObject<{
|
|
253
293
|
coverImage: z.ZodOptional<z.ZodString>;
|
|
254
294
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -273,6 +313,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
273
313
|
isActive?: boolean | undefined;
|
|
274
314
|
description?: string | undefined;
|
|
275
315
|
bundleProductIds?: string[] | undefined;
|
|
316
|
+
bundleKind?: "brand" | "special" | undefined;
|
|
276
317
|
bundlePriceInPaise?: number | undefined;
|
|
277
318
|
bundleQueryRule?: {
|
|
278
319
|
type: "static";
|
|
@@ -280,7 +321,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
280
321
|
} | {
|
|
281
322
|
filter: {
|
|
282
323
|
tags?: string[] | undefined;
|
|
283
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
324
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
284
325
|
categorySlug?: string | undefined;
|
|
285
326
|
brandSlug?: string | undefined;
|
|
286
327
|
};
|
|
@@ -288,6 +329,10 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
288
329
|
limit: number;
|
|
289
330
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
290
331
|
} | undefined;
|
|
332
|
+
bundleItemDetails?: {
|
|
333
|
+
productId: string;
|
|
334
|
+
drawCount?: number | undefined;
|
|
335
|
+
}[] | undefined;
|
|
291
336
|
}, {
|
|
292
337
|
name?: string | undefined;
|
|
293
338
|
display?: {
|
|
@@ -298,6 +343,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
298
343
|
isActive?: boolean | undefined;
|
|
299
344
|
description?: string | undefined;
|
|
300
345
|
bundleProductIds?: string[] | undefined;
|
|
346
|
+
bundleKind?: "brand" | "special" | undefined;
|
|
301
347
|
bundlePriceInPaise?: number | undefined;
|
|
302
348
|
bundleQueryRule?: {
|
|
303
349
|
type: "static";
|
|
@@ -305,7 +351,7 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
305
351
|
} | {
|
|
306
352
|
filter: {
|
|
307
353
|
tags?: string[] | undefined;
|
|
308
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
354
|
+
listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
|
|
309
355
|
categorySlug?: string | undefined;
|
|
310
356
|
brandSlug?: string | undefined;
|
|
311
357
|
};
|
|
@@ -313,6 +359,10 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
313
359
|
limit: number;
|
|
314
360
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
315
361
|
} | undefined;
|
|
362
|
+
bundleItemDetails?: {
|
|
363
|
+
productId: string;
|
|
364
|
+
drawCount?: number | undefined;
|
|
365
|
+
}[] | undefined;
|
|
316
366
|
}>;
|
|
317
367
|
export type BundleCreateBody = z.infer<typeof bundleCreateSchema>;
|
|
318
368
|
export type BundleUpdateBody = z.infer<typeof bundleUpdateSchema>;
|
|
@@ -8,8 +8,16 @@
|
|
|
8
8
|
* client too if the admin form ever pre-validates.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { BUNDLE_MAX_ITEMS } from "./bundle-config";
|
|
11
|
+
import { BUNDLE_MAX_ITEMS, BUNDLE_DRAW_COUNT_MAX, BUNDLE_KIND_SPECIAL, BUNDLE_KIND_BRAND, } from "./bundle-config";
|
|
12
12
|
const productIdsSchema = z.array(z.string().min(1)).min(0).max(BUNDLE_MAX_ITEMS);
|
|
13
|
+
/**
|
|
14
|
+
* Per-member detail — mirrors BundleItemDetail in the Firestore schema.
|
|
15
|
+
* `drawCount` is required when the member is a prize-draw listing (1–BUNDLE_DRAW_COUNT_MAX).
|
|
16
|
+
*/
|
|
17
|
+
const bundleItemDetailSchema = z.object({
|
|
18
|
+
productId: z.string().min(1),
|
|
19
|
+
drawCount: z.number().int().min(1).max(BUNDLE_DRAW_COUNT_MAX).optional(),
|
|
20
|
+
});
|
|
13
21
|
export const bundleQueryRuleSchema = z.discriminatedUnion("type", [
|
|
14
22
|
z.object({
|
|
15
23
|
type: z.literal("static"),
|
|
@@ -21,7 +29,8 @@ export const bundleQueryRuleSchema = z.discriminatedUnion("type", [
|
|
|
21
29
|
categorySlug: z.string().optional(),
|
|
22
30
|
brandSlug: z.string().optional(),
|
|
23
31
|
tags: z.array(z.string()).optional(),
|
|
24
|
-
|
|
32
|
+
/** Eligible listing types for a dynamic bundle rule. */
|
|
33
|
+
listingType: z.enum(["standard", "pre-order", "prize-draw"]).optional(),
|
|
25
34
|
}),
|
|
26
35
|
orderBy: z
|
|
27
36
|
.enum(["price-asc", "price-desc", "createdAt-desc"])
|
|
@@ -38,18 +47,27 @@ export const bundleCreateSchema = z.object({
|
|
|
38
47
|
name: z.string().min(2).max(120),
|
|
39
48
|
slug: z.string().min(2).max(120).optional(),
|
|
40
49
|
description: z.string().max(2000).optional(),
|
|
50
|
+
/**
|
|
51
|
+
* "special" — curated bundle; updates partOfBundleIds on member products.
|
|
52
|
+
* "brand" — brand discovery collection; does not touch product reverse pointers.
|
|
53
|
+
*/
|
|
54
|
+
bundleKind: z.enum([BUNDLE_KIND_SPECIAL, BUNDLE_KIND_BRAND]),
|
|
41
55
|
bundlePriceInPaise: z.number().int().min(100),
|
|
42
56
|
bundleQueryRule: bundleQueryRuleSchema,
|
|
43
57
|
bundleProductIds: productIdsSchema,
|
|
58
|
+
/** Richer per-member metadata (draw counts for prize-draws). */
|
|
59
|
+
bundleItemDetails: z.array(bundleItemDetailSchema).optional(),
|
|
44
60
|
display: bundleDisplaySchema.optional(),
|
|
45
61
|
isActive: z.boolean().optional(),
|
|
46
62
|
});
|
|
47
63
|
export const bundleUpdateSchema = z.object({
|
|
48
64
|
name: z.string().min(2).max(120).optional(),
|
|
49
65
|
description: z.string().max(2000).optional(),
|
|
66
|
+
bundleKind: z.enum([BUNDLE_KIND_SPECIAL, BUNDLE_KIND_BRAND]).optional(),
|
|
50
67
|
bundlePriceInPaise: z.number().int().min(100).optional(),
|
|
51
68
|
bundleQueryRule: bundleQueryRuleSchema.optional(),
|
|
52
69
|
bundleProductIds: productIdsSchema.optional(),
|
|
70
|
+
bundleItemDetails: z.array(bundleItemDetailSchema).optional(),
|
|
53
71
|
display: bundleDisplaySchema.optional(),
|
|
54
72
|
isActive: z.boolean().optional(),
|
|
55
73
|
});
|
|
@@ -4,5 +4,5 @@ export declare const CHECKOUT_DEFAULT_COMMISSIONS: {
|
|
|
4
4
|
readonly platformShippingPercent: 10;
|
|
5
5
|
readonly platformShippingFixedMin: 50;
|
|
6
6
|
};
|
|
7
|
-
export declare const CHECKOUT_PAYMENT_METHODS: readonly ["cod", "online", "upi_manual"];
|
|
7
|
+
export declare const CHECKOUT_PAYMENT_METHODS: readonly ["cod", "online", "upi_manual", "admin_bypass"];
|
|
8
8
|
export type CheckoutPaymentMethod = (typeof CHECKOUT_PAYMENT_METHODS)[number];
|
|
@@ -4,4 +4,4 @@ export const CHECKOUT_DEFAULT_COMMISSIONS = {
|
|
|
4
4
|
platformShippingPercent: 10,
|
|
5
5
|
platformShippingFixedMin: 50,
|
|
6
6
|
};
|
|
7
|
-
export const CHECKOUT_PAYMENT_METHODS = ["cod", "online", "upi_manual"];
|
|
7
|
+
export const CHECKOUT_PAYMENT_METHODS = ["cod", "online", "upi_manual", "admin_bypass"];
|
|
@@ -34,12 +34,12 @@ export declare const productInputSchema: z.ZodObject<{
|
|
|
34
34
|
availableQuantity: number;
|
|
35
35
|
mainImage: string;
|
|
36
36
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
37
|
+
features?: string[] | undefined;
|
|
37
38
|
description?: string | undefined;
|
|
38
39
|
seoTitle?: string | undefined;
|
|
39
40
|
seoDescription?: string | undefined;
|
|
40
41
|
seoKeywords?: string[] | undefined;
|
|
41
42
|
brandSlug?: string | undefined;
|
|
42
|
-
features?: string[] | undefined;
|
|
43
43
|
shippingInfo?: string | undefined;
|
|
44
44
|
returnPolicy?: string | undefined;
|
|
45
45
|
insurance?: boolean | undefined;
|
|
@@ -55,6 +55,7 @@ export declare const productInputSchema: z.ZodObject<{
|
|
|
55
55
|
currency?: string | undefined;
|
|
56
56
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
57
57
|
tags?: string[] | undefined;
|
|
58
|
+
features?: string[] | undefined;
|
|
58
59
|
images?: string[] | undefined;
|
|
59
60
|
description?: string | undefined;
|
|
60
61
|
seoTitle?: string | undefined;
|
|
@@ -63,7 +64,6 @@ export declare const productInputSchema: z.ZodObject<{
|
|
|
63
64
|
brandSlug?: string | undefined;
|
|
64
65
|
stockQuantity?: number | undefined;
|
|
65
66
|
availableQuantity?: number | undefined;
|
|
66
|
-
features?: string[] | undefined;
|
|
67
67
|
shippingInfo?: string | undefined;
|
|
68
68
|
returnPolicy?: string | undefined;
|
|
69
69
|
insurance?: boolean | undefined;
|
|
@@ -103,6 +103,7 @@ export declare const productUpdateSchema: z.ZodObject<{
|
|
|
103
103
|
price?: number | undefined;
|
|
104
104
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
105
105
|
tags?: string[] | undefined;
|
|
106
|
+
features?: string[] | undefined;
|
|
106
107
|
images?: string[] | undefined;
|
|
107
108
|
description?: string | undefined;
|
|
108
109
|
seoTitle?: string | undefined;
|
|
@@ -112,7 +113,6 @@ export declare const productUpdateSchema: z.ZodObject<{
|
|
|
112
113
|
stockQuantity?: number | undefined;
|
|
113
114
|
availableQuantity?: number | undefined;
|
|
114
115
|
mainImage?: string | undefined;
|
|
115
|
-
features?: string[] | undefined;
|
|
116
116
|
shippingInfo?: string | undefined;
|
|
117
117
|
returnPolicy?: string | undefined;
|
|
118
118
|
insurance?: boolean | undefined;
|
|
@@ -127,6 +127,7 @@ export declare const productUpdateSchema: z.ZodObject<{
|
|
|
127
127
|
price?: number | undefined;
|
|
128
128
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
129
129
|
tags?: string[] | undefined;
|
|
130
|
+
features?: string[] | undefined;
|
|
130
131
|
images?: string[] | undefined;
|
|
131
132
|
description?: string | undefined;
|
|
132
133
|
seoTitle?: string | undefined;
|
|
@@ -136,7 +137,6 @@ export declare const productUpdateSchema: z.ZodObject<{
|
|
|
136
137
|
stockQuantity?: number | undefined;
|
|
137
138
|
availableQuantity?: number | undefined;
|
|
138
139
|
mainImage?: string | undefined;
|
|
139
|
-
features?: string[] | undefined;
|
|
140
140
|
shippingInfo?: string | undefined;
|
|
141
141
|
returnPolicy?: string | undefined;
|
|
142
142
|
insurance?: boolean | undefined;
|
|
@@ -194,12 +194,12 @@ export declare const auctionInputSchema: z.ZodObject<{
|
|
|
194
194
|
startingBid: number;
|
|
195
195
|
autoExtendable: boolean;
|
|
196
196
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
197
|
+
features?: string[] | undefined;
|
|
197
198
|
description?: string | undefined;
|
|
198
199
|
seoTitle?: string | undefined;
|
|
199
200
|
seoDescription?: string | undefined;
|
|
200
201
|
seoKeywords?: string[] | undefined;
|
|
201
202
|
brandSlug?: string | undefined;
|
|
202
|
-
features?: string[] | undefined;
|
|
203
203
|
shippingInfo?: string | undefined;
|
|
204
204
|
returnPolicy?: string | undefined;
|
|
205
205
|
insurance?: boolean | undefined;
|
|
@@ -223,6 +223,7 @@ export declare const auctionInputSchema: z.ZodObject<{
|
|
|
223
223
|
currency?: string | undefined;
|
|
224
224
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
225
225
|
tags?: string[] | undefined;
|
|
226
|
+
features?: string[] | undefined;
|
|
226
227
|
images?: string[] | undefined;
|
|
227
228
|
description?: string | undefined;
|
|
228
229
|
seoTitle?: string | undefined;
|
|
@@ -231,7 +232,6 @@ export declare const auctionInputSchema: z.ZodObject<{
|
|
|
231
232
|
brandSlug?: string | undefined;
|
|
232
233
|
stockQuantity?: number | undefined;
|
|
233
234
|
availableQuantity?: number | undefined;
|
|
234
|
-
features?: string[] | undefined;
|
|
235
235
|
shippingInfo?: string | undefined;
|
|
236
236
|
returnPolicy?: string | undefined;
|
|
237
237
|
insurance?: boolean | undefined;
|
|
@@ -292,12 +292,12 @@ export declare const preOrderInputSchema: z.ZodObject<{
|
|
|
292
292
|
preOrderDeliveryDate: string;
|
|
293
293
|
preOrderCancellable: boolean;
|
|
294
294
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
295
|
+
features?: string[] | undefined;
|
|
295
296
|
description?: string | undefined;
|
|
296
297
|
seoTitle?: string | undefined;
|
|
297
298
|
seoDescription?: string | undefined;
|
|
298
299
|
seoKeywords?: string[] | undefined;
|
|
299
300
|
brandSlug?: string | undefined;
|
|
300
|
-
features?: string[] | undefined;
|
|
301
301
|
shippingInfo?: string | undefined;
|
|
302
302
|
returnPolicy?: string | undefined;
|
|
303
303
|
insurance?: boolean | undefined;
|
|
@@ -318,6 +318,7 @@ export declare const preOrderInputSchema: z.ZodObject<{
|
|
|
318
318
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
319
319
|
tags?: string[] | undefined;
|
|
320
320
|
preOrderProductionStatus?: "upcoming" | "in_production" | "ready_to_ship" | undefined;
|
|
321
|
+
features?: string[] | undefined;
|
|
321
322
|
images?: string[] | undefined;
|
|
322
323
|
description?: string | undefined;
|
|
323
324
|
seoTitle?: string | undefined;
|
|
@@ -326,7 +327,6 @@ export declare const preOrderInputSchema: z.ZodObject<{
|
|
|
326
327
|
brandSlug?: string | undefined;
|
|
327
328
|
stockQuantity?: number | undefined;
|
|
328
329
|
availableQuantity?: number | undefined;
|
|
329
|
-
features?: string[] | undefined;
|
|
330
330
|
shippingInfo?: string | undefined;
|
|
331
331
|
returnPolicy?: string | undefined;
|
|
332
332
|
insurance?: boolean | undefined;
|
|
@@ -407,7 +407,9 @@ export declare const CATEGORY_FIELDS: {
|
|
|
407
407
|
readonly DISPLAY_ORDER: "displayOrder";
|
|
408
408
|
readonly IS_ACTIVE: "isActive";
|
|
409
409
|
readonly CATEGORY_TYPE: "categoryType";
|
|
410
|
+
readonly BUNDLE_KIND: "bundleKind";
|
|
410
411
|
readonly BUNDLE_PRODUCT_IDS: "bundleProductIds";
|
|
412
|
+
readonly BUNDLE_ITEM_DETAILS: "bundleItemDetails";
|
|
411
413
|
readonly BUNDLE_STOCK_STATUS: "bundleStockStatus";
|
|
412
414
|
readonly BUNDLE_QUERY_RESOLVED_AT: "bundleQueryResolvedAt";
|
|
413
415
|
readonly DISPLAY: "display";
|
|
@@ -766,11 +768,16 @@ export declare const SITE_SETTINGS_FIELDS: {
|
|
|
766
768
|
};
|
|
767
769
|
readonly COMMISSIONS: "commissions";
|
|
768
770
|
readonly COMMISSION_FIELDS: {
|
|
769
|
-
readonly
|
|
771
|
+
readonly PLATFORM_FEE_PERCENT: "commissions.platformFeePercent";
|
|
772
|
+
readonly GST_PERCENT: "commissions.gstPercent";
|
|
773
|
+
readonly MINIMUM_TRANSACTION_FEE: "commissions.minimumTransactionFee";
|
|
774
|
+
readonly GATEWAY_FEE_PERCENT: "commissions.gatewayFeePercent";
|
|
770
775
|
readonly COD_DEPOSIT_PERCENT: "commissions.codDepositPercent";
|
|
771
776
|
readonly SELLER_SHIPPING_FIXED: "commissions.sellerShippingFixed";
|
|
772
777
|
readonly PLATFORM_SHIPPING_PERCENT: "commissions.platformShippingPercent";
|
|
773
778
|
readonly PLATFORM_SHIPPING_FIXED_MIN: "commissions.platformShippingFixedMin";
|
|
779
|
+
readonly PAYOUT_HOLD_DAYS: "commissions.payoutHoldDays";
|
|
780
|
+
readonly MIN_PAYOUT_AMOUNT: "commissions.minPayoutAmount";
|
|
774
781
|
};
|
|
775
782
|
readonly SOCIAL_LINKS: "socialLinks";
|
|
776
783
|
readonly EMAIL_SETTINGS: "emailSettings";
|
|
@@ -448,8 +448,10 @@ export const CATEGORY_FIELDS = {
|
|
|
448
448
|
IS_ACTIVE: "isActive",
|
|
449
449
|
// SB-UNI — categoryType discriminator (category/brand/sublisting/bundle)
|
|
450
450
|
CATEGORY_TYPE: "categoryType",
|
|
451
|
-
// Bundle-specific fields (SB3)
|
|
451
|
+
// Bundle-specific fields (SB3 + bundle-eligibility rules)
|
|
452
|
+
BUNDLE_KIND: "bundleKind",
|
|
452
453
|
BUNDLE_PRODUCT_IDS: "bundleProductIds",
|
|
454
|
+
BUNDLE_ITEM_DETAILS: "bundleItemDetails",
|
|
453
455
|
BUNDLE_STOCK_STATUS: "bundleStockStatus",
|
|
454
456
|
BUNDLE_QUERY_RESOLVED_AT: "bundleQueryResolvedAt",
|
|
455
457
|
DISPLAY: "display",
|
|
@@ -862,11 +864,16 @@ export const SITE_SETTINGS_FIELDS = {
|
|
|
862
864
|
},
|
|
863
865
|
COMMISSIONS: "commissions",
|
|
864
866
|
COMMISSION_FIELDS: {
|
|
865
|
-
|
|
867
|
+
PLATFORM_FEE_PERCENT: "commissions.platformFeePercent",
|
|
868
|
+
GST_PERCENT: "commissions.gstPercent",
|
|
869
|
+
MINIMUM_TRANSACTION_FEE: "commissions.minimumTransactionFee",
|
|
870
|
+
GATEWAY_FEE_PERCENT: "commissions.gatewayFeePercent",
|
|
866
871
|
COD_DEPOSIT_PERCENT: "commissions.codDepositPercent",
|
|
867
872
|
SELLER_SHIPPING_FIXED: "commissions.sellerShippingFixed",
|
|
868
873
|
PLATFORM_SHIPPING_PERCENT: "commissions.platformShippingPercent",
|
|
869
874
|
PLATFORM_SHIPPING_FIXED_MIN: "commissions.platformShippingFixedMin",
|
|
875
|
+
PAYOUT_HOLD_DAYS: "commissions.payoutHoldDays",
|
|
876
|
+
MIN_PAYOUT_AMOUNT: "commissions.minPayoutAmount",
|
|
870
877
|
},
|
|
871
878
|
SOCIAL_LINKS: "socialLinks",
|
|
872
879
|
EMAIL_SETTINGS: "emailSettings",
|
|
@@ -38,6 +38,9 @@ export declare const TABLE_KEYS: {
|
|
|
38
38
|
readonly CATEGORY_SLUG: "categorySlug";
|
|
39
39
|
readonly SHOW_UNREAD: "showUnread";
|
|
40
40
|
readonly TYPE: "type";
|
|
41
|
+
readonly IS_PART_OF_BUNDLE: "isPartOfBundle";
|
|
42
|
+
readonly SUBLISTING_CATEGORY: "sublistingCategory";
|
|
43
|
+
readonly FEATURES: "features";
|
|
41
44
|
};
|
|
42
45
|
export type TableKey = (typeof TABLE_KEYS)[keyof typeof TABLE_KEYS];
|
|
43
46
|
export declare const VIEW_MODE: {
|
|
@@ -38,6 +38,9 @@ export const TABLE_KEYS = {
|
|
|
38
38
|
CATEGORY_SLUG: "categorySlug",
|
|
39
39
|
SHOW_UNREAD: "showUnread",
|
|
40
40
|
TYPE: "type",
|
|
41
|
+
IS_PART_OF_BUNDLE: "isPartOfBundle",
|
|
42
|
+
SUBLISTING_CATEGORY: "sublistingCategory",
|
|
43
|
+
FEATURES: "features",
|
|
41
44
|
};
|
|
42
45
|
export const VIEW_MODE = {
|
|
43
46
|
GRID: "grid",
|