@mohasinac/appkit 2.8.3 → 2.8.4
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/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/core/hooks/useSiteSettings.d.ts +1 -1
- package/dist/features/account/hooks/useAccount.d.ts +2 -2
- package/dist/features/account/hooks/useAddressSelector.d.ts +1 -1
- package/dist/features/account/hooks/useAddresses.d.ts +2 -2
- package/dist/features/account/hooks/useNotifications.d.ts +1 -1
- package/dist/features/account/hooks/useProfile.d.ts +1 -1
- package/dist/features/account/hooks/usePublicProfile.d.ts +2 -2
- package/dist/features/admin/components/AdminAllEventEntriesView.js +5 -3
- package/dist/features/admin/components/AdminBidsView.js +6 -4
- package/dist/features/admin/components/AdminBlogView.js +6 -4
- package/dist/features/admin/components/AdminBrandsView.js +8 -6
- package/dist/features/admin/components/AdminBundlesView.js +10 -8
- package/dist/features/admin/components/AdminCartsView.js +6 -4
- package/dist/features/admin/components/AdminCategoriesView.js +7 -5
- package/dist/features/admin/components/AdminClassifiedView.js +4 -3
- package/dist/features/admin/components/AdminContactView.js +6 -4
- package/dist/features/admin/components/AdminCouponsView.js +6 -4
- package/dist/features/admin/components/AdminDigitalCodesView.js +4 -3
- package/dist/features/admin/components/AdminFaqsView.js +5 -3
- package/dist/features/admin/components/AdminFeaturesView.js +5 -4
- package/dist/features/admin/components/AdminGroupedListingsView.js +4 -3
- package/dist/features/admin/components/AdminHistoryView.js +4 -3
- package/dist/features/admin/components/AdminLiveView.js +4 -3
- package/dist/features/admin/components/AdminNewsletterView.js +5 -3
- package/dist/features/admin/components/AdminNotificationsView.js +6 -4
- package/dist/features/admin/components/AdminOrdersView.js +6 -4
- package/dist/features/admin/components/AdminPayoutsView.js +7 -5
- package/dist/features/admin/components/AdminPrizeDrawsView.js +6 -4
- package/dist/features/admin/components/AdminProductsView.js +7 -5
- package/dist/features/admin/components/AdminReturnRequestsView.js +4 -3
- package/dist/features/admin/components/AdminReviewsView.js +8 -6
- package/dist/features/admin/components/AdminScammersView.js +8 -6
- package/dist/features/admin/components/AdminSessionsView.js +6 -4
- package/dist/features/admin/components/AdminStoreAddressesView.js +2 -1
- package/dist/features/admin/components/AdminStoresView.js +6 -4
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +6 -5
- package/dist/features/admin/components/AdminSupportTicketsView.js +8 -6
- package/dist/features/admin/components/AdminTeamView.js +6 -4
- package/dist/features/admin/components/AdminUsersView.js +6 -4
- package/dist/features/admin/components/AdminWishlistsView.js +4 -3
- package/dist/features/admin/constants/filter-tabs.d.ts +1 -1
- package/dist/features/admin/constants/filter-tabs.js +0 -11
- package/dist/features/admin/hooks/useAdmin.d.ts +1 -1
- package/dist/features/admin/hooks/useAdminSectionsListing.d.ts +1 -1
- package/dist/features/admin/hooks/useChat.d.ts +1 -1
- package/dist/features/admin/types/index.d.ts +1 -1
- package/dist/features/auctions/actions/bid-actions.js +4 -2
- package/dist/features/auctions/components/AuctionsListView.js +7 -6
- package/dist/features/auctions/hooks/useAuctions.d.ts +8 -8
- package/dist/features/auth/hooks/useAuth.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.js +3 -2
- package/dist/features/cart/hooks/useCart.d.ts +1 -1
- package/dist/features/cart/hooks/useCartQuery.d.ts +1 -1
- package/dist/features/cart/hooks/useCheckoutReadQueries.d.ts +2 -2
- package/dist/features/cart/hooks/useOrder.d.ts +2 -2
- package/dist/features/categories/components/BrandDetailPageView.js +10 -8
- package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +5 -4
- package/dist/features/categories/components/CategoryBundlesListing.js +5 -4
- package/dist/features/categories/components/CategoryDetailPageView.js +12 -10
- package/dist/features/categories/components/CategoryFilters.d.ts +12 -12
- package/dist/features/categories/components/CategoryFilters.js +13 -12
- package/dist/features/categories/components/CategoryTree.d.ts +1 -1
- package/dist/features/categories/components/CategoryTree.js +1 -1
- package/dist/features/categories/hooks/useCategories.d.ts +3 -3
- package/dist/features/categories/hooks/useCategorySelector.d.ts +3 -3
- package/dist/features/categories/hooks/useCategoryTree.d.ts +1 -1
- package/dist/features/categories/schemas/firestore.d.ts +2 -2
- package/dist/features/checkout/actions/checkout-actions.d.ts +1 -1
- package/dist/features/checkout/actions/checkout-actions.js +1 -1
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +2 -2
- package/dist/features/classified/components/ClassifiedListView.js +6 -5
- package/dist/features/collections/hooks/useCollections.d.ts +2 -2
- package/dist/features/cron/jobs/auction-expiry.job.d.ts +2 -2
- package/dist/features/cron/jobs/auction-expiry.job.js +2 -1
- package/dist/features/cron/jobs/preorder-reminder.job.d.ts +1 -1
- package/dist/features/cron/jobs/preorder-reminder.job.js +2 -1
- package/dist/features/digital-codes/components/DigitalCodesListView.js +4 -3
- package/dist/features/events/actions/event-actions.js +6 -4
- package/dist/features/events/components/AdminEventEditorView.js +1 -1
- package/dist/features/events/components/AdminEventsView.js +7 -5
- package/dist/features/events/components/EventFilters.d.ts +4 -4
- package/dist/features/events/components/EventFilters.js +2 -2
- package/dist/features/events/components/EventRafflesSection.js +4 -2
- package/dist/features/events/hooks/useEvent.d.ts +3 -3
- package/dist/features/events/hooks/useEvents.d.ts +1 -1
- package/dist/features/faq/actions/faq-actions.js +4 -2
- package/dist/features/faq/components/FAQPageContent.js +2 -1
- package/dist/features/faq/hooks/useFAQs.d.ts +1 -1
- package/dist/features/faq/hooks/useFaqList.d.ts +15 -15
- package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -2
- package/dist/features/homepage/hooks/useBlogArticles.d.ts +1 -1
- package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +1 -1
- package/dist/features/homepage/hooks/useFeaturedPreOrders.d.ts +1 -1
- package/dist/features/homepage/hooks/useFeaturedProducts.d.ts +1 -1
- package/dist/features/homepage/hooks/useFeaturedStores.d.ts +1 -1
- package/dist/features/homepage/hooks/useHeroCarousel.d.ts +1 -1
- package/dist/features/homepage/hooks/useHomepageEvents.d.ts +1 -1
- package/dist/features/homepage/hooks/useHomepageReviews.d.ts +1 -1
- package/dist/features/homepage/hooks/useHomepageSections.d.ts +1 -1
- package/dist/features/homepage/hooks/useTopBrands.d.ts +1 -1
- package/dist/features/homepage/hooks/useTopCategories.d.ts +1 -1
- package/dist/features/layout/BottomActions.js +0 -27
- package/dist/features/layout/BottomActionsContext.d.ts +0 -36
- package/dist/features/layout/BottomActionsContext.js +0 -36
- package/dist/features/live/components/LiveItemsListView.js +6 -5
- package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +1 -1
- package/dist/features/orders/hooks/useOrders.d.ts +2 -2
- package/dist/features/payments/hooks/usePayments.d.ts +1 -1
- package/dist/features/pre-orders/components/PreOrdersListView.js +5 -4
- package/dist/features/pre-orders/hooks/usePreOrders.d.ts +2 -2
- package/dist/features/products/actions/product-actions.js +17 -15
- package/dist/features/products/columns/index.d.ts +1 -1
- package/dist/features/products/columns/index.js +1 -1
- package/dist/features/products/components/PrizeDrawCollage.js +0 -14
- package/dist/features/products/components/PrizeDrawsListingView.js +5 -4
- package/dist/features/products/components/PrizeDrawsSection.js +4 -2
- package/dist/features/products/constants/sieve.d.ts +2 -2
- package/dist/features/products/constants/sieve.js +2 -2
- package/dist/features/products/hooks/useProductDetail.d.ts +1 -1
- package/dist/features/products/hooks/useRelatedProducts.d.ts +1 -1
- package/dist/features/products/hooks/useRelatedProducts.js +5 -4
- package/dist/features/promotions/hooks/usePromotions.d.ts +2 -2
- package/dist/features/reviews/actions/review-actions.js +2 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.js +7 -6
- package/dist/features/reviews/hooks/useReviews.d.ts +2 -2
- package/dist/features/scams/actions/scam-actions.js +3 -2
- package/dist/features/scams/components/ScamRegistryView.js +5 -4
- package/dist/features/search/actions/search-actions.js +7 -6
- package/dist/features/search/hooks/useSearch.d.ts +2 -2
- package/dist/features/seller/components/CouponInlineSelect.js +2 -1
- package/dist/features/seller/components/SellerAuctionsView.js +7 -5
- package/dist/features/seller/components/SellerBidsView.js +5 -3
- package/dist/features/seller/components/SellerBundlesView.js +7 -6
- package/dist/features/seller/components/SellerClassifiedView.js +6 -5
- package/dist/features/seller/components/SellerCouponsView.js +6 -4
- package/dist/features/seller/components/SellerDigitalCodesView.js +5 -4
- package/dist/features/seller/components/SellerGroupedListingsView.js +5 -4
- package/dist/features/seller/components/SellerLiveView.js +6 -5
- package/dist/features/seller/components/SellerOffersView.js +6 -4
- package/dist/features/seller/components/SellerOrdersView.js +5 -3
- package/dist/features/seller/components/SellerPayoutMethodsView.js +3 -2
- package/dist/features/seller/components/SellerPayoutsView.js +6 -4
- package/dist/features/seller/components/SellerPreOrdersView.js +6 -4
- package/dist/features/seller/components/SellerPrizeDrawsView.js +6 -4
- package/dist/features/seller/components/SellerProductsView.js +9 -7
- package/dist/features/seller/components/SellerShippingConfigsView.js +3 -2
- package/dist/features/seller/components/SellerStoreCategoriesView.js +4 -3
- package/dist/features/seller/components/SellerTemplatesView.js +4 -3
- package/dist/features/seller/components/SublistingInlineSelect.js +2 -1
- package/dist/features/seller/hooks/useSellerPayouts.d.ts +3 -3
- package/dist/features/seller/hooks/useSellerStore.d.ts +6 -6
- package/dist/features/seller/hooks/useSellerStorefront.d.ts +2 -2
- package/dist/features/stores/actions/store-query-actions.js +3 -2
- package/dist/features/stores/components/StoreAuctionsPageView.js +4 -2
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +7 -6
- package/dist/features/stores/components/StorePreOrdersPageView.js +4 -2
- package/dist/features/stores/components/StorePrizeDrawsPageView.js +4 -2
- package/dist/features/stores/components/StoreProductsPageView.js +2 -1
- package/dist/features/stores/components/StoreProductsView.js +5 -4
- package/dist/features/stores/components/StoresIndexListing.js +4 -3
- package/dist/features/stores/hooks/useStoreAddressSelector.d.ts +1 -1
- package/dist/features/stores/hooks/useStores.d.ts +6 -6
- package/dist/features/wishlist/components/WishlistView.js +4 -3
- package/dist/features/wishlist/hooks/useUserWishlist.d.ts +15 -15
- package/dist/features/wishlist/hooks/useWishlist.d.ts +1 -1
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Business logic for auction bidding. Auth, rate-limiting, and
|
|
5
5
|
* input validation are handled by the calling server action.
|
|
6
6
|
*/
|
|
7
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
8
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
7
9
|
import { serverLogger } from "../../../monitoring";
|
|
8
10
|
import { bidRepository } from "../repository/bid.repository";
|
|
9
11
|
import { productRepository } from "../../products/repository/products.repository";
|
|
@@ -215,8 +217,8 @@ export async function buyNowAuction(userId, userName, userEmail, input) {
|
|
|
215
217
|
}
|
|
216
218
|
export async function listBidsByProduct(productId, params) {
|
|
217
219
|
const result = await bidRepository.list({
|
|
218
|
-
filters:
|
|
219
|
-
sorts: "
|
|
220
|
+
filters: sieveFilter("productId", SIEVE_OP.EQ, productId),
|
|
221
|
+
sorts: sortBy("bidDate", "DESC"),
|
|
220
222
|
page: params?.page ?? 1,
|
|
221
223
|
pageSize: params?.pageSize ?? 20,
|
|
222
224
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
2
3
|
import { productRepository } from "../../../repositories";
|
|
3
4
|
import { Container, Heading, Main, Section } from "../../../ui";
|
|
4
5
|
import { AdSlot } from "../../homepage/components/AdSlot";
|
|
@@ -16,23 +17,23 @@ function buildAuctionFilters(params) {
|
|
|
16
17
|
const minBid = sp(params, "minBid");
|
|
17
18
|
const maxBid = sp(params, "maxBid");
|
|
18
19
|
if (minBid)
|
|
19
|
-
parts.push(
|
|
20
|
+
parts.push(sieveFilter("currentBid", SIEVE_OP.GTE, minBid));
|
|
20
21
|
if (maxBid)
|
|
21
|
-
parts.push(
|
|
22
|
+
parts.push(sieveFilter("currentBid", SIEVE_OP.LTE, maxBid));
|
|
22
23
|
const store = sp(params, "store");
|
|
23
24
|
if (store) {
|
|
24
25
|
const values = store.split("|").filter(Boolean);
|
|
25
26
|
if (values.length === 1)
|
|
26
|
-
parts.push(
|
|
27
|
+
parts.push(sieveFilter("storeId", SIEVE_OP.EQ, values[0]));
|
|
27
28
|
else if (values.length > 1)
|
|
28
|
-
parts.push(
|
|
29
|
+
parts.push(sieveFilter("storeId", SIEVE_OP.EQ, values.join("|")));
|
|
29
30
|
}
|
|
30
31
|
const dateFrom = sp(params, "dateFrom");
|
|
31
32
|
const dateTo = sp(params, "dateTo");
|
|
32
33
|
if (dateFrom)
|
|
33
|
-
parts.push(
|
|
34
|
+
parts.push(sieveFilter("auctionEndDate", SIEVE_OP.GTE, dateFrom));
|
|
34
35
|
if (dateTo)
|
|
35
|
-
parts.push(
|
|
36
|
+
parts.push(sieveFilter("auctionEndDate", SIEVE_OP.LTE, dateTo));
|
|
36
37
|
return parts.join(",");
|
|
37
38
|
}
|
|
38
39
|
export async function AuctionsListView({ searchParams = {} }) {
|
|
@@ -17,22 +17,22 @@ interface UseAuctionDetailOptions {
|
|
|
17
17
|
bidsQueryKeyPrefix?: string;
|
|
18
18
|
}
|
|
19
19
|
export declare function useAuctions(params?: AuctionListQuery, opts?: UseAuctionsOptions): {
|
|
20
|
-
data:
|
|
20
|
+
data: AuctionListResponse | undefined;
|
|
21
21
|
auctions: AuctionItem[];
|
|
22
22
|
total: number;
|
|
23
23
|
totalPages: number;
|
|
24
24
|
hasMore: boolean;
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
error: string | null;
|
|
27
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
27
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<AuctionListResponse, Error>>;
|
|
28
28
|
};
|
|
29
29
|
export declare function useAuction(slug: string, opts?: {
|
|
30
30
|
enabled?: boolean;
|
|
31
31
|
}): {
|
|
32
|
-
auction:
|
|
32
|
+
auction: AuctionItem | null;
|
|
33
33
|
isLoading: boolean;
|
|
34
34
|
error: string | null;
|
|
35
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
35
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<AuctionItem | null, Error>>;
|
|
36
36
|
};
|
|
37
37
|
export declare function useAuctionBids(auctionSlug: string, limit?: number, opts?: {
|
|
38
38
|
enabled?: boolean;
|
|
@@ -43,9 +43,9 @@ export declare function useAuctionBids(auctionSlug: string, limit?: number, opts
|
|
|
43
43
|
error: string | null;
|
|
44
44
|
};
|
|
45
45
|
export declare function useAuctionDetail(id: string, opts?: UseAuctionDetailOptions): {
|
|
46
|
-
productQuery: import("@tanstack/react-query").UseQueryResult<
|
|
47
|
-
product:
|
|
48
|
-
bidsQuery: import("@tanstack/react-query").UseQueryResult<
|
|
49
|
-
bids:
|
|
46
|
+
productQuery: import("@tanstack/react-query").UseQueryResult<ProductItem | null, Error>;
|
|
47
|
+
product: ProductItem | null;
|
|
48
|
+
bidsQuery: import("@tanstack/react-query").UseQueryResult<PublicBid[], Error>;
|
|
49
|
+
bids: PublicBid[];
|
|
50
50
|
};
|
|
51
51
|
export {};
|
|
@@ -4,11 +4,11 @@ interface UseCurrentUserOptions {
|
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare function useCurrentUser(opts?: UseCurrentUserOptions): {
|
|
7
|
-
user:
|
|
7
|
+
user: AuthUser | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
isAuthenticated: boolean;
|
|
10
10
|
error: Error | null;
|
|
11
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
11
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<AuthUser | null, Error>>;
|
|
12
12
|
};
|
|
13
13
|
export interface LoginCredentials {
|
|
14
14
|
email: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { serverLogger } from "../../../monitoring";
|
|
3
4
|
import { blogRepository } from "../repository/blog.repository";
|
|
@@ -104,11 +105,11 @@ export async function listBlogPosts(params) {
|
|
|
104
105
|
return blogRepository.listPublished({ category: params?.category }, sieve);
|
|
105
106
|
}
|
|
106
107
|
export async function getFeaturedBlogPosts(count = 3) {
|
|
107
|
-
const result = await blogRepository.listPublished({ featuredOnly: true }, { sorts: "
|
|
108
|
+
const result = await blogRepository.listPublished({ featuredOnly: true }, { sorts: sortBy("publishedAt", "DESC"), page: 1, pageSize: count });
|
|
108
109
|
return result.items;
|
|
109
110
|
}
|
|
110
111
|
export async function getLatestBlogPosts(count = 5) {
|
|
111
|
-
const result = await blogRepository.listPublished({}, { sorts: "
|
|
112
|
+
const result = await blogRepository.listPublished({}, { sorts: sortBy("publishedAt", "DESC"), page: 1, pageSize: count });
|
|
112
113
|
return result.items;
|
|
113
114
|
}
|
|
114
115
|
export async function getBlogPostById(id) {
|
|
@@ -12,6 +12,6 @@ export declare function useCart(userIdOrSession: string, opts?: UseCartOptions):
|
|
|
12
12
|
itemCount: number;
|
|
13
13
|
isLoading: boolean;
|
|
14
14
|
error: Error | null;
|
|
15
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
15
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<CartData, Error>>;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -4,5 +4,5 @@ interface UseCartQueryOptions<TData> {
|
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
initialData?: TData;
|
|
6
6
|
}
|
|
7
|
-
export declare function useCartQuery<TData = unknown>(options: UseCartQueryOptions<TData>): import("@tanstack/react-query").UseQueryResult<NoInfer<TData>, Error>;
|
|
7
|
+
export declare function useCartQuery<TData = unknown>(options: UseCartQueryOptions<TData>): import("@tanstack/react-query").UseQueryResult<import("@tanstack/query-core").NoInfer<TData>, Error>;
|
|
8
8
|
export {};
|
|
@@ -8,7 +8,7 @@ interface UseCheckoutReadQueriesOptions<TAddress, TCart> {
|
|
|
8
8
|
initialCart?: TCart;
|
|
9
9
|
}
|
|
10
10
|
export declare function useCheckoutReadQueries<TAddress = unknown, TCart = unknown>(options: UseCheckoutReadQueriesOptions<TAddress, TCart>): {
|
|
11
|
-
addressQuery: import("@tanstack/react-query").UseQueryResult<
|
|
12
|
-
cartQuery: import("@tanstack/react-query").UseQueryResult<NoInfer<TCart>, Error>;
|
|
11
|
+
addressQuery: import("@tanstack/react-query").UseQueryResult<TAddress[], Error>;
|
|
12
|
+
cartQuery: import("@tanstack/react-query").UseQueryResult<import("@tanstack/query-core").NoInfer<TCart>, Error>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -5,9 +5,9 @@ interface UseOrderOptions<TOrder> {
|
|
|
5
5
|
initialData?: TOrder | null;
|
|
6
6
|
}
|
|
7
7
|
export declare function useOrder<TOrder = unknown>(orderId: string | null, options?: UseOrderOptions<TOrder>): {
|
|
8
|
-
order: NonNullable<NoInfer<TOrder | null>> | null;
|
|
8
|
+
order: NonNullable<import("@tanstack/query-core").NoInfer<TOrder | null>> | null;
|
|
9
9
|
isLoading: boolean;
|
|
10
10
|
error: Error | null;
|
|
11
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<TOrder | null>, Error>>;
|
|
11
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TOrder | null>, Error>>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
2
4
|
import Link from "next/link";
|
|
3
5
|
import { categoriesRepository, productRepository, } from "../../../repositories";
|
|
4
6
|
import { ROUTES } from "../../../next";
|
|
@@ -16,8 +18,8 @@ export async function BrandDetailPageView({ slug, initialBrand }) {
|
|
|
16
18
|
brandName
|
|
17
19
|
? productRepository
|
|
18
20
|
.list({
|
|
19
|
-
filters:
|
|
20
|
-
sorts: "
|
|
21
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("brand", SIEVE_OP.EQ, brandName), sieveFilter("listingType", SIEVE_OP.EQ, "standard")),
|
|
22
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
21
23
|
page: 1,
|
|
22
24
|
pageSize: 24,
|
|
23
25
|
})
|
|
@@ -26,8 +28,8 @@ export async function BrandDetailPageView({ slug, initialBrand }) {
|
|
|
26
28
|
brandName
|
|
27
29
|
? productRepository
|
|
28
30
|
.list({
|
|
29
|
-
filters:
|
|
30
|
-
sorts: "auctionEndDate",
|
|
31
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("brand", SIEVE_OP.EQ, brandName), sieveFilter("listingType", SIEVE_OP.EQ, "auction")),
|
|
32
|
+
sorts: sortBy("auctionEndDate", "ASC"),
|
|
31
33
|
page: 1,
|
|
32
34
|
pageSize: 1,
|
|
33
35
|
})
|
|
@@ -36,8 +38,8 @@ export async function BrandDetailPageView({ slug, initialBrand }) {
|
|
|
36
38
|
brandName
|
|
37
39
|
? productRepository
|
|
38
40
|
.list({
|
|
39
|
-
filters:
|
|
40
|
-
sorts: "
|
|
41
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("brand", SIEVE_OP.EQ, brandName), sieveFilter("listingType", SIEVE_OP.EQ, "pre-order")),
|
|
42
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
41
43
|
page: 1,
|
|
42
44
|
pageSize: 1,
|
|
43
45
|
})
|
|
@@ -46,8 +48,8 @@ export async function BrandDetailPageView({ slug, initialBrand }) {
|
|
|
46
48
|
brandName
|
|
47
49
|
? productRepository
|
|
48
50
|
.list({
|
|
49
|
-
filters:
|
|
50
|
-
sorts: "
|
|
51
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("brand", SIEVE_OP.EQ, brandName), sieveFilter("listingType", SIEVE_OP.EQ, "prize-draw")),
|
|
52
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
51
53
|
page: 1,
|
|
52
54
|
pageSize: 1,
|
|
53
55
|
})
|
|
@@ -43,7 +43,7 @@ const FILTER_KEYS = [TABLE_KEYS.IS_FEATURED, "isBrand", "rootOnly", "tier", "min
|
|
|
43
43
|
const SORT_OPTIONS = [
|
|
44
44
|
{ value: sortBy(CATEGORY_FIELDS.NAME, "ASC"), label: "Name A–Z" },
|
|
45
45
|
{ value: sortBy(CATEGORY_FIELDS.NAME), label: "Name Z–A" },
|
|
46
|
-
{ value: "
|
|
46
|
+
{ value: sortBy("productCount", "DESC"), label: "Most Products" },
|
|
47
47
|
];
|
|
48
48
|
export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
|
|
49
49
|
const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
2
3
|
import { categoriesRepository } from "../../../repositories";
|
|
3
4
|
import { Container, Heading, Main, Section } from "../../../ui";
|
|
4
5
|
import { AdSlot } from "../../homepage/components/AdSlot";
|
|
@@ -21,16 +22,16 @@ function buildCategoryFilters(params) {
|
|
|
21
22
|
const minItemCount = sp(params, "minItemCount");
|
|
22
23
|
const maxItemCount = sp(params, "maxItemCount");
|
|
23
24
|
if (minItemCount)
|
|
24
|
-
parts.push(
|
|
25
|
+
parts.push(sieveFilter("metrics.totalItemCount", SIEVE_OP.GTE, minItemCount));
|
|
25
26
|
if (maxItemCount)
|
|
26
|
-
parts.push(
|
|
27
|
+
parts.push(sieveFilter("metrics.totalItemCount", SIEVE_OP.LTE, maxItemCount));
|
|
27
28
|
const tier = sp(params, "tier");
|
|
28
29
|
if (tier) {
|
|
29
30
|
const values = tier.split("|").filter(Boolean);
|
|
30
31
|
if (values.length === 1)
|
|
31
|
-
parts.push(
|
|
32
|
+
parts.push(sieveFilter("tier", SIEVE_OP.EQ, values[0]));
|
|
32
33
|
else if (values.length > 1)
|
|
33
|
-
parts.push(
|
|
34
|
+
parts.push(sieveFilter("tier", SIEVE_OP.EQ, values.join("|")));
|
|
34
35
|
}
|
|
35
36
|
return parts.join(",");
|
|
36
37
|
}
|
|
@@ -8,6 +8,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
* All data is server-fetched; this component owns URL-state driven
|
|
9
9
|
* sort/search/filter/pagination on top of the initial snapshot.
|
|
10
10
|
*/
|
|
11
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
11
12
|
import { useMemo, useCallback, useState } from "react";
|
|
12
13
|
import { Div, Span, Text } from "../../../ui";
|
|
13
14
|
import { ListingToolbar, Pagination, FilterDrawer } from "../../../ui";
|
|
@@ -21,10 +22,10 @@ const __P = {
|
|
|
21
22
|
const PAGE_SIZE = 12;
|
|
22
23
|
const FILTER_KEYS = ["showOutOfStock"];
|
|
23
24
|
const SORT_OPTIONS = [
|
|
24
|
-
{ value: "
|
|
25
|
-
{ value: "createdAt", label: "Oldest First" },
|
|
26
|
-
{ value: "price", label: "Price: Low to High" },
|
|
27
|
-
{ value: "
|
|
25
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest First" },
|
|
26
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest First" },
|
|
27
|
+
{ value: sortBy("price", "ASC"), label: "Price: Low to High" },
|
|
28
|
+
{ value: sortBy("price", "DESC"), label: "Price: High to Low" },
|
|
28
29
|
];
|
|
29
30
|
const DEFAULT_SORT = "-createdAt";
|
|
30
31
|
export function CategoryBundlesListing({ initialBundles, brandName, onBuyNow, }) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { sieveAnd, sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
2
4
|
import Link from "next/link";
|
|
3
5
|
import { categoriesRepository, productRepository, storeRepository, } from "../../../repositories";
|
|
4
6
|
import { ROUTES } from "../../../next";
|
|
@@ -14,13 +16,13 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
14
16
|
.catch(() => undefined);
|
|
15
17
|
// Use categorySlugs@=<id> (array-contains) — products store category FK in
|
|
16
18
|
// the categorySlugs[] array, not the legacy `category` string field.
|
|
17
|
-
const catFilter = category?.id ?
|
|
19
|
+
const catFilter = category?.id ? sieveFilter("categorySlugs", SIEVE_OP.CONTAINS, category.id) : null;
|
|
18
20
|
const [productsResult, auctionsCountResult, preOrdersCountResult, prizeDrawsCountResult, bundlesResult, childCategories] = await Promise.all([
|
|
19
21
|
catFilter
|
|
20
22
|
? productRepository
|
|
21
23
|
.list({
|
|
22
|
-
filters:
|
|
23
|
-
sorts: "
|
|
24
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), catFilter, sieveFilter("listingType", SIEVE_OP.EQ, "standard")),
|
|
25
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
24
26
|
page: 1,
|
|
25
27
|
pageSize: 24,
|
|
26
28
|
})
|
|
@@ -29,8 +31,8 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
29
31
|
catFilter
|
|
30
32
|
? productRepository
|
|
31
33
|
.list({
|
|
32
|
-
filters:
|
|
33
|
-
sorts: "auctionEndDate",
|
|
34
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), catFilter, sieveFilter("listingType", SIEVE_OP.EQ, "auction")),
|
|
35
|
+
sorts: sortBy("auctionEndDate", "ASC"),
|
|
34
36
|
page: 1,
|
|
35
37
|
pageSize: 1,
|
|
36
38
|
})
|
|
@@ -39,8 +41,8 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
39
41
|
catFilter
|
|
40
42
|
? productRepository
|
|
41
43
|
.list({
|
|
42
|
-
filters:
|
|
43
|
-
sorts: "
|
|
44
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), catFilter, sieveFilter("listingType", SIEVE_OP.EQ, "pre-order")),
|
|
45
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
44
46
|
page: 1,
|
|
45
47
|
pageSize: 1,
|
|
46
48
|
})
|
|
@@ -49,8 +51,8 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
49
51
|
catFilter
|
|
50
52
|
? productRepository
|
|
51
53
|
.list({
|
|
52
|
-
filters:
|
|
53
|
-
sorts: "
|
|
54
|
+
filters: sieveAnd(sieveFilter("status", SIEVE_OP.EQ, "published"), catFilter, sieveFilter("listingType", SIEVE_OP.EQ, "prize-draw")),
|
|
55
|
+
sorts: sortBy("createdAt", "DESC"),
|
|
54
56
|
page: 1,
|
|
55
57
|
pageSize: 1,
|
|
56
58
|
})
|
|
@@ -73,7 +75,7 @@ export async function CategoryDetailPageView({ slug }) {
|
|
|
73
75
|
...childCategories.map((c) => c.slug).filter(Boolean),
|
|
74
76
|
];
|
|
75
77
|
const storeResults = await Promise.all(storeCategorySlugs.map((catSlug) => storeRepository
|
|
76
|
-
.listStores({ filters:
|
|
78
|
+
.listStores({ filters: sieveFilter("storeCategory", SIEVE_OP.EQ, catSlug), page: 1, pageSize: 50 }, true)
|
|
77
79
|
.catch(() => null)));
|
|
78
80
|
const seen = new Set();
|
|
79
81
|
const categoryStores = storeResults
|
|
@@ -9,51 +9,51 @@ export declare const CATEGORY_ADMIN_SORT_OPTIONS: readonly [{
|
|
|
9
9
|
readonly value: "order";
|
|
10
10
|
readonly label: "Order Asc";
|
|
11
11
|
}, {
|
|
12
|
-
readonly value:
|
|
12
|
+
readonly value: string;
|
|
13
13
|
readonly label: "Order Desc";
|
|
14
14
|
}, {
|
|
15
|
-
readonly value:
|
|
15
|
+
readonly value: string;
|
|
16
16
|
readonly label: "Name A-Z";
|
|
17
17
|
}, {
|
|
18
|
-
readonly value:
|
|
18
|
+
readonly value: string;
|
|
19
19
|
readonly label: "Name Z-A";
|
|
20
20
|
}, {
|
|
21
21
|
readonly value: "tier";
|
|
22
22
|
readonly label: "Tier Low to High";
|
|
23
23
|
}, {
|
|
24
|
-
readonly value:
|
|
24
|
+
readonly value: string;
|
|
25
25
|
readonly label: "Tier High to Low";
|
|
26
26
|
}, {
|
|
27
|
-
readonly value:
|
|
27
|
+
readonly value: string;
|
|
28
28
|
readonly label: "Most Items";
|
|
29
29
|
}, {
|
|
30
|
-
readonly value:
|
|
30
|
+
readonly value: string;
|
|
31
31
|
readonly label: "Newest First";
|
|
32
32
|
}];
|
|
33
33
|
export declare const CATEGORY_SELLER_SORT_OPTIONS: readonly [{
|
|
34
34
|
readonly value: "order";
|
|
35
35
|
readonly label: "Order Asc";
|
|
36
36
|
}, {
|
|
37
|
-
readonly value:
|
|
37
|
+
readonly value: string;
|
|
38
38
|
readonly label: "Name A-Z";
|
|
39
39
|
}, {
|
|
40
|
-
readonly value:
|
|
40
|
+
readonly value: string;
|
|
41
41
|
readonly label: "Name Z-A";
|
|
42
42
|
}, {
|
|
43
|
-
readonly value:
|
|
43
|
+
readonly value: string;
|
|
44
44
|
readonly label: "Most Items";
|
|
45
45
|
}];
|
|
46
46
|
export declare const CATEGORY_PUBLIC_SORT_OPTIONS: readonly [{
|
|
47
47
|
readonly value: "order";
|
|
48
48
|
readonly label: "Recommended";
|
|
49
49
|
}, {
|
|
50
|
-
readonly value:
|
|
50
|
+
readonly value: string;
|
|
51
51
|
readonly label: "Name A-Z";
|
|
52
52
|
}, {
|
|
53
|
-
readonly value:
|
|
53
|
+
readonly value: string;
|
|
54
54
|
readonly label: "Name Z-A";
|
|
55
55
|
}, {
|
|
56
|
-
readonly value:
|
|
56
|
+
readonly value: string;
|
|
57
57
|
readonly label: "Most Items";
|
|
58
58
|
}];
|
|
59
59
|
export declare function getCategoryFilterKeys(variant: CategoryFilterVariant): readonly string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useTranslations } from "next-intl";
|
|
4
5
|
import { FilterFacetSection } from "../../filters/FilterFacetSection";
|
|
5
6
|
import { RangeFilter } from "../../filters/RangeFilter";
|
|
@@ -19,25 +20,25 @@ export const CATEGORY_FILTER_KEYS = {
|
|
|
19
20
|
};
|
|
20
21
|
export const CATEGORY_ADMIN_SORT_OPTIONS = [
|
|
21
22
|
{ value: "order", label: "Order Asc" },
|
|
22
|
-
{ value: "
|
|
23
|
-
{ value: "name", label: "Name A-Z" },
|
|
24
|
-
{ value: "
|
|
23
|
+
{ value: sortBy("order", "DESC"), label: "Order Desc" },
|
|
24
|
+
{ value: sortBy("name", "ASC"), label: "Name A-Z" },
|
|
25
|
+
{ value: sortBy("name", "DESC"), label: "Name Z-A" },
|
|
25
26
|
{ value: "tier", label: "Tier Low to High" },
|
|
26
|
-
{ value: "
|
|
27
|
-
{ value: "
|
|
28
|
-
{ value: "
|
|
27
|
+
{ value: sortBy("tier", "DESC"), label: "Tier High to Low" },
|
|
28
|
+
{ value: sortBy("metrics.totalItemCount", "DESC"), label: "Most Items" },
|
|
29
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest First" },
|
|
29
30
|
];
|
|
30
31
|
export const CATEGORY_SELLER_SORT_OPTIONS = [
|
|
31
32
|
{ value: "order", label: "Order Asc" },
|
|
32
|
-
{ value: "name", label: "Name A-Z" },
|
|
33
|
-
{ value: "
|
|
34
|
-
{ value: "
|
|
33
|
+
{ value: sortBy("name", "ASC"), label: "Name A-Z" },
|
|
34
|
+
{ value: sortBy("name", "DESC"), label: "Name Z-A" },
|
|
35
|
+
{ value: sortBy("metrics.totalItemCount", "DESC"), label: "Most Items" },
|
|
35
36
|
];
|
|
36
37
|
export const CATEGORY_PUBLIC_SORT_OPTIONS = [
|
|
37
38
|
{ value: "order", label: "Recommended" },
|
|
38
|
-
{ value: "name", label: "Name A-Z" },
|
|
39
|
-
{ value: "
|
|
40
|
-
{ value: "
|
|
39
|
+
{ value: sortBy("name", "ASC"), label: "Name A-Z" },
|
|
40
|
+
{ value: sortBy("name", "DESC"), label: "Name Z-A" },
|
|
41
|
+
{ value: sortBy("metrics.totalItemCount", "DESC"), label: "Most Items" },
|
|
41
42
|
];
|
|
42
43
|
export function getCategoryFilterKeys(variant) {
|
|
43
44
|
return CATEGORY_FILTER_KEYS[variant];
|
|
@@ -10,6 +10,6 @@ export interface CategoryTreeProps {
|
|
|
10
10
|
* CategoryTree — hierarchical expandable navigation for categories.
|
|
11
11
|
*
|
|
12
12
|
* Builds a tree from a flat list by grouping on `rootId` and `parentIds`.
|
|
13
|
-
* Root-level nodes have
|
|
13
|
+
* Root-level nodes have sieveFilter("tier", SIEVE_OP.EQ, "= 0") or no `parentIds`.
|
|
14
14
|
*/
|
|
15
15
|
export declare function CategoryTree({ categories, activeId, onSelect, className, }: CategoryTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,7 +25,7 @@ function CategoryTreeNode({ item, children = [], activeId, onSelect, depth = 0,
|
|
|
25
25
|
* CategoryTree — hierarchical expandable navigation for categories.
|
|
26
26
|
*
|
|
27
27
|
* Builds a tree from a flat list by grouping on `rootId` and `parentIds`.
|
|
28
|
-
* Root-level nodes have
|
|
28
|
+
* Root-level nodes have sieveFilter("tier", SIEVE_OP.EQ, "= 0") or no `parentIds`.
|
|
29
29
|
*/
|
|
30
30
|
export function CategoryTree({ categories, activeId, onSelect, className = "", }) {
|
|
31
31
|
// Group children by parent
|
|
@@ -4,7 +4,7 @@ interface UseCategoriesListOptions {
|
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare function useCategoriesList(opts?: UseCategoriesListOptions): {
|
|
7
|
-
categories:
|
|
7
|
+
categories: CategoryItem[];
|
|
8
8
|
total: number;
|
|
9
9
|
isLoading: boolean;
|
|
10
10
|
error: Error | null;
|
|
@@ -37,8 +37,8 @@ interface UseCategoryDetailOptions {
|
|
|
37
37
|
childrenEndpoint?: string;
|
|
38
38
|
}
|
|
39
39
|
export declare function useCategoryDetail(slug: string, opts?: UseCategoryDetailOptions): {
|
|
40
|
-
category:
|
|
41
|
-
children:
|
|
40
|
+
category: CategoryItem | null;
|
|
41
|
+
children: CategoryItem[];
|
|
42
42
|
isLoading: boolean;
|
|
43
43
|
childrenLoading: boolean;
|
|
44
44
|
error: Error | null;
|
|
@@ -8,16 +8,16 @@ export interface UseCategorySelectorOptions {
|
|
|
8
8
|
export declare function useCategorySelector(options?: UseCategorySelectorOptions): {
|
|
9
9
|
categories: CategoryItem[];
|
|
10
10
|
isLoading: boolean;
|
|
11
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
11
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<CategoryItem[], Error>>;
|
|
12
12
|
createCategory: import("@tanstack/react-query").UseMutateFunction<CategoryItem, Error, Record<string, unknown>, unknown>;
|
|
13
13
|
isCreating: boolean;
|
|
14
14
|
};
|
|
15
15
|
export declare function useCategories(options?: {
|
|
16
16
|
endpoint?: string;
|
|
17
17
|
}): {
|
|
18
|
-
categories:
|
|
18
|
+
categories: CategoryItem[];
|
|
19
19
|
isLoading: boolean;
|
|
20
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
20
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<CategoryItem[], Error>>;
|
|
21
21
|
};
|
|
22
22
|
export declare function useCreateCategory(options?: {
|
|
23
23
|
endpoint?: string;
|
|
@@ -7,7 +7,7 @@ import type { CategoryItem } from "../types";
|
|
|
7
7
|
export declare function useCategoryTree(opts?: {
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
}): {
|
|
10
|
-
categories:
|
|
10
|
+
categories: CategoryItem[];
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
};
|
|
13
13
|
/** Convert category tree to FacetOption[] with indentation prefix for tier > 0. */
|
|
@@ -36,7 +36,7 @@ export type BundleQueryRule = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Per-member metadata stored alongside `bundleProductIds`.
|
|
38
38
|
* `drawCount` — only meaningful when the member product has
|
|
39
|
-
*
|
|
39
|
+
* sieveFilter("listingType", SIEVE_OP.EQ, "= "prize-draw""). Represents how many draw entries
|
|
40
40
|
* the buyer receives for that product when they purchase the bundle
|
|
41
41
|
* (e.g. drawCount=5 means 5 raffle entries, not 5 copies of the draw).
|
|
42
42
|
*/
|
|
@@ -195,7 +195,7 @@ export declare const categoryQueryHelpers: {
|
|
|
195
195
|
/** @deprecated Use byCategoryType("brand"). */
|
|
196
196
|
readonly brands: () => readonly ["isBrand", "==", true];
|
|
197
197
|
/** SB-UNI B + C + D — discriminator-based listing. */
|
|
198
|
-
readonly byCategoryType: (type: import("../types").CategoryType) => readonly ["categoryType", "==", import("
|
|
198
|
+
readonly byCategoryType: (type: import("../types").CategoryType) => readonly ["categoryType", "==", import("@mohasinac/appkit").CategoryType];
|
|
199
199
|
readonly sublistings: () => readonly ["categoryType", "==", "sublisting"];
|
|
200
200
|
readonly brandPages: () => readonly ["categoryType", "==", "brand"];
|
|
201
201
|
readonly active: () => readonly ["isActive", "==", true];
|
|
@@ -25,7 +25,7 @@ export declare function grantCheckoutConsentViaSms(userId: string, userPhone: st
|
|
|
25
25
|
* `verifiedVia: "admin_bypass"` marker prevents bypass-credit grants.
|
|
26
26
|
*
|
|
27
27
|
* Security: callers MUST verify the requesting user is an admin AND that
|
|
28
|
-
*
|
|
28
|
+
* sieveFilter("siteSettings.featureFlags.adminCheckoutBypass", SIEVE_OP.EQ, "= true") before calling this.
|
|
29
29
|
*/
|
|
30
30
|
export declare function grantAdminCheckoutBypass(userId: string, addressId: string, bypassingAdminUid: string): Promise<void>;
|
|
31
31
|
export { userRepository };
|
|
@@ -103,7 +103,7 @@ export async function grantCheckoutConsentViaSms(userId, userPhone, addressId) {
|
|
|
103
103
|
* `verifiedVia: "admin_bypass"` marker prevents bypass-credit grants.
|
|
104
104
|
*
|
|
105
105
|
* Security: callers MUST verify the requesting user is an admin AND that
|
|
106
|
-
*
|
|
106
|
+
* sieveFilter("siteSettings.featureFlags.adminCheckoutBypass", SIEVE_OP.EQ, "= true") before calling this.
|
|
107
107
|
*/
|
|
108
108
|
export async function grantAdminCheckoutBypass(userId, addressId, bypassingAdminUid) {
|
|
109
109
|
const address = await findUserAddress(userId, addressId);
|
|
@@ -62,8 +62,8 @@ interface UseCheckoutOptions<TAddress = any, TCart = any> {
|
|
|
62
62
|
initialCart?: CartApiResponse<TCart>;
|
|
63
63
|
}
|
|
64
64
|
export declare function useCheckout<TAddress = any, TCart = any>(options?: UseCheckoutOptions<TAddress, TCart>): {
|
|
65
|
-
addressQuery: import("@tanstack/react-query").UseQueryResult<
|
|
66
|
-
cartQuery: import("@tanstack/react-query").UseQueryResult<
|
|
65
|
+
addressQuery: import("@tanstack/react-query").UseQueryResult<TAddress[], Error>;
|
|
66
|
+
cartQuery: import("@tanstack/react-query").UseQueryResult<CartApiResponse<TCart>, Error>;
|
|
67
67
|
preflightMutation: import("@tanstack/react-query").UseMutationResult<PreflightResponse, Error, string, unknown>;
|
|
68
68
|
placeCodOrderMutation: import("@tanstack/react-query").UseMutationResult<PlaceOrderResponse, Error, PlaceOrderPayload, unknown>;
|
|
69
69
|
createPaymentOrderMutation: import("@tanstack/react-query").UseMutationResult<CreatePaymentOrderResponse, Error, CreatePaymentOrderPayload, unknown>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
2
3
|
import { productRepository } from "../../../repositories";
|
|
3
4
|
import { Container, Heading, Main, Section } from "../../../ui";
|
|
4
5
|
import { AdSlot } from "../../homepage/components/AdSlot";
|
|
@@ -16,18 +17,18 @@ function buildClassifiedFilters(params) {
|
|
|
16
17
|
const minPrice = sp(params, "minPrice");
|
|
17
18
|
const maxPrice = sp(params, "maxPrice");
|
|
18
19
|
if (minPrice)
|
|
19
|
-
parts.push(
|
|
20
|
+
parts.push(sieveFilter("price", SIEVE_OP.GTE, minPrice));
|
|
20
21
|
if (maxPrice)
|
|
21
|
-
parts.push(
|
|
22
|
+
parts.push(sieveFilter("price", SIEVE_OP.LTE, maxPrice));
|
|
22
23
|
const city = sp(params, "city");
|
|
23
24
|
if (city)
|
|
24
|
-
parts.push(
|
|
25
|
+
parts.push(sieveFilter("classifiedCity", SIEVE_OP.EQ, city));
|
|
25
26
|
const negotiable = sp(params, "negotiable");
|
|
26
27
|
if (negotiable === "true")
|
|
27
|
-
parts.push(
|
|
28
|
+
parts.push(sieveFilter("classifiedNegotiable", SIEVE_OP.EQ, "true"));
|
|
28
29
|
const acceptsShipping = sp(params, "acceptsShipping");
|
|
29
30
|
if (acceptsShipping === "true")
|
|
30
|
-
parts.push(
|
|
31
|
+
parts.push(sieveFilter("classifiedAcceptsShipping", SIEVE_OP.EQ, "true"));
|
|
31
32
|
return parts.join(",");
|
|
32
33
|
}
|
|
33
34
|
export async function ClassifiedListView({ searchParams = {} }) {
|