@mohasinac/appkit 4.41.0 → 4.41.2
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/features/seller/schemas/coupon-form.d.ts +37 -37
- package/dist/features/seller/schemas/coupon-form.js +36 -8
- package/dist/features/shell/SectionForm.js +44 -5
- package/dist/schemas/registry.d.ts +10 -10
- package/package.json +2 -2
- package/dist/_internal/server/features/classified/actions.d.ts +0 -12
- package/dist/_internal/server/features/classified/actions.js +0 -33
- package/dist/_internal/server/features/digital-code/actions.d.ts +0 -12
- package/dist/_internal/server/features/digital-code/actions.js +0 -33
- package/dist/_internal/server/features/homepage/data.d.ts +0 -18
- package/dist/_internal/server/features/homepage/data.js +0 -70
- package/dist/_internal/server/features/live/actions.d.ts +0 -6
- package/dist/_internal/server/features/live/actions.js +0 -27
- package/dist/_internal/server/features/messages/actions.d.ts +0 -6
- package/dist/_internal/server/features/messages/actions.js +0 -6
- package/dist/_internal/server/features/messages/data.d.ts +0 -10
- package/dist/_internal/server/features/messages/data.js +0 -24
- package/dist/_internal/server/features/messages/index.d.ts +0 -2
- package/dist/_internal/server/features/messages/index.js +0 -2
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.d.ts +0 -12
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.js +0 -112
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.js +0 -2
- package/dist/_internal/shared/features/homepage/section-gate.d.ts +0 -14
- package/dist/_internal/shared/features/homepage/section-gate.js +0 -51
- package/dist/_internal/shared/features/lottery/config-form.d.ts +0 -58
- package/dist/_internal/shared/features/lottery/config-form.js +0 -71
- package/dist/client/api/useFeatureFlags.d.ts +0 -22
- package/dist/client/api/useFeatureFlags.js +0 -27
- package/dist/features/account/address-validation.d.ts +0 -20
- package/dist/features/account/address-validation.js +0 -35
- package/dist/features/account/components/ChatList.d.ts +0 -14
- package/dist/features/account/components/ChatList.js +0 -9
- package/dist/features/account/components/ChatWindow.d.ts +0 -17
- package/dist/features/account/components/ChatWindow.js +0 -6
- package/dist/features/account/components/MessagesView.d.ts +0 -16
- package/dist/features/account/components/MessagesView.js +0 -5
- package/dist/features/account/components/UserOffersView.d.ts +0 -10
- package/dist/features/account/components/UserOffersView.js +0 -5
- package/dist/features/account/constants/addresses.d.ts +0 -13
- package/dist/features/account/constants/addresses.js +0 -43
- package/dist/features/account/hooks/useAddressForm.d.ts +0 -24
- package/dist/features/account/hooks/useAddressForm.js +0 -58
- package/dist/features/admin/actions/chat-actions.d.ts +0 -29
- package/dist/features/admin/actions/chat-actions.js +0 -101
- package/dist/features/admin/components/AdminFeatureFlagsView.d.ts +0 -9
- package/dist/features/admin/components/AdminFeatureFlagsView.js +0 -109
- package/dist/features/admin/components/AdminSiteView.d.ts +0 -10
- package/dist/features/admin/components/AdminSiteView.js +0 -52
- package/dist/features/admin/hooks/useChat.d.ts +0 -24
- package/dist/features/admin/hooks/useChat.js +0 -100
- package/dist/features/admin/permission-map.d.ts +0 -3
- package/dist/features/admin/permission-map.js +0 -26
- package/dist/features/admin/repository/chat.repository.d.ts +0 -50
- package/dist/features/admin/repository/chat.repository.js +0 -223
- package/dist/features/auth/actions/password-change-otp-actions.d.ts +0 -18
- package/dist/features/auth/actions/password-change-otp-actions.js +0 -88
- package/dist/features/auth/actions/realtime-token-actions.d.ts +0 -11
- package/dist/features/auth/actions/realtime-token-actions.js +0 -38
- package/dist/features/auth/password-change-otp.d.ts +0 -34
- package/dist/features/auth/password-change-otp.js +0 -56
- package/dist/features/classified/components/ClassifiedContactSellerPanel.d.ts +0 -12
- package/dist/features/classified/components/ClassifiedContactSellerPanel.js +0 -49
- package/dist/features/events/api/route.d.ts +0 -12
- package/dist/features/events/api/route.js +0 -90
- package/dist/features/faq/api/route.d.ts +0 -11
- package/dist/features/faq/api/route.js +0 -52
- package/dist/features/faq/hooks/useFAQs.d.ts +0 -22
- package/dist/features/faq/hooks/useFAQs.js +0 -41
- package/dist/features/media/upload/video-poster.test.d.ts +0 -1
- package/dist/features/media/upload/video-poster.test.js +0 -42
- package/dist/features/messages/actions/index.d.ts +0 -2
- package/dist/features/messages/actions/index.js +0 -2
- package/dist/features/messages/actions/messages-actions.d.ts +0 -15
- package/dist/features/messages/actions/messages-actions.js +0 -33
- package/dist/features/messages/actions/ping-rtdb.d.ts +0 -2
- package/dist/features/messages/actions/ping-rtdb.js +0 -26
- package/dist/features/messages/hooks/useConversation.d.ts +0 -22
- package/dist/features/messages/hooks/useConversation.js +0 -155
- package/dist/features/messages/hooks/useConversations.d.ts +0 -15
- package/dist/features/messages/hooks/useConversations.js +0 -104
- package/dist/features/messages/index.d.ts +0 -6
- package/dist/features/messages/index.js +0 -4
- package/dist/features/messages/realtime.d.ts +0 -32
- package/dist/features/messages/realtime.js +0 -39
- package/dist/features/messages/repository/conversations.repository.d.ts +0 -71
- package/dist/features/messages/repository/conversations.repository.js +0 -284
- package/dist/features/messages/schemas/firestore.d.ts +0 -34
- package/dist/features/messages/schemas/firestore.js +0 -16
- package/dist/features/messages/schemas/index.d.ts +0 -177
- package/dist/features/messages/schemas/index.js +0 -35
- package/dist/features/messages/server.d.ts +0 -6
- package/dist/features/messages/server.js +0 -6
- package/dist/features/products/components/MakeOfferForm.d.ts +0 -20
- package/dist/features/products/components/MakeOfferForm.js +0 -9
- package/dist/features/reviews/api/route.d.ts +0 -21
- package/dist/features/reviews/api/route.js +0 -174
- package/dist/features/seller/api/offers/route.d.ts +0 -17
- package/dist/features/seller/api/offers/route.js +0 -63
- package/dist/features/seller/components/SellerAuctionsView.d.ts +0 -9
- package/dist/features/seller/components/SellerAuctionsView.js +0 -113
- package/dist/features/seller/components/SellerOffersPanel.d.ts +0 -21
- package/dist/features/seller/components/SellerOffersPanel.js +0 -160
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +0 -6
- package/dist/features/seller/components/SellerPreOrdersView.js +0 -148
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +0 -6
- package/dist/features/seller/components/SellerPrizeDrawsView.js +0 -152
- package/dist/features/seller/permission-map.d.ts +0 -5
- package/dist/features/seller/permission-map.js +0 -17
- package/dist/features/shell/StepForm.d.ts +0 -80
- package/dist/features/shell/StepForm.js +0 -136
- package/dist/features/stores/api/route.d.ts +0 -12
- package/dist/features/stores/api/route.js +0 -110
- package/dist/features/tester/seed-data/authored/account-auth__testing-program--admin.d.ts +0 -2
- package/dist/features/tester/seed-data/authored/account-auth__testing-program--admin.js +0 -33
- package/dist/features/tester/seed-data/authored/account-auth__testing-program.d.ts +0 -2
- package/dist/features/tester/seed-data/authored/account-auth__testing-program.js +0 -138
- package/dist/features/tester/seed-data/bids-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/bids-tester-seed-data.js +0 -37
- package/dist/features/tester/seed-data/blog-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/blog-tester-seed-data.js +0 -40
- package/dist/features/tester/seed-data/carts-tester-seed-data.d.ts +0 -3
- package/dist/features/tester/seed-data/carts-tester-seed-data.js +0 -70
- package/dist/features/tester/seed-data/categories-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/categories-tester-seed-data.js +0 -218
- package/dist/features/tester/seed-data/coupons-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/coupons-tester-seed-data.js +0 -76
- package/dist/features/tester/seed-data/events-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/events-tester-seed-data.js +0 -193
- package/dist/features/tester/seed-data/offers-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/offers-tester-seed-data.js +0 -191
- package/dist/features/tester/seed-data/orders-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/orders-tester-seed-data.js +0 -329
- package/dist/features/tester/seed-data/products-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/products-tester-seed-data.js +0 -815
- package/dist/features/tester/seed-data/stores-tester-seed-data.d.ts +0 -2
- package/dist/features/tester/seed-data/stores-tester-seed-data.js +0 -79
- package/dist/features/wishlist/components/WishlistToggleButton.d.ts +0 -12
- package/dist/features/wishlist/components/WishlistToggleButton.js +0 -36
- package/dist/monitoring/analytics.d.ts +0 -80
- package/dist/monitoring/analytics.js +0 -176
- package/dist/next/middleware/pii-redactor.d.ts +0 -32
- package/dist/next/middleware/pii-redactor.js +0 -84
- package/dist/providers/db-firebase/realtime.d.ts +0 -42
- package/dist/providers/db-firebase/realtime.js +0 -138
- package/dist/security/rbac/Can.d.ts +0 -31
- package/dist/security/rbac/Can.js +0 -22
- package/dist/security/rbac/default-roles.d.ts +0 -2
- package/dist/security/rbac/default-roles.js +0 -83
- package/dist/security/rbac/hook.d.ts +0 -20
- package/dist/security/rbac/hook.js +0 -30
- package/dist/security/rbac/index.d.ts +0 -8
- package/dist/security/rbac/index.js +0 -6
- package/dist/security/rbac/middleware.d.ts +0 -51
- package/dist/security/rbac/middleware.js +0 -51
- package/dist/security/rbac/resolver.d.ts +0 -5
- package/dist/security/rbac/resolver.js +0 -38
- package/dist/security/rbac/server.d.ts +0 -24
- package/dist/security/rbac/server.js +0 -42
- package/dist/security/rbac/types.d.ts +0 -22
- package/dist/security/rbac/types.js +0 -2
- package/dist/seed/conversations-seed-data.d.ts +0 -2
- package/dist/seed/conversations-seed-data.js +0 -292
- package/dist/utils/filter.helper.d.ts +0 -18
- package/dist/utils/filter.helper.js +0 -21
- package/dist/utils/pagination.helper.d.ts +0 -23
- package/dist/utils/pagination.helper.js +0 -24
- package/dist/utils/search-tokens.d.ts +0 -2
- package/dist/utils/search-tokens.js +0 -21
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHY: Seeds buyer ↔ seller conversations for the Beyblade marketplace.
|
|
3
|
-
* WHAT: 6 conversations covering condition queries, offer negotiation, prize-draw fairness, shipping delays, returns, bulk orders, tracking.
|
|
4
|
-
*
|
|
5
|
-
* EXPORTS:
|
|
6
|
-
* conversationsSeedData — Array of Partial<ConversationDocument> for seed runner
|
|
7
|
-
*
|
|
8
|
-
* @tag domain:messages
|
|
9
|
-
* @tag layer:seed
|
|
10
|
-
* @tag pattern:none
|
|
11
|
-
* @tag access:server-only
|
|
12
|
-
* @tag consumers:seed/index.ts,seed/runner.ts
|
|
13
|
-
* @tag sideEffects:none
|
|
14
|
-
*/
|
|
15
|
-
const NOW = new Date();
|
|
16
|
-
const minsAgo = (n) => new Date(NOW.getTime() - n * 60000);
|
|
17
|
-
const hoursAgo = (n) => new Date(NOW.getTime() - n * 3600000);
|
|
18
|
-
const daysAgo = (n) => new Date(NOW.getTime() - n * 86400000);
|
|
19
|
-
export const conversationsSeedData = [
|
|
20
|
-
// ── 1. Metal Lightning L-Drago — Pre-purchase condition query ────────────
|
|
21
|
-
{
|
|
22
|
-
id: "conv-l-drago-yugi-kaiba-001",
|
|
23
|
-
buyerId: "user-yugi-muto",
|
|
24
|
-
buyerDisplayName: "Mock User 3",
|
|
25
|
-
sellerDisplayName: "Mock User 6",
|
|
26
|
-
storeId: "store-beyblade-arena",
|
|
27
|
-
storeName: "Beyblade Arena",
|
|
28
|
-
productId: "auction-beyblade-metal-lightning-l-drago",
|
|
29
|
-
productTitle: "Beyblade Metal Lightning L-Drago",
|
|
30
|
-
messages: [
|
|
31
|
-
{
|
|
32
|
-
id: "msg-001-1",
|
|
33
|
-
senderId: "user-yugi-muto",
|
|
34
|
-
senderRole: "buyer",
|
|
35
|
-
body: "Hi! Is this a sharp, unrounded tip or has it seen a lot of stadium battles? I'm buying for my collection, not battling, so I want to know the tip wear before I bid.",
|
|
36
|
-
isRead: true,
|
|
37
|
-
sentAt: daysAgo(3),
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: "msg-001-2",
|
|
41
|
-
senderId: "user-tyson-blader",
|
|
42
|
-
senderRole: "seller",
|
|
43
|
-
body: "Hey Rehan! The tip is factory-sharp with visible grooves — barely used, maybe 10 launches total. No cracks on the layer. This came direct from a sealed Metal Fight booster. Happy to share close-up photos on WhatsApp if you DM me before bidding.",
|
|
44
|
-
isRead: true,
|
|
45
|
-
sentAt: daysAgo(3),
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "msg-001-3",
|
|
49
|
-
senderId: "user-yugi-muto",
|
|
50
|
-
senderRole: "buyer",
|
|
51
|
-
body: "That sounds great! Can you also confirm it's genuine Takara-Tomy and not a clone?",
|
|
52
|
-
isRead: true,
|
|
53
|
-
sentAt: daysAgo(2),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: "msg-001-4",
|
|
57
|
-
senderId: "user-tyson-blader",
|
|
58
|
-
senderRole: "seller",
|
|
59
|
-
body: "100% genuine — laser-etched logo on the underside, verified. Good luck in the auction!",
|
|
60
|
-
isRead: false,
|
|
61
|
-
sentAt: daysAgo(2),
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
lastMessage: "100% genuine — laser-etched logo on the underside, verified. Good luck in the auction!",
|
|
65
|
-
lastMessageAt: daysAgo(2),
|
|
66
|
-
unreadBuyer: 1,
|
|
67
|
-
unreadSeller: 0,
|
|
68
|
-
status: "active",
|
|
69
|
-
createdAt: daysAgo(3),
|
|
70
|
-
updatedAt: daysAgo(2),
|
|
71
|
-
},
|
|
72
|
-
// ── 2. Burst Valkyrie — Offer negotiation ────────────────────────────────
|
|
73
|
-
{
|
|
74
|
-
id: "conv-burst-valkyrie-yugi-kaiba-002",
|
|
75
|
-
buyerId: "user-yugi-muto",
|
|
76
|
-
buyerDisplayName: "Mock User 3",
|
|
77
|
-
sellerDisplayName: "Mock User 6",
|
|
78
|
-
storeId: "store-beyblade-arena",
|
|
79
|
-
storeName: "Beyblade Arena",
|
|
80
|
-
productId: "product-beyblade-burst-valkyrie",
|
|
81
|
-
productTitle: "Beyblade Burst Valkyrie",
|
|
82
|
-
messages: [
|
|
83
|
-
{
|
|
84
|
-
id: "msg-002-1",
|
|
85
|
-
senderId: "user-yugi-muto",
|
|
86
|
-
senderRole: "buyer",
|
|
87
|
-
body: "Would you take ₹1,500 for the Burst Valkyrie? I see it's listed at ₹1,899.",
|
|
88
|
-
isRead: true,
|
|
89
|
-
sentAt: daysAgo(1),
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "msg-002-2",
|
|
93
|
-
senderId: "user-tyson-blader",
|
|
94
|
-
senderRole: "seller",
|
|
95
|
-
body: "Hi Rehan! Best I can do is ₹1,700 — it's a clean, sealed piece with no sticker damage. I'll cover shipping at that price.",
|
|
96
|
-
isRead: true,
|
|
97
|
-
sentAt: daysAgo(1),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "msg-002-3",
|
|
101
|
-
senderId: "user-yugi-muto",
|
|
102
|
-
senderRole: "buyer",
|
|
103
|
-
body: "Deal at ₹1,700 with free shipping. Can I use the Make Offer feature or should you update the listing?",
|
|
104
|
-
isRead: false,
|
|
105
|
-
sentAt: hoursAgo(8),
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
lastMessage: "Deal at ₹1,700 with free shipping. Can I use the Make Offer feature or should you update the listing?",
|
|
109
|
-
lastMessageAt: hoursAgo(8),
|
|
110
|
-
unreadBuyer: 0,
|
|
111
|
-
unreadSeller: 1,
|
|
112
|
-
status: "active",
|
|
113
|
-
createdAt: daysAgo(1),
|
|
114
|
-
updatedAt: hoursAgo(8),
|
|
115
|
-
},
|
|
116
|
-
// ── 3. Mystery Box — Prize draw fairness question ────────────────────────
|
|
117
|
-
{
|
|
118
|
-
id: "conv-mystery-box-yugi-admin-003",
|
|
119
|
-
buyerId: "user-yugi-muto",
|
|
120
|
-
buyerDisplayName: "Mock User 3",
|
|
121
|
-
sellerDisplayName: "Mock User 1",
|
|
122
|
-
storeId: "store-letitrip-official",
|
|
123
|
-
storeName: "LetItRip Official",
|
|
124
|
-
productId: "prizedraw-beyblade-mystery-box",
|
|
125
|
-
productTitle: "Beyblade Mystery Box",
|
|
126
|
-
messages: [
|
|
127
|
-
{
|
|
128
|
-
id: "msg-003-1",
|
|
129
|
-
senderId: "user-yugi-muto",
|
|
130
|
-
senderRole: "buyer",
|
|
131
|
-
body: "How is the winner for the mystery box actually selected? My friend got burned by a rigged giveaway last month.",
|
|
132
|
-
isRead: true,
|
|
133
|
-
sentAt: daysAgo(2),
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: "msg-003-2",
|
|
137
|
-
senderId: "user-admin-letitrip",
|
|
138
|
-
senderRole: "seller",
|
|
139
|
-
body: "Great question — the draw uses a cryptographically random selection (crypto.randomInt) run server-side, logged with a timestamp, and the winner is announced publicly on the event page. No manual picking involved. Happy to walk you through the mechanics before you enter.",
|
|
140
|
-
isRead: true,
|
|
141
|
-
sentAt: daysAgo(2),
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: "msg-003-3",
|
|
145
|
-
senderId: "user-yugi-muto",
|
|
146
|
-
senderRole: "buyer",
|
|
147
|
-
body: "Perfect, that's exactly what I needed to hear. Entering now!",
|
|
148
|
-
isRead: true,
|
|
149
|
-
sentAt: daysAgo(1),
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
lastMessage: "Perfect, that's exactly what I needed to hear. Entering now!",
|
|
153
|
-
lastMessageAt: daysAgo(1),
|
|
154
|
-
unreadBuyer: 0,
|
|
155
|
-
unreadSeller: 0,
|
|
156
|
-
status: "active",
|
|
157
|
-
createdAt: daysAgo(2),
|
|
158
|
-
updatedAt: daysAgo(1),
|
|
159
|
-
},
|
|
160
|
-
// ── 4. Original Dranzer S — Shipping delay ───────────────────────────────
|
|
161
|
-
{
|
|
162
|
-
id: "conv-dranzer-s-admin-kaiba-004",
|
|
163
|
-
buyerId: "user-admin-letitrip",
|
|
164
|
-
buyerDisplayName: "Mock User 1",
|
|
165
|
-
sellerDisplayName: "Mock User 6",
|
|
166
|
-
storeId: "store-beyblade-arena",
|
|
167
|
-
storeName: "Beyblade Arena",
|
|
168
|
-
productId: "product-beyblade-original-dranzer-s",
|
|
169
|
-
productTitle: "Beyblade Original Dranzer S",
|
|
170
|
-
messages: [
|
|
171
|
-
{
|
|
172
|
-
id: "msg-004-1",
|
|
173
|
-
senderId: "user-admin-letitrip",
|
|
174
|
-
senderRole: "buyer",
|
|
175
|
-
body: "Hi Tyson, I ordered the sealed Dranzer S 3 days ago. The tracking shows it's still at the dispatch hub in Chennai. Is there a delay?",
|
|
176
|
-
isRead: true,
|
|
177
|
-
sentAt: daysAgo(2),
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: "msg-004-2",
|
|
181
|
-
senderId: "user-tyson-blader",
|
|
182
|
-
senderRole: "seller",
|
|
183
|
-
body: "Apologies for the delay! There was a backlog at the courier facility — they've confirmed it will leave Chennai tonight. Updated tracking should show movement tomorrow morning. If it doesn't arrive by end of week, I'll initiate a replacement. Very sorry for the inconvenience!",
|
|
184
|
-
isRead: true,
|
|
185
|
-
sentAt: daysAgo(2),
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: "msg-004-3",
|
|
189
|
-
senderId: "user-admin-letitrip",
|
|
190
|
-
senderRole: "buyer",
|
|
191
|
-
body: "Thanks for the quick update. I'll keep an eye on the tracking.",
|
|
192
|
-
isRead: true,
|
|
193
|
-
sentAt: daysAgo(1),
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
lastMessage: "Thanks for the quick update. I'll keep an eye on the tracking.",
|
|
197
|
-
lastMessageAt: daysAgo(1),
|
|
198
|
-
unreadBuyer: 0,
|
|
199
|
-
unreadSeller: 0,
|
|
200
|
-
status: "active",
|
|
201
|
-
createdAt: daysAgo(2),
|
|
202
|
-
updatedAt: daysAgo(1),
|
|
203
|
-
},
|
|
204
|
-
// ── 5. Bulk Original Series — Bulk order query ───────────────────────────
|
|
205
|
-
{
|
|
206
|
-
id: "conv-bulk-original-yugi-kaiba-005",
|
|
207
|
-
buyerId: "user-yugi-muto",
|
|
208
|
-
buyerDisplayName: "Mock User 3",
|
|
209
|
-
sellerDisplayName: "Mock User 6",
|
|
210
|
-
storeId: "store-beyblade-arena",
|
|
211
|
-
storeName: "Beyblade Arena",
|
|
212
|
-
productId: "product-beyblade-original-driger-v",
|
|
213
|
-
productTitle: "Beyblade Original Driger V",
|
|
214
|
-
messages: [
|
|
215
|
-
{
|
|
216
|
-
id: "msg-005-1",
|
|
217
|
-
senderId: "user-yugi-muto",
|
|
218
|
-
senderRole: "buyer",
|
|
219
|
-
body: "Do you have 3 copies of the Original Driger V? I'm completing my original-series set and need multiples for tournament backup.",
|
|
220
|
-
isRead: true,
|
|
221
|
-
sentAt: minsAgo(240),
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
id: "msg-005-2",
|
|
225
|
-
senderId: "user-tyson-blader",
|
|
226
|
-
senderRole: "seller",
|
|
227
|
-
body: "Yes! I have 5 copies in stock. For 3+ copies I can do ₹1,600 per piece (saving ₹399 per piece vs list price) + free shipping. All pieces are NM with sharp tips.",
|
|
228
|
-
isRead: false,
|
|
229
|
-
sentAt: minsAgo(200),
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
lastMessage: "Yes! I have 5 copies in stock. For 3+ copies I can do ₹1,600 per piece (saving ₹399 per piece vs list price) + free shipping. All pieces are NM with sharp tips.",
|
|
233
|
-
lastMessageAt: minsAgo(200),
|
|
234
|
-
unreadBuyer: 1,
|
|
235
|
-
unreadSeller: 0,
|
|
236
|
-
status: "active",
|
|
237
|
-
createdAt: minsAgo(240),
|
|
238
|
-
updatedAt: minsAgo(200),
|
|
239
|
-
},
|
|
240
|
-
// ── 6. X Knife Shinobi — Post-purchase tracking (archived) ───────────────
|
|
241
|
-
{
|
|
242
|
-
id: "conv-x-knife-admin-kaiba-006",
|
|
243
|
-
buyerId: "user-admin-letitrip",
|
|
244
|
-
buyerDisplayName: "Mock User 1",
|
|
245
|
-
sellerDisplayName: "Mock User 6",
|
|
246
|
-
storeId: "store-beyblade-arena",
|
|
247
|
-
storeName: "Beyblade Arena",
|
|
248
|
-
productId: "product-beyblade-x-knife-shinobi",
|
|
249
|
-
productTitle: "Beyblade X Knife Shinobi",
|
|
250
|
-
messages: [
|
|
251
|
-
{
|
|
252
|
-
id: "msg-006-1",
|
|
253
|
-
senderId: "user-admin-letitrip",
|
|
254
|
-
senderRole: "buyer",
|
|
255
|
-
body: "Hi! My order for the X Knife Shinobi shipped 2 days ago — the courier's tracking page shows it left your city but has not updated since. Can you check with the courier?",
|
|
256
|
-
isRead: true,
|
|
257
|
-
sentAt: daysAgo(6),
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
id: "msg-006-2",
|
|
261
|
-
senderId: "user-tyson-blader",
|
|
262
|
-
senderRole: "seller",
|
|
263
|
-
body: "Hi! Yes, I raised a ticket with the courier about that. They confirmed it is in transit at the sorting facility — tracking updates can lag by 24-48 hours. Should arrive tomorrow or day after.",
|
|
264
|
-
isRead: true,
|
|
265
|
-
sentAt: daysAgo(6),
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
id: "msg-006-3",
|
|
269
|
-
senderId: "user-admin-letitrip",
|
|
270
|
-
senderRole: "buyer",
|
|
271
|
-
body: "Got the piece today, arrived in perfect condition. Thanks Tyson!",
|
|
272
|
-
isRead: true,
|
|
273
|
-
sentAt: daysAgo(4),
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: "msg-006-4",
|
|
277
|
-
senderId: "user-tyson-blader",
|
|
278
|
-
senderRole: "seller",
|
|
279
|
-
body: "Glad it arrived safely! Please leave a review when you get a chance.",
|
|
280
|
-
isRead: true,
|
|
281
|
-
sentAt: daysAgo(4),
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
lastMessage: "Glad it arrived safely! Please leave a review when you get a chance.",
|
|
285
|
-
lastMessageAt: daysAgo(4),
|
|
286
|
-
unreadBuyer: 0,
|
|
287
|
-
unreadSeller: 0,
|
|
288
|
-
status: "archived",
|
|
289
|
-
createdAt: daysAgo(6),
|
|
290
|
-
updatedAt: daysAgo(4),
|
|
291
|
-
},
|
|
292
|
-
];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filter Helper
|
|
3
|
-
*
|
|
4
|
-
* Builds Sieve-compatible filter strings from conditional entries.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* buildSieveFilters(
|
|
9
|
-
* ["status==", statusFilter],
|
|
10
|
-
* ["totalPrice>=", minAmount],
|
|
11
|
-
* ["title@=*", searchTerm],
|
|
12
|
-
* );
|
|
13
|
-
* // → "status==pending,totalPrice>=100,title@=*shoes"
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
type FilterEntry = [expression: string, value: string | undefined | null];
|
|
17
|
-
export declare function buildSieveFilters(...entries: FilterEntry[]): string;
|
|
18
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filter Helper
|
|
3
|
-
*
|
|
4
|
-
* Builds Sieve-compatible filter strings from conditional entries.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* buildSieveFilters(
|
|
9
|
-
* ["status==", statusFilter],
|
|
10
|
-
* ["totalPrice>=", minAmount],
|
|
11
|
-
* ["title@=*", searchTerm],
|
|
12
|
-
* );
|
|
13
|
-
* // → "status==pending,totalPrice>=100,title@=*shoes"
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export function buildSieveFilters(...entries) {
|
|
17
|
-
return entries
|
|
18
|
-
.filter((entry) => !!entry[1])
|
|
19
|
-
.map(([expr, value]) => `${expr}${value}`)
|
|
20
|
-
.join(",");
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pagination Helper
|
|
3
|
-
*
|
|
4
|
-
* Generic helpers for pagination metadata calculations.
|
|
5
|
-
*/
|
|
6
|
-
export interface PaginationOptions {
|
|
7
|
-
page: number;
|
|
8
|
-
perPage: number;
|
|
9
|
-
total: number;
|
|
10
|
-
}
|
|
11
|
-
export interface PaginationResult {
|
|
12
|
-
currentPage: number;
|
|
13
|
-
perPage: number;
|
|
14
|
-
total: number;
|
|
15
|
-
totalPages: number;
|
|
16
|
-
hasNextPage: boolean;
|
|
17
|
-
hasPrevPage: boolean;
|
|
18
|
-
nextPage: number | null;
|
|
19
|
-
prevPage: number | null;
|
|
20
|
-
startIndex: number;
|
|
21
|
-
endIndex: number;
|
|
22
|
-
}
|
|
23
|
-
export declare function calculatePagination(options: PaginationOptions): PaginationResult;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pagination Helper
|
|
3
|
-
*
|
|
4
|
-
* Generic helpers for pagination metadata calculations.
|
|
5
|
-
*/
|
|
6
|
-
export function calculatePagination(options) {
|
|
7
|
-
const { page, perPage, total } = options;
|
|
8
|
-
const totalPages = Math.ceil(total / perPage);
|
|
9
|
-
const currentPage = Math.max(1, Math.min(page, totalPages));
|
|
10
|
-
const startIndex = (currentPage - 1) * perPage;
|
|
11
|
-
const endIndex = Math.min(startIndex + perPage, total);
|
|
12
|
-
return {
|
|
13
|
-
currentPage,
|
|
14
|
-
perPage,
|
|
15
|
-
total,
|
|
16
|
-
totalPages,
|
|
17
|
-
hasNextPage: currentPage < totalPages,
|
|
18
|
-
hasPrevPage: currentPage > 1,
|
|
19
|
-
nextPage: currentPage < totalPages ? currentPage + 1 : null,
|
|
20
|
-
prevPage: currentPage > 1 ? currentPage - 1 : null,
|
|
21
|
-
startIndex,
|
|
22
|
-
endIndex,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const MAX_TOKENS = 50;
|
|
2
|
-
const MIN_TOKEN_LENGTH = 2;
|
|
3
|
-
export function buildSearchTokens(...sources) {
|
|
4
|
-
const rawText = sources
|
|
5
|
-
.flat()
|
|
6
|
-
.filter(Boolean)
|
|
7
|
-
.join(" ")
|
|
8
|
-
.toLowerCase();
|
|
9
|
-
return Array.from(new Set(rawText
|
|
10
|
-
.split(/[^a-z0-9]+/i)
|
|
11
|
-
.map((t) => t.trim())
|
|
12
|
-
.filter((t) => t.length >= MIN_TOKEN_LENGTH))).slice(0, MAX_TOKENS);
|
|
13
|
-
}
|
|
14
|
-
export function tokenizeQuery(query) {
|
|
15
|
-
return query
|
|
16
|
-
.toLowerCase()
|
|
17
|
-
.split(/[^a-z0-9]+/i)
|
|
18
|
-
.map((t) => t.trim())
|
|
19
|
-
.filter((t) => t.length >= MIN_TOKEN_LENGTH)
|
|
20
|
-
.slice(0, 10);
|
|
21
|
-
}
|