@mohasinac/appkit 2.7.10 → 2.7.12
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/jobs/core/assignSpinPrize.js +8 -7
- package/dist/_internal/server/jobs/core/bundleStockSync.js +11 -6
- package/dist/_internal/server/jobs/core/countersReconcile.js +3 -2
- package/dist/_internal/server/jobs/core/onProductStockChange.js +12 -7
- package/dist/_internal/server/jobs/core/onProductWrite.js +3 -2
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +7 -5
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +11 -6
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +13 -7
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +9 -4
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +3 -2
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +32 -32
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +20 -20
- package/dist/_internal/shared/features/promotions/schema.d.ts +2 -2
- package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
- package/dist/configs/next.js +17 -1
- package/dist/constants/field-names.d.ts +813 -0
- package/dist/constants/field-names.js +918 -0
- package/dist/constants/sort.d.ts +7 -0
- package/dist/constants/sort.js +5 -0
- package/dist/constants/table-keys.d.ts +48 -0
- package/dist/constants/table-keys.js +46 -0
- package/dist/features/account/components/AddressesIndexListing.js +9 -6
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -1
- package/dist/features/admin/components/AdminBidsView.js +4 -1
- package/dist/features/admin/components/AdminBlogView.js +9 -2
- package/dist/features/admin/components/AdminBrandsView.js +9 -2
- package/dist/features/admin/components/AdminCarouselView.js +4 -1
- package/dist/features/admin/components/AdminCartsView.js +4 -1
- package/dist/features/admin/components/AdminCategoriesView.js +9 -2
- package/dist/features/admin/components/AdminContactView.js +4 -1
- package/dist/features/admin/components/AdminCouponsView.js +4 -1
- package/dist/features/admin/components/AdminFaqsView.js +5 -1
- package/dist/features/admin/components/AdminFeaturesView.js +5 -2
- package/dist/features/admin/components/AdminHistoryView.js +5 -1
- package/dist/features/admin/components/AdminNewsletterView.js +4 -1
- package/dist/features/admin/components/AdminNotificationsView.js +4 -1
- package/dist/features/admin/components/AdminOrdersView.js +14 -12
- package/dist/features/admin/components/AdminPayoutsView.js +4 -1
- package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -1
- package/dist/features/admin/components/AdminProductsView.js +14 -3
- package/dist/features/admin/components/AdminReturnRequestsView.js +4 -1
- package/dist/features/admin/components/AdminReviewsView.js +4 -1
- package/dist/features/admin/components/AdminScammersView.js +4 -1
- package/dist/features/admin/components/AdminSessionsView.js +4 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +5 -1
- package/dist/features/admin/components/AdminStoresView.js +10 -3
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +4 -1
- package/dist/features/admin/components/AdminSupportTicketsView.js +4 -1
- package/dist/features/admin/components/AdminTeamView.js +4 -1
- package/dist/features/admin/components/AdminUsersView.js +9 -12
- package/dist/features/admin/components/AdminViewCards.d.ts +12 -0
- package/dist/features/admin/components/AdminViewCards.js +53 -0
- package/dist/features/admin/components/AdminWishlistsView.js +4 -1
- package/dist/features/auctions/repository/bid.repository.js +1 -6
- package/dist/features/auctions/schemas/index.d.ts +4 -4
- package/dist/features/blog/actions/blog-actions.d.ts +16 -16
- package/dist/features/blog/components/BlogFilters.d.ts +28 -28
- package/dist/features/blog/components/BlogFilters.js +18 -15
- package/dist/features/blog/components/BlogIndexListing.js +24 -13
- package/dist/features/blog/schemas/index.d.ts +10 -10
- package/dist/features/categories/components/CategoriesIndexListing.js +30 -19
- package/dist/features/categories/schemas/index.d.ts +2 -2
- package/dist/features/events/components/AdminEventsView.js +5 -1
- package/dist/features/events/components/EventFilters.d.ts +24 -24
- package/dist/features/events/components/EventFilters.js +16 -13
- package/dist/features/events/components/EventStatusBadge.js +1 -0
- package/dist/features/events/components/EventsIndexListing.js +36 -24
- package/dist/features/events/components/EventsListPageView.js +13 -10
- package/dist/features/events/schemas/firestore.d.ts +1 -0
- package/dist/features/events/schemas/firestore.js +1 -0
- package/dist/features/events/schemas/index.d.ts +1 -1
- package/dist/features/events/types/index.d.ts +1 -1
- package/dist/features/faq/actions/faq-actions.d.ts +10 -10
- package/dist/features/faq/schemas/index.d.ts +4 -4
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/orders/components/OrderFilters.d.ts +20 -20
- package/dist/features/orders/components/OrderFilters.js +33 -30
- package/dist/features/orders/repository/orders.repository.js +1 -15
- package/dist/features/orders/schemas/index.d.ts +2 -2
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +44 -36
- package/dist/features/pre-orders/schemas/index.d.ts +3 -3
- package/dist/features/products/components/AuctionsIndexListing.js +63 -30
- package/dist/features/products/components/BidHistory.d.ts +0 -1
- package/dist/features/products/components/BidHistory.js +1 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +44 -37
- package/dist/features/products/components/ProductDetailPageView.js +1 -1
- package/dist/features/products/components/ProductFilters.d.ts +20 -20
- package/dist/features/products/components/ProductFilters.js +62 -59
- package/dist/features/products/components/ProductsIndexListing.js +37 -29
- package/dist/features/products/components/ProductsIndexPageView.js +18 -10
- package/dist/features/products/hooks/useProducts.js +2 -0
- package/dist/features/products/repository/products.repository.js +2 -22
- package/dist/features/products/schemas/index.d.ts +28 -28
- package/dist/features/products/schemas/product-features.validators.d.ts +12 -12
- package/dist/features/products/types/index.d.ts +2 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +21 -17
- package/dist/features/promotions/schemas/index.d.ts +4 -4
- package/dist/features/reviews/components/ReviewDetailShell.js +6 -5
- package/dist/features/reviews/components/ReviewFilters.d.ts +16 -16
- package/dist/features/reviews/components/ReviewFilters.js +10 -7
- package/dist/features/reviews/components/ReviewsIndexListing.js +25 -14
- package/dist/features/reviews/components/ReviewsList.d.ts +5 -2
- package/dist/features/reviews/components/ReviewsList.js +11 -5
- package/dist/features/reviews/schemas/firestore.d.ts +1 -0
- package/dist/features/reviews/schemas/index.d.ts +8 -8
- package/dist/features/reviews/types/index.d.ts +1 -0
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +5 -1
- package/dist/features/seller/components/SellerBidsView.js +4 -1
- package/dist/features/seller/components/SellerCouponsView.js +4 -1
- package/dist/features/seller/components/SellerOffersView.js +5 -1
- package/dist/features/seller/components/SellerOrdersView.js +4 -1
- package/dist/features/seller/components/SellerPayoutsView.js +5 -1
- package/dist/features/seller/components/SellerPreOrdersView.js +4 -1
- package/dist/features/seller/components/SellerPrizeDrawsView.js +4 -1
- package/dist/features/seller/components/SellerProductsView.js +4 -1
- package/dist/features/seller/schemas/index.d.ts +10 -10
- package/dist/features/stores/api/route.js +10 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +2 -1
- package/dist/features/stores/components/StorePreOrdersListing.js +2 -1
- package/dist/features/stores/components/StoreReviewsListing.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +45 -27
- package/dist/features/stores/schemas/firestore.d.ts +1 -0
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/index.js +12 -1
- package/dist/react/hooks/useUrlTable.js +2 -1
- package/dist/seed/bids-seed-data.js +45 -44
- package/dist/seed/categories-seed-data.js +41 -40
- package/dist/seed/coupons-seed-data.js +41 -40
- package/dist/seed/products-auctions-seed-data.js +54 -53
- package/dist/seed/products-preorders-seed-data.js +25 -24
- package/dist/seed/products-prize-draws-seed-data.js +24 -23
- package/dist/seed/products-standard-seed-data.js +294 -293
- package/dist/seed/reviews-seed-data.js +61 -60
- package/dist/seed/scammers-seed-data.js +3 -2
- package/dist/seed/stores-seed-data.js +9 -8
- package/dist/seed/support-tickets-seed-data.js +13 -12
- package/dist/seed/users-seed-data.js +28 -27
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/ListingToolbar.d.ts +7 -4
- package/dist/ui/components/ListingToolbar.js +4 -3
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/utils/sieve-builder.d.ts +41 -0
- package/dist/utils/sieve-builder.js +66 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* `crypto.randomInt`. Enforces one spin per user.
|
|
4
4
|
*/
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
|
+
import { EVENT_ENTRY_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
6
7
|
const EVENTS_COLLECTION = "events";
|
|
7
8
|
const EVENT_ENTRIES_COLLECTION = "eventEntries";
|
|
8
9
|
const COUPONS_COLLECTION = "coupons";
|
|
@@ -20,8 +21,8 @@ export async function runAssignSpinPrize(input, ctx) {
|
|
|
20
21
|
}
|
|
21
22
|
const entriesSnap = await ctx.db
|
|
22
23
|
.collection(EVENT_ENTRIES_COLLECTION)
|
|
23
|
-
.where(
|
|
24
|
-
.where(
|
|
24
|
+
.where(EVENT_ENTRY_FIELDS.EVENT_ID, "==", eventId)
|
|
25
|
+
.where(EVENT_ENTRY_FIELDS.USER_ID, "==", userId)
|
|
25
26
|
.limit(1)
|
|
26
27
|
.get();
|
|
27
28
|
if (entriesSnap.empty) {
|
|
@@ -60,11 +61,11 @@ export async function runAssignSpinPrize(input, ctx) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
await entryDoc.ref.update({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
[EVENT_ENTRY_FIELDS.SPIN_USED]: true,
|
|
65
|
+
[EVENT_ENTRY_FIELDS.SPIN_PRIZE_ID]: pick.id,
|
|
66
|
+
[EVENT_ENTRY_FIELDS.SPIN_WON_AT]: ctx.now,
|
|
67
|
+
[EVENT_ENTRY_FIELDS.SPIN_PRIZE_COUPON_CODE]: spinPrizeCouponCode ?? null,
|
|
68
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
68
69
|
});
|
|
69
70
|
ctx.logger.info("Spin prize assigned", {
|
|
70
71
|
eventId,
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
* `bundleStockStatus`. This sweep recomputes `bundleStockStatus` for
|
|
7
7
|
* every active bundle by inspecting its members' product status.
|
|
8
8
|
*/
|
|
9
|
+
import { CATEGORY_FIELDS, PRODUCT_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
9
10
|
const CATEGORIES_COLLECTION = "categories";
|
|
10
11
|
const PRODUCT_COLLECTION = "products";
|
|
11
|
-
const UNAVAILABLE = new Set([
|
|
12
|
+
const UNAVAILABLE = new Set([
|
|
13
|
+
PRODUCT_FIELDS.STATUS_VALUES.SOLD,
|
|
14
|
+
PRODUCT_FIELDS.STATUS_VALUES.OUT_OF_STOCK,
|
|
15
|
+
PRODUCT_FIELDS.STATUS_VALUES.DISCONTINUED,
|
|
16
|
+
]);
|
|
12
17
|
const MIN_ACTIVE_DEFAULT = 1;
|
|
13
18
|
async function computeBundleStockStatus(productIds, minActive, ctx) {
|
|
14
19
|
if (productIds.length === 0)
|
|
@@ -39,8 +44,8 @@ export async function runBundleStockSync(ctx) {
|
|
|
39
44
|
ctx.logger.info("Bundle stock sync starting (SB-UNI-V categories)");
|
|
40
45
|
const snap = await ctx.db
|
|
41
46
|
.collection(CATEGORIES_COLLECTION)
|
|
42
|
-
.where(
|
|
43
|
-
.where(
|
|
47
|
+
.where(CATEGORY_FIELDS.CATEGORY_TYPE, "==", CATEGORY_FIELDS.CATEGORY_TYPE_VALUES.BUNDLE)
|
|
48
|
+
.where(CATEGORY_FIELDS.IS_ACTIVE, "==", true)
|
|
44
49
|
.limit(500)
|
|
45
50
|
.get();
|
|
46
51
|
if (snap.empty) {
|
|
@@ -57,9 +62,9 @@ export async function runBundleStockSync(ctx) {
|
|
|
57
62
|
const nextStatus = await computeBundleStockStatus(productIds, minActive, ctx);
|
|
58
63
|
if (nextStatus !== data.bundleStockStatus) {
|
|
59
64
|
await bundleDoc.ref.update({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
[CATEGORY_FIELDS.BUNDLE_STOCK_STATUS]: nextStatus,
|
|
66
|
+
[CATEGORY_FIELDS.BUNDLE_QUERY_RESOLVED_AT]: ctx.now,
|
|
67
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
63
68
|
});
|
|
64
69
|
updated++;
|
|
65
70
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { categoriesRepository, reviewRepository, storeRepository, } from "../../../../repositories";
|
|
2
2
|
import { ProductStatusValues, PRODUCT_COLLECTION } from "../../../../features/products/schemas/firestore";
|
|
3
|
+
import { ORDER_FIELDS, PRODUCT_FIELDS } from "../../../../constants/field-names";
|
|
3
4
|
import { QUERY_LIMIT } from "../handlers/messages";
|
|
4
5
|
const STORES_COLLECTION = "stores";
|
|
5
6
|
const ORDERS_COLLECTION = "orders";
|
|
@@ -18,7 +19,7 @@ async function reconcileCategories(ctx) {
|
|
|
18
19
|
continue;
|
|
19
20
|
if (!leafCounts[catId])
|
|
20
21
|
leafCounts[catId] = { productIds: [], auctionIds: [] };
|
|
21
|
-
if (data.listingType ===
|
|
22
|
+
if (data.listingType === PRODUCT_FIELDS.LISTING_TYPE_VALUES.AUCTION)
|
|
22
23
|
leafCounts[catId].auctionIds.push(doc.id);
|
|
23
24
|
else
|
|
24
25
|
leafCounts[catId].productIds.push(doc.id);
|
|
@@ -69,7 +70,7 @@ async function reconcileStores(ctx) {
|
|
|
69
70
|
ctx.db
|
|
70
71
|
.collection(ORDERS_COLLECTION)
|
|
71
72
|
.where("sellerId", "==", sellerId)
|
|
72
|
-
.where(
|
|
73
|
+
.where(ORDER_FIELDS.STATUS, "==", ORDER_FIELDS.STATUS_VALUES.DELIVERED)
|
|
73
74
|
.limit(QUERY_LIMIT)
|
|
74
75
|
.get(),
|
|
75
76
|
reviewRepository.getApprovedRatingAggregateByStore(storeId),
|
|
@@ -10,10 +10,15 @@
|
|
|
10
10
|
* member products (≤16 typically). Caller should skip when the product's
|
|
11
11
|
* status didn't transition between "available" and "unavailable".
|
|
12
12
|
*/
|
|
13
|
+
import { CATEGORY_FIELDS, PRODUCT_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
13
14
|
const CATEGORIES_COLLECTION = "categories";
|
|
14
15
|
const GROUPED_LISTINGS_COLLECTION = "groupedListings";
|
|
15
16
|
const PRODUCT_COLLECTION = "products";
|
|
16
|
-
const UNAVAILABLE_STATUSES = new Set([
|
|
17
|
+
const UNAVAILABLE_STATUSES = new Set([
|
|
18
|
+
PRODUCT_FIELDS.STATUS_VALUES.SOLD,
|
|
19
|
+
PRODUCT_FIELDS.STATUS_VALUES.OUT_OF_STOCK,
|
|
20
|
+
PRODUCT_FIELDS.STATUS_VALUES.DISCONTINUED,
|
|
21
|
+
]);
|
|
17
22
|
const MIN_ACTIVE_DEFAULT = 2;
|
|
18
23
|
export function isAvailable(status) {
|
|
19
24
|
if (!status)
|
|
@@ -48,8 +53,8 @@ async function recomputeBundleStatus(productIds, minActive, ctx) {
|
|
|
48
53
|
export async function syncBundlesForProduct(productId, ctx) {
|
|
49
54
|
const snap = await ctx.db
|
|
50
55
|
.collection(CATEGORIES_COLLECTION)
|
|
51
|
-
.where(
|
|
52
|
-
.where(
|
|
56
|
+
.where(CATEGORY_FIELDS.CATEGORY_TYPE, "==", CATEGORY_FIELDS.CATEGORY_TYPE_VALUES.BUNDLE)
|
|
57
|
+
.where(CATEGORY_FIELDS.BUNDLE_PRODUCT_IDS, "array-contains", productId)
|
|
53
58
|
.get();
|
|
54
59
|
let updated = 0;
|
|
55
60
|
for (const bundleDoc of snap.docs) {
|
|
@@ -59,9 +64,9 @@ export async function syncBundlesForProduct(productId, ctx) {
|
|
|
59
64
|
const next = await recomputeBundleStatus(ids, minActive, ctx);
|
|
60
65
|
if (next !== data.bundleStockStatus) {
|
|
61
66
|
await bundleDoc.ref.update({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
[CATEGORY_FIELDS.BUNDLE_STOCK_STATUS]: next,
|
|
68
|
+
[CATEGORY_FIELDS.BUNDLE_QUERY_RESOLVED_AT]: ctx.now,
|
|
69
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
65
70
|
});
|
|
66
71
|
updated++;
|
|
67
72
|
}
|
|
@@ -99,7 +104,7 @@ export async function syncGroupedListingsForProduct(productId, ctx) {
|
|
|
99
104
|
await groupDoc.ref.update({
|
|
100
105
|
activeMemberCount: activeCount,
|
|
101
106
|
visibilityStatus: nextVisibility,
|
|
102
|
-
|
|
107
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
103
108
|
});
|
|
104
109
|
updated++;
|
|
105
110
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { categoriesRepository, storeRepository, } from "../../../../repositories";
|
|
6
6
|
import { ProductStatusValues } from "../../../../features/products/schemas/firestore";
|
|
7
|
+
import { PRODUCT_FIELDS } from "../../../../constants/field-names";
|
|
7
8
|
const UNAVAILABLE_PRODUCT_STATUSES = new Set([
|
|
8
9
|
ProductStatusValues.SOLD,
|
|
9
10
|
ProductStatusValues.OUT_OF_STOCK,
|
|
@@ -23,8 +24,8 @@ export async function handleProductWrite(input, ctx) {
|
|
|
23
24
|
const afterCategory = after?.category ?? null;
|
|
24
25
|
const beforeStoreId = (before?.storeId || before?.sellerId) ?? null;
|
|
25
26
|
const afterStoreId = (after?.storeId || after?.sellerId) ?? null;
|
|
26
|
-
const isAuction = after?.listingType ===
|
|
27
|
-
const beforeIsAuction = before?.listingType ===
|
|
27
|
+
const isAuction = after?.listingType === PRODUCT_FIELDS.LISTING_TYPE_VALUES.AUCTION;
|
|
28
|
+
const beforeIsAuction = before?.listingType === PRODUCT_FIELDS.LISTING_TYPE_VALUES.AUCTION;
|
|
28
29
|
const wasPublished = beforeStatus === ProductStatusValues.PUBLISHED;
|
|
29
30
|
const isPublished = afterStatus === ProductStatusValues.PUBLISHED;
|
|
30
31
|
const isDelete = !after;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { PRODUCT_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
1
2
|
const PRODUCT_COLLECTION = "products";
|
|
3
|
+
const PRIZE_DRAW_LISTING_TYPE = "prize-draw";
|
|
2
4
|
export async function runPrizeRevealClose(ctx) {
|
|
3
5
|
ctx.logger.info("Prize reveal close sweep starting");
|
|
4
6
|
const snap = await ctx.db
|
|
5
7
|
.collection(PRODUCT_COLLECTION)
|
|
6
|
-
.where(
|
|
7
|
-
.where(
|
|
8
|
-
.where(
|
|
8
|
+
.where(PRODUCT_FIELDS.LISTING_TYPE, "==", PRIZE_DRAW_LISTING_TYPE)
|
|
9
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_STATUS, "==", PRODUCT_FIELDS.PRIZE_REVEAL_STATUS_VALUES.OPEN)
|
|
10
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_WINDOW_END, "<=", ctx.now)
|
|
9
11
|
.limit(100)
|
|
10
12
|
.get();
|
|
11
13
|
if (snap.empty) {
|
|
@@ -14,8 +16,8 @@ export async function runPrizeRevealClose(ctx) {
|
|
|
14
16
|
}
|
|
15
17
|
const batch = ctx.db.batch();
|
|
16
18
|
snap.docs.forEach((doc) => batch.update(doc.ref, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
[PRODUCT_FIELDS.PRIZE_REVEAL_STATUS]: PRODUCT_FIELDS.PRIZE_REVEAL_STATUS_VALUES.CLOSED,
|
|
20
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
19
21
|
}));
|
|
20
22
|
await batch.commit();
|
|
21
23
|
ctx.logger.info("Closed prize draws", { count: snap.size });
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { notificationRepository } from "../../../../repositories";
|
|
2
|
+
import { ORDER_FIELDS, PRODUCT_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
2
3
|
const ORDER_COLLECTION = "orders";
|
|
3
4
|
export async function runPrizeRevealExpiry(ctx) {
|
|
4
5
|
ctx.logger.info("Prize reveal expiry sweep starting");
|
|
5
6
|
const snap = await ctx.db
|
|
6
7
|
.collection(ORDER_COLLECTION)
|
|
7
|
-
.where(
|
|
8
|
-
.where(
|
|
9
|
-
.
|
|
8
|
+
.where(ORDER_FIELDS.PAYMENT_STATUS, "==", ORDER_FIELDS.PAYMENT_STATUS_VALUES.PAID)
|
|
9
|
+
.where(ORDER_FIELDS.STATUS, "in", [
|
|
10
|
+
ORDER_FIELDS.STATUS_VALUES.PENDING,
|
|
11
|
+
ORDER_FIELDS.STATUS_VALUES.CONFIRMED,
|
|
12
|
+
ORDER_FIELDS.STATUS_VALUES.PROCESSING,
|
|
13
|
+
])
|
|
14
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_DEADLINE, "<", ctx.now)
|
|
10
15
|
.limit(200)
|
|
11
16
|
.get();
|
|
12
17
|
if (snap.empty) {
|
|
@@ -21,11 +26,11 @@ export async function runPrizeRevealExpiry(ctx) {
|
|
|
21
26
|
if (!order.prizeDrawProductId)
|
|
22
27
|
continue;
|
|
23
28
|
await doc.ref.update({
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
[ORDER_FIELDS.STATUS]: ORDER_FIELDS.STATUS_VALUES.REFUNDED,
|
|
30
|
+
[ORDER_FIELDS.PAYMENT_STATUS]: ORDER_FIELDS.PAYMENT_STATUS_VALUES.REFUNDED,
|
|
26
31
|
isNonRefundable: false,
|
|
27
32
|
prizeRevealExpired: true,
|
|
28
|
-
|
|
33
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
29
34
|
});
|
|
30
35
|
if (order.userId) {
|
|
31
36
|
try {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { notificationRepository } from "../../../../repositories";
|
|
2
|
+
import { PRODUCT_FIELDS, ORDER_FIELDS, COMMON_FIELDS } from "../../../../constants/field-names";
|
|
2
3
|
const PRODUCT_COLLECTION = "products";
|
|
3
4
|
const ORDER_COLLECTION = "orders";
|
|
5
|
+
const PRIZE_DRAW_LISTING_TYPE = "prize-draw";
|
|
4
6
|
export async function runPrizeRevealOpen(ctx) {
|
|
5
7
|
ctx.logger.info("Prize reveal open sweep starting");
|
|
6
8
|
const snap = await ctx.db
|
|
7
9
|
.collection(PRODUCT_COLLECTION)
|
|
8
|
-
.where(
|
|
9
|
-
.where(
|
|
10
|
-
.where(
|
|
10
|
+
.where(PRODUCT_FIELDS.LISTING_TYPE, "==", PRIZE_DRAW_LISTING_TYPE)
|
|
11
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_STATUS, "==", PRODUCT_FIELDS.PRIZE_REVEAL_STATUS_VALUES.PENDING)
|
|
12
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_WINDOW_START, "<=", ctx.now)
|
|
11
13
|
.limit(100)
|
|
12
14
|
.get();
|
|
13
15
|
if (snap.empty) {
|
|
@@ -17,14 +19,18 @@ export async function runPrizeRevealOpen(ctx) {
|
|
|
17
19
|
for (const doc of snap.docs) {
|
|
18
20
|
const product = doc.data();
|
|
19
21
|
await doc.ref.update({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
[PRODUCT_FIELDS.PRIZE_REVEAL_STATUS]: PRODUCT_FIELDS.PRIZE_REVEAL_STATUS_VALUES.OPEN,
|
|
23
|
+
[COMMON_FIELDS.UPDATED_AT]: ctx.now,
|
|
22
24
|
});
|
|
23
25
|
const orders = await ctx.db
|
|
24
26
|
.collection(ORDER_COLLECTION)
|
|
25
27
|
.where("prizeDrawProductId", "==", doc.id)
|
|
26
|
-
.where(
|
|
27
|
-
.where(
|
|
28
|
+
.where(ORDER_FIELDS.PAYMENT_STATUS, "==", ORDER_FIELDS.PAYMENT_STATUS_VALUES.PAID)
|
|
29
|
+
.where(ORDER_FIELDS.STATUS, "in", [
|
|
30
|
+
ORDER_FIELDS.STATUS_VALUES.PENDING,
|
|
31
|
+
ORDER_FIELDS.STATUS_VALUES.CONFIRMED,
|
|
32
|
+
ORDER_FIELDS.STATUS_VALUES.PROCESSING,
|
|
33
|
+
])
|
|
28
34
|
.get();
|
|
29
35
|
let notified = 0;
|
|
30
36
|
for (const orderDoc of orders.docs) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { notificationRepository } from "../../../../repositories";
|
|
2
|
+
import { ORDER_FIELDS, PRODUCT_FIELDS } from "../../../../constants/field-names";
|
|
2
3
|
const ORDER_COLLECTION = "orders";
|
|
3
4
|
const ONE_DAY_MS = 86400000;
|
|
4
5
|
export async function runPrizeRevealReminder(ctx) {
|
|
@@ -6,10 +7,14 @@ export async function runPrizeRevealReminder(ctx) {
|
|
|
6
7
|
const cutoff = new Date(ctx.now.getTime() + ONE_DAY_MS);
|
|
7
8
|
const snap = await ctx.db
|
|
8
9
|
.collection(ORDER_COLLECTION)
|
|
9
|
-
.where(
|
|
10
|
-
.where(
|
|
11
|
-
.
|
|
12
|
-
.
|
|
10
|
+
.where(ORDER_FIELDS.PAYMENT_STATUS, "==", ORDER_FIELDS.PAYMENT_STATUS_VALUES.PAID)
|
|
11
|
+
.where(ORDER_FIELDS.STATUS, "in", [
|
|
12
|
+
ORDER_FIELDS.STATUS_VALUES.PENDING,
|
|
13
|
+
ORDER_FIELDS.STATUS_VALUES.CONFIRMED,
|
|
14
|
+
ORDER_FIELDS.STATUS_VALUES.PROCESSING,
|
|
15
|
+
])
|
|
16
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_DEADLINE, "<=", cutoff)
|
|
17
|
+
.where(PRODUCT_FIELDS.PRIZE_REVEAL_DEADLINE, ">", ctx.now)
|
|
13
18
|
.limit(500)
|
|
14
19
|
.get();
|
|
15
20
|
let notified = 0;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* logic keys off the event's `raffleType`.
|
|
4
4
|
*/
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
|
+
import { EVENT_ENTRY_FIELDS } from "../../../../constants/field-names";
|
|
6
7
|
const EVENTS_COLLECTION = "events";
|
|
7
8
|
const EVENT_ENTRIES_COLLECTION = "eventEntries";
|
|
8
9
|
export async function runTriggerEventRaffle(input, ctx) {
|
|
@@ -28,8 +29,8 @@ export async function runTriggerEventRaffle(input, ctx) {
|
|
|
28
29
|
const topN = input.topN ?? event.raffleTopN ?? 0;
|
|
29
30
|
const entriesSnap = await ctx.db
|
|
30
31
|
.collection(EVENT_ENTRIES_COLLECTION)
|
|
31
|
-
.where(
|
|
32
|
-
.where(
|
|
32
|
+
.where(EVENT_ENTRY_FIELDS.EVENT_ID, "==", input.eventId)
|
|
33
|
+
.where(EVENT_ENTRY_FIELDS.STATUS, "==", EVENT_ENTRY_FIELDS.STATUS_VALUES.CONFIRMED)
|
|
33
34
|
.get();
|
|
34
35
|
let pool = entriesSnap.docs.map((d) => ({
|
|
35
36
|
id: d.id,
|
|
@@ -17,9 +17,9 @@ export declare const blogPostInputSchema: z.ZodObject<{
|
|
|
17
17
|
title: string;
|
|
18
18
|
content: string;
|
|
19
19
|
category: string;
|
|
20
|
-
slug: string;
|
|
21
20
|
tags: string[];
|
|
22
21
|
isFeatured: boolean;
|
|
22
|
+
slug: string;
|
|
23
23
|
youtubeId?: string | undefined;
|
|
24
24
|
coverImage?: string | undefined;
|
|
25
25
|
excerpt?: string | undefined;
|
|
@@ -31,9 +31,9 @@ export declare const blogPostInputSchema: z.ZodObject<{
|
|
|
31
31
|
category: string;
|
|
32
32
|
slug: string;
|
|
33
33
|
status?: "draft" | "published" | undefined;
|
|
34
|
-
youtubeId?: string | undefined;
|
|
35
34
|
tags?: string[] | undefined;
|
|
36
35
|
isFeatured?: boolean | undefined;
|
|
36
|
+
youtubeId?: string | undefined;
|
|
37
37
|
coverImage?: string | undefined;
|
|
38
38
|
excerpt?: string | undefined;
|
|
39
39
|
metaTitle?: string | undefined;
|
|
@@ -57,9 +57,9 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
|
|
|
57
57
|
title?: string | undefined;
|
|
58
58
|
content?: string | undefined;
|
|
59
59
|
category?: string | undefined;
|
|
60
|
-
youtubeId?: string | undefined;
|
|
61
60
|
tags?: string[] | undefined;
|
|
62
61
|
isFeatured?: boolean | undefined;
|
|
62
|
+
youtubeId?: string | undefined;
|
|
63
63
|
coverImage?: string | undefined;
|
|
64
64
|
excerpt?: string | undefined;
|
|
65
65
|
metaTitle?: string | undefined;
|
|
@@ -69,9 +69,9 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
|
|
|
69
69
|
title?: string | undefined;
|
|
70
70
|
content?: string | undefined;
|
|
71
71
|
category?: string | undefined;
|
|
72
|
-
youtubeId?: string | undefined;
|
|
73
72
|
tags?: string[] | undefined;
|
|
74
73
|
isFeatured?: boolean | undefined;
|
|
74
|
+
youtubeId?: string | undefined;
|
|
75
75
|
coverImage?: string | undefined;
|
|
76
76
|
excerpt?: string | undefined;
|
|
77
77
|
metaTitle?: string | undefined;
|
|
@@ -25,34 +25,34 @@ export declare const bundleQueryRuleSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
25
25
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
26
|
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order"]>>;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
29
|
-
brandSlug?: string | undefined;
|
|
30
28
|
tags?: string[] | undefined;
|
|
31
|
-
categorySlug?: string | undefined;
|
|
32
|
-
}, {
|
|
33
29
|
listingType?: "standard" | "pre-order" | undefined;
|
|
30
|
+
categorySlug?: string | undefined;
|
|
34
31
|
brandSlug?: string | undefined;
|
|
32
|
+
}, {
|
|
35
33
|
tags?: string[] | undefined;
|
|
34
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
36
35
|
categorySlug?: string | undefined;
|
|
36
|
+
brandSlug?: string | undefined;
|
|
37
37
|
}>;
|
|
38
38
|
orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
|
|
39
39
|
limit: z.ZodNumber;
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
41
41
|
filter: {
|
|
42
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
43
|
-
brandSlug?: string | undefined;
|
|
44
42
|
tags?: string[] | undefined;
|
|
43
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
45
44
|
categorySlug?: string | undefined;
|
|
45
|
+
brandSlug?: string | undefined;
|
|
46
46
|
};
|
|
47
47
|
type: "dynamic";
|
|
48
48
|
limit: number;
|
|
49
49
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
50
50
|
}, {
|
|
51
51
|
filter: {
|
|
52
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
53
|
-
brandSlug?: string | undefined;
|
|
54
52
|
tags?: string[] | undefined;
|
|
53
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
55
54
|
categorySlug?: string | undefined;
|
|
55
|
+
brandSlug?: string | undefined;
|
|
56
56
|
};
|
|
57
57
|
type: "dynamic";
|
|
58
58
|
limit: number;
|
|
@@ -93,34 +93,34 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
93
93
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
94
94
|
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order"]>>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
97
|
-
brandSlug?: string | undefined;
|
|
98
96
|
tags?: string[] | undefined;
|
|
99
|
-
categorySlug?: string | undefined;
|
|
100
|
-
}, {
|
|
101
97
|
listingType?: "standard" | "pre-order" | undefined;
|
|
98
|
+
categorySlug?: string | undefined;
|
|
102
99
|
brandSlug?: string | undefined;
|
|
100
|
+
}, {
|
|
103
101
|
tags?: string[] | undefined;
|
|
102
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
104
103
|
categorySlug?: string | undefined;
|
|
104
|
+
brandSlug?: string | undefined;
|
|
105
105
|
}>;
|
|
106
106
|
orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
|
|
107
107
|
limit: z.ZodNumber;
|
|
108
108
|
}, "strip", z.ZodTypeAny, {
|
|
109
109
|
filter: {
|
|
110
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
111
|
-
brandSlug?: string | undefined;
|
|
112
110
|
tags?: string[] | undefined;
|
|
111
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
113
112
|
categorySlug?: string | undefined;
|
|
113
|
+
brandSlug?: string | undefined;
|
|
114
114
|
};
|
|
115
115
|
type: "dynamic";
|
|
116
116
|
limit: number;
|
|
117
117
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
118
118
|
}, {
|
|
119
119
|
filter: {
|
|
120
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
121
|
-
brandSlug?: string | undefined;
|
|
122
120
|
tags?: string[] | undefined;
|
|
121
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
123
122
|
categorySlug?: string | undefined;
|
|
123
|
+
brandSlug?: string | undefined;
|
|
124
124
|
};
|
|
125
125
|
type: "dynamic";
|
|
126
126
|
limit: number;
|
|
@@ -150,10 +150,10 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
150
150
|
productIds: string[];
|
|
151
151
|
} | {
|
|
152
152
|
filter: {
|
|
153
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
154
|
-
brandSlug?: string | undefined;
|
|
155
153
|
tags?: string[] | undefined;
|
|
154
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
156
155
|
categorySlug?: string | undefined;
|
|
156
|
+
brandSlug?: string | undefined;
|
|
157
157
|
};
|
|
158
158
|
type: "dynamic";
|
|
159
159
|
limit: number;
|
|
@@ -176,10 +176,10 @@ export declare const bundleCreateSchema: z.ZodObject<{
|
|
|
176
176
|
productIds: string[];
|
|
177
177
|
} | {
|
|
178
178
|
filter: {
|
|
179
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
180
|
-
brandSlug?: string | undefined;
|
|
181
179
|
tags?: string[] | undefined;
|
|
180
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
182
181
|
categorySlug?: string | undefined;
|
|
182
|
+
brandSlug?: string | undefined;
|
|
183
183
|
};
|
|
184
184
|
type: "dynamic";
|
|
185
185
|
limit: number;
|
|
@@ -215,34 +215,34 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
215
215
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
216
216
|
listingType: z.ZodOptional<z.ZodEnum<["standard", "pre-order"]>>;
|
|
217
217
|
}, "strip", z.ZodTypeAny, {
|
|
218
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
219
|
-
brandSlug?: string | undefined;
|
|
220
218
|
tags?: string[] | undefined;
|
|
221
|
-
categorySlug?: string | undefined;
|
|
222
|
-
}, {
|
|
223
219
|
listingType?: "standard" | "pre-order" | undefined;
|
|
220
|
+
categorySlug?: string | undefined;
|
|
224
221
|
brandSlug?: string | undefined;
|
|
222
|
+
}, {
|
|
225
223
|
tags?: string[] | undefined;
|
|
224
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
226
225
|
categorySlug?: string | undefined;
|
|
226
|
+
brandSlug?: string | undefined;
|
|
227
227
|
}>;
|
|
228
228
|
orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
|
|
229
229
|
limit: z.ZodNumber;
|
|
230
230
|
}, "strip", z.ZodTypeAny, {
|
|
231
231
|
filter: {
|
|
232
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
233
|
-
brandSlug?: string | undefined;
|
|
234
232
|
tags?: string[] | undefined;
|
|
233
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
235
234
|
categorySlug?: string | undefined;
|
|
235
|
+
brandSlug?: string | undefined;
|
|
236
236
|
};
|
|
237
237
|
type: "dynamic";
|
|
238
238
|
limit: number;
|
|
239
239
|
orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
|
|
240
240
|
}, {
|
|
241
241
|
filter: {
|
|
242
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
243
|
-
brandSlug?: string | undefined;
|
|
244
242
|
tags?: string[] | undefined;
|
|
243
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
245
244
|
categorySlug?: string | undefined;
|
|
245
|
+
brandSlug?: string | undefined;
|
|
246
246
|
};
|
|
247
247
|
type: "dynamic";
|
|
248
248
|
limit: number;
|
|
@@ -279,10 +279,10 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
279
279
|
productIds: string[];
|
|
280
280
|
} | {
|
|
281
281
|
filter: {
|
|
282
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
283
|
-
brandSlug?: string | undefined;
|
|
284
282
|
tags?: string[] | undefined;
|
|
283
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
285
284
|
categorySlug?: string | undefined;
|
|
285
|
+
brandSlug?: string | undefined;
|
|
286
286
|
};
|
|
287
287
|
type: "dynamic";
|
|
288
288
|
limit: number;
|
|
@@ -304,10 +304,10 @@ export declare const bundleUpdateSchema: z.ZodObject<{
|
|
|
304
304
|
productIds: string[];
|
|
305
305
|
} | {
|
|
306
306
|
filter: {
|
|
307
|
-
listingType?: "standard" | "pre-order" | undefined;
|
|
308
|
-
brandSlug?: string | undefined;
|
|
309
307
|
tags?: string[] | undefined;
|
|
308
|
+
listingType?: "standard" | "pre-order" | undefined;
|
|
310
309
|
categorySlug?: string | undefined;
|
|
310
|
+
brandSlug?: string | undefined;
|
|
311
311
|
};
|
|
312
312
|
type: "dynamic";
|
|
313
313
|
limit: number;
|
|
@@ -15,8 +15,8 @@ export declare const eventInputSchema: z.ZodObject<{
|
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
16
|
type: "TOURNAMENT" | "CONVENTION" | "MEETUP" | "SALE";
|
|
17
17
|
title: string;
|
|
18
|
-
slug: string;
|
|
19
18
|
tags: string[];
|
|
19
|
+
slug: string;
|
|
20
20
|
startsAt: string;
|
|
21
21
|
endsAt: string;
|
|
22
22
|
entryFee: number;
|
|
@@ -33,9 +33,9 @@ export declare const eventInputSchema: z.ZodObject<{
|
|
|
33
33
|
endsAt: string;
|
|
34
34
|
location?: string | undefined;
|
|
35
35
|
maxEntries?: number | undefined;
|
|
36
|
+
tags?: string[] | undefined;
|
|
36
37
|
imageUrl?: string | undefined;
|
|
37
38
|
description?: string | undefined;
|
|
38
|
-
tags?: string[] | undefined;
|
|
39
39
|
entryFee?: number | undefined;
|
|
40
40
|
isOnline?: boolean | undefined;
|
|
41
41
|
}>;
|
|
@@ -57,9 +57,9 @@ export declare const eventUpdateSchema: z.ZodObject<Omit<{
|
|
|
57
57
|
title?: string | undefined;
|
|
58
58
|
location?: string | undefined;
|
|
59
59
|
maxEntries?: number | undefined;
|
|
60
|
+
tags?: string[] | undefined;
|
|
60
61
|
imageUrl?: string | undefined;
|
|
61
62
|
description?: string | undefined;
|
|
62
|
-
tags?: string[] | undefined;
|
|
63
63
|
startsAt?: string | undefined;
|
|
64
64
|
endsAt?: string | undefined;
|
|
65
65
|
entryFee?: number | undefined;
|
|
@@ -69,9 +69,9 @@ export declare const eventUpdateSchema: z.ZodObject<Omit<{
|
|
|
69
69
|
title?: string | undefined;
|
|
70
70
|
location?: string | undefined;
|
|
71
71
|
maxEntries?: number | undefined;
|
|
72
|
+
tags?: string[] | undefined;
|
|
72
73
|
imageUrl?: string | undefined;
|
|
73
74
|
description?: string | undefined;
|
|
74
|
-
tags?: string[] | undefined;
|
|
75
75
|
startsAt?: string | undefined;
|
|
76
76
|
endsAt?: string | undefined;
|
|
77
77
|
entryFee?: number | undefined;
|