@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,218 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHY: Shared tester sandbox — a small self-contained category tree (root + 3 leaves,
|
|
3
|
-
* one leaf deliberately isActive:false), 1 brand row, and 1 bundle row so testers
|
|
4
|
-
* can exercise browsing/filtering/bundle flows without touching real catalog data.
|
|
5
|
-
* Auto-expires after 7 days.
|
|
6
|
-
* WHAT: Exports categoriesTesterSeedData — 4 plain categories + 1 categoryType:"brand" +
|
|
7
|
-
* 1 categoryType:"bundle" (bundleProductIds + bundleOriginalTotal reference
|
|
8
|
-
* products-tester-seed-data.ts).
|
|
9
|
-
*
|
|
10
|
-
* EXPORTS:
|
|
11
|
-
* categoriesTesterSeedData — Array of Partial<CategoryDocument> for the seed runner
|
|
12
|
-
*
|
|
13
|
-
* @tag domain:categories,tester
|
|
14
|
-
* @tag layer:seed
|
|
15
|
-
* @tag pattern:none
|
|
16
|
-
* @tag access:server-only
|
|
17
|
-
* @tag consumers:seed/index.ts,seed-cli.mjs
|
|
18
|
-
* @tag sideEffects:none
|
|
19
|
-
*/
|
|
20
|
-
import { CATEGORY_FIELDS } from "../../../constants/field-names";
|
|
21
|
-
import { seedPhoto } from "../../../seed/_helpers/media";
|
|
22
|
-
import { testDataExpiresAt } from "./tester-ttl";
|
|
23
|
-
const emptyMetrics = {
|
|
24
|
-
productCount: 0,
|
|
25
|
-
productIds: [],
|
|
26
|
-
auctionCount: 0,
|
|
27
|
-
auctionIds: [],
|
|
28
|
-
totalProductCount: 0,
|
|
29
|
-
totalAuctionCount: 0,
|
|
30
|
-
totalItemCount: 0,
|
|
31
|
-
lastUpdated: new Date(),
|
|
32
|
-
};
|
|
33
|
-
export const categoriesTesterSeedData = [
|
|
34
|
-
// ── ROOT: Tester Sandbox ─────────────────────────────────────────────────
|
|
35
|
-
{
|
|
36
|
-
id: "category-tester-sandbox",
|
|
37
|
-
slug: "category-tester-sandbox",
|
|
38
|
-
name: "Tester Sandbox",
|
|
39
|
-
description: "Disposable test category tree for the tester QA program.",
|
|
40
|
-
rootId: "category-tester-sandbox",
|
|
41
|
-
parentIds: [],
|
|
42
|
-
childrenIds: ["category-tester-gadgets", "category-tester-collectibles", "category-tester-inactive"],
|
|
43
|
-
tier: 0,
|
|
44
|
-
path: "tester-sandbox",
|
|
45
|
-
order: 999,
|
|
46
|
-
isLeaf: false,
|
|
47
|
-
position: 0,
|
|
48
|
-
subtreeSize: 3,
|
|
49
|
-
metrics: emptyMetrics,
|
|
50
|
-
isFeatured: false,
|
|
51
|
-
isBrand: false,
|
|
52
|
-
seo: { title: "Tester Sandbox", description: "Disposable test category.", keywords: ["test"] },
|
|
53
|
-
display: { icon: "🧪", coverImage: seedPhoto("category-image-tester-sandbox-20260101", 1200, 600), color: "#64748b", showInMenu: false, showInFooter: false },
|
|
54
|
-
isActive: true,
|
|
55
|
-
isSearchable: true,
|
|
56
|
-
showOnHomepage: false,
|
|
57
|
-
createdBy: "user-admin-letitrip",
|
|
58
|
-
isTestData: true,
|
|
59
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
60
|
-
createdAt: new Date(),
|
|
61
|
-
updatedAt: new Date(),
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "category-tester-gadgets",
|
|
65
|
-
slug: "category-tester-gadgets",
|
|
66
|
-
name: "Test Gadgets",
|
|
67
|
-
description: "Disposable test gadgets category.",
|
|
68
|
-
rootId: "category-tester-sandbox",
|
|
69
|
-
parentIds: ["category-tester-sandbox"],
|
|
70
|
-
childrenIds: [],
|
|
71
|
-
tier: 1,
|
|
72
|
-
path: "tester-sandbox/gadgets",
|
|
73
|
-
order: 1,
|
|
74
|
-
isLeaf: true,
|
|
75
|
-
position: 0,
|
|
76
|
-
subtreeSize: 0,
|
|
77
|
-
metrics: emptyMetrics,
|
|
78
|
-
isFeatured: false,
|
|
79
|
-
isBrand: false,
|
|
80
|
-
isActive: true,
|
|
81
|
-
isSearchable: true,
|
|
82
|
-
showOnHomepage: false,
|
|
83
|
-
createdBy: "user-admin-letitrip",
|
|
84
|
-
isTestData: true,
|
|
85
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
86
|
-
createdAt: new Date(),
|
|
87
|
-
updatedAt: new Date(),
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "category-tester-collectibles",
|
|
91
|
-
slug: "category-tester-collectibles",
|
|
92
|
-
name: "Test Collectibles",
|
|
93
|
-
description: "Disposable test collectibles category.",
|
|
94
|
-
rootId: "category-tester-sandbox",
|
|
95
|
-
parentIds: ["category-tester-sandbox"],
|
|
96
|
-
childrenIds: [],
|
|
97
|
-
tier: 1,
|
|
98
|
-
path: "tester-sandbox/collectibles",
|
|
99
|
-
order: 2,
|
|
100
|
-
isLeaf: true,
|
|
101
|
-
position: 1,
|
|
102
|
-
subtreeSize: 0,
|
|
103
|
-
metrics: emptyMetrics,
|
|
104
|
-
isFeatured: false,
|
|
105
|
-
isBrand: false,
|
|
106
|
-
isActive: true,
|
|
107
|
-
isSearchable: true,
|
|
108
|
-
showOnHomepage: false,
|
|
109
|
-
createdBy: "user-admin-letitrip",
|
|
110
|
-
isTestData: true,
|
|
111
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
112
|
-
createdAt: new Date(),
|
|
113
|
-
updatedAt: new Date(),
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
// Deliberately isActive:false — the entire real seed dataset (17 categories
|
|
117
|
-
// before this) has isActive:true on every single row, so the admin Categories
|
|
118
|
-
// dashboard's "isActive" toggle (backed by the categories(isActive, name ASC)
|
|
119
|
-
// composite index) had nothing to show when toggled to the inactive branch.
|
|
120
|
-
id: "category-tester-inactive",
|
|
121
|
-
slug: "category-tester-inactive",
|
|
122
|
-
name: "Test Inactive Category",
|
|
123
|
-
description: "Disposable test category deliberately seeded as inactive, for verifying the admin Categories isActive toggle. Auto-expires in 7 days.",
|
|
124
|
-
rootId: "category-tester-sandbox",
|
|
125
|
-
parentIds: ["category-tester-sandbox"],
|
|
126
|
-
childrenIds: [],
|
|
127
|
-
tier: 1,
|
|
128
|
-
path: "tester-sandbox/inactive",
|
|
129
|
-
order: 3,
|
|
130
|
-
isLeaf: true,
|
|
131
|
-
position: 2,
|
|
132
|
-
subtreeSize: 0,
|
|
133
|
-
metrics: emptyMetrics,
|
|
134
|
-
isFeatured: false,
|
|
135
|
-
isBrand: false,
|
|
136
|
-
isActive: false,
|
|
137
|
-
isSearchable: false,
|
|
138
|
-
showOnHomepage: false,
|
|
139
|
-
createdBy: "user-admin-letitrip",
|
|
140
|
-
isTestData: true,
|
|
141
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
142
|
-
createdAt: new Date(),
|
|
143
|
-
updatedAt: new Date(),
|
|
144
|
-
},
|
|
145
|
-
// ── BRAND ────────────────────────────────────────────────────────────────
|
|
146
|
-
{
|
|
147
|
-
id: "brand-tester-sandbox",
|
|
148
|
-
slug: "brand-tester-sandbox",
|
|
149
|
-
name: "TestBrand",
|
|
150
|
-
categoryType: CATEGORY_FIELDS.CATEGORY_TYPE_VALUES.BRAND,
|
|
151
|
-
description: "Disposable test brand for the tester QA program.",
|
|
152
|
-
brandWebsite: "https://example.com",
|
|
153
|
-
brandCountry: "India",
|
|
154
|
-
rootId: "brand-tester-sandbox",
|
|
155
|
-
parentIds: [],
|
|
156
|
-
childrenIds: [],
|
|
157
|
-
tier: 0,
|
|
158
|
-
path: "brand-tester-sandbox",
|
|
159
|
-
order: 999,
|
|
160
|
-
isLeaf: true,
|
|
161
|
-
position: 0,
|
|
162
|
-
subtreeSize: 0,
|
|
163
|
-
metrics: emptyMetrics,
|
|
164
|
-
isFeatured: false,
|
|
165
|
-
isBrand: true,
|
|
166
|
-
isActive: true,
|
|
167
|
-
isSearchable: true,
|
|
168
|
-
showOnHomepage: false,
|
|
169
|
-
createdBy: "user-admin-letitrip",
|
|
170
|
-
isTestData: true,
|
|
171
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
172
|
-
createdAt: new Date(),
|
|
173
|
-
updatedAt: new Date(),
|
|
174
|
-
},
|
|
175
|
-
// ── BUNDLE ───────────────────────────────────────────────────────────────
|
|
176
|
-
{
|
|
177
|
-
id: "bundle-tester-sandbox",
|
|
178
|
-
slug: "bundle-tester-sandbox",
|
|
179
|
-
name: "Test Bundle",
|
|
180
|
-
description: "Two disposable test products bundled at a discount — for testing the bundle flow.",
|
|
181
|
-
categoryType: "bundle",
|
|
182
|
-
bundleKind: "special",
|
|
183
|
-
bundlePrice: 199,
|
|
184
|
-
bundleQueryRule: {
|
|
185
|
-
type: "static",
|
|
186
|
-
productIds: ["product-tester-standard-1", "product-tester-standard-2"],
|
|
187
|
-
},
|
|
188
|
-
bundleProductIds: ["product-tester-standard-1", "product-tester-standard-2"],
|
|
189
|
-
bundleOriginalTotal: 348, // 199 + 149
|
|
190
|
-
bundleStockStatus: "in_stock",
|
|
191
|
-
// Without these, `addBundleToCartAction` wrote `storeId: ""` on the cart
|
|
192
|
-
// line, which produced an order group keyed `standard:` with an undefined
|
|
193
|
-
// storeId — no seller notification, no shipping resolution, no payout. The
|
|
194
|
-
// bug was seeded in, so it reproduced on every tester run.
|
|
195
|
-
createdByStoreId: "store-tester-qa-seller",
|
|
196
|
-
createdByStoreName: "Tester Sandbox Store",
|
|
197
|
-
rootId: "bundle-tester-sandbox",
|
|
198
|
-
parentIds: [],
|
|
199
|
-
childrenIds: [],
|
|
200
|
-
tier: 0,
|
|
201
|
-
path: "bundle-tester-sandbox",
|
|
202
|
-
order: 999,
|
|
203
|
-
isLeaf: true,
|
|
204
|
-
position: 0,
|
|
205
|
-
subtreeSize: 0,
|
|
206
|
-
metrics: emptyMetrics,
|
|
207
|
-
isFeatured: false,
|
|
208
|
-
isBrand: false,
|
|
209
|
-
isActive: true,
|
|
210
|
-
isSearchable: true,
|
|
211
|
-
showOnHomepage: false,
|
|
212
|
-
createdBy: "user-admin-letitrip",
|
|
213
|
-
isTestData: true,
|
|
214
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
215
|
-
createdAt: new Date(),
|
|
216
|
-
updatedAt: new Date(),
|
|
217
|
-
},
|
|
218
|
-
];
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHY: Shared tester sandbox — 3 disposable test coupons so testers can exercise
|
|
3
|
-
* coupon apply/reject edge cases end to end: a perUserLimit:1 admin coupon (to
|
|
4
|
-
* verify the second-use rejection), an already-expired admin coupon (to verify
|
|
5
|
-
* the expiry rejection), and a seller-scope coupon on store-tester-sandbox.
|
|
6
|
-
* NOTE: CouponDocument does not currently carry isTestData/testDataExpiresAt
|
|
7
|
-
* (unlike categories/stores/products/blogPosts/events) — testerSandboxCleanup
|
|
8
|
-
* does not cascade-delete these. They're small, static, and harmless to leave;
|
|
9
|
-
* extending the cleanup script to cover coupons is a follow-up, not blocking.
|
|
10
|
-
* WHAT: Exports couponsTesterSeedData — 3 Partial<CouponDocument> for the seed runner.
|
|
11
|
-
*
|
|
12
|
-
* EXPORTS:
|
|
13
|
-
* couponsTesterSeedData — Array of 3 Partial<CouponDocument> for the seed runner
|
|
14
|
-
*
|
|
15
|
-
* @tag domain:coupons,tester
|
|
16
|
-
* @tag layer:seed
|
|
17
|
-
* @tag pattern:none
|
|
18
|
-
* @tag access:server-only
|
|
19
|
-
* @tag consumers:seed/index.ts,seed-cli.mjs
|
|
20
|
-
* @tag sideEffects:none
|
|
21
|
-
*/
|
|
22
|
-
import { COUPON_FIELDS } from "../../../constants/field-names";
|
|
23
|
-
const NOW = new Date();
|
|
24
|
-
const daysAgo = (n) => new Date(NOW.getTime() - n * 86400000);
|
|
25
|
-
const daysAhead = (n) => new Date(NOW.getTime() + n * 86400000);
|
|
26
|
-
export const couponsTesterSeedData = [
|
|
27
|
-
{
|
|
28
|
-
id: "coupon-tester-sandbox-limited",
|
|
29
|
-
code: "TESTERLIMITED",
|
|
30
|
-
name: "Tester Sandbox — One Use Per Tester",
|
|
31
|
-
description: "Disposable test coupon: 10% off, capped at one use per tester. Use it twice to verify the second attempt is rejected.",
|
|
32
|
-
type: COUPON_FIELDS.TYPE_VALUES.PERCENTAGE,
|
|
33
|
-
scope: COUPON_FIELDS.SCOPE_VALUES.ADMIN,
|
|
34
|
-
discount: { value: 10, maxDiscount: 100, minPurchase: 100 },
|
|
35
|
-
usage: { totalLimit: undefined, perUserLimit: 1, currentUsage: 0 },
|
|
36
|
-
validity: { startDate: daysAgo(1), endDate: daysAhead(7), isActive: true },
|
|
37
|
-
restrictions: { firstTimeUserOnly: false },
|
|
38
|
-
createdBy: "user-admin-letitrip",
|
|
39
|
-
createdAt: daysAgo(1),
|
|
40
|
-
updatedAt: daysAgo(1),
|
|
41
|
-
stats: { totalUses: 0, totalRevenue: 0, totalDiscount: 0 },
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "coupon-tester-sandbox-expired",
|
|
45
|
-
code: "TESTEREXPIRED",
|
|
46
|
-
name: "Tester Sandbox — Already Expired",
|
|
47
|
-
description: "Disposable test coupon that already expired — applying it at checkout should show a specific expiry rejection.",
|
|
48
|
-
type: COUPON_FIELDS.TYPE_VALUES.FIXED,
|
|
49
|
-
scope: COUPON_FIELDS.SCOPE_VALUES.ADMIN,
|
|
50
|
-
discount: { value: 50, maxDiscount: 50, minPurchase: 100 },
|
|
51
|
-
usage: { totalLimit: undefined, perUserLimit: 5, currentUsage: 0 },
|
|
52
|
-
validity: { startDate: daysAgo(30), endDate: daysAgo(1), isActive: true },
|
|
53
|
-
restrictions: { firstTimeUserOnly: false },
|
|
54
|
-
createdBy: "user-admin-letitrip",
|
|
55
|
-
createdAt: daysAgo(30),
|
|
56
|
-
updatedAt: daysAgo(30),
|
|
57
|
-
stats: { totalUses: 0, totalRevenue: 0, totalDiscount: 0 },
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "coupon-tester-sandbox-seller",
|
|
61
|
-
code: "TESTERSTORE",
|
|
62
|
-
name: "Tester Sandbox Store — 5% Off",
|
|
63
|
-
description: "Disposable seller-scope test coupon on the tester sandbox store.",
|
|
64
|
-
type: COUPON_FIELDS.TYPE_VALUES.PERCENTAGE,
|
|
65
|
-
scope: COUPON_FIELDS.SCOPE_VALUES.SELLER,
|
|
66
|
-
storeId: "store-tester-sandbox",
|
|
67
|
-
discount: { value: 5, maxDiscount: 50, minPurchase: 0 },
|
|
68
|
-
usage: { totalLimit: undefined, perUserLimit: 3, currentUsage: 0 },
|
|
69
|
-
validity: { startDate: daysAgo(1), endDate: daysAhead(7), isActive: true },
|
|
70
|
-
restrictions: { firstTimeUserOnly: false },
|
|
71
|
-
createdBy: "user-admin-letitrip",
|
|
72
|
-
createdAt: daysAgo(1),
|
|
73
|
-
updatedAt: daysAgo(1),
|
|
74
|
-
stats: { totalUses: 0, totalRevenue: 0, totalDiscount: 0 },
|
|
75
|
-
},
|
|
76
|
-
];
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHY: Shared tester sandbox — disposable test events covering spin-wheel, both raffle
|
|
3
|
-
* variants, a coupon offer, and a lottery with a pre-booked slot, so testers can
|
|
4
|
-
* exercise each flow end to end.
|
|
5
|
-
* WHAT: Exports eventsTesterSeedData — 5 Partial<EventDocument> tagged isTestData:true.
|
|
6
|
-
*
|
|
7
|
-
* The lottery's draw window is expressed via tester-window.ts rather than a fixed
|
|
8
|
-
* duration, so an automated run can shorten it and still watch the window close.
|
|
9
|
-
* The other four stay long-lived on purpose: they are meant to read as ACTIVE
|
|
10
|
-
* events for a human tester who seeds today and returns tomorrow. A fixture that
|
|
11
|
-
* must expire mid-session should be added as its own row, not by re-timing these.
|
|
12
|
-
*
|
|
13
|
-
* EXPORTS:
|
|
14
|
-
* eventsTesterSeedData — Array of 5 Partial<EventDocument> for the seed runner
|
|
15
|
-
*
|
|
16
|
-
* @tag domain:events,tester
|
|
17
|
-
* @tag layer:seed
|
|
18
|
-
* @tag pattern:none
|
|
19
|
-
* @tag access:server-only
|
|
20
|
-
* @tag consumers:seed/index.ts,seed-cli.mjs
|
|
21
|
-
* @tag sideEffects:none
|
|
22
|
-
*/
|
|
23
|
-
import { EVENT_FIELDS } from "../../../constants/field-names";
|
|
24
|
-
import { seedPhoto } from "../../../seed/_helpers/media";
|
|
25
|
-
import { testDataExpiresAt } from "./tester-ttl";
|
|
26
|
-
import { windowMinutes, windowOffset } from "./tester-window";
|
|
27
|
-
const TEST_EVENT_COVER_ALT = "Test event cover";
|
|
28
|
-
const TEST_RAFFLE_PRIZE = "Test prize — not a real reward";
|
|
29
|
-
export const eventsTesterSeedData = [
|
|
30
|
-
{
|
|
31
|
-
id: "event-tester-sandbox-spin",
|
|
32
|
-
slug: "tester-sandbox-spin",
|
|
33
|
-
type: EVENT_FIELDS.TYPE_VALUES.SPIN_WHEEL,
|
|
34
|
-
title: "Tester Sandbox — Spin the Wheel",
|
|
35
|
-
description: "Disposable test event for the tester QA program. Spin the wheel and confirm a prize is assigned.",
|
|
36
|
-
status: EVENT_FIELDS.STATUS_VALUES.ACTIVE,
|
|
37
|
-
startsAt: new Date(),
|
|
38
|
-
endsAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
39
|
-
coverImage: { type: "image", url: seedPhoto("event-cover-tester-sandbox-spin-20260101", 1200, 600), alt: TEST_EVENT_COVER_ALT },
|
|
40
|
-
tags: ["test"],
|
|
41
|
-
hasRaffle: true,
|
|
42
|
-
raffleType: "open_raffle",
|
|
43
|
-
rafflePrize: TEST_RAFFLE_PRIZE,
|
|
44
|
-
raffleEntryCount: 0,
|
|
45
|
-
spinPrizes: [
|
|
46
|
-
{ id: "spin-tester-win", label: "You Win!", weight: 50, isActive: true },
|
|
47
|
-
{ id: "spin-tester-try-again", label: "Try Again", weight: 50, isActive: true },
|
|
48
|
-
],
|
|
49
|
-
spinMaxPerUser: 1,
|
|
50
|
-
spinWindowStart: new Date(),
|
|
51
|
-
spinWindowEnd: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
52
|
-
stats: { totalEntries: 0, approvedEntries: 0, flaggedEntries: 0 },
|
|
53
|
-
createdBy: "user-admin-letitrip",
|
|
54
|
-
isTestData: true,
|
|
55
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
56
|
-
createdAt: new Date(),
|
|
57
|
-
updatedAt: new Date(),
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "event-tester-sandbox-top-scorers",
|
|
61
|
-
slug: "tester-sandbox-top-scorers",
|
|
62
|
-
type: EVENT_FIELDS.TYPE_VALUES.RAFFLE,
|
|
63
|
-
title: "Tester Sandbox — Top Scorers Raffle",
|
|
64
|
-
description: "Disposable test event for the tester QA program. Verify top_n_scorers raffle entry and the leaderboard.",
|
|
65
|
-
status: EVENT_FIELDS.STATUS_VALUES.ACTIVE,
|
|
66
|
-
startsAt: new Date(),
|
|
67
|
-
endsAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
68
|
-
coverImage: { type: "image", url: seedPhoto("event-cover-tester-sandbox-top-scorers-20260101", 1200, 600), alt: TEST_EVENT_COVER_ALT },
|
|
69
|
-
tags: ["test"],
|
|
70
|
-
hasRaffle: true,
|
|
71
|
-
raffleType: "top_n_scorers",
|
|
72
|
-
raffleTopN: 3,
|
|
73
|
-
rafflePrize: TEST_RAFFLE_PRIZE,
|
|
74
|
-
raffleEntryCount: 0,
|
|
75
|
-
stats: { totalEntries: 0, approvedEntries: 0, flaggedEntries: 0 },
|
|
76
|
-
createdBy: "user-admin-letitrip",
|
|
77
|
-
isTestData: true,
|
|
78
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
79
|
-
createdAt: new Date(),
|
|
80
|
-
updatedAt: new Date(),
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: "event-tester-sandbox-top-participants",
|
|
84
|
-
slug: "tester-sandbox-top-participants",
|
|
85
|
-
type: EVENT_FIELDS.TYPE_VALUES.RAFFLE,
|
|
86
|
-
title: "Tester Sandbox — Top Participants Raffle",
|
|
87
|
-
description: "Disposable test event for the tester QA program. Verify top_n_participants raffle entry.",
|
|
88
|
-
status: EVENT_FIELDS.STATUS_VALUES.ACTIVE,
|
|
89
|
-
startsAt: new Date(),
|
|
90
|
-
endsAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
91
|
-
coverImage: { type: "image", url: seedPhoto("event-cover-tester-sandbox-top-participants-20260101", 1200, 600), alt: TEST_EVENT_COVER_ALT },
|
|
92
|
-
tags: ["test"],
|
|
93
|
-
hasRaffle: true,
|
|
94
|
-
raffleType: "top_n_participants",
|
|
95
|
-
raffleTopN: 5,
|
|
96
|
-
rafflePrize: TEST_RAFFLE_PRIZE,
|
|
97
|
-
raffleEntryCount: 0,
|
|
98
|
-
stats: { totalEntries: 0, approvedEntries: 0, flaggedEntries: 0 },
|
|
99
|
-
createdBy: "user-admin-letitrip",
|
|
100
|
-
isTestData: true,
|
|
101
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
102
|
-
createdAt: new Date(),
|
|
103
|
-
updatedAt: new Date(),
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: "event-tester-sandbox-offer",
|
|
107
|
-
slug: "tester-sandbox-offer",
|
|
108
|
-
type: EVENT_FIELDS.TYPE_VALUES.OFFER,
|
|
109
|
-
title: "Tester Sandbox — Offer Coupon",
|
|
110
|
-
description: "Disposable test event for the tester QA program. Verify the Overview tab shows the coupon code and the Copy code button copies it to the clipboard.",
|
|
111
|
-
status: EVENT_FIELDS.STATUS_VALUES.ACTIVE,
|
|
112
|
-
startsAt: new Date(),
|
|
113
|
-
endsAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
114
|
-
coverImage: { type: "image", url: seedPhoto("event-cover-tester-sandbox-offer-20260101", 1200, 600), alt: TEST_EVENT_COVER_ALT },
|
|
115
|
-
tags: ["test"],
|
|
116
|
-
offerConfig: {
|
|
117
|
-
couponId: "coupon-rehan10",
|
|
118
|
-
displayCode: "REHAN10",
|
|
119
|
-
bannerText: "Test offer — not a real discount.",
|
|
120
|
-
},
|
|
121
|
-
stats: { totalEntries: 0, approvedEntries: 0, flaggedEntries: 0 },
|
|
122
|
-
createdBy: "user-admin-letitrip",
|
|
123
|
-
isTestData: true,
|
|
124
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
125
|
-
createdAt: new Date(),
|
|
126
|
-
updatedAt: new Date(),
|
|
127
|
-
},
|
|
128
|
-
// ── Lottery, with one slot ALREADY BOOKED ───────────────────────────────────
|
|
129
|
-
// This fixture exists for exactly two checklist cases, both marked 🛑:
|
|
130
|
-
// page-wiring/data-loss/lottery-edit-preserves-bookings
|
|
131
|
-
// page-wiring/data-loss/lottery-booked-slot-cannot-be-deleted
|
|
132
|
-
// Neither could be tested before, because no lottery fixture existed anywhere —
|
|
133
|
-
// lottery events could previously only come from a hand-run seed.
|
|
134
|
-
//
|
|
135
|
-
// 🛑 Slot 3's booking IS the fixture. A booked slot carries a buyer id, a display
|
|
136
|
-
// name and a lottery number, and the bug being guarded silently cleared all three
|
|
137
|
-
// while returning a success message. Do not "tidy" this into an all-unbooked
|
|
138
|
-
// lottery — an unbooked slot cannot demonstrate the loss, and the case would then
|
|
139
|
-
// pass against the very bug it exists to catch.
|
|
140
|
-
//
|
|
141
|
-
// price/weight are server-only (toClientLotterySlot strips them). Uniform pricing
|
|
142
|
-
// means every slot is weight 50 by definition — see computeWeight().
|
|
143
|
-
{
|
|
144
|
-
id: "event-tester-sandbox-lottery",
|
|
145
|
-
slug: "tester-sandbox-lottery",
|
|
146
|
-
type: EVENT_FIELDS.TYPE_VALUES.LOTTERY,
|
|
147
|
-
title: "Tester Sandbox — Lottery",
|
|
148
|
-
description: "Disposable test lottery for the tester QA program. Slot 3 is pre-booked: edit an unrelated slot, save, reopen, and confirm slot 3 is STILL booked to the same buyer with the same lottery number.",
|
|
149
|
-
status: EVENT_FIELDS.STATUS_VALUES.ACTIVE,
|
|
150
|
-
startsAt: new Date(),
|
|
151
|
-
endsAt: windowOffset(1),
|
|
152
|
-
coverImage: {
|
|
153
|
-
type: "image",
|
|
154
|
-
url: seedPhoto("event-cover-tester-sandbox-lottery-20260101", 1200, 600),
|
|
155
|
-
alt: TEST_EVENT_COVER_ALT,
|
|
156
|
-
},
|
|
157
|
-
tags: ["test"],
|
|
158
|
-
lotteryConfig: {
|
|
159
|
-
totalSlots: 6,
|
|
160
|
-
pricingMode: "uniform",
|
|
161
|
-
uniformPrice: 100,
|
|
162
|
-
// Must outlast the run, or late batches meet a closed lottery. windowOffset(1)
|
|
163
|
-
// is the run's end, so the draw window is expressed in the same units.
|
|
164
|
-
drawWindowDurationMinutes: Math.ceil(windowMinutes()),
|
|
165
|
-
maxPullsPerTransaction: 1,
|
|
166
|
-
maxPullsPerUser: 1,
|
|
167
|
-
slots: [
|
|
168
|
-
{ slotNumber: 1, name: "Test Prize — Dragoon Storm", price: 100, weight: 50, isBooked: false, image: seedPhoto("lottery-slot-tester-1-20260101", 600, 600) },
|
|
169
|
-
{ slotNumber: 2, name: "Test Prize — Dranzer S", price: 100, weight: 50, isBooked: false, image: seedPhoto("lottery-slot-tester-2-20260101", 600, 600) },
|
|
170
|
-
{
|
|
171
|
-
slotNumber: 3,
|
|
172
|
-
name: "Test Prize — Draciel Shield",
|
|
173
|
-
price: 100,
|
|
174
|
-
weight: 50,
|
|
175
|
-
isBooked: true,
|
|
176
|
-
bookedByUserId: "user-ash-trainer",
|
|
177
|
-
bookedByDisplayName: "Mock User 4",
|
|
178
|
-
bookedByUserLotteryNumber: 1,
|
|
179
|
-
image: seedPhoto("lottery-slot-tester-3-20260101", 600, 600),
|
|
180
|
-
},
|
|
181
|
-
{ slotNumber: 4, name: "Test Prize — Driger F", price: 100, weight: 50, isBooked: false },
|
|
182
|
-
{ slotNumber: 5, name: "Test Prize — Wolborg", price: 100, weight: 50, isBooked: false },
|
|
183
|
-
{ slotNumber: 6, name: "Test Prize — Trygle", price: 100, weight: 50, isBooked: false },
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
stats: { totalEntries: 1, approvedEntries: 1, flaggedEntries: 0 },
|
|
187
|
-
createdBy: "user-admin-letitrip",
|
|
188
|
-
isTestData: true,
|
|
189
|
-
testDataExpiresAt: testDataExpiresAt(),
|
|
190
|
-
createdAt: new Date(),
|
|
191
|
-
updatedAt: new Date(),
|
|
192
|
-
},
|
|
193
|
-
];
|