@mohasinac/appkit 2.7.53 → 2.7.54
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/client/features/layout/DashboardLayoutClient.js +1 -1
- package/dist/_internal/server/jobs/core/auctionSettlement.js +6 -3
- package/dist/_internal/server/jobs/core/bundleStockSync.js +9 -7
- package/dist/_internal/server/jobs/core/onProductStockChange.d.ts +12 -3
- package/dist/_internal/server/jobs/core/onProductStockChange.js +12 -13
- package/dist/_internal/server/jobs/core/onProductWrite.js +1 -3
- package/dist/_internal/server/jobs/handlers/onProductStockChange.js +11 -2
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/constants/field-names.d.ts +4 -3
- package/dist/constants/field-names.js +8 -8
- package/dist/errors/error-codes.d.ts +3 -0
- package/dist/errors/error-codes.js +3 -0
- package/dist/errors/messages.d.ts +3 -0
- package/dist/errors/messages.js +3 -0
- package/dist/features/admin/types/product.types.d.ts +1 -1
- package/dist/features/admin/types/product.types.js +2 -3
- package/dist/features/auctions/actions/bid-actions.d.ts +9 -0
- package/dist/features/auctions/actions/bid-actions.js +61 -0
- package/dist/features/auctions/components/AuctionDetailPageView.d.ts +2 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +5 -4
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +3 -1
- package/dist/features/auctions/components/PlaceBidFormClient.js +32 -2
- package/dist/features/auctions/types/index.d.ts +1 -1
- package/dist/features/layout/AppLayoutShell.js +1 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +2 -11
- package/dist/features/products/api/[id]/route.js +4 -8
- package/dist/features/products/api/route.js +1 -3
- package/dist/features/products/components/AuctionsIndexListing.js +3 -11
- package/dist/features/products/components/PrizeDrawsIndexListing.js +2 -10
- package/dist/features/products/components/ProductFilters.d.ts +33 -9
- package/dist/features/products/components/ProductFilters.js +6 -29
- package/dist/features/products/components/ProductForm.js +2 -3
- package/dist/features/products/constants/sieve.d.ts +162 -0
- package/dist/features/products/constants/sieve.js +95 -0
- package/dist/features/products/repository/products.repository.d.ts +5 -0
- package/dist/features/products/repository/products.repository.js +23 -3
- package/dist/features/products/schemas/firestore.d.ts +4 -4
- package/dist/features/products/schemas/firestore.js +2 -3
- package/dist/features/products/schemas/index.d.ts +6 -6
- package/dist/features/products/schemas/index.js +2 -6
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/seller/actions/offer-actions.js +2 -2
- package/dist/features/wishlist/types/index.d.ts +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -4
- package/dist/seed/addresses-seed-data.d.ts +2 -18
- package/dist/seed/addresses-seed-data.js +137 -203
- package/dist/seed/bids-seed-data.d.ts +2 -8
- package/dist/seed/bids-seed-data.js +172 -648
- package/dist/seed/blog-posts-seed-data.d.ts +0 -5
- package/dist/seed/blog-posts-seed-data.js +341 -596
- package/dist/seed/carousel-slides-seed-data.d.ts +0 -5
- package/dist/seed/carousel-slides-seed-data.js +61 -192
- package/dist/seed/carousels-seed-data.js +18 -1
- package/dist/seed/cart-seed-data.d.ts +1 -18
- package/dist/seed/cart-seed-data.js +116 -293
- package/dist/seed/categories-seed-data.d.ts +0 -6
- package/dist/seed/categories-seed-data.js +1409 -1537
- package/dist/seed/claimed-coupons-seed-data.d.ts +0 -11
- package/dist/seed/claimed-coupons-seed-data.js +32 -29
- package/dist/seed/conversations-seed-data.d.ts +0 -6
- package/dist/seed/conversations-seed-data.js +132 -280
- package/dist/seed/coupon-usage-seed-data.d.ts +0 -16
- package/dist/seed/coupon-usage-seed-data.js +30 -44
- package/dist/seed/coupons-seed-data.d.ts +0 -6
- package/dist/seed/coupons-seed-data.js +141 -489
- package/dist/seed/events-seed-data.d.ts +0 -6
- package/dist/seed/events-seed-data.js +201 -379
- package/dist/seed/faq-seed-data.d.ts +0 -14
- package/dist/seed/faq-seed-data.js +609 -1184
- package/dist/seed/grouped-listings-seed-data.d.ts +119 -8
- package/dist/seed/grouped-listings-seed-data.js +148 -233
- package/dist/seed/history-seed-data.d.ts +0 -7
- package/dist/seed/history-seed-data.js +50 -54
- package/dist/seed/homepage-sections-seed-data.d.ts +0 -5
- package/dist/seed/homepage-sections-seed-data.js +83 -175
- package/dist/seed/index.d.ts +1 -1
- package/dist/seed/index.js +1 -1
- package/dist/seed/manifest.js +2 -2
- package/dist/seed/notifications-seed-data.d.ts +0 -6
- package/dist/seed/notifications-seed-data.js +309 -196
- package/dist/seed/offers-seed-data.d.ts +0 -8
- package/dist/seed/offers-seed-data.js +118 -197
- package/dist/seed/orders-seed-data.d.ts +2 -8
- package/dist/seed/orders-seed-data.js +248 -1510
- package/dist/seed/payouts-seed-data.d.ts +0 -6
- package/dist/seed/payouts-seed-data.js +102 -441
- package/dist/seed/products-auctions-seed-data.d.ts +1 -14
- package/dist/seed/products-auctions-seed-data.js +612 -1084
- package/dist/seed/products-preorders-seed-data.d.ts +119 -14
- package/dist/seed/products-preorders-seed-data.js +154 -455
- package/dist/seed/products-standard-seed-data.d.ts +1 -15
- package/dist/seed/products-standard-seed-data.js +1355 -4128
- package/dist/seed/reviews-seed-data.d.ts +2 -8
- package/dist/seed/reviews-seed-data.js +99 -1182
- package/dist/seed/scammers-seed-data.d.ts +0 -15
- package/dist/seed/scammers-seed-data.js +36 -37
- package/dist/seed/sessions-seed-data.d.ts +0 -13
- package/dist/seed/sessions-seed-data.js +58 -335
- package/dist/seed/site-settings-seed-data.d.ts +0 -4
- package/dist/seed/site-settings-seed-data.js +61 -52
- package/dist/seed/store-addresses-seed-data.js +27 -151
- package/dist/seed/store-extensions-seed-data.d.ts +0 -7
- package/dist/seed/store-extensions-seed-data.js +147 -261
- package/dist/seed/stores-seed-data.d.ts +0 -5
- package/dist/seed/stores-seed-data.js +222 -184
- package/dist/seed/sub-listings-seed-data.d.ts +119 -0
- package/dist/seed/sub-listings-seed-data.js +447 -0
- package/dist/seed/support-tickets-seed-data.d.ts +0 -7
- package/dist/seed/support-tickets-seed-data.js +82 -75
- package/dist/seed/users-seed-data.d.ts +0 -5
- package/dist/seed/users-seed-data.js +279 -634
- package/dist/seed/wishlists-seed-data.d.ts +0 -9
- package/dist/seed/wishlists-seed-data.js +36 -52
- package/dist/seo/json-ld.js +6 -4
- package/dist/styles.css +8052 -3
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/search-tokens.d.ts +2 -0
- package/dist/utils/search-tokens.js +21 -0
- package/package.json +2 -2
- package/scripts/seed-cli.mjs +2 -2
|
@@ -1,359 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: Seeds shopping carts for YGO marketplace — tests cart flows (multi-item, single, auction, guest, empty).
|
|
3
|
+
* WHAT: 4 carts: Yugi (3 items from Kaiba store), Kaiba (2 items from Admin store), Admin (2 items from Kaiba store), guest (2 items). All YGO-themed with YGOPRODECK images.
|
|
4
|
+
*
|
|
5
|
+
* EXPORTS:
|
|
6
|
+
* cartsSeedData — Array of CartDocument for seed runner
|
|
7
|
+
*
|
|
8
|
+
* @tag domain:cart
|
|
9
|
+
* @tag layer:seed
|
|
10
|
+
* @tag pattern:none
|
|
11
|
+
* @tag access:server-only
|
|
12
|
+
* @tag consumers:seed/index.ts,seed/runner.ts,SeedPanel
|
|
13
|
+
* @tag sideEffects:none
|
|
14
|
+
*/
|
|
1
15
|
import { getDefaultCurrency } from "./seed-market-config";
|
|
2
16
|
const _CURRENCY = getDefaultCurrency();
|
|
3
|
-
// Dynamic date helpers
|
|
4
17
|
const NOW = new Date();
|
|
5
18
|
const daysAgo = (n) => new Date(NOW.getTime() - n * 86400000);
|
|
6
19
|
export const cartsSeedData = [
|
|
7
|
-
//
|
|
8
|
-
// Tests: list cart items, remove single item, update quantity, checkout
|
|
20
|
+
// Yugi's cart: 3 items from Kaiba Corp Card Vault
|
|
9
21
|
{
|
|
10
|
-
id: "user-
|
|
11
|
-
userId: "user-
|
|
22
|
+
id: "user-yugi-muto",
|
|
23
|
+
userId: "user-yugi-muto",
|
|
12
24
|
items: [
|
|
13
25
|
{
|
|
14
|
-
itemId: "cartitem-
|
|
15
|
-
productId: "product-
|
|
16
|
-
productTitle: "
|
|
17
|
-
productImage: "/
|
|
18
|
-
price:
|
|
26
|
+
itemId: "cartitem-yugi-dark-magician-lob-1st",
|
|
27
|
+
productId: "product-dark-magician-lob-1st",
|
|
28
|
+
productTitle: "Dark Magician LOB 1st Edition",
|
|
29
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/46986414.jpg",
|
|
30
|
+
price: 499900,
|
|
19
31
|
currency: _CURRENCY,
|
|
20
32
|
quantity: 1,
|
|
21
|
-
storeId: "store-
|
|
22
|
-
storeName: "
|
|
33
|
+
storeId: "store-kaiba-corp-cards",
|
|
34
|
+
storeName: "Kaiba Corp Card Vault",
|
|
23
35
|
listingType: "standard",
|
|
24
|
-
addedAt: daysAgo(
|
|
25
|
-
updatedAt: daysAgo(
|
|
36
|
+
addedAt: daysAgo(3),
|
|
37
|
+
updatedAt: daysAgo(3),
|
|
26
38
|
},
|
|
27
39
|
{
|
|
28
|
-
itemId: "cartitem-
|
|
29
|
-
productId: "product-
|
|
30
|
-
productTitle: "
|
|
31
|
-
productImage: "/
|
|
32
|
-
price:
|
|
40
|
+
itemId: "cartitem-yugi-lob-booster-pack",
|
|
41
|
+
productId: "product-lob-booster-pack",
|
|
42
|
+
productTitle: "Legend of Blue Eyes Booster Pack",
|
|
43
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/89631139.jpg",
|
|
44
|
+
price: 149900,
|
|
33
45
|
currency: _CURRENCY,
|
|
34
|
-
quantity:
|
|
35
|
-
storeId: "store-
|
|
36
|
-
storeName: "
|
|
46
|
+
quantity: 2,
|
|
47
|
+
storeId: "store-kaiba-corp-cards",
|
|
48
|
+
storeName: "Kaiba Corp Card Vault",
|
|
37
49
|
listingType: "standard",
|
|
38
|
-
addedAt: daysAgo(
|
|
39
|
-
updatedAt: daysAgo(
|
|
50
|
+
addedAt: daysAgo(2),
|
|
51
|
+
updatedAt: daysAgo(2),
|
|
40
52
|
},
|
|
41
53
|
{
|
|
42
|
-
itemId: "cartitem-
|
|
43
|
-
productId: "product-
|
|
44
|
-
productTitle: "
|
|
45
|
-
productImage: "/
|
|
46
|
-
price:
|
|
54
|
+
itemId: "cartitem-yugi-kuriboh-mrd",
|
|
55
|
+
productId: "product-kuriboh-mrd",
|
|
56
|
+
productTitle: "Kuriboh MRD",
|
|
57
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/40640057.jpg",
|
|
58
|
+
price: 29900,
|
|
47
59
|
currency: _CURRENCY,
|
|
48
|
-
quantity:
|
|
49
|
-
storeId: "store-
|
|
50
|
-
storeName: "
|
|
60
|
+
quantity: 1,
|
|
61
|
+
storeId: "store-kaiba-corp-cards",
|
|
62
|
+
storeName: "Kaiba Corp Card Vault",
|
|
51
63
|
listingType: "standard",
|
|
52
|
-
addedAt: daysAgo(
|
|
53
|
-
updatedAt: daysAgo(
|
|
64
|
+
addedAt: daysAgo(1),
|
|
65
|
+
updatedAt: daysAgo(1),
|
|
54
66
|
},
|
|
55
67
|
],
|
|
56
|
-
createdAt: daysAgo(
|
|
57
|
-
updatedAt: daysAgo(
|
|
68
|
+
createdAt: daysAgo(3),
|
|
69
|
+
updatedAt: daysAgo(1),
|
|
58
70
|
},
|
|
59
|
-
//
|
|
60
|
-
// Tests: add item, checkout with single item, clear cart after order
|
|
71
|
+
// Kaiba's cart: 2 items from LetItRip Official (Kaiba as buyer)
|
|
61
72
|
{
|
|
62
|
-
id: "user-
|
|
63
|
-
userId: "user-
|
|
73
|
+
id: "user-seto-kaiba",
|
|
74
|
+
userId: "user-seto-kaiba",
|
|
64
75
|
items: [
|
|
65
76
|
{
|
|
66
|
-
itemId: "cartitem-
|
|
67
|
-
productId: "product-
|
|
68
|
-
productTitle: "
|
|
69
|
-
productImage: "/
|
|
70
|
-
price:
|
|
77
|
+
itemId: "cartitem-kaiba-duelist-kingdom-playmat",
|
|
78
|
+
productId: "product-duelist-kingdom-playmat",
|
|
79
|
+
productTitle: "Duelist Kingdom Playmat",
|
|
80
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/10000015.jpg",
|
|
81
|
+
price: 129900,
|
|
71
82
|
currency: _CURRENCY,
|
|
72
83
|
quantity: 1,
|
|
73
84
|
storeId: "store-letitrip-official",
|
|
74
85
|
storeName: "LetItRip Official",
|
|
75
86
|
listingType: "standard",
|
|
76
|
-
addedAt: daysAgo(
|
|
77
|
-
updatedAt: daysAgo(
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
createdAt: daysAgo(10),
|
|
81
|
-
updatedAt: daysAgo(10),
|
|
82
|
-
},
|
|
83
|
-
// -- Arjun Singh: cart with auction item ------------------------------------
|
|
84
|
-
// Tests: auction item add-to-cart display, checkout CTA blocked (must bid)
|
|
85
|
-
{
|
|
86
|
-
id: "user-arjun-singh",
|
|
87
|
-
userId: "user-arjun-singh",
|
|
88
|
-
items: [
|
|
89
|
-
{
|
|
90
|
-
itemId: "cartitem-arjun-pokemon-base-auction-001",
|
|
91
|
-
productId: "auction-pokemon-base-set-booster-box",
|
|
92
|
-
productTitle: "Pokémon Base Set 1st Edition Booster Box (SEALED AUCTION)",
|
|
93
|
-
productImage: "/media/auction-image-pokemon-base-set-booster-box-1-20260101.jpg",
|
|
94
|
-
price: 45000000,
|
|
95
|
-
currency: _CURRENCY,
|
|
96
|
-
quantity: 1,
|
|
97
|
-
storeId: "store-pokemon-palace",
|
|
98
|
-
storeName: "Pokémon Palace",
|
|
99
|
-
listingType: "auction",
|
|
100
|
-
addedAt: daysAgo(17),
|
|
101
|
-
updatedAt: daysAgo(17),
|
|
87
|
+
addedAt: daysAgo(5),
|
|
88
|
+
updatedAt: daysAgo(5),
|
|
102
89
|
},
|
|
103
90
|
{
|
|
104
|
-
itemId: "cartitem-
|
|
105
|
-
productId: "product-
|
|
106
|
-
productTitle: "
|
|
107
|
-
productImage: "/
|
|
108
|
-
price:
|
|
91
|
+
itemId: "cartitem-kaiba-exodia-art-print",
|
|
92
|
+
productId: "product-exodia-art-print",
|
|
93
|
+
productTitle: "Exodia Art Print A3",
|
|
94
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/33396948.jpg",
|
|
95
|
+
price: 79900,
|
|
109
96
|
currency: _CURRENCY,
|
|
110
97
|
quantity: 1,
|
|
111
|
-
storeId: "store-
|
|
112
|
-
storeName: "
|
|
98
|
+
storeId: "store-letitrip-official",
|
|
99
|
+
storeName: "LetItRip Official",
|
|
113
100
|
listingType: "standard",
|
|
114
|
-
addedAt: daysAgo(
|
|
115
|
-
updatedAt: daysAgo(
|
|
101
|
+
addedAt: daysAgo(4),
|
|
102
|
+
updatedAt: daysAgo(4),
|
|
116
103
|
},
|
|
117
104
|
],
|
|
118
|
-
createdAt: daysAgo(
|
|
119
|
-
updatedAt: daysAgo(
|
|
105
|
+
createdAt: daysAgo(5),
|
|
106
|
+
updatedAt: daysAgo(4),
|
|
120
107
|
},
|
|
121
|
-
//
|
|
122
|
-
// Tests: increment/decrement quantity controls, cart total calculation
|
|
108
|
+
// Admin's cart: 2 items from Kaiba Corp (Admin as buyer)
|
|
123
109
|
{
|
|
124
|
-
id: "user-
|
|
125
|
-
userId: "user-
|
|
110
|
+
id: "user-admin-letitrip",
|
|
111
|
+
userId: "user-admin-letitrip",
|
|
126
112
|
items: [
|
|
127
113
|
{
|
|
128
|
-
itemId: "cartitem-
|
|
129
|
-
productId: "product-
|
|
130
|
-
productTitle: "
|
|
131
|
-
productImage: "/
|
|
132
|
-
price:
|
|
114
|
+
itemId: "cartitem-admin-chaos-emperor",
|
|
115
|
+
productId: "product-chaos-emperor-dragon",
|
|
116
|
+
productTitle: "Chaos Emperor Dragon — Envoy of the End",
|
|
117
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/82301904.jpg",
|
|
118
|
+
price: 1299900,
|
|
133
119
|
currency: _CURRENCY,
|
|
134
|
-
quantity:
|
|
135
|
-
storeId: "store-
|
|
136
|
-
storeName: "
|
|
120
|
+
quantity: 1,
|
|
121
|
+
storeId: "store-kaiba-corp-cards",
|
|
122
|
+
storeName: "Kaiba Corp Card Vault",
|
|
137
123
|
listingType: "standard",
|
|
138
|
-
addedAt: daysAgo(
|
|
139
|
-
updatedAt: daysAgo(
|
|
124
|
+
addedAt: daysAgo(2),
|
|
125
|
+
updatedAt: daysAgo(2),
|
|
140
126
|
},
|
|
141
127
|
{
|
|
142
|
-
itemId: "cartitem-
|
|
143
|
-
productId: "product-
|
|
144
|
-
productTitle: "
|
|
145
|
-
productImage: "/
|
|
146
|
-
price:
|
|
128
|
+
itemId: "cartitem-admin-potd-box",
|
|
129
|
+
productId: "product-potd-booster-box",
|
|
130
|
+
productTitle: "Power of the Duelist Booster Box 24pk",
|
|
131
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/89943723.jpg",
|
|
132
|
+
price: 2299900,
|
|
147
133
|
currency: _CURRENCY,
|
|
148
134
|
quantity: 1,
|
|
149
|
-
storeId: "store-
|
|
150
|
-
storeName: "
|
|
135
|
+
storeId: "store-kaiba-corp-cards",
|
|
136
|
+
storeName: "Kaiba Corp Card Vault",
|
|
151
137
|
listingType: "standard",
|
|
152
|
-
addedAt: daysAgo(
|
|
153
|
-
updatedAt: daysAgo(
|
|
138
|
+
addedAt: daysAgo(1),
|
|
139
|
+
updatedAt: daysAgo(1),
|
|
154
140
|
},
|
|
155
141
|
],
|
|
156
|
-
createdAt: daysAgo(
|
|
157
|
-
updatedAt: daysAgo(
|
|
158
|
-
},
|
|
159
|
-
// -- Amit Sharma: empty cart (all items removed) ----------------------------
|
|
160
|
-
// Tests: empty cart UI state, "Your cart is empty" message,
|
|
161
|
-
// add-to-cart starting from empty state
|
|
162
|
-
{
|
|
163
|
-
id: "user-amit-sharma",
|
|
164
|
-
userId: "user-amit-sharma",
|
|
165
|
-
items: [],
|
|
166
|
-
createdAt: daysAgo(27),
|
|
167
|
-
updatedAt: daysAgo(9),
|
|
142
|
+
createdAt: daysAgo(2),
|
|
143
|
+
updatedAt: daysAgo(1),
|
|
168
144
|
},
|
|
169
|
-
//
|
|
170
|
-
...mkCart("user-kavya-iyer", 6, [
|
|
171
|
-
{
|
|
172
|
-
productId: "product-pokemon-151-booster-box",
|
|
173
|
-
title: "Pokémon 151 Booster Box (36-pack)",
|
|
174
|
-
price: 1799900,
|
|
175
|
-
store: ["store-pokemon-palace", "Pokémon Palace"],
|
|
176
|
-
qty: 1,
|
|
177
|
-
},
|
|
178
|
-
]),
|
|
179
|
-
...mkCart("user-sneha-kumar", 12, [
|
|
180
|
-
{
|
|
181
|
-
productId: "product-hot-wheels-treasure-hunt-2024",
|
|
182
|
-
title: "Hot Wheels 2024 Treasure Hunt (Single)",
|
|
183
|
-
price: 49900,
|
|
184
|
-
store: ["store-diecast-depot", "Diecast Depot"],
|
|
185
|
-
qty: 2,
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
productId: "product-funko-pop-naruto-sage-mode",
|
|
189
|
-
title: "Funko Pop Naruto Sage Mode",
|
|
190
|
-
price: 129900,
|
|
191
|
-
store: ["store-tokyo-toys-india", "Tokyo Toys India"],
|
|
192
|
-
qty: 1,
|
|
193
|
-
},
|
|
194
|
-
]),
|
|
195
|
-
...mkCart("user-kartik-nair", 3, [
|
|
196
|
-
{
|
|
197
|
-
productId: "product-beyblade-x-bx18-leon-crest",
|
|
198
|
-
title: "Beyblade X BX-18 Leon Crest Booster",
|
|
199
|
-
price: 199900,
|
|
200
|
-
store: ["store-beyblade-arena", "Beyblade Arena"],
|
|
201
|
-
qty: 1,
|
|
202
|
-
},
|
|
203
|
-
]),
|
|
204
|
-
...mkCart("user-divya-menon", 8, [
|
|
205
|
-
{
|
|
206
|
-
productId: "preorder-pokemon-stellar-crown-etb",
|
|
207
|
-
title: "PRE-ORDER: Pokémon Stellar Crown ETB",
|
|
208
|
-
price: 599900,
|
|
209
|
-
store: ["store-pokemon-palace", "Pokémon Palace"],
|
|
210
|
-
qty: 1,
|
|
211
|
-
listingType: "pre-order",
|
|
212
|
-
},
|
|
213
|
-
]),
|
|
214
|
-
...mkCart("user-ankit-gupta", 14, [
|
|
215
|
-
{
|
|
216
|
-
productId: "product-gundam-rg-nu-gundam",
|
|
217
|
-
title: "Bandai RG 1/144 Nu Gundam",
|
|
218
|
-
price: 449900,
|
|
219
|
-
store: ["store-gundam-galaxy", "Gundam Galaxy"],
|
|
220
|
-
qty: 1,
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
productId: "product-gunpla-action-base-clear",
|
|
224
|
-
title: "Gunpla Action Base Clear (Display Stand)",
|
|
225
|
-
price: 59900,
|
|
226
|
-
store: ["store-gundam-galaxy", "Gundam Galaxy"],
|
|
227
|
-
qty: 2,
|
|
228
|
-
},
|
|
229
|
-
]),
|
|
230
|
-
...mkCart("user-siddharth-rao", 5, [
|
|
231
|
-
{
|
|
232
|
-
productId: "product-shf-luffy-gear-5",
|
|
233
|
-
title: "S.H.Figuarts Luffy Gear 5",
|
|
234
|
-
price: 1199900,
|
|
235
|
-
store: ["store-tokyo-toys-india", "Tokyo Toys India"],
|
|
236
|
-
qty: 1,
|
|
237
|
-
},
|
|
238
|
-
]),
|
|
239
|
-
...mkCart("user-tanvi-desai", 2, [
|
|
240
|
-
{
|
|
241
|
-
productId: "product-yugioh-25th-quarter-century-tin",
|
|
242
|
-
title: "Yu-Gi-Oh! 25th Quarter Century Stampede Tin",
|
|
243
|
-
price: 599900,
|
|
244
|
-
store: ["store-cardgame-hub", "CardGame Hub"],
|
|
245
|
-
qty: 1,
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
productId: "product-yugioh-rarity-collection-pack",
|
|
249
|
-
title: "Yu-Gi-Oh! Rarity Collection Pack",
|
|
250
|
-
price: 119900,
|
|
251
|
-
store: ["store-cardgame-hub", "CardGame Hub"],
|
|
252
|
-
qty: 3,
|
|
253
|
-
},
|
|
254
|
-
]),
|
|
255
|
-
...mkCart("user-anjali-verma", 1, [
|
|
256
|
-
{
|
|
257
|
-
productId: "product-pokemon-charizard-ex-obsidian",
|
|
258
|
-
title: "Pokémon Charizard ex Obsidian Flames Hyper Rare",
|
|
259
|
-
price: 1499900,
|
|
260
|
-
store: ["store-cardgame-hub", "CardGame Hub"],
|
|
261
|
-
qty: 1,
|
|
262
|
-
},
|
|
263
|
-
]),
|
|
264
|
-
...mkCart("user-rohit-verma", 7, [
|
|
265
|
-
{
|
|
266
|
-
productId: "product-tomica-limited-vintage-skyline",
|
|
267
|
-
title: "Tomica Limited Vintage Nissan Skyline GT-R",
|
|
268
|
-
price: 349900,
|
|
269
|
-
store: ["store-vintage-vault", "Vintage Vault"],
|
|
270
|
-
qty: 1,
|
|
271
|
-
},
|
|
272
|
-
]),
|
|
273
|
-
...mkCart("user-pooja-sharma", 4, [
|
|
274
|
-
{
|
|
275
|
-
productId: "auction-pokemon-lugia-neo-genesis-psa9",
|
|
276
|
-
title: "Pokémon Neo Genesis Lugia #9 PSA 9 (AUCTION)",
|
|
277
|
-
price: 6999900,
|
|
278
|
-
store: ["store-pokemon-palace", "Pokémon Palace"],
|
|
279
|
-
qty: 1,
|
|
280
|
-
listingType: "auction",
|
|
281
|
-
},
|
|
282
|
-
]),
|
|
283
|
-
// Guest carts skipped — sessionId is a runtime-only optional field on the
|
|
284
|
-
// Zod input but not on the `CartDocument` interface used by the seed array.
|
|
285
|
-
// Guest cart behavior is exercised at runtime via localStorage merge tests.
|
|
286
|
-
// -- Admin: personal collector cart (buying rare items from other stores) ---
|
|
145
|
+
// Guest cart: 2 items, no userId
|
|
287
146
|
{
|
|
288
|
-
id: "
|
|
289
|
-
userId: "
|
|
147
|
+
id: "guest-session-001",
|
|
148
|
+
userId: "",
|
|
290
149
|
items: [
|
|
291
150
|
{
|
|
292
|
-
itemId: "cartitem-
|
|
293
|
-
productId: "product-
|
|
294
|
-
productTitle: "
|
|
295
|
-
productImage: "/
|
|
296
|
-
price:
|
|
151
|
+
itemId: "cartitem-guest-mirror-force",
|
|
152
|
+
productId: "product-mirror-force-mrd",
|
|
153
|
+
productTitle: "Mirror Force MRD Ultra Rare",
|
|
154
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/44095762.jpg",
|
|
155
|
+
price: 999900,
|
|
297
156
|
currency: _CURRENCY,
|
|
298
157
|
quantity: 1,
|
|
299
|
-
storeId: "store-
|
|
300
|
-
storeName: "
|
|
158
|
+
storeId: "store-kaiba-corp-cards",
|
|
159
|
+
storeName: "Kaiba Corp Card Vault",
|
|
301
160
|
listingType: "standard",
|
|
302
|
-
addedAt: daysAgo(
|
|
303
|
-
updatedAt: daysAgo(
|
|
161
|
+
addedAt: daysAgo(1),
|
|
162
|
+
updatedAt: daysAgo(1),
|
|
304
163
|
},
|
|
305
164
|
{
|
|
306
|
-
itemId: "cartitem-
|
|
307
|
-
productId: "product-
|
|
308
|
-
productTitle: "
|
|
309
|
-
productImage: "/
|
|
310
|
-
price:
|
|
165
|
+
itemId: "cartitem-guest-yugi-starter",
|
|
166
|
+
productId: "product-yugi-starter-deck",
|
|
167
|
+
productTitle: "Starter Deck: Yugi",
|
|
168
|
+
productImage: "https://images.ygoprodeck.com/images/cards/small/46986414.jpg",
|
|
169
|
+
price: 199900,
|
|
311
170
|
currency: _CURRENCY,
|
|
312
171
|
quantity: 1,
|
|
313
|
-
storeId: "store-
|
|
314
|
-
storeName: "
|
|
172
|
+
storeId: "store-kaiba-corp-cards",
|
|
173
|
+
storeName: "Kaiba Corp Card Vault",
|
|
315
174
|
listingType: "standard",
|
|
316
|
-
addedAt: daysAgo(
|
|
317
|
-
updatedAt: daysAgo(
|
|
175
|
+
addedAt: daysAgo(1),
|
|
176
|
+
updatedAt: daysAgo(1),
|
|
318
177
|
},
|
|
319
178
|
],
|
|
320
|
-
createdAt: daysAgo(
|
|
321
|
-
updatedAt: daysAgo(
|
|
179
|
+
createdAt: daysAgo(1),
|
|
180
|
+
updatedAt: daysAgo(1),
|
|
322
181
|
},
|
|
323
182
|
];
|
|
324
|
-
/**
|
|
325
|
-
* Compact constructor for authenticated user carts. Each item gets a
|
|
326
|
-
* deterministic itemId derived from the cart id + product id so the seed
|
|
327
|
-
* is idempotent across re-runs. The id-prefix on `productId` infers a default
|
|
328
|
-
* listingType when the spec doesn't pass one (auction-* / preorder-* / *).
|
|
329
|
-
*/
|
|
330
|
-
function mkCart(userId, ageDays, items) {
|
|
331
|
-
const created = daysAgo(ageDays);
|
|
332
|
-
return [
|
|
333
|
-
{
|
|
334
|
-
id: userId,
|
|
335
|
-
userId,
|
|
336
|
-
items: items.map((it) => ({
|
|
337
|
-
itemId: `cartitem-${userId.replace("user-", "")}-${it.productId.split("-").slice(-3).join("-")}`,
|
|
338
|
-
productId: it.productId,
|
|
339
|
-
productTitle: it.title,
|
|
340
|
-
productImage: `/media/${it.productId.startsWith("auction-") ? "auction" : it.productId.startsWith("preorder-") ? "preorder" : "product"}-image-${it.productId.replace(/^(auction|preorder|product)-/, "")}-1-20260101.jpg`,
|
|
341
|
-
price: it.price,
|
|
342
|
-
currency: _CURRENCY,
|
|
343
|
-
quantity: it.qty,
|
|
344
|
-
storeId: it.store[0],
|
|
345
|
-
storeName: it.store[1],
|
|
346
|
-
listingType: it.listingType ??
|
|
347
|
-
(it.productId.startsWith("auction-")
|
|
348
|
-
? "auction"
|
|
349
|
-
: it.productId.startsWith("preorder-")
|
|
350
|
-
? "pre-order"
|
|
351
|
-
: "standard"),
|
|
352
|
-
addedAt: created,
|
|
353
|
-
updatedAt: created,
|
|
354
|
-
})),
|
|
355
|
-
createdAt: created,
|
|
356
|
-
updatedAt: created,
|
|
357
|
-
},
|
|
358
|
-
];
|
|
359
|
-
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Categories Seed Data — Collectibles Edition
|
|
3
|
-
* 22 categories in 3-tier hierarchy covering 5 collectibles verticals.
|
|
4
|
-
* Verticals: action figures, trading cards, diecast, spinning tops, model kits + vintage/rare.
|
|
5
|
-
* id === slug convention enforced throughout.
|
|
6
|
-
*/
|
|
7
1
|
import type { CategoryDocument } from "../features/categories/schemas";
|
|
8
2
|
export declare const categoriesSeedData: Partial<CategoryDocument>[];
|