@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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useUrlTable } from "../../../react/hooks/useUrlTable";
|
|
5
7
|
import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
|
|
@@ -18,9 +20,9 @@ const PAGE_SIZE = 25;
|
|
|
18
20
|
const FILTER_KEYS = ["status"];
|
|
19
21
|
const DEFAULT_SORT = "-bidDate";
|
|
20
22
|
const SORT_OPTIONS = [
|
|
21
|
-
{ value: "
|
|
23
|
+
{ value: sortBy("bidDate", "DESC"), label: "Newest" },
|
|
22
24
|
{ value: "bidDate", label: "Oldest" },
|
|
23
|
-
{ value: "
|
|
25
|
+
{ value: sortBy("bidAmount", "DESC"), label: "Highest Bid" },
|
|
24
26
|
{ value: "bidAmount", label: "Lowest Bid" },
|
|
25
27
|
];
|
|
26
28
|
const STATUS_OPTIONS = SELLER_BID_STATUS_TABS;
|
|
@@ -67,7 +69,7 @@ export function SellerBidsView({ endpoint = SELLER_ENDPOINTS.BIDS }) {
|
|
|
67
69
|
const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
|
|
68
70
|
const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
|
|
69
71
|
const statusRaw = table.get("status");
|
|
70
|
-
const filters = statusRaw ?
|
|
72
|
+
const filters = statusRaw ? sieveFilter("status", SIEVE_OP.EQ, statusRaw) : undefined;
|
|
71
73
|
const productIdFilter = table.get("productId") || undefined;
|
|
72
74
|
const endpointWithProduct = productIdFilter
|
|
73
75
|
? `${endpoint}?productId=${encodeURIComponent(productIdFilter)}`
|
|
@@ -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 { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { ConfirmDeleteModal, RowActionMenu, Text } from "../../../ui";
|
|
@@ -60,16 +61,16 @@ export function SellerBundlesView({ onCreateClick, onEditClick, onDelete, onBulk
|
|
|
60
61
|
searchPlaceholder: "Search bundles...",
|
|
61
62
|
emptyLabel: "No bundles yet — create a bundle to group multiple products together",
|
|
62
63
|
filterKeys: [],
|
|
63
|
-
defaultSort: "
|
|
64
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
64
65
|
queryKey: ["seller", "bundles"],
|
|
65
66
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
66
67
|
sortOptions: [
|
|
67
|
-
{ value: "
|
|
68
|
-
{ value: "createdAt", label: "Oldest" },
|
|
68
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
69
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
69
70
|
{ value: "productTitle", label: "Name A–Z" },
|
|
70
|
-
{ value: "
|
|
71
|
-
{ value: "price", label: "Price: Low–High" },
|
|
72
|
-
{ value: "
|
|
71
|
+
{ value: sortBy("productTitle", "DESC"), label: "Name Z–A" },
|
|
72
|
+
{ value: sortBy("price", "ASC"), label: "Price: Low–High" },
|
|
73
|
+
{ value: sortBy("price", "DESC"), label: "Price: High–Low" },
|
|
73
74
|
],
|
|
74
75
|
columns: COLUMNS,
|
|
75
76
|
mapRows: (response) => toRecordArray(response.products).map((item, index) => ({
|
|
@@ -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 { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { ConfirmDeleteModal, RowActionMenu, Text } from "../../../ui";
|
|
@@ -66,15 +67,15 @@ export function SellerClassifiedView({ onCreateClick, onEditClick, onDelete, onB
|
|
|
66
67
|
searchPlaceholder: "Search classified listings...",
|
|
67
68
|
emptyLabel: "No classified listings yet — post your first buy/sell/trade ad",
|
|
68
69
|
filterKeys: [],
|
|
69
|
-
defaultSort: "
|
|
70
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
70
71
|
queryKey: ["seller", "classified"],
|
|
71
72
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
72
73
|
sortOptions: [
|
|
73
|
-
{ value: "
|
|
74
|
-
{ value: "createdAt", label: "Oldest" },
|
|
74
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
75
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
75
76
|
{ value: "productTitle", label: "Name A–Z" },
|
|
76
|
-
{ value: "price", label: "Price: Low–High" },
|
|
77
|
-
{ value: "
|
|
77
|
+
{ value: sortBy("price", "ASC"), label: "Price: Low–High" },
|
|
78
|
+
{ value: sortBy("price", "DESC"), label: "Price: High–Low" },
|
|
78
79
|
],
|
|
79
80
|
columns: COLUMNS,
|
|
80
81
|
mapRows: (response) => toRecordArray(response.products).map((item, index) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
7
|
import { Div, ListingLayout, Text, useToast } from "../../../ui";
|
|
@@ -48,12 +50,12 @@ export function SellerCouponsView({ onCreateClick, onEditClick, onToggle, onDele
|
|
|
48
50
|
searchPlaceholder: "Search by coupon code",
|
|
49
51
|
emptyLabel: "No coupons found — create your first coupon",
|
|
50
52
|
filterKeys: ["isActive"],
|
|
51
|
-
defaultSort: "
|
|
53
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
52
54
|
queryKey: ["seller", "coupons", "listing"],
|
|
53
55
|
endpoint: SELLER_ENDPOINTS.COUPONS,
|
|
54
56
|
sortOptions: [
|
|
55
|
-
{ value: "
|
|
56
|
-
{ value: "createdAt", label: "Oldest" },
|
|
57
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
58
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
57
59
|
{ value: "code", label: "Code A–Z" },
|
|
58
60
|
],
|
|
59
61
|
hideTableView: true,
|
|
@@ -63,7 +65,7 @@ export function SellerCouponsView({ onCreateClick, onEditClick, onToggle, onDele
|
|
|
63
65
|
isActive: getIsActive(item),
|
|
64
66
|
})),
|
|
65
67
|
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
66
|
-
buildFilters: (state) => state.isActive ?
|
|
68
|
+
buildFilters: (state) => state.isActive ? sieveFilter("isActive", SIEVE_OP.EQ, state.isActive) : undefined,
|
|
67
69
|
primaryAction: onCreateClick
|
|
68
70
|
? { label: "Add Coupon", onClick: () => onCreateClick() }
|
|
69
71
|
: undefined,
|
|
@@ -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 { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { ConfirmDeleteModal, RowActionMenu, Span, Text } from "../../../ui";
|
|
@@ -69,14 +70,14 @@ export function SellerDigitalCodesView({ onCreateClick, onEditClick, onDelete, o
|
|
|
69
70
|
searchPlaceholder: "Search digital code listings...",
|
|
70
71
|
emptyLabel: "No digital code listings yet",
|
|
71
72
|
filterKeys: [],
|
|
72
|
-
defaultSort: "
|
|
73
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
73
74
|
queryKey: ["seller", "digital-codes"],
|
|
74
75
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
75
76
|
sortOptions: [
|
|
76
|
-
{ value: "
|
|
77
|
-
{ value: "createdAt", label: "Oldest" },
|
|
77
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
78
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
78
79
|
{ value: "productTitle", label: "Name A–Z" },
|
|
79
|
-
{ value: "price", label: "Price: Low–High" },
|
|
80
|
+
{ value: sortBy("price", "ASC"), label: "Price: Low–High" },
|
|
80
81
|
],
|
|
81
82
|
columns: COLUMNS,
|
|
82
83
|
mapRows: (response) => toRecordArray(response.products).map((item, index) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { Badge, Button, Div, Span } from "../../../ui";
|
|
4
5
|
import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
5
6
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
@@ -56,14 +57,14 @@ export function SellerGroupedListingsView({ onCreateClick, onEditClick, onDelete
|
|
|
56
57
|
searchPlaceholder: "Search grouped listings",
|
|
57
58
|
emptyLabel: "No grouped listings yet",
|
|
58
59
|
filterKeys: [],
|
|
59
|
-
defaultSort: "
|
|
60
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
60
61
|
queryKey: ["seller", "grouped-listings"],
|
|
61
62
|
endpoint: SELLER_ENDPOINTS.GROUPED_LISTINGS,
|
|
62
63
|
sortOptions: [
|
|
63
|
-
{ value: "
|
|
64
|
-
{ value: "createdAt", label: "Oldest" },
|
|
64
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
65
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
65
66
|
{ value: "title", label: "Title A–Z" },
|
|
66
|
-
{ value: "
|
|
67
|
+
{ value: sortBy("title", "DESC"), label: "Title Z–A" },
|
|
67
68
|
],
|
|
68
69
|
columns: COLUMNS,
|
|
69
70
|
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { ConfirmDeleteModal, Div, RowActionMenu, Text } from "../../../ui";
|
|
@@ -70,15 +71,15 @@ export function SellerLiveView({ onCreateClick, onEditClick, onDelete, onBulkDel
|
|
|
70
71
|
searchPlaceholder: "Search live item listings...",
|
|
71
72
|
emptyLabel: "No live item listings yet",
|
|
72
73
|
filterKeys: [],
|
|
73
|
-
defaultSort: "
|
|
74
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
74
75
|
queryKey: ["seller", "live-items"],
|
|
75
76
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
76
77
|
sortOptions: [
|
|
77
|
-
{ value: "
|
|
78
|
-
{ value: "createdAt", label: "Oldest" },
|
|
78
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
79
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
79
80
|
{ value: "productTitle", label: "Name A–Z" },
|
|
80
|
-
{ value: "price", label: "Price: Low–High" },
|
|
81
|
-
{ value: "
|
|
81
|
+
{ value: sortBy("price", "ASC"), label: "Price: Low–High" },
|
|
82
|
+
{ value: sortBy("price", "DESC"), label: "Price: High–Low" },
|
|
82
83
|
],
|
|
83
84
|
columns: COLUMNS,
|
|
84
85
|
mapRows: (response) => toRecordArray(response.products).map((item, index) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import { FilterChipGroup, ListingLayout, RowActionMenu } from "../../../ui";
|
|
5
7
|
import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
@@ -17,12 +19,12 @@ export function SellerOffersView({ children, onAcceptOffer, onRejectOffer, onCou
|
|
|
17
19
|
searchPlaceholder: "Search offers by product or buyer name",
|
|
18
20
|
emptyLabel: "No offers received",
|
|
19
21
|
filterKeys: ["status"],
|
|
20
|
-
defaultSort: "
|
|
22
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
21
23
|
queryKey: ["seller", "offers", "listing"],
|
|
22
24
|
endpoint: SELLER_ENDPOINTS.OFFERS,
|
|
23
25
|
sortOptions: [
|
|
24
|
-
{ value: "
|
|
25
|
-
{ value: "createdAt", label: "Oldest" },
|
|
26
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
27
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
26
28
|
],
|
|
27
29
|
mapRows: (response) => toRecordArray(response.offers).map((item, index) => ({
|
|
28
30
|
id: toStringValue(item.id, `offer-${index}`),
|
|
@@ -37,7 +39,7 @@ export function SellerOffersView({ children, onAcceptOffer, onRejectOffer, onCou
|
|
|
37
39
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number"
|
|
38
40
|
? response.meta.total
|
|
39
41
|
: mappedRows.length,
|
|
40
|
-
buildFilters: (state) => state.status && state.status !== "All" ?
|
|
42
|
+
buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
|
|
41
43
|
renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
42
44
|
...(onAcceptOffer
|
|
43
45
|
? [{ label: ACTIONS.STORE["accept-offer"].label, onClick: () => void onAcceptOffer(row.id) }]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { Eye, Printer, MapPin, Truck } from "lucide-react";
|
|
5
7
|
import { useUrlTable } from "../../../react/hooks/useUrlTable";
|
|
@@ -25,8 +27,8 @@ const PAGE_SIZE = 25;
|
|
|
25
27
|
const FILTER_KEYS = ["status"];
|
|
26
28
|
const DEFAULT_SORT = "-createdAt";
|
|
27
29
|
const SORT_OPTIONS = [
|
|
28
|
-
{ value: "
|
|
29
|
-
{ value: "createdAt", label: "Oldest" },
|
|
30
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
31
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
30
32
|
];
|
|
31
33
|
const STATUS_OPTIONS = SELLER_ORDER_STATUS_TABS;
|
|
32
34
|
const STATUS_BADGE_VARIANT = {
|
|
@@ -155,7 +157,7 @@ export function SellerOrdersView({ orderDetailApiBase = SELLER_ENDPOINTS.ORDERS,
|
|
|
155
157
|
const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
|
|
156
158
|
const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
|
|
157
159
|
const statusRaw = table.get("status");
|
|
158
|
-
const filters = statusRaw && statusRaw !== "All" ?
|
|
160
|
+
const filters = statusRaw && statusRaw !== "All" ? sieveFilter("status", SIEVE_OP.EQ, statusRaw) : undefined;
|
|
159
161
|
const { rows, total, isLoading, errorMessage } = useSellerListingData({
|
|
160
162
|
queryKey: ["seller", "orders", "listing"],
|
|
161
163
|
endpoint: SELLER_ENDPOINTS.ORDERS,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { Plus } from "lucide-react";
|
|
@@ -13,8 +14,8 @@ import { TABLE_KEYS } from "../../../constants/table-keys";
|
|
|
13
14
|
const PAGE_SIZE = 50;
|
|
14
15
|
const DEFAULT_SORT = "-createdAt";
|
|
15
16
|
const SORT_OPTIONS = [
|
|
16
|
-
{ value: "
|
|
17
|
-
{ value: "createdAt", label: "Oldest" },
|
|
17
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
18
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
18
19
|
{ value: "label", label: "Label A–Z" },
|
|
19
20
|
];
|
|
20
21
|
function getMaskedIdentifier(item) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import { FilterChipGroup, ListingLayout, RowActionMenu } from "../../../ui";
|
|
5
7
|
import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
@@ -17,12 +19,12 @@ export function SellerPayoutsView({ children, onViewClick, onExportClick, ...pro
|
|
|
17
19
|
searchPlaceholder: "Search payouts by payout # or amount",
|
|
18
20
|
emptyLabel: "No payouts found",
|
|
19
21
|
filterKeys: ["status"],
|
|
20
|
-
defaultSort: "
|
|
22
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
21
23
|
queryKey: ["seller", "payouts", "listing"],
|
|
22
24
|
endpoint: SELLER_ENDPOINTS.PAYOUTS,
|
|
23
25
|
sortOptions: [
|
|
24
|
-
{ value: "
|
|
25
|
-
{ value: "createdAt", label: "Oldest" },
|
|
26
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
27
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
26
28
|
],
|
|
27
29
|
mapRows: (response) => toRecordArray(response.payouts).map((item, index) => ({
|
|
28
30
|
id: toStringValue(item.id, `payout-${index}`),
|
|
@@ -37,7 +39,7 @@ export function SellerPayoutsView({ children, onViewClick, onExportClick, ...pro
|
|
|
37
39
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number"
|
|
38
40
|
? response.meta.total
|
|
39
41
|
: mappedRows.length,
|
|
40
|
-
buildFilters: (state) => state.status && state.status !== "All" ?
|
|
42
|
+
buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
|
|
41
43
|
renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
42
44
|
...(onViewClick
|
|
43
45
|
? [{ label: ACTIONS.STORE["view-payout"].label, onClick: () => onViewClick(row.id) }]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
7
|
import { Badge, ConfirmDeleteModal, Div, FilterChipGroup, ListingLayout, RowActionMenu, Span, Text } from "../../../ui";
|
|
@@ -78,12 +80,12 @@ export function SellerPreOrdersView({ children, onDelete, ...props }) {
|
|
|
78
80
|
searchPlaceholder: "Search pre-orders by name…",
|
|
79
81
|
emptyLabel: "No pre-orders listed yet",
|
|
80
82
|
filterKeys: ["status"],
|
|
81
|
-
defaultSort: "
|
|
83
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
82
84
|
queryKey: ["seller", "pre-orders", "listing"],
|
|
83
85
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
84
86
|
sortOptions: [
|
|
85
|
-
{ value: "
|
|
86
|
-
{ value: "createdAt", label: "Oldest" },
|
|
87
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
88
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
87
89
|
{ value: "title", label: "Title A–Z" },
|
|
88
90
|
{ value: "preorderAvailableDate", label: "Delivery Soon" },
|
|
89
91
|
],
|
|
@@ -105,7 +107,7 @@ export function SellerPreOrdersView({ children, onDelete, ...props }) {
|
|
|
105
107
|
}),
|
|
106
108
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
|
|
107
109
|
buildFilters: (state) => {
|
|
108
|
-
const status = state.status && state.status !== "All" ?
|
|
110
|
+
const status = state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : null;
|
|
109
111
|
return ["listingType==pre-order", status].filter(Boolean).join(",");
|
|
110
112
|
},
|
|
111
113
|
getRowHref: (row) => String(ROUTES.STORE.PRE_ORDERS_EDIT(row.id)),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
7
|
import { Badge, ConfirmDeleteModal, Div, FilterChipGroup, ListingLayout, RowActionMenu, Span, Text } from "../../../ui";
|
|
@@ -75,12 +77,12 @@ export function SellerPrizeDrawsView({ children, onDelete, ...props }) {
|
|
|
75
77
|
searchPlaceholder: "Search prize draws by name…",
|
|
76
78
|
emptyLabel: "No prize draws listed yet",
|
|
77
79
|
filterKeys: ["status"],
|
|
78
|
-
defaultSort: "
|
|
80
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
79
81
|
queryKey: ["seller", "prize-draws", "listing"],
|
|
80
82
|
endpoint: SELLER_ENDPOINTS.PRODUCTS,
|
|
81
83
|
sortOptions: [
|
|
82
|
-
{ value: "
|
|
83
|
-
{ value: "createdAt", label: "Oldest" },
|
|
84
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
85
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
84
86
|
{ value: "title", label: "Title A–Z" },
|
|
85
87
|
{ value: "prizeDrawEndDate", label: "Draw Date Soon" },
|
|
86
88
|
],
|
|
@@ -102,7 +104,7 @@ export function SellerPrizeDrawsView({ children, onDelete, ...props }) {
|
|
|
102
104
|
}),
|
|
103
105
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
|
|
104
106
|
buildFilters: (state) => {
|
|
105
|
-
const status = state.status && state.status !== "All" ?
|
|
107
|
+
const status = state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : null;
|
|
106
108
|
return ["listingType==prize-draw", status].filter(Boolean).join(",");
|
|
107
109
|
},
|
|
108
110
|
getRowHref: (row) => String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
7
|
import { useActionDispatch } from "../../../react/hooks/use-action-dispatch";
|
|
@@ -34,12 +36,12 @@ const FILTER_KEYS = [
|
|
|
34
36
|
];
|
|
35
37
|
const DEFAULT_SORT = "-createdAt";
|
|
36
38
|
const SORT_OPTIONS = [
|
|
37
|
-
{ value: "
|
|
38
|
-
{ value: "createdAt", label: "Oldest" },
|
|
39
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
40
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
39
41
|
{ value: "title", label: "Title A–Z" },
|
|
40
|
-
{ value: "
|
|
41
|
-
{ value: "
|
|
42
|
-
{ value: "price", label: "Price Low" },
|
|
42
|
+
{ value: sortBy("title", "DESC"), label: "Title Z–A" },
|
|
43
|
+
{ value: sortBy("price", "DESC"), label: "Price High" },
|
|
44
|
+
{ value: sortBy("price", "ASC"), label: "Price Low" },
|
|
43
45
|
];
|
|
44
46
|
const STATUS_OPTIONS = SELLER_PRODUCT_STATUS_TABS;
|
|
45
47
|
// S-STORE-2-A — `<TypeDropdown>` replaces the legacy chip strip. Same width on
|
|
@@ -163,10 +165,10 @@ export function SellerProductsView({ onDeleteProduct, onCreateClick, children, .
|
|
|
163
165
|
listingKind !== "all" ||
|
|
164
166
|
showSold;
|
|
165
167
|
const statusRaw = table.get("status");
|
|
166
|
-
const statusFilter = statusRaw && statusRaw !== "All" ?
|
|
168
|
+
const statusFilter = statusRaw && statusRaw !== "All" ? sieveFilter("status", SIEVE_OP.EQ, statusRaw) : undefined;
|
|
167
169
|
// SB1-G — single-field listingType clause. The repository's Sieve aliases
|
|
168
170
|
// accept both `==auction|preorder|standard` and `==pre-order` directly.
|
|
169
|
-
const kindFilter = listingKind === "all" ? undefined :
|
|
171
|
+
const kindFilter = listingKind === "all" ? undefined : sieveFilter("listingType", SIEVE_OP.EQ, listingKind);
|
|
170
172
|
const soldFilter = showSold ? undefined : "isSold==false";
|
|
171
173
|
const filters = [statusFilter, kindFilter, soldFilter].filter(Boolean).join(",") || undefined;
|
|
172
174
|
const { rows, total, isLoading, errorMessage } = useSellerListingData({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { Plus } from "lucide-react";
|
|
@@ -13,8 +14,8 @@ import { TABLE_KEYS } from "../../../constants/table-keys";
|
|
|
13
14
|
const PAGE_SIZE = 50;
|
|
14
15
|
const DEFAULT_SORT = "-createdAt";
|
|
15
16
|
const SORT_OPTIONS = [
|
|
16
|
-
{ value: "
|
|
17
|
-
{ value: "createdAt", label: "Oldest" },
|
|
17
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
18
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
18
19
|
{ value: "label", label: "Label A–Z" },
|
|
19
20
|
];
|
|
20
21
|
const COLUMNS = [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState, useCallback } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { Plus } from "lucide-react";
|
|
@@ -16,10 +17,10 @@ import { TABLE_KEYS } from "../../../constants/table-keys";
|
|
|
16
17
|
const PAGE_SIZE = 25;
|
|
17
18
|
const DEFAULT_SORT = "displayOrder";
|
|
18
19
|
const SORT_OPTIONS = [
|
|
19
|
-
{ value: "displayOrder", label: "Display Order" },
|
|
20
|
+
{ value: sortBy("displayOrder", "ASC"), label: "Display Order" },
|
|
20
21
|
{ value: "label", label: "Label A–Z" },
|
|
21
|
-
{ value: "
|
|
22
|
-
{ value: "
|
|
22
|
+
{ value: sortBy("label", "DESC"), label: "Label Z–A" },
|
|
23
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
23
24
|
];
|
|
24
25
|
const COLUMNS = [
|
|
25
26
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState, useCallback, useMemo } from "react";
|
|
4
5
|
import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
|
|
5
6
|
import { Plus } from "lucide-react";
|
|
@@ -18,9 +19,9 @@ const __P = {
|
|
|
18
19
|
const PAGE_SIZE = 25;
|
|
19
20
|
const DEFAULT_SORT = "name";
|
|
20
21
|
const SORT_OPTIONS = [
|
|
21
|
-
{ value: "name", label: "Name A–Z" },
|
|
22
|
-
{ value: "
|
|
23
|
-
{ value: "
|
|
22
|
+
{ value: sortBy("name", "ASC"), label: "Name A–Z" },
|
|
23
|
+
{ value: sortBy("name", "DESC"), label: "Name Z–A" },
|
|
24
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
24
25
|
];
|
|
25
26
|
const CONDITION_OPTIONS = [
|
|
26
27
|
{ value: "", label: "Any condition" },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { PaginatedSelect } from "../../../ui/components/PaginatedSelect";
|
|
4
5
|
import { apiClient } from "../../../http";
|
|
5
6
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
@@ -7,7 +8,7 @@ async function loadSublistingOptions(query, page) {
|
|
|
7
8
|
const params = new URLSearchParams({
|
|
8
9
|
page: String(page),
|
|
9
10
|
pageSize: "25",
|
|
10
|
-
sorts: "name",
|
|
11
|
+
sorts: sortBy("name", "ASC"),
|
|
11
12
|
});
|
|
12
13
|
if (query.trim())
|
|
13
14
|
params.set("q", query.trim());
|
|
@@ -12,14 +12,14 @@ export declare function useSellerPayouts(params?: {
|
|
|
12
12
|
totalPages: number;
|
|
13
13
|
isLoading: boolean;
|
|
14
14
|
error: string | 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<PayoutListResponse, Error>>;
|
|
16
16
|
};
|
|
17
17
|
export declare function useSellerPayoutSettings(opts?: {
|
|
18
18
|
enabled?: boolean;
|
|
19
19
|
endpoint?: string;
|
|
20
20
|
}): {
|
|
21
|
-
settings:
|
|
21
|
+
settings: SellerPayoutSettings | null;
|
|
22
22
|
isLoading: boolean;
|
|
23
23
|
error: string | null;
|
|
24
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
24
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<SellerPayoutSettings | null, Error>>;
|
|
25
25
|
};
|
|
@@ -3,28 +3,28 @@ export declare function useSellerStore(opts?: {
|
|
|
3
3
|
enabled?: boolean;
|
|
4
4
|
endpoint?: string;
|
|
5
5
|
}): {
|
|
6
|
-
store:
|
|
6
|
+
store: SellerStore | null;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
error: string | null;
|
|
9
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
9
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<SellerStore | null, Error>>;
|
|
10
10
|
};
|
|
11
11
|
export declare function useSellerDashboard(opts?: {
|
|
12
12
|
enabled?: boolean;
|
|
13
13
|
endpoint?: string;
|
|
14
14
|
}): {
|
|
15
|
-
stats:
|
|
15
|
+
stats: SellerDashboardStats | null;
|
|
16
16
|
isLoading: boolean;
|
|
17
17
|
error: string | null;
|
|
18
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<
|
|
18
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<SellerDashboardStats, Error>>;
|
|
19
19
|
};
|
|
20
20
|
export declare function useSellerAnalytics(period?: string, opts?: {
|
|
21
21
|
enabled?: boolean;
|
|
22
22
|
endpoint?: string;
|
|
23
23
|
}): {
|
|
24
|
-
analytics:
|
|
24
|
+
analytics: SellerAnalytics | null;
|
|
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<SellerAnalytics, Error>>;
|
|
28
28
|
};
|
|
29
29
|
/** @deprecated Use useStoreDashboard */
|
|
30
30
|
export { useSellerDashboard as useStoreDashboard };
|
|
@@ -9,8 +9,8 @@ export declare function useSellerStorefront(sellerId: string, options?: {
|
|
|
9
9
|
seller: PublicUserProfile | undefined;
|
|
10
10
|
loading: boolean;
|
|
11
11
|
profileError: string;
|
|
12
|
-
productsData:
|
|
12
|
+
productsData: ProductsApiResponse | undefined;
|
|
13
13
|
productsLoading: boolean;
|
|
14
|
-
reviewsData:
|
|
14
|
+
reviewsData: SellerReviewsData | undefined;
|
|
15
15
|
reviewsLoading: boolean;
|
|
16
16
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Public and seller-facing read functions for store listings, products,
|
|
5
5
|
* auctions and reviews. No auth — callers decide whether auth is needed.
|
|
6
6
|
*/
|
|
7
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
7
8
|
import { NotFoundError } from "../../../errors";
|
|
8
9
|
const ERR_STORE_NOT_FOUND = "Store not found";
|
|
9
10
|
import { maskPublicReview } from "../../../security";
|
|
@@ -35,7 +36,7 @@ export async function getStoreProducts(storeSlug, params = {}) {
|
|
|
35
36
|
throw new NotFoundError(ERR_STORE_NOT_FOUND);
|
|
36
37
|
}
|
|
37
38
|
const filtersArr = [
|
|
38
|
-
|
|
39
|
+
sieveFilter("storeId", SIEVE_OP.EQ, storeDoc.id),
|
|
39
40
|
"status==published",
|
|
40
41
|
"listingType==standard",
|
|
41
42
|
];
|
|
@@ -57,7 +58,7 @@ export async function getStoreAuctions(storeSlug, params = {}) {
|
|
|
57
58
|
throw new NotFoundError(ERR_STORE_NOT_FOUND);
|
|
58
59
|
}
|
|
59
60
|
const filtersArr = [
|
|
60
|
-
|
|
61
|
+
sieveFilter("storeId", SIEVE_OP.EQ, storeDoc.id),
|
|
61
62
|
"status==published",
|
|
62
63
|
"listingType==auction",
|
|
63
64
|
];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
2
4
|
import { productRepository } from "../../../repositories";
|
|
3
5
|
import { getStoreBySlug } from "./StoreDetailLayoutView";
|
|
4
6
|
import { StoreAuctionsListing } from "./StoreAuctionsListing";
|
|
@@ -8,8 +10,8 @@ export async function StoreAuctionsPageView({ storeSlug }) {
|
|
|
8
10
|
const result = storeId
|
|
9
11
|
? await productRepository
|
|
10
12
|
.list({
|
|
11
|
-
filters:
|
|
12
|
-
sorts: "auctionEndDate",
|
|
13
|
+
filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "auction")),
|
|
14
|
+
sorts: sortBy("auctionEndDate", "ASC"),
|
|
13
15
|
page: 1,
|
|
14
16
|
pageSize: 24,
|
|
15
17
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
export declare const getStoreBySlug: (slug: string) => Promise<import("
|
|
2
|
+
export declare const getStoreBySlug: (slug: string) => Promise<import("@mohasinac/appkit").StoreDocument | null | undefined>;
|
|
3
3
|
export interface StoreDetailLayoutViewProps {
|
|
4
4
|
storeSlug: string;
|
|
5
5
|
/** The current active tab value: "products" | "auctions" | "reviews" | "about" */
|