@mohasinac/appkit 3.0.4 → 3.0.6
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/data.d.ts +2 -4
- package/dist/_internal/server/features/auctions/data.js +3 -9
- package/dist/_internal/server/features/classified/adapters.d.ts +2 -15
- package/dist/_internal/server/features/classified/adapters.js +2 -17
- package/dist/_internal/server/features/classified/data.d.ts +1 -6
- package/dist/_internal/server/features/classified/data.js +2 -10
- package/dist/_internal/server/features/digital-code/adapters.d.ts +2 -15
- package/dist/_internal/server/features/digital-code/adapters.js +2 -17
- package/dist/_internal/server/features/digital-code/data.d.ts +1 -6
- package/dist/_internal/server/features/digital-code/data.js +2 -10
- package/dist/_internal/server/features/live/adapters.d.ts +2 -15
- package/dist/_internal/server/features/live/adapters.js +2 -17
- package/dist/_internal/server/features/live/data.d.ts +1 -6
- package/dist/_internal/server/features/live/data.js +2 -10
- package/dist/_internal/server/features/pre-orders/data.d.ts +2 -4
- package/dist/_internal/server/features/pre-orders/data.js +3 -9
- package/dist/_internal/server/features/prize-draws/actions.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/actions.js +22 -0
- package/dist/_internal/server/features/prize-draws/data.d.ts +1 -17
- package/dist/_internal/server/features/prize-draws/data.js +2 -20
- package/dist/_internal/server/features/prize-draws/index.d.ts +3 -1
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/service.d.ts +3 -0
- package/dist/_internal/server/features/prize-draws/service.js +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.d.ts +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.js +20 -0
- package/dist/_internal/server/features/shared/listing-data-factory.d.ts +9 -0
- package/dist/_internal/server/features/shared/listing-data-factory.js +33 -0
- package/dist/_internal/server/features/stores/data.d.ts +3 -14
- package/dist/_internal/server/features/stores/data.js +6 -44
- package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
- package/dist/_internal/shared/features/cart/schema.js +3 -0
- package/dist/_internal/shared/listing-types/_registry.js +2 -0
- package/dist/_internal/shared/listing-types/auction/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/auction/schema.js +7 -1
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/classified/schema.js +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.js +7 -1
- package/dist/_internal/shared/listing-types/live/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/live/schema.js +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.js +7 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.js +13 -1
- package/dist/_internal/shared/listing-types/standard/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/standard/schema.js +4 -1
- package/dist/_internal/shared/types/base-document.d.ts +15 -0
- package/dist/_internal/shared/types/base-document.js +1 -0
- package/dist/_internal/shared/types/index.d.ts +2 -0
- package/dist/_internal/shared/types/index.js +1 -0
- package/dist/client.d.ts +4 -4
- package/dist/client.js +2 -2
- package/dist/constants/api-endpoints.d.ts +12 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/features/addresses/schemas/firestore.d.ts +2 -4
- package/dist/features/admin/components/AdminFulfillmentView.d.ts +6 -0
- package/dist/features/admin/components/AdminFulfillmentView.js +107 -0
- package/dist/features/admin/components/AdminProductEditorView.js +21 -9
- package/dist/features/admin/components/AdminProductsView.js +3 -0
- package/dist/features/admin/components/DataListingView.d.ts +1 -0
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +3 -8
- package/dist/features/auctions/schemas/firestore.d.ts +2 -4
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/schemas/firestore.d.ts +2 -4
- package/dist/features/blog/schemas/index.d.ts +4 -4
- package/dist/features/cart/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/schemas/index.d.ts +4 -4
- package/dist/features/events/schemas/firestore.d.ts +2 -4
- package/dist/features/events/schemas/index.d.ts +2 -2
- package/dist/features/faq/schemas/firestore.d.ts +2 -4
- package/dist/features/faq/schemas/index.d.ts +2 -2
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/homepage/schemas/firestore.d.ts +4 -12
- package/dist/features/homepage/schemas/index.d.ts +2 -2
- package/dist/features/messages/schemas/firestore.d.ts +2 -4
- package/dist/features/messages/schemas/index.d.ts +2 -2
- package/dist/features/orders/repository/orders.repository.d.ts +5 -0
- package/dist/features/orders/repository/orders.repository.js +26 -0
- package/dist/features/orders/schemas/firestore.d.ts +9 -5
- package/dist/features/orders/schemas/firestore.js +3 -0
- package/dist/features/payments/schemas/firestore.d.ts +2 -4
- package/dist/features/pre-orders/schemas/index.d.ts +2 -2
- package/dist/features/products/constants/action-defs.d.ts +16 -0
- package/dist/features/products/constants/action-defs.js +16 -0
- package/dist/features/products/constants/listing-tabs.d.ts +48 -0
- package/dist/features/products/constants/listing-tabs.js +12 -0
- package/dist/features/products/repository/products.repository.d.ts +37 -0
- package/dist/features/products/repository/products.repository.js +28 -1
- package/dist/features/products/schemas/firestore.d.ts +8 -6
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +6 -6
- package/dist/features/products/types/index.d.ts +2 -0
- package/dist/features/promotions/schemas/firestore.d.ts +2 -4
- package/dist/features/promotions/schemas/index.d.ts +4 -4
- package/dist/features/reviews/schemas/firestore.d.ts +2 -4
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/scams/schemas/firestore.d.ts +2 -4
- package/dist/features/scams/schemas/index.d.ts +4 -4
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/seller/components/BarcodeField.d.ts +17 -0
- package/dist/features/seller/components/BarcodeField.js +30 -0
- package/dist/features/seller/components/FulfillmentView.d.ts +5 -0
- package/dist/features/seller/components/FulfillmentView.js +120 -0
- package/dist/features/seller/components/PrintCenterView.d.ts +3 -1
- package/dist/features/seller/components/PrintCenterView.js +52 -4
- package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
- package/dist/features/seller/components/SellerProductShell.js +2 -1
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/store-extensions/schemas/firestore.d.ts +12 -44
- package/dist/features/stores/components/StoreClassifiedsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreClassifiedsListing.js +48 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.js +20 -0
- package/dist/features/stores/components/StoreDetailLayoutView.js +23 -2
- package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +5 -0
- package/dist/features/stores/components/StoreDigitalCodesListing.js +48 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.js +20 -0
- package/dist/features/stores/components/StoreLiveItemsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreLiveItemsListing.js +48 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.js +20 -0
- package/dist/features/stores/components/index.d.ts +9 -0
- package/dist/features/stores/components/index.js +3 -0
- package/dist/features/stores/schemas/firestore.d.ts +2 -4
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/features/support/schemas/firestore.d.ts +2 -4
- package/dist/features/support/schemas/index.d.ts +2 -2
- package/dist/next/routing/route-map.d.ts +11 -0
- package/dist/next/routing/route-map.js +5 -0
- package/dist/schemas/registry.d.ts +24 -24
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -1
- package/dist/seed/products-preorders-seed-data.d.ts +2 -1
- package/dist/seed/products-standard-seed-data.js +8 -0
- package/dist/server-entry.d.ts +3 -0
- package/dist/server-entry.js +3 -0
- package/dist/server.d.ts +4 -4
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/utils/id-generators.d.ts +8 -0
- package/dist/utils/id-generators.js +14 -0
- package/package.json +2 -1
|
@@ -45,8 +45,8 @@ export declare const preorderItemSchema: z.ZodObject<{
|
|
|
45
45
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
46
46
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
47
47
|
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
id: string;
|
|
49
48
|
slug: string;
|
|
49
|
+
id: string;
|
|
50
50
|
name: string;
|
|
51
51
|
active: boolean;
|
|
52
52
|
isFeatured: boolean;
|
|
@@ -66,8 +66,8 @@ export declare const preorderItemSchema: z.ZodObject<{
|
|
|
66
66
|
franchise?: string | undefined;
|
|
67
67
|
preorderShipDate?: string | undefined;
|
|
68
68
|
}, {
|
|
69
|
-
id: string;
|
|
70
69
|
slug: string;
|
|
70
|
+
id: string;
|
|
71
71
|
name: string;
|
|
72
72
|
salePrice: number;
|
|
73
73
|
regularPrice: number;
|
|
@@ -96,16 +96,32 @@ export declare const DETAIL_ACTIONS: {
|
|
|
96
96
|
readonly auction: readonly ["place-bid", "buy-now-auction", "watch-auction", "share"];
|
|
97
97
|
/** Pre-order: reserve, wishlist, share */
|
|
98
98
|
readonly preorder: readonly ["reserve-now", "add-to-wishlist", "share"];
|
|
99
|
+
/** Prize draw: enter, wishlist, share */
|
|
100
|
+
readonly "prize-draw": readonly ["enter-prize-draw", "add-to-wishlist", "share"];
|
|
101
|
+
/** Classified: offer, share */
|
|
102
|
+
readonly classified: readonly ["make-offer", "share"];
|
|
103
|
+
/** Digital code: buy now, share */
|
|
104
|
+
readonly "digital-code": readonly ["buy-now", "share"];
|
|
105
|
+
/** Live item: buy now, wishlist, share */
|
|
106
|
+
readonly live: readonly ["buy-now", "add-to-wishlist", "share"];
|
|
99
107
|
};
|
|
100
108
|
export declare const MOBILE_PRIMARY_ACTIONS: {
|
|
101
109
|
readonly product: readonly ["buy-now", "add-to-cart"];
|
|
102
110
|
readonly auction: readonly ["place-bid", "buy-now-auction"];
|
|
103
111
|
readonly preorder: readonly ["reserve-now"];
|
|
112
|
+
readonly "prize-draw": readonly ["enter-prize-draw"];
|
|
113
|
+
readonly classified: readonly ["make-offer"];
|
|
114
|
+
readonly "digital-code": readonly ["buy-now"];
|
|
115
|
+
readonly live: readonly ["buy-now"];
|
|
104
116
|
};
|
|
105
117
|
export declare const LISTING_BULK_ACTIONS: {
|
|
106
118
|
readonly products: readonly ["add-to-cart", "add-to-wishlist", "compare"];
|
|
107
119
|
readonly auctions: readonly ["watch-auction", "unwatch-auction", "compare"];
|
|
108
120
|
readonly preorders: readonly ["add-to-cart", "add-to-wishlist", "compare"];
|
|
121
|
+
readonly prizeDraws: readonly ActionId[];
|
|
122
|
+
readonly classifieds: readonly ActionId[];
|
|
123
|
+
readonly digitalCodes: readonly ActionId[];
|
|
124
|
+
readonly live: readonly ActionId[];
|
|
109
125
|
readonly stores: ActionId[];
|
|
110
126
|
};
|
|
111
127
|
/** Maximum number of items the Compare overlay (BK3) supports at once. */
|
|
@@ -137,18 +137,34 @@ export const DETAIL_ACTIONS = {
|
|
|
137
137
|
auction: [ACTION_ID.PLACE_BID, ACTION_ID.BUY_NOW_AUCTION, ACTION_ID.WATCH_AUCTION, ACTION_ID.SHARE],
|
|
138
138
|
/** Pre-order: reserve, wishlist, share */
|
|
139
139
|
preorder: [ACTION_ID.RESERVE_NOW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
140
|
+
/** Prize draw: enter, wishlist, share */
|
|
141
|
+
"prize-draw": [ACTION_ID.ENTER_PRIZE_DRAW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
142
|
+
/** Classified: offer, share */
|
|
143
|
+
classified: [ACTION_ID.MAKE_OFFER, ACTION_ID.SHARE],
|
|
144
|
+
/** Digital code: buy now, share */
|
|
145
|
+
"digital-code": [ACTION_ID.BUY_NOW, ACTION_ID.SHARE],
|
|
146
|
+
/** Live item: buy now, wishlist, share */
|
|
147
|
+
live: [ACTION_ID.BUY_NOW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
140
148
|
};
|
|
141
149
|
// Mobile bottom bar — 1–2 primary CTAs only (limited horizontal space)
|
|
142
150
|
export const MOBILE_PRIMARY_ACTIONS = {
|
|
143
151
|
product: [ACTION_ID.BUY_NOW, ACTION_ID.ADD_TO_CART],
|
|
144
152
|
auction: [ACTION_ID.PLACE_BID, ACTION_ID.BUY_NOW_AUCTION],
|
|
145
153
|
preorder: [ACTION_ID.RESERVE_NOW],
|
|
154
|
+
"prize-draw": [ACTION_ID.ENTER_PRIZE_DRAW],
|
|
155
|
+
classified: [ACTION_ID.MAKE_OFFER],
|
|
156
|
+
"digital-code": [ACTION_ID.BUY_NOW],
|
|
157
|
+
live: [ACTION_ID.BUY_NOW],
|
|
146
158
|
};
|
|
147
159
|
// Listing page bulk actions — shown in the bottom action bar when items are selected
|
|
148
160
|
export const LISTING_BULK_ACTIONS = {
|
|
149
161
|
products: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
150
162
|
auctions: [ACTION_ID.WATCH_AUCTION, ACTION_ID.UNWATCH_AUCTION, ACTION_ID.COMPARE],
|
|
151
163
|
preorders: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
164
|
+
prizeDraws: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
165
|
+
classifieds: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
166
|
+
digitalCodes: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
167
|
+
live: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
152
168
|
stores: [ACTION_ID.COMPARE],
|
|
153
169
|
};
|
|
154
170
|
/** Maximum number of items the Compare overlay (BK3) supports at once. */
|
|
@@ -40,6 +40,18 @@ export declare const CATEGORY_PAGE_TABS: readonly [{
|
|
|
40
40
|
readonly id: "bundles";
|
|
41
41
|
readonly label: "Bundles";
|
|
42
42
|
readonly collection: "bundles";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "classifieds";
|
|
45
|
+
readonly label: "Classifieds";
|
|
46
|
+
readonly listingType: "classified";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "digital-codes";
|
|
49
|
+
readonly label: "Digital Codes";
|
|
50
|
+
readonly listingType: "digital-code";
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "live";
|
|
53
|
+
readonly label: "Live Items";
|
|
54
|
+
readonly listingType: "live";
|
|
43
55
|
}, {
|
|
44
56
|
readonly id: "stores";
|
|
45
57
|
readonly label: "Stores";
|
|
@@ -67,6 +79,18 @@ export declare const STORE_PAGE_TABS: readonly [{
|
|
|
67
79
|
readonly id: "bundles";
|
|
68
80
|
readonly label: "Bundles";
|
|
69
81
|
readonly collection: "bundles";
|
|
82
|
+
}, {
|
|
83
|
+
readonly id: "classifieds";
|
|
84
|
+
readonly label: "Classifieds";
|
|
85
|
+
readonly listingType: "classified";
|
|
86
|
+
}, {
|
|
87
|
+
readonly id: "digital-codes";
|
|
88
|
+
readonly label: "Digital Codes";
|
|
89
|
+
readonly listingType: "digital-code";
|
|
90
|
+
}, {
|
|
91
|
+
readonly id: "live";
|
|
92
|
+
readonly label: "Live Items";
|
|
93
|
+
readonly listingType: "live";
|
|
70
94
|
}];
|
|
71
95
|
export type StoreTabId = (typeof STORE_PAGE_TABS)[number]["id"];
|
|
72
96
|
/** Tabs shown on the seller-dashboard listings view + admin products list. */
|
|
@@ -89,6 +113,18 @@ export declare const SELLER_LISTING_TABS: readonly [{
|
|
|
89
113
|
readonly id: "prize-draws";
|
|
90
114
|
readonly label: "Prize Draws";
|
|
91
115
|
readonly listingType: "prize-draw";
|
|
116
|
+
}, {
|
|
117
|
+
readonly id: "classifieds";
|
|
118
|
+
readonly label: "Classifieds";
|
|
119
|
+
readonly listingType: "classified";
|
|
120
|
+
}, {
|
|
121
|
+
readonly id: "digital-codes";
|
|
122
|
+
readonly label: "Digital Codes";
|
|
123
|
+
readonly listingType: "digital-code";
|
|
124
|
+
}, {
|
|
125
|
+
readonly id: "live";
|
|
126
|
+
readonly label: "Live Items";
|
|
127
|
+
readonly listingType: "live";
|
|
92
128
|
}];
|
|
93
129
|
export type SellerListingTabId = (typeof SELLER_LISTING_TABS)[number]["id"];
|
|
94
130
|
/** Tabs shown on `/search` results. */
|
|
@@ -115,5 +151,17 @@ export declare const SEARCH_RESULT_TABS: readonly [{
|
|
|
115
151
|
readonly id: "bundles";
|
|
116
152
|
readonly label: "Bundles";
|
|
117
153
|
readonly collection: "bundles";
|
|
154
|
+
}, {
|
|
155
|
+
readonly id: "classifieds";
|
|
156
|
+
readonly label: "Classifieds";
|
|
157
|
+
readonly listingType: "classified";
|
|
158
|
+
}, {
|
|
159
|
+
readonly id: "digital-codes";
|
|
160
|
+
readonly label: "Digital Codes";
|
|
161
|
+
readonly listingType: "digital-code";
|
|
162
|
+
}, {
|
|
163
|
+
readonly id: "live";
|
|
164
|
+
readonly label: "Live Items";
|
|
165
|
+
readonly listingType: "live";
|
|
118
166
|
}];
|
|
119
167
|
export type SearchTabId = (typeof SEARCH_RESULT_TABS)[number]["id"];
|
|
@@ -15,6 +15,9 @@ export const CATEGORY_PAGE_TABS = [
|
|
|
15
15
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
16
16
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
17
17
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
18
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
19
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
20
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
18
21
|
{ id: "stores", label: "Stores", entity: "stores" },
|
|
19
22
|
];
|
|
20
23
|
/** Tabs shown on the public `/stores/[slug]` nav bar. */
|
|
@@ -24,6 +27,9 @@ export const STORE_PAGE_TABS = [
|
|
|
24
27
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
25
28
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
26
29
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
30
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
31
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
32
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
27
33
|
];
|
|
28
34
|
/** Tabs shown on the seller-dashboard listings view + admin products list. */
|
|
29
35
|
export const SELLER_LISTING_TABS = [
|
|
@@ -32,6 +38,9 @@ export const SELLER_LISTING_TABS = [
|
|
|
32
38
|
{ id: "auctions", label: "Auctions", listingType: "auction" },
|
|
33
39
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
34
40
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
41
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
42
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
43
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
35
44
|
];
|
|
36
45
|
/** Tabs shown on `/search` results. */
|
|
37
46
|
export const SEARCH_RESULT_TABS = [
|
|
@@ -41,4 +50,7 @@ export const SEARCH_RESULT_TABS = [
|
|
|
41
50
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
42
51
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
43
52
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
53
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
54
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
55
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
44
56
|
];
|
|
@@ -18,6 +18,7 @@ export declare class ProductRepository extends BaseRepository<ProductDocument> {
|
|
|
18
18
|
findByStatus(status: ProductStatus): Promise<ProductDocument[]>;
|
|
19
19
|
findFeatured(): Promise<ProductDocument[]>;
|
|
20
20
|
findByCategory(category: string): Promise<ProductDocument[]>;
|
|
21
|
+
findByBarcodeId(barcodeId: string): Promise<ProductDocument | null>;
|
|
21
22
|
findBySlug(slug: string): Promise<ProductDocument | undefined>;
|
|
22
23
|
findByIdOrSlug(idOrSlug: string): Promise<ProductDocument | undefined>;
|
|
23
24
|
/**
|
|
@@ -206,6 +207,42 @@ export declare class ProductRepository extends BaseRepository<ProductDocument> {
|
|
|
206
207
|
canFilter: boolean;
|
|
207
208
|
canSort: boolean;
|
|
208
209
|
};
|
|
210
|
+
"classified.meetupArea": {
|
|
211
|
+
canFilter: boolean;
|
|
212
|
+
canSort: boolean;
|
|
213
|
+
};
|
|
214
|
+
"classified.acceptsShipping": {
|
|
215
|
+
canFilter: boolean;
|
|
216
|
+
canSort: boolean;
|
|
217
|
+
};
|
|
218
|
+
"classified.negotiable": {
|
|
219
|
+
canFilter: boolean;
|
|
220
|
+
canSort: boolean;
|
|
221
|
+
};
|
|
222
|
+
"digitalCode.codeDeliveryMethod": {
|
|
223
|
+
canFilter: boolean;
|
|
224
|
+
canSort: boolean;
|
|
225
|
+
};
|
|
226
|
+
"digitalCode.codesAvailable": {
|
|
227
|
+
canFilter: boolean;
|
|
228
|
+
canSort: boolean;
|
|
229
|
+
};
|
|
230
|
+
"liveItem.species": {
|
|
231
|
+
canFilter: boolean;
|
|
232
|
+
canSort: boolean;
|
|
233
|
+
};
|
|
234
|
+
"liveItem.sex": {
|
|
235
|
+
canFilter: boolean;
|
|
236
|
+
canSort: boolean;
|
|
237
|
+
};
|
|
238
|
+
"liveItem.jurisdictionAllowed": {
|
|
239
|
+
canFilter: boolean;
|
|
240
|
+
canSort: boolean;
|
|
241
|
+
};
|
|
242
|
+
"liveItem.cites": {
|
|
243
|
+
canFilter: boolean;
|
|
244
|
+
canSort: boolean;
|
|
245
|
+
};
|
|
209
246
|
};
|
|
210
247
|
/**
|
|
211
248
|
* Virtual filter aliases — callers can pass `f=listingType==auction` for
|
|
@@ -3,7 +3,7 @@ import { increment, serverTimestamp } from "../../../contracts/field-ops";
|
|
|
3
3
|
import { DatabaseError } from "../../../errors";
|
|
4
4
|
import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase";
|
|
5
5
|
import { cacheManager } from "../../../core";
|
|
6
|
-
import { generateUniqueId, slugify, buildSearchTokens, tokenizeQuery } from "../../../utils";
|
|
6
|
+
import { generateUniqueId, slugify, buildSearchTokens, tokenizeQuery, generateBarcodeId } from "../../../utils";
|
|
7
7
|
import { PRODUCT_COLLECTION, ProductStatusValues, } from "../schemas";
|
|
8
8
|
import { PRODUCT_FIELDS } from "../../../constants/field-names";
|
|
9
9
|
/**
|
|
@@ -20,11 +20,17 @@ const SIEVE_CLAUSE_LT_AUCTION = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_
|
|
|
20
20
|
const SIEVE_CLAUSE_LT_PREORDER = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRE_ORDER}`;
|
|
21
21
|
const SIEVE_CLAUSE_LT_STANDARD = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.STANDARD}`;
|
|
22
22
|
const SIEVE_CLAUSE_LT_PRIZE_DRAW = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRIZE_DRAW}`;
|
|
23
|
+
const SIEVE_CLAUSE_LT_CLASSIFIED = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.CLASSIFIED}`;
|
|
24
|
+
const SIEVE_CLAUSE_LT_DIGITAL_CODE = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.DIGITAL_CODE}`;
|
|
25
|
+
const SIEVE_CLAUSE_LT_LIVE = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.LIVE}`;
|
|
23
26
|
const LISTING_KIND_ALIAS_MAP = {
|
|
24
27
|
standard: LISTING_TYPE_VALUES.STANDARD,
|
|
25
28
|
auction: LISTING_TYPE_VALUES.AUCTION,
|
|
26
29
|
"pre-order": LISTING_TYPE_VALUES.PRE_ORDER,
|
|
27
30
|
"prize-draw": LISTING_TYPE_VALUES.PRIZE_DRAW,
|
|
31
|
+
classified: LISTING_TYPE_VALUES.CLASSIFIED,
|
|
32
|
+
"digital-code": LISTING_TYPE_VALUES.DIGITAL_CODE,
|
|
33
|
+
live: LISTING_TYPE_VALUES.LIVE,
|
|
28
34
|
// Legacy → canonical.
|
|
29
35
|
product: LISTING_TYPE_VALUES.STANDARD,
|
|
30
36
|
preorder: LISTING_TYPE_VALUES.PRE_ORDER,
|
|
@@ -105,8 +111,10 @@ export class ProductRepository extends BaseRepository {
|
|
|
105
111
|
return false;
|
|
106
112
|
}
|
|
107
113
|
});
|
|
114
|
+
const barcodeId = input.barcodeId ?? await generateBarcodeId(id);
|
|
108
115
|
const productData = {
|
|
109
116
|
...input,
|
|
117
|
+
barcodeId,
|
|
110
118
|
slug: id,
|
|
111
119
|
availableQuantity: input.stockQuantity,
|
|
112
120
|
searchTokens: buildProductSearchTokens(input),
|
|
@@ -136,6 +144,10 @@ export class ProductRepository extends BaseRepository {
|
|
|
136
144
|
.get();
|
|
137
145
|
return snap.docs.map((d) => this.mapDoc(d));
|
|
138
146
|
}
|
|
147
|
+
async findByBarcodeId(barcodeId) {
|
|
148
|
+
const docs = await this.findBy("barcodeId", barcodeId);
|
|
149
|
+
return docs[0] ?? null;
|
|
150
|
+
}
|
|
139
151
|
async findBySlug(slug) {
|
|
140
152
|
const key = this.cacheKeyBySlug(slug);
|
|
141
153
|
const cached = cacheManager.get(key);
|
|
@@ -486,6 +498,15 @@ ProductRepository.SIEVE_FIELDS = {
|
|
|
486
498
|
currency: { canFilter: true, canSort: false },
|
|
487
499
|
freeShipping: { canFilter: true, canSort: false },
|
|
488
500
|
searchTokens: { canFilter: true, canSort: false },
|
|
501
|
+
"classified.meetupArea": { canFilter: true, canSort: false },
|
|
502
|
+
"classified.acceptsShipping": { canFilter: true, canSort: false },
|
|
503
|
+
"classified.negotiable": { canFilter: true, canSort: false },
|
|
504
|
+
"digitalCode.codeDeliveryMethod": { canFilter: true, canSort: false },
|
|
505
|
+
"digitalCode.codesAvailable": { canFilter: true, canSort: true },
|
|
506
|
+
"liveItem.species": { canFilter: true, canSort: false },
|
|
507
|
+
"liveItem.sex": { canFilter: true, canSort: false },
|
|
508
|
+
"liveItem.jurisdictionAllowed": { canFilter: true, canSort: false },
|
|
509
|
+
"liveItem.cites": { canFilter: true, canSort: false },
|
|
489
510
|
};
|
|
490
511
|
/**
|
|
491
512
|
* Virtual filter aliases — callers can pass `f=listingType==auction` for
|
|
@@ -540,6 +561,12 @@ ProductRepository.FILTER_ALIASES = {
|
|
|
540
561
|
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PREORDER].join(",");
|
|
541
562
|
case "publicPrizeDraws":
|
|
542
563
|
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PRIZE_DRAW].join(",");
|
|
564
|
+
case "publicClassifieds":
|
|
565
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_CLASSIFIED].join(",");
|
|
566
|
+
case "publicDigitalCodes":
|
|
567
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_DIGITAL_CODE].join(",");
|
|
568
|
+
case "publicLive":
|
|
569
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_LIVE].join(",");
|
|
543
570
|
case "published":
|
|
544
571
|
return SIEVE_CLAUSE_PUBLISHED;
|
|
545
572
|
default:
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type GenerateProductIdInput, type GenerateAuctionIdInput, type GeneratePreOrderIdInput } from "../../../utils/id-generators";
|
|
5
5
|
import type { ProductStatus, ListingType } from "../types";
|
|
6
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
6
7
|
export interface ProductVideoField {
|
|
7
8
|
url: string;
|
|
8
9
|
thumbnailUrl: string;
|
|
@@ -103,8 +104,7 @@ export interface ProductLiveItemMeta {
|
|
|
103
104
|
/** CITES permit number (Appendix I/II species). */
|
|
104
105
|
cites?: string;
|
|
105
106
|
}
|
|
106
|
-
export interface ProductDocument {
|
|
107
|
-
id: string;
|
|
107
|
+
export interface ProductDocument extends BaseDocument {
|
|
108
108
|
title: string;
|
|
109
109
|
description: string;
|
|
110
110
|
slug?: string;
|
|
@@ -264,9 +264,11 @@ export interface ProductDocument {
|
|
|
264
264
|
shelf: string;
|
|
265
265
|
bin: string;
|
|
266
266
|
};
|
|
267
|
+
/** Scannable barcode identifier linking this listing to a physical stickered item.
|
|
268
|
+
* Auto-generated as `LIR-{8-char-hex}` on product creation when not supplied.
|
|
269
|
+
* Override by scanning a pre-printed sticker during the create/edit flow. */
|
|
270
|
+
barcodeId?: string;
|
|
267
271
|
searchTokens?: string[];
|
|
268
|
-
createdAt: Date;
|
|
269
|
-
updatedAt: Date;
|
|
270
272
|
}
|
|
271
273
|
/**
|
|
272
274
|
* Single prize within a prize-draw listing. A draw can have between 3 and 16
|
|
@@ -294,10 +296,10 @@ export declare const ProductStatusValues: {
|
|
|
294
296
|
readonly ARCHIVED: "archived";
|
|
295
297
|
};
|
|
296
298
|
export declare const PRODUCT_COLLECTION: "products";
|
|
297
|
-
export declare const PRODUCT_INDEXED_FIELDS: readonly ["storeId", "status", "category", "featured", "listingType", "isPromoted", "isOnSale", "isSold", "searchTokens", "createdAt"];
|
|
299
|
+
export declare const PRODUCT_INDEXED_FIELDS: readonly ["storeId", "status", "category", "featured", "listingType", "isPromoted", "isOnSale", "isSold", "searchTokens", "createdAt", "barcodeId"];
|
|
298
300
|
export declare const DEFAULT_PRODUCT_DATA: Partial<ProductDocument>;
|
|
299
301
|
export declare const PRODUCT_PUBLIC_FIELDS: readonly ["id", "title", "description", "category", "subcategory", "brand", "price", "currency", "stockQuantity", "availableQuantity", "images", "status", "storeName", "featured", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "listingType", "auctionEndDate", "startingBid", "currentBid", "bidCount", "reservePrice", "buyNowPrice", "minBidIncrement", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderCurrentCount", "preOrderProductionStatus", "preOrderCancellable", "condition", "insurance", "insuranceCost", "shippingPaidBy", "isPromoted", "isOnSale", "isSold", "slug", "seoTitle", "seoDescription", "seoKeywords", "viewCount", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle", "createdAt"];
|
|
300
|
-
export declare const PRODUCT_UPDATABLE_FIELDS: readonly ["title", "description", "category", "subcategory", "brand", "price", "stockQuantity", "images", "status", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "pickupAddressId", "condition", "insurance", "shippingPaidBy", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "reservePrice", "buyNowPrice", "minBidIncrement", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "listingType", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderProductionStatus", "preOrderCancellable", "isOnSale", "isSold", "seoTitle", "seoDescription", "seoKeywords", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle"];
|
|
302
|
+
export declare const PRODUCT_UPDATABLE_FIELDS: readonly ["title", "description", "category", "subcategory", "brand", "price", "stockQuantity", "images", "status", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "pickupAddressId", "condition", "insurance", "shippingPaidBy", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "reservePrice", "buyNowPrice", "minBidIncrement", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "listingType", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderProductionStatus", "preOrderCancellable", "isOnSale", "isSold", "seoTitle", "seoDescription", "seoKeywords", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle", "barcodeId"];
|
|
301
303
|
export type ProductCreateInput = Omit<ProductDocument, "id" | "createdAt" | "updatedAt" | "availableQuantity" | "bidCount" | "currentBid" | "auctionOriginalEndDate">;
|
|
302
304
|
export type ProductUpdateInput = Partial<Pick<ProductDocument, (typeof PRODUCT_UPDATABLE_FIELDS)[number]>>;
|
|
303
305
|
export type ProductAdminUpdateInput = Partial<Omit<ProductDocument, "id" | "createdAt">>;
|
|
@@ -23,6 +23,7 @@ export const PRODUCT_INDEXED_FIELDS = [
|
|
|
23
23
|
"isSold",
|
|
24
24
|
"searchTokens",
|
|
25
25
|
"createdAt",
|
|
26
|
+
"barcodeId",
|
|
26
27
|
];
|
|
27
28
|
export const DEFAULT_PRODUCT_DATA = {
|
|
28
29
|
status: "draft",
|
|
@@ -173,6 +174,7 @@ export const PRODUCT_UPDATABLE_FIELDS = [
|
|
|
173
174
|
"groupParentSlug",
|
|
174
175
|
"groupChildSlugs",
|
|
175
176
|
"groupTitle",
|
|
177
|
+
"barcodeId",
|
|
176
178
|
];
|
|
177
179
|
// ── SB-UNI-N 2026-05-15 — Digital-code pool subcollection ───────────────────
|
|
178
180
|
// Codes live at `products/{productId}/codes/{codeId}` — seller-only write,
|
|
@@ -263,8 +263,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
263
263
|
unit?: string | undefined;
|
|
264
264
|
}>, "many">>;
|
|
265
265
|
}, "strip", z.ZodTypeAny, {
|
|
266
|
-
id: string;
|
|
267
266
|
title: string;
|
|
267
|
+
id: string;
|
|
268
268
|
text?: string | undefined;
|
|
269
269
|
fields?: {
|
|
270
270
|
value: string;
|
|
@@ -273,8 +273,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
273
273
|
unit?: string | undefined;
|
|
274
274
|
}[] | undefined;
|
|
275
275
|
}, {
|
|
276
|
-
id: string;
|
|
277
276
|
title: string;
|
|
277
|
+
id: string;
|
|
278
278
|
text?: string | undefined;
|
|
279
279
|
fields?: {
|
|
280
280
|
value: string;
|
|
@@ -285,9 +285,9 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
285
285
|
}>, "many">>;
|
|
286
286
|
}, "strip", z.ZodTypeAny, {
|
|
287
287
|
status: "draft" | "published" | "archived" | "in_review";
|
|
288
|
-
id: string;
|
|
289
288
|
title: string;
|
|
290
289
|
price: number;
|
|
290
|
+
id: string;
|
|
291
291
|
currency?: string | undefined;
|
|
292
292
|
video?: {
|
|
293
293
|
url: string;
|
|
@@ -356,8 +356,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
356
356
|
unit?: string | undefined;
|
|
357
357
|
}[] | undefined;
|
|
358
358
|
customSections?: {
|
|
359
|
-
id: string;
|
|
360
359
|
title: string;
|
|
360
|
+
id: string;
|
|
361
361
|
text?: string | undefined;
|
|
362
362
|
fields?: {
|
|
363
363
|
value: string;
|
|
@@ -414,9 +414,9 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
414
414
|
publishedAt?: string | undefined;
|
|
415
415
|
}, {
|
|
416
416
|
status: "draft" | "published" | "archived" | "in_review";
|
|
417
|
-
id: string;
|
|
418
417
|
title: string;
|
|
419
418
|
price: number;
|
|
419
|
+
id: string;
|
|
420
420
|
currency?: string | undefined;
|
|
421
421
|
video?: {
|
|
422
422
|
url: string;
|
|
@@ -485,8 +485,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
485
485
|
unit?: string | undefined;
|
|
486
486
|
}[] | undefined;
|
|
487
487
|
customSections?: {
|
|
488
|
-
id: string;
|
|
489
488
|
title: string;
|
|
489
|
+
id: string;
|
|
490
490
|
text?: string | undefined;
|
|
491
491
|
fields?: {
|
|
492
492
|
value: string;
|
|
@@ -149,6 +149,8 @@ export interface ProductItem {
|
|
|
149
149
|
shelf: string;
|
|
150
150
|
bin: string;
|
|
151
151
|
};
|
|
152
|
+
/** Scannable barcode ID linking this listing to a physical stickered item. */
|
|
153
|
+
barcodeId?: string;
|
|
152
154
|
}
|
|
153
155
|
export interface ProductListResponse {
|
|
154
156
|
items: ProductItem[];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Coupons/Promotions Firestore Document Types & Constants
|
|
3
3
|
*/
|
|
4
4
|
import type { CouponType } from "../types";
|
|
5
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
5
6
|
export interface DiscountConfig {
|
|
6
7
|
value: number;
|
|
7
8
|
maxDiscount?: number;
|
|
@@ -41,8 +42,7 @@ export interface CouponStats {
|
|
|
41
42
|
totalRevenue: number;
|
|
42
43
|
totalDiscount: number;
|
|
43
44
|
}
|
|
44
|
-
export interface CouponDocument {
|
|
45
|
-
id: string;
|
|
45
|
+
export interface CouponDocument extends BaseDocument {
|
|
46
46
|
code: string;
|
|
47
47
|
name: string;
|
|
48
48
|
description: string;
|
|
@@ -58,8 +58,6 @@ export interface CouponDocument {
|
|
|
58
58
|
validity: ValidityConfig;
|
|
59
59
|
restrictions: RestrictionsConfig;
|
|
60
60
|
createdBy: string;
|
|
61
|
-
createdAt: Date;
|
|
62
|
-
updatedAt: Date;
|
|
63
61
|
stats: CouponStats;
|
|
64
62
|
}
|
|
65
63
|
export interface CouponUsageDocument {
|
|
@@ -277,8 +277,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
277
277
|
createdAt: string | Date | z.objectOutputType<{
|
|
278
278
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
279
279
|
}, z.ZodTypeAny, "passthrough">;
|
|
280
|
-
id: string;
|
|
281
280
|
description: string;
|
|
281
|
+
id: string;
|
|
282
282
|
updatedAt: string | Date | z.objectOutputType<{
|
|
283
283
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
284
284
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -336,8 +336,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
336
336
|
createdAt: string | Date | z.objectInputType<{
|
|
337
337
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
338
338
|
}, z.ZodTypeAny, "passthrough">;
|
|
339
|
-
id: string;
|
|
340
339
|
description: string;
|
|
340
|
+
id: string;
|
|
341
341
|
updatedAt: string | Date | z.objectInputType<{
|
|
342
342
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
343
343
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -758,8 +758,8 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
758
758
|
code: string;
|
|
759
759
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
760
760
|
createdAt: string;
|
|
761
|
-
id: string;
|
|
762
761
|
description: string;
|
|
762
|
+
id: string;
|
|
763
763
|
updatedAt: string;
|
|
764
764
|
name: string;
|
|
765
765
|
scope: "seller" | "admin";
|
|
@@ -782,8 +782,8 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
782
782
|
code: string;
|
|
783
783
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
784
784
|
createdAt: string;
|
|
785
|
-
id: string;
|
|
786
785
|
description: string;
|
|
786
|
+
id: string;
|
|
787
787
|
updatedAt: string;
|
|
788
788
|
name: string;
|
|
789
789
|
scope: "seller" | "admin";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Reviews Firestore Document Types & Constants
|
|
3
3
|
*/
|
|
4
4
|
import type { ReviewStatus } from "../types";
|
|
5
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
5
6
|
/** Runtime-accessible review status values — use instead of bare string literals. */
|
|
6
7
|
export declare const ReviewStatusValues: {
|
|
7
8
|
readonly PENDING: "pending";
|
|
@@ -15,8 +16,7 @@ export interface ReviewVideoField {
|
|
|
15
16
|
trimStart?: number;
|
|
16
17
|
trimEnd?: number;
|
|
17
18
|
}
|
|
18
|
-
export interface ReviewDocument {
|
|
19
|
-
id: string;
|
|
19
|
+
export interface ReviewDocument extends BaseDocument {
|
|
20
20
|
productId: string;
|
|
21
21
|
productTitle: string;
|
|
22
22
|
storeId?: string;
|
|
@@ -44,8 +44,6 @@ export interface ReviewDocument {
|
|
|
44
44
|
isAnonymous?: boolean;
|
|
45
45
|
sellerReply?: string;
|
|
46
46
|
sellerRepliedAt?: Date;
|
|
47
|
-
createdAt: Date;
|
|
48
|
-
updatedAt: Date;
|
|
49
47
|
approvedAt?: Date;
|
|
50
48
|
rejectedAt?: Date;
|
|
51
49
|
}
|
|
@@ -103,8 +103,8 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
103
103
|
createdAt: string | Date | z.objectOutputType<{
|
|
104
104
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
105
105
|
}, z.ZodTypeAny, "passthrough">;
|
|
106
|
-
id: string;
|
|
107
106
|
title: string;
|
|
107
|
+
id: string;
|
|
108
108
|
updatedAt: string | Date | z.objectOutputType<{
|
|
109
109
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
110
110
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -150,8 +150,8 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
150
150
|
createdAt: string | Date | z.objectInputType<{
|
|
151
151
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
152
152
|
}, z.ZodTypeAny, "passthrough">;
|
|
153
|
-
id: string;
|
|
154
153
|
title: string;
|
|
154
|
+
id: string;
|
|
155
155
|
updatedAt: string | Date | z.objectInputType<{
|
|
156
156
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
157
157
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* - SCAMMER_MATCH_FIELDS lists the Firestore array-contains fields used for this query
|
|
26
26
|
*/
|
|
27
27
|
import type { ScamType } from "../constants/scam-types";
|
|
28
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
28
29
|
export declare const ScammerStatusValues: {
|
|
29
30
|
readonly PENDING_REVIEW: "pending_review";
|
|
30
31
|
readonly VERIFIED: "verified";
|
|
@@ -83,8 +84,7 @@ export interface ScammerSocialMedia {
|
|
|
83
84
|
handle: string;
|
|
84
85
|
url?: string;
|
|
85
86
|
}
|
|
86
|
-
export interface ScammerDocument {
|
|
87
|
-
id: string;
|
|
87
|
+
export interface ScammerDocument extends BaseDocument {
|
|
88
88
|
/** URL-safe slug — used in /scams/[slug]. Same as id. */
|
|
89
89
|
seoSlug: string;
|
|
90
90
|
/**
|
|
@@ -159,8 +159,6 @@ export interface ScammerDocument {
|
|
|
159
159
|
* Reset to false when all contests are reviewed.
|
|
160
160
|
*/
|
|
161
161
|
isContested?: boolean;
|
|
162
|
-
createdAt: Date;
|
|
163
|
-
updatedAt: Date;
|
|
164
162
|
}
|
|
165
163
|
/**
|
|
166
164
|
* One victim's report linked to an existing scammer profile.
|
|
@@ -83,9 +83,9 @@ export declare const scammerFirestoreSchema: z.ZodObject<{
|
|
|
83
83
|
createdAt: string | Date | z.objectOutputType<{
|
|
84
84
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
85
85
|
}, z.ZodTypeAny, "passthrough">;
|
|
86
|
-
id: string;
|
|
87
86
|
description: string;
|
|
88
87
|
tags: string[];
|
|
88
|
+
id: string;
|
|
89
89
|
updatedAt: string | Date | z.objectOutputType<{
|
|
90
90
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
91
91
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -123,9 +123,9 @@ export declare const scammerFirestoreSchema: z.ZodObject<{
|
|
|
123
123
|
createdAt: string | Date | z.objectInputType<{
|
|
124
124
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
125
125
|
}, z.ZodTypeAny, "passthrough">;
|
|
126
|
-
id: string;
|
|
127
126
|
description: string;
|
|
128
127
|
tags: string[];
|
|
128
|
+
id: string;
|
|
129
129
|
updatedAt: string | Date | z.objectInputType<{
|
|
130
130
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
131
131
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -195,8 +195,8 @@ export declare const scammerIncidentFirestoreSchema: z.ZodObject<{
|
|
|
195
195
|
createdAt: string | Date | z.objectOutputType<{
|
|
196
196
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
197
197
|
}, z.ZodTypeAny, "passthrough">;
|
|
198
|
-
id: string;
|
|
199
198
|
description: string;
|
|
199
|
+
id: string;
|
|
200
200
|
scamType: string;
|
|
201
201
|
reportedBy: string;
|
|
202
202
|
scammerId: string;
|
|
@@ -218,8 +218,8 @@ export declare const scammerIncidentFirestoreSchema: z.ZodObject<{
|
|
|
218
218
|
createdAt: string | Date | z.objectInputType<{
|
|
219
219
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
220
220
|
}, z.ZodTypeAny, "passthrough">;
|
|
221
|
-
id: string;
|
|
222
221
|
description: string;
|
|
222
|
+
id: string;
|
|
223
223
|
scamType: string;
|
|
224
224
|
reportedBy: string;
|
|
225
225
|
scammerId: string;
|