@mohasinac/appkit 4.10.0 → 4.11.1
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/client/features/layout/DashboardLayoutClient.d.ts +6 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +4 -1
- package/dist/_internal/client/features/lottery/LotteryPullForm.d.ts +1 -1
- package/dist/_internal/client/features/lottery/LotteryPullForm.js +2 -2
- package/dist/_internal/server/features/admin/daily-digest-actions.d.ts +18 -0
- package/dist/_internal/server/features/admin/daily-digest-actions.js +37 -0
- package/dist/_internal/server/features/audit-log/actions.d.ts +25 -0
- package/dist/_internal/server/features/audit-log/actions.js +38 -0
- package/dist/_internal/server/features/brands/actions.js +0 -2
- package/dist/_internal/server/features/brands/og.d.ts +4 -1
- package/dist/_internal/server/features/brands/og.js +1 -1
- package/dist/_internal/server/features/grouped/data.d.ts +4 -0
- package/dist/_internal/server/features/grouped/data.js +24 -0
- package/dist/_internal/server/features/grouped/index.d.ts +1 -1
- package/dist/_internal/server/features/grouped/index.js +1 -1
- package/dist/_internal/server/features/orders/actions.js +9 -0
- package/dist/_internal/server/features/orders/adapters.js +25 -0
- package/dist/_internal/server/features/products/data.d.ts +2 -2
- package/dist/_internal/server/features/products/data.js +5 -23
- package/dist/_internal/server/functions/scheduled.d.ts +3 -1
- package/dist/_internal/server/functions/scheduled.js +17 -1
- package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +40 -0
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +164 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.js +11 -0
- package/dist/_internal/server/jobs/core/testerSandboxCleanup.d.ts +1 -0
- package/dist/_internal/server/jobs/core/testerSandboxCleanup.js +4 -1
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.d.ts +12 -0
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.js +85 -0
- package/dist/_internal/server/jobs/core/whatsappNotify.js +16 -0
- package/dist/_internal/server/jobs/handlers/dailyStatusDigest.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/dailyStatusDigest.js +4 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/index.js +3 -0
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.js +2 -0
- package/dist/_internal/server/notifications/channel-health.d.ts +27 -0
- package/dist/_internal/server/notifications/channel-health.js +101 -0
- package/dist/_internal/shared/features/brands/schema.d.ts +0 -6
- package/dist/_internal/shared/features/brands/schema.js +0 -1
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +7 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.js +3 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
- package/dist/_internal/shared/features/products/to-product-item.d.ts +25 -0
- package/dist/_internal/shared/features/products/to-product-item.js +45 -0
- package/dist/client.d.ts +21 -6
- package/dist/client.js +13 -3
- package/dist/constants/api-endpoints.d.ts +6 -9
- package/dist/constants/api-endpoints.js +2 -3
- package/dist/contracts/client-auth.d.ts +3 -7
- package/dist/contracts/email.d.ts +1 -0
- package/dist/features/account/components/AddressForm.js +24 -2
- package/dist/features/account/components/BecomeSellerView.d.ts +1 -2
- package/dist/features/account/components/BecomeSellerView.js +1 -1
- package/dist/features/account/components/NotificationBell.js +1 -1
- package/dist/features/account/components/UserBidsView.d.ts +1 -0
- package/dist/features/account/components/UserBidsView.js +47 -0
- package/dist/features/account/components/UserOrdersView.d.ts +4 -11
- package/dist/features/account/components/UserOrdersView.js +54 -4
- package/dist/features/account/components/UserReturnsView.d.ts +4 -9
- package/dist/features/account/components/UserReturnsView.js +37 -3
- package/dist/features/account/components/index.d.ts +3 -2
- package/dist/features/account/components/index.js +1 -0
- package/dist/features/admin/actions/admin-actions.js +22 -0
- package/dist/features/admin/actions/admin-coupon-actions.js +10 -0
- package/dist/features/admin/actions/notification-actions.js +4 -3
- package/dist/features/admin/components/AdminAdsView.d.ts +2 -3
- package/dist/features/admin/components/AdminAdsView.js +86 -89
- package/dist/features/admin/components/AdminAllEventEntriesView.js +18 -3
- package/dist/features/admin/components/AdminAuditLogView.d.ts +11 -0
- package/dist/features/admin/components/AdminAuditLogView.js +95 -0
- package/dist/features/admin/components/AdminBlogEditorView.js +37 -3
- package/dist/features/admin/components/AdminBrandEditorView.js +10 -6
- package/dist/features/admin/components/AdminBundleEditorView.js +18 -2
- package/dist/features/admin/components/AdminCarouselEditorView.js +2 -2
- package/dist/features/admin/components/AdminCarouselGroupEditorView.js +2 -2
- package/dist/features/admin/components/AdminCartsView.js +34 -4
- package/dist/features/admin/components/AdminCategoryEditorView.js +5 -4
- package/dist/features/admin/components/AdminCouponEditorView.js +2 -2
- package/dist/features/admin/components/AdminFaqEditorView.js +2 -2
- package/dist/features/admin/components/AdminHistoryView.js +11 -1
- package/dist/features/admin/components/AdminNotificationsView.js +27 -1
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +4 -3
- package/dist/features/admin/components/AdminOrdersView.js +92 -24
- package/dist/features/admin/components/AdminPayoutMarkPaidModal.d.ts +7 -0
- package/dist/features/admin/components/AdminPayoutMarkPaidModal.js +47 -0
- package/dist/features/admin/components/AdminPayoutsView.js +15 -31
- package/dist/features/admin/components/AdminProductEditorView.js +26 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +20 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +22 -2
- package/dist/features/admin/components/AdminStoresView.js +7 -0
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +2 -2
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +2 -2
- package/dist/features/admin/components/AdminUserEditorView.d.ts +2 -2
- package/dist/features/admin/components/AdminUserEditorView.js +4 -2
- package/dist/features/admin/components/AdminUsersView.js +1 -1
- package/dist/features/admin/components/AdminWishlistsView.js +14 -1
- package/dist/features/admin/components/DataListingView.d.ts +2 -2
- package/dist/features/admin/components/ViewAuditLogEntryModal.d.ts +19 -0
- package/dist/features/admin/components/ViewAuditLogEntryModal.js +22 -0
- package/dist/features/admin/components/ViewNotificationModal.d.ts +21 -0
- package/dist/features/admin/components/ViewNotificationModal.js +15 -0
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.d.ts +4 -7
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.js +56 -36
- package/dist/features/admin/components/index.d.ts +8 -1
- package/dist/features/admin/components/index.js +4 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +49 -0
- package/dist/features/admin/constants/filter-tabs.js +27 -0
- package/dist/features/admin/hooks/useAdminListing.d.ts +6 -0
- package/dist/features/admin/hooks/useAdminListing.js +3 -1
- package/dist/features/admin/hooks/useAdminListingData.d.ts +9 -1
- package/dist/features/admin/hooks/useAdminListingData.js +9 -2
- package/dist/features/admin/repository/site-settings.repository.d.ts +5 -0
- package/dist/features/admin/schemas/firestore.d.ts +12 -0
- package/dist/features/analytics/types.d.ts +1 -1
- package/dist/features/analytics/types.js +8 -0
- package/dist/features/auctions/schemas/index.d.ts +5 -0
- package/dist/features/audit-log/repository/audit-log.repository.d.ts +45 -0
- package/dist/features/audit-log/repository/audit-log.repository.js +30 -0
- package/dist/features/audit-log/schemas/firestore.d.ts +59 -0
- package/dist/features/audit-log/schemas/firestore.js +35 -0
- package/dist/features/auth/actions/index.d.ts +0 -1
- package/dist/features/auth/actions/index.js +0 -1
- package/dist/features/auth/hooks/useAuth.d.ts +8 -35
- package/dist/features/auth/hooks/useAuth.js +21 -37
- package/dist/features/auth/permissions/constants.d.ts +1 -1
- package/dist/features/auth/permissions/constants.js +2 -0
- package/dist/features/blog/schemas/index.d.ts +32 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +31 -3
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +2 -1
- package/dist/features/categories/components/BrandDetailPageView.js +14 -12
- package/dist/features/categories/components/CategoryDetailPageView.js +7 -3
- package/dist/features/categories/components/CategoryHighlightsAndFaqSection.d.ts +14 -0
- package/dist/features/categories/components/CategoryHighlightsAndFaqSection.js +22 -0
- package/dist/features/categories/components/CategoryProductsView.d.ts +1 -5
- package/dist/features/categories/components/CategoryProductsView.js +1 -1
- package/dist/features/categories/components/CategorySelectorCreate.js +16 -2
- package/dist/features/categories/schemas/firestore.d.ts +19 -2
- package/dist/features/categories/schemas/index.d.ts +24 -3
- package/dist/features/categories/schemas/index.js +3 -1
- package/dist/features/categories/types/index.d.ts +7 -0
- package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +17 -3
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +101 -22
- package/dist/features/contact/components/ContactForm.js +17 -4
- package/dist/features/contact/email.d.ts +1 -0
- package/dist/features/contact/email.js +3 -0
- package/dist/features/events/components/AdminEventEditorView.js +54 -2
- package/dist/features/events/components/AdminEventEntriesView.d.ts +2 -16
- package/dist/features/events/components/AdminEventEntriesView.js +56 -89
- package/dist/features/events/components/EventFormDrawer.js +5 -1
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +1 -3
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/schemas/index.d.ts +22 -0
- package/dist/features/grouped/components/GroupedListingsCarousel.js +4 -1
- package/dist/features/grouped/repository/grouped-listings.repository.d.ts +4 -0
- package/dist/features/grouped/repository/grouped-listings.repository.js +18 -0
- package/dist/features/homepage/components/CharacterHotspotForm.js +202 -187
- package/dist/features/homepage/components/SectionCarousel.d.ts +1 -7
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/layout/TitleBarLayout.d.ts +1 -1
- package/dist/features/layout/TitleBarLayout.js +3 -3
- package/dist/features/media/MediaImage.js +39 -3
- package/dist/features/media/types/index.d.ts +10 -0
- package/dist/features/media/types/index.js +1 -0
- package/dist/features/media/upload/MediaUploadField.d.ts +7 -1
- package/dist/features/media/upload/MediaUploadField.js +11 -7
- package/dist/features/media/upload/video-poster.d.ts +2 -0
- package/dist/features/media/upload/video-poster.js +16 -1
- package/dist/features/media/upload/video-poster.test.js +1 -1
- package/dist/features/orders/components/OrderStatusTimeline.d.ts +12 -0
- package/dist/features/orders/components/OrderStatusTimeline.js +55 -0
- package/dist/features/orders/components/index.d.ts +2 -0
- package/dist/features/orders/components/index.js +1 -0
- package/dist/features/orders/constants/payment-window.d.ts +25 -0
- package/dist/features/orders/constants/payment-window.js +25 -0
- package/dist/features/orders/repository/orders.repository.d.ts +32 -0
- package/dist/features/orders/repository/orders.repository.js +56 -0
- package/dist/features/orders/schemas/index.d.ts +24 -24
- package/dist/features/orders/types/index.d.ts +33 -0
- package/dist/features/pre-orders/schemas/index.d.ts +5 -0
- package/dist/features/products/components/BidHistory.js +9 -1
- package/dist/features/products/components/GroupSettingsPanel.js +25 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +1 -1
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +1 -4
- package/dist/features/products/components/PrizeDrawEntryActions.js +1 -1
- package/dist/features/products/components/ProductDetailActions.d.ts +1 -2
- package/dist/features/products/components/ProductDetailActions.js +1 -1
- package/dist/features/products/components/ProductGrid.js +15 -1
- package/dist/features/products/constants/action-defs.d.ts +1 -0
- package/dist/features/products/constants/action-defs.js +1 -0
- package/dist/features/products/schemas/index.d.ts +5 -0
- package/dist/features/promotions/components/CouponsIndexListing.d.ts +1 -3
- package/dist/features/promotions/components/CouponsIndexListing.js +1 -1
- package/dist/features/search/components/SearchView.d.ts +1 -3
- package/dist/features/search/components/SearchView.js +1 -1
- package/dist/features/seller/components/QuickProductForm.js +2 -1
- package/dist/features/seller/components/SellerBidsView.js +66 -107
- package/dist/features/seller/components/SellerGoogleReviewsView.js +17 -1
- package/dist/features/seller/components/SellerOrdersView.d.ts +15 -3
- package/dist/features/seller/components/SellerOrdersView.js +134 -163
- package/dist/features/seller/components/SellerPayoutMethodsView.js +60 -48
- package/dist/features/seller/components/SellerPayoutSettingsView.js +69 -4
- package/dist/features/seller/components/SellerPayoutsView.d.ts +12 -0
- package/dist/features/seller/components/SellerPayoutsView.js +25 -5
- package/dist/features/seller/components/SellerProductShell.d.ts +10 -3
- package/dist/features/seller/components/SellerProductShell.js +89 -36
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +2 -7
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +4 -4
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -4
- package/dist/features/seller/components/SellerProductsView.js +131 -189
- package/dist/features/seller/components/SellerReviewsView.js +95 -133
- package/dist/features/seller/components/SellerShippingConfigsView.js +47 -67
- package/dist/features/seller/components/SellerShippingView.js +41 -4
- package/dist/features/seller/components/SellerStoreCategoriesView.js +51 -59
- package/dist/features/seller/components/SellerStorefrontView.d.ts +6 -1
- package/dist/features/seller/components/SellerStorefrontView.js +42 -5
- package/dist/features/seller/components/index.d.ts +2 -2
- package/dist/features/seller/components/index.js +2 -2
- package/dist/features/shell/FormShell.d.ts +24 -4
- package/dist/features/shell/FormShell.js +12 -6
- package/dist/features/shell/QuickFormDrawer.js +67 -12
- package/dist/features/shell/StepForm.d.ts +30 -1
- package/dist/features/shell/StepForm.js +47 -4
- package/dist/features/shell/index.d.ts +1 -1
- package/dist/features/shell/index.js +1 -1
- package/dist/features/shipments/components/AdminShipmentEditorView.js +2 -2
- package/dist/features/shipments/schemas/validation.d.ts +14 -4
- package/dist/features/tester/components/AdminTesterFeedbackListView.js +23 -2
- package/dist/features/tester/components/TesterChecklistStepRow.js +1 -1
- package/dist/features/tester/components/TesterHubView.js +3 -2
- package/dist/features/tester/seed-data/orders-tester-seed-data.js +9 -1
- package/dist/features/tester/seed-data/products-tester-seed-data.js +43 -32
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +404 -15
- package/dist/index.d.ts +15 -3
- package/dist/index.js +22 -5
- package/dist/next/routing/route-map.d.ts +11 -0
- package/dist/next/routing/route-map.js +5 -0
- package/dist/providers/email-resend/provider.js +1 -0
- package/dist/providers/firebase-client/auth.d.ts +1 -0
- package/dist/providers/firebase-client/auth.js +7 -1
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +1 -0
- package/dist/schemas/registry.d.ts +61 -25
- package/dist/security/pii-mask.js +1 -1
- package/dist/seed/categories-seed-data.js +69 -0
- package/dist/seed/products-auctions-seed-data.js +11 -0
- package/dist/seed/products-standard-seed-data.js +93 -4
- package/dist/seed/site-settings-seed-data.js +13 -1
- package/dist/seed/store-extensions-seed-data.js +1 -1
- package/dist/server-entry.d.ts +2 -1
- package/dist/server-entry.js +20 -2
- package/dist/server.d.ts +7 -2
- package/dist/server.js +8 -3
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Form.d.ts +11 -2
- package/dist/ui/components/Form.js +4 -3
- package/dist/ui/components/FormField.d.ts +3 -1
- package/dist/ui/components/FormField.js +22 -4
- package/dist/ui/components/ListingLayout.d.ts +1 -2
- package/dist/ui/components/ListingLayout.js +1 -1
- package/dist/ui/components/RecordDetailModal.d.ts +68 -0
- package/dist/ui/components/RecordDetailModal.js +8 -0
- package/dist/ui/components/SlottedListingView.js +9 -1
- package/dist/ui/forms/FormErrorSummary.d.ts +25 -0
- package/dist/ui/forms/FormErrorSummary.js +37 -0
- package/dist/ui/forms/FormShell.d.ts +37 -2
- package/dist/ui/forms/FormShell.js +37 -7
- package/dist/ui/forms/FormShell.style.css +17 -0
- package/dist/ui/forms/index.d.ts +2 -0
- package/dist/ui/forms/index.js +1 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +5 -0
- package/dist/utils/media-url.d.ts +3 -1
- package/dist/utils/media-url.js +20 -1
- package/dist/validation/schemas.d.ts +4 -4
- package/package.json +1 -1
- package/dist/_internal/client/features/classified/ClassifiedDetailView.d.ts +0 -9
- package/dist/_internal/client/features/classified/ClassifiedDetailView.js +0 -55
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.d.ts +0 -18
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +0 -21
- package/dist/_internal/client/features/live/LiveItemDetailView.d.ts +0 -9
- package/dist/_internal/client/features/live/LiveItemDetailView.js +0 -25
- package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +0 -28
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +0 -61
- package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +0 -68
- package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +0 -49
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +0 -2
- package/dist/features/auth/consent-otp.d.ts +0 -57
- package/dist/features/auth/consent-otp.js +0 -127
- package/dist/features/cart/components/CheckoutOtpModal.d.ts +0 -15
- package/dist/features/cart/components/CheckoutOtpModal.js +0 -12
- package/dist/features/checkout/actions/checkout-actions.d.ts +0 -31
- package/dist/features/checkout/actions/checkout-actions.js +0 -124
- package/dist/features/classified/components/ClassifiedIndexListing.d.ts +0 -5
- package/dist/features/classified/components/ClassifiedIndexListing.js +0 -123
- package/dist/features/classified/components/ClassifiedListView.d.ts +0 -6
- package/dist/features/classified/components/ClassifiedListView.js +0 -44
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.d.ts +0 -5
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +0 -114
- package/dist/features/digital-codes/components/DigitalCodesListView.d.ts +0 -6
- package/dist/features/digital-codes/components/DigitalCodesListView.js +0 -38
- package/dist/features/live/components/LiveItemsIndexListing.d.ts +0 -5
- package/dist/features/live/components/LiveItemsIndexListing.js +0 -115
- package/dist/features/live/components/LiveItemsListView.d.ts +0 -6
- package/dist/features/live/components/LiveItemsListView.js +0 -44
- package/dist/features/seller/components/SellerTemplatesView.d.ts +0 -12
- package/dist/features/seller/components/SellerTemplatesView.js +0 -276
- package/dist/react/hooks/useVisibleItems.d.ts +0 -37
- package/dist/react/hooks/useVisibleItems.js +0 -59
- package/dist/ui/components/TabStrip.d.ts +0 -34
- package/dist/ui/components/TabStrip.js +0 -56
- package/dist/ui/components/TabStrip.style.css +0 -97
|
@@ -45,11 +45,6 @@ export declare const createOrderSchema: z.ZodObject<{
|
|
|
45
45
|
couponCode: z.ZodOptional<z.ZodString>;
|
|
46
46
|
}, "strip", z.ZodTypeAny, {
|
|
47
47
|
paymentMethod: "upi" | "razorpay" | "cod";
|
|
48
|
-
items: {
|
|
49
|
-
price: number;
|
|
50
|
-
productId: string;
|
|
51
|
-
quantity: number;
|
|
52
|
-
}[];
|
|
53
48
|
shippingAddress: {
|
|
54
49
|
country: string;
|
|
55
50
|
phone: string;
|
|
@@ -60,14 +55,14 @@ export declare const createOrderSchema: z.ZodObject<{
|
|
|
60
55
|
pincode: string;
|
|
61
56
|
addressLine2?: string | undefined;
|
|
62
57
|
};
|
|
63
|
-
couponCode?: string | undefined;
|
|
64
|
-
}, {
|
|
65
|
-
paymentMethod: "upi" | "razorpay" | "cod";
|
|
66
58
|
items: {
|
|
67
59
|
price: number;
|
|
68
60
|
productId: string;
|
|
69
61
|
quantity: number;
|
|
70
62
|
}[];
|
|
63
|
+
couponCode?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
paymentMethod: "upi" | "razorpay" | "cod";
|
|
71
66
|
shippingAddress: {
|
|
72
67
|
phone: string;
|
|
73
68
|
city: string;
|
|
@@ -78,6 +73,11 @@ export declare const createOrderSchema: z.ZodObject<{
|
|
|
78
73
|
country?: string | undefined;
|
|
79
74
|
addressLine2?: string | undefined;
|
|
80
75
|
};
|
|
76
|
+
items: {
|
|
77
|
+
price: number;
|
|
78
|
+
productId: string;
|
|
79
|
+
quantity: number;
|
|
80
|
+
}[];
|
|
81
81
|
couponCode?: string | undefined;
|
|
82
82
|
}>;
|
|
83
83
|
export declare const updateOrderStatusSchema: z.ZodObject<{
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* toProductItem — Firestore doc → card-grid `ProductItem` mapper.
|
|
3
|
+
*
|
|
4
|
+
* Lives in `_internal/shared/` (client+server safe), NOT in
|
|
5
|
+
* `_internal/server/features/products/data.ts` where it was originally
|
|
6
|
+
* written. It is a pure field mapping with no server dependencies of its
|
|
7
|
+
* own, but `data.ts` transitively reaches `providers/db-firebase/admin.js`
|
|
8
|
+
* (firebase-admin), and `GroupedListingsCarousel.tsx` is a `"use client"`
|
|
9
|
+
* component that imports this function as a VALUE. Turbopack resolves a
|
|
10
|
+
* module's full static import graph before tree-shaking, so that single
|
|
11
|
+
* import dragged the whole firebase-admin chain into the client bundle and
|
|
12
|
+
* failed the production build outright:
|
|
13
|
+
*
|
|
14
|
+
* Module not found: .../providers/db-firebase/admin.js
|
|
15
|
+
* [Client Component Browser] → GroupedListingsCarousel
|
|
16
|
+
* → _internal/server/features/products/data.js
|
|
17
|
+
*
|
|
18
|
+
* This is the Turbopack client-bundle trap from CLAUDE.md's appkit Export
|
|
19
|
+
* Rules / Recurrent Root Cause #6, reached through an ordinary deep import
|
|
20
|
+
* rather than a barrel. Keep this file free of any server-only import so a
|
|
21
|
+
* client component can always call it directly.
|
|
22
|
+
*/
|
|
23
|
+
import type { FirestoreDocument } from "../../../../schemas/types";
|
|
24
|
+
import type { ProductItem } from "../../../../features/products/types";
|
|
25
|
+
export declare function toProductItem(doc: FirestoreDocument): ProductItem;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* toProductItem — Firestore doc → card-grid `ProductItem` mapper.
|
|
3
|
+
*
|
|
4
|
+
* Lives in `_internal/shared/` (client+server safe), NOT in
|
|
5
|
+
* `_internal/server/features/products/data.ts` where it was originally
|
|
6
|
+
* written. It is a pure field mapping with no server dependencies of its
|
|
7
|
+
* own, but `data.ts` transitively reaches `providers/db-firebase/admin.js`
|
|
8
|
+
* (firebase-admin), and `GroupedListingsCarousel.tsx` is a `"use client"`
|
|
9
|
+
* component that imports this function as a VALUE. Turbopack resolves a
|
|
10
|
+
* module's full static import graph before tree-shaking, so that single
|
|
11
|
+
* import dragged the whole firebase-admin chain into the client bundle and
|
|
12
|
+
* failed the production build outright:
|
|
13
|
+
*
|
|
14
|
+
* Module not found: .../providers/db-firebase/admin.js
|
|
15
|
+
* [Client Component Browser] → GroupedListingsCarousel
|
|
16
|
+
* → _internal/server/features/products/data.js
|
|
17
|
+
*
|
|
18
|
+
* This is the Turbopack client-bundle trap from CLAUDE.md's appkit Export
|
|
19
|
+
* Rules / Recurrent Root Cause #6, reached through an ordinary deep import
|
|
20
|
+
* rather than a barrel. Keep this file free of any server-only import so a
|
|
21
|
+
* client component can always call it directly.
|
|
22
|
+
*/
|
|
23
|
+
export function toProductItem(doc) {
|
|
24
|
+
return {
|
|
25
|
+
id: String(doc.id ?? ""),
|
|
26
|
+
title: String(doc.title ?? doc.name ?? ""),
|
|
27
|
+
price: typeof doc.price === "number" ? doc.price : 0,
|
|
28
|
+
originalPrice: typeof doc.originalPrice === "number" ? doc.originalPrice : undefined,
|
|
29
|
+
mainImage: Array.isArray(doc.images)
|
|
30
|
+
? doc.images[0]
|
|
31
|
+
: typeof doc.mainImage === "string"
|
|
32
|
+
? doc.mainImage
|
|
33
|
+
: undefined,
|
|
34
|
+
status: doc.status ?? "published",
|
|
35
|
+
slug: typeof doc.slug === "string" ? doc.slug : undefined,
|
|
36
|
+
storeName: typeof doc.storeName === "string" ? doc.storeName : undefined,
|
|
37
|
+
rating: typeof doc.rating === "number" ? doc.rating : undefined,
|
|
38
|
+
reviewCount: typeof doc.reviewCount === "number" ? doc.reviewCount : undefined,
|
|
39
|
+
// Without this, every related-item card silently linked to the standard
|
|
40
|
+
// PDP regardless of its real type (pluginFor() defaults to "standard"
|
|
41
|
+
// when listingType is missing) — same bug class as the Phase 1 routing
|
|
42
|
+
// fix, one hop further downstream in the related-items card link path.
|
|
43
|
+
listingType: doc.listingType ?? undefined,
|
|
44
|
+
};
|
|
45
|
+
}
|
package/dist/client.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export { Divider } from "./ui/components/Divider";
|
|
|
39
39
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./ui/components/Tabs";
|
|
40
40
|
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps } from "./ui/components/Tabs";
|
|
41
41
|
export { SellerProductsView } from "./features/seller/components/SellerProductsView";
|
|
42
|
+
export { SellerOrderDetailPanel } from "./features/seller/components/SellerOrdersView";
|
|
43
|
+
export { SellerPayoutDetailContent } from "./features/seller/components/SellerPayoutsView";
|
|
42
44
|
export { Drawer } from "./ui/components/Drawer";
|
|
43
45
|
export { FilterDrawer } from "./ui/components/FilterDrawer";
|
|
44
46
|
export { Modal } from "./ui/components/Modal";
|
|
@@ -122,6 +124,10 @@ export { ProgressBarFill } from "./ui/components/ProgressBarFill";
|
|
|
122
124
|
export type { ProgressBarFillProps } from "./ui/components/ProgressBarFill";
|
|
123
125
|
export { Main, Section, Nav, Ul, Ol, Li, Table, Thead, Tbody, Tr, Th, Td, Code, Pre, Blockquote } from "./ui/components/Semantic";
|
|
124
126
|
export { Badge } from "./ui/components/Badge";
|
|
127
|
+
export { Avatar, AvatarGroup } from "./ui/components/Avatar";
|
|
128
|
+
export type { AvatarProps, AvatarGroupProps } from "./ui/components/Avatar";
|
|
129
|
+
export { AvatarDisplay } from "./ui/components/AvatarDisplay";
|
|
130
|
+
export type { AvatarDisplayProps } from "./ui/components/AvatarDisplay";
|
|
125
131
|
export { Button } from "./ui/components/Button";
|
|
126
132
|
export { ClaimCouponButton } from "./ui/components/ClaimCouponButton";
|
|
127
133
|
export type { ClaimCouponButtonProps } from "./ui/components/ClaimCouponButton";
|
|
@@ -145,6 +151,8 @@ export type { FieldTextareaProps } from "./ui/forms";
|
|
|
145
151
|
export { FieldTextarea } from "./ui/forms";
|
|
146
152
|
export type { ColorPickerFieldProps } from "./ui/forms";
|
|
147
153
|
export { ColorPickerField } from "./ui/forms";
|
|
154
|
+
export type { FormErrorSummaryProps } from "./ui/forms";
|
|
155
|
+
export { FormErrorSummary } from "./ui/forms";
|
|
148
156
|
export { Select } from "./ui/components/Select";
|
|
149
157
|
export type { SelectOption, SelectProps } from "./ui/components/Select";
|
|
150
158
|
export { Heading } from "./ui/components/Typography";
|
|
@@ -168,7 +176,7 @@ export type { ZodSetupProps } from "./validation/ZodSetup";
|
|
|
168
176
|
export { AdminSidebar } from "./features/admin/components/AdminSidebar";
|
|
169
177
|
export type { AdminSidebarProps, AdminNavItem, AdminNavGroup } from "./features/admin/components/AdminSidebar";
|
|
170
178
|
export { AdminDashboardView, AdminAnalyticsView, AdminPageViewsReportView, AdminPrizeDrawsView, AdminCarouselView, AdminSublistingCategoriesView, AdminFulfillmentView, DataTable, DataListingView, useAdminListingData, toRecordArray, toStringValue, toRelativeDate } from "./features/admin/index";
|
|
171
|
-
export type { AdminDashboardViewProps, AdminAnalyticsViewProps, AdminAnalyticsViewLabels,
|
|
179
|
+
export type { AdminDashboardViewProps, AdminAnalyticsViewProps, AdminAnalyticsViewLabels, AdminPrizeDrawsViewProps, AdminCarouselViewProps, AdminFulfillmentViewProps, AdminListingScaffoldRow, ListingViewConfig } from "./features/admin/index";
|
|
172
180
|
export type { BulkActionItem } from "./ui/components/BulkActionBar";
|
|
173
181
|
export { PERMISSION_GROUPS, PERMISSION_DOMAINS, getPermissionsForDomain, formatPermLabel } from "./features/auth/permissions/constants";
|
|
174
182
|
export { ADMIN_ENDPOINTS } from "./constants/index";
|
|
@@ -195,8 +203,8 @@ export { AuctionBidsTable } from "./features/auctions/components/AuctionBidsTabl
|
|
|
195
203
|
export type { AuctionBidsTableProps, AuctionWithBids } from "./features/auctions/components/AuctionBidsTable";
|
|
196
204
|
export { ProtectedRoute, AuthStatusPanel, ForgotPasswordView, LoginForm, RegisterForm, ResetPasswordView, VerifyEmailView } from "./features/auth/index";
|
|
197
205
|
export type { AuthGuardUser, ForgotPasswordViewProps, LoginFormProps, LoginFormValues, RegisterFormProps, RegisterFormValues, ResetPasswordViewProps, VerifyEmailViewProps, } from "./features/auth/index";
|
|
198
|
-
export { useLogout, useLogin, useGoogleLogin, useLinkGoogleAccount, useRegister, useForgotPassword, useResetPassword, useVerifyEmail,
|
|
199
|
-
export type { LoginCredentials, RegisterData, ForgotPasswordData, ResetPasswordData, VerifyEmailData,
|
|
206
|
+
export { useLogout, useLogin, useGoogleLogin, useLinkGoogleAccount, useRegister, useForgotPassword, useResetPassword, useVerifyEmail, useChangeEmail } from "./features/auth/index";
|
|
207
|
+
export type { LoginCredentials, RegisterData, ForgotPasswordData, ResetPasswordData, VerifyEmailData, ChangeEmailData } from "./features/auth/index";
|
|
200
208
|
export { CartView, CartItemRow, CartSummary, CartDrawer, CheckoutView, CheckoutSuccessView, CheckoutAddressStep, useGuestCart, useCartCount, useAddToCart, useCart, useGuestCartMerge, useCartQuery } from "./features/cart/index";
|
|
201
209
|
export { getCartOps, CART_OPS_CHANGE_EVENT } from "./features/cart/utils/pending-ops";
|
|
202
210
|
export type { CartOp } from "./features/cart/utils/pending-ops";
|
|
@@ -283,9 +291,15 @@ export type { SellerDashboardViewProps as StoreDashboardViewProps, SellerDashboa
|
|
|
283
291
|
export { SellerPayoutSettingsView, SellerShippingView, SellerReviewsView, SellerPayoutRequestView, SellerAnalyticsStats, SellerTopProducts, SellerAnalyticsView, SellerPayoutsView, SellerCouponEditorView, SellerBidsView, SellerAddressesView, SellerPreOrdersView, SellerPrizeDrawsView, PrintCenterView, SellerOffersView, SellerGroupedListingsView, StoreGroupedListingsView, SellerAnalyticsAlertsView, StoreAnalyticsAlertsView, BarcodeField, FulfillmentView } from "./features/seller/components/index";
|
|
284
292
|
export type { SellerPayoutSettingsViewProps, SellerShippingViewProps, SellerReviewsViewProps, SellerPayoutRequestViewProps, SellerAnalyticsViewProps, SellerPayoutsViewProps, SellerCouponEditorViewProps, CouponEditorDraft, SellerBidsViewProps, SellerAddressesViewProps, SellerPreOrdersViewProps, SellerPrizeDrawsViewProps, SellerOffersViewProps, SellerGroupedListingsViewProps, SellerAnalyticsAlertsViewProps, BarcodeFieldProps, FulfillmentViewProps } from "./features/seller/components/index";
|
|
285
293
|
export type { SellerAnalyticsSummary, SellerAnalyticsTopProduct } from "./features/seller/types/index";
|
|
286
|
-
export { UserAccountHubView, UserOrdersView, OrderDetailView, UserNotificationsView, UserReturnsView, UserSupportView, useNotifications } from "./features/account/index";
|
|
287
|
-
export type { UserAccountHubViewProps, UserAccountHubViewLabels, UserOrdersViewProps,
|
|
294
|
+
export { UserAccountHubView, UserOrdersView, UserBidsView, OrderDetailView, UserNotificationsView, UserReturnsView, UserSupportView, useNotifications } from "./features/account/index";
|
|
295
|
+
export type { UserAccountHubViewProps, UserAccountHubViewLabels, UserOrdersViewProps, OrderDetailViewProps, OrderDetailViewLabels, UserNotificationsViewProps, UserNotificationsViewLabels, UserReturnsViewProps, UserSupportViewProps } from "./features/account/index";
|
|
288
296
|
export { useOrders, useOrder, OrdersList } from "./features/orders/index";
|
|
297
|
+
export { OrderStatusTimeline } from "./features/orders/components/OrderStatusTimeline";
|
|
298
|
+
export type { OrderStatusTimelineProps } from "./features/orders/components/OrderStatusTimeline";
|
|
299
|
+
export { MANUAL_PAYMENT_METHODS, isManualPaymentMethod, PAYMENT_REVIEW_QUEUE_MODES, isPaymentReviewQueueMode, PAYMENT_WINDOW_MINUTES, } from "./features/orders/constants/payment-window";
|
|
300
|
+
export type { PaymentReviewQueueMode } from "./features/orders/constants/payment-window";
|
|
301
|
+
export { UserOrderTrackView } from "./features/account/components/UserOrderTrackView";
|
|
302
|
+
export type { UserOrderTrackViewProps, UserOrderTrackViewLabels } from "./features/account/components/UserOrderTrackView";
|
|
289
303
|
export { useCouponValidate } from "./features/promotions/hooks/useCouponValidate";
|
|
290
304
|
export { BlogPostView } from "./features/blog/components/BlogPostView";
|
|
291
305
|
export type { BlogPostViewProps } from "./features/blog/components/BlogPostView";
|
|
@@ -366,7 +380,8 @@ export type { PaymentProofReviewMessageInput } from "./features/whatsapp-bot/typ
|
|
|
366
380
|
export type { AdminNotificationDocument, ItemRequestDocument, ModerationQueueDocument, ReportDocument, CustomRoleDocument, AnalyticsCardDocument, ListingTemplateDocument, } from "./features/store-extensions/index";
|
|
367
381
|
export { CommandPalette, useCommandPaletteHotkey } from "./features/shell/index";
|
|
368
382
|
export type { CommandPaletteGroup } from "./features/shell/index";
|
|
369
|
-
export { AdminBlogEditorView, AdminBundleEditorView, AdminCarouselEditorView, AdminCategoryEditorView, AdminCouponEditorView, AdminFaqEditorView, AdminOrderEditorView, AdminProductEditorView, AdminScammerEditorView, AdminSublistingCategoryEditorView, AdminSupportTicketDetailView, } from "./features/admin/index";
|
|
383
|
+
export { AdminBlogEditorView, AdminBundleEditorView, AdminCarouselEditorView, AdminCategoryEditorView, AdminCouponEditorView, AdminFaqEditorView, AdminOrderEditorView, AdminPayoutMarkPaidModal, AdminAuditLogView, ViewAuditLogEntryModal, AdminProductEditorView, AdminScammerEditorView, AdminStoreEditorView, AdminSublistingCategoryEditorView, AdminSupportTicketDetailView, } from "./features/admin/index";
|
|
384
|
+
export type { AdminStoreEditorViewProps, AdminPayoutMarkPaidModalProps, AdminAuditLogViewProps, AuditLogEntryDetail, ViewAuditLogEntryModalProps } from "./features/admin/index";
|
|
370
385
|
export { ADMIN_CHECKOUT_BYPASS_FLAG_KEY } from "./features/admin/schemas/firestore";
|
|
371
386
|
export { SpinWheelView, EventRaffleEntryForm } from "./features/events/index";
|
|
372
387
|
export { Card, CardBody } from "./ui/index";
|
package/dist/client.js
CHANGED
|
@@ -52,6 +52,8 @@ export { Alert } from "./ui/components/Alert";
|
|
|
52
52
|
export { Divider } from "./ui/components/Divider";
|
|
53
53
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./ui/components/Tabs";
|
|
54
54
|
export { SellerProductsView } from "./features/seller/components/SellerProductsView";
|
|
55
|
+
export { SellerOrderDetailPanel } from "./features/seller/components/SellerOrdersView";
|
|
56
|
+
export { SellerPayoutDetailContent } from "./features/seller/components/SellerPayoutsView";
|
|
55
57
|
// [CLIENT-ONLY]-Cannot run in SSR mode â€" uses browser-only APIs (window, navigator, localStorage, matchMedia, DOM events) that do not exist in Node.js.
|
|
56
58
|
// Drawer - Component for drawer.
|
|
57
59
|
export { Drawer } from "./ui/components/Drawer";
|
|
@@ -186,6 +188,8 @@ export { DynamicBgDiv } from "./ui/components/DynamicBgDiv";
|
|
|
186
188
|
export { ProgressBarFill } from "./ui/components/ProgressBarFill";
|
|
187
189
|
export { Main, Section, Nav, Ul, Ol, Li, Table, Thead, Tbody, Tr, Th, Td, Code, Pre, Blockquote } from "./ui/components/Semantic";
|
|
188
190
|
export { Badge } from "./ui/components/Badge";
|
|
191
|
+
export { Avatar, AvatarGroup } from "./ui/components/Avatar";
|
|
192
|
+
export { AvatarDisplay } from "./ui/components/AvatarDisplay";
|
|
189
193
|
export { Button } from "./ui/components/Button";
|
|
190
194
|
export { ClaimCouponButton } from "./ui/components/ClaimCouponButton";
|
|
191
195
|
export { Checkbox } from "./ui/components/Checkbox";
|
|
@@ -199,6 +203,7 @@ export { FieldSelect } from "./ui/forms";
|
|
|
199
203
|
export { FieldCheckbox } from "./ui/forms";
|
|
200
204
|
export { FieldTextarea } from "./ui/forms";
|
|
201
205
|
export { ColorPickerField } from "./ui/forms";
|
|
206
|
+
export { FormErrorSummary } from "./ui/forms";
|
|
202
207
|
export { Select } from "./ui/components/Select";
|
|
203
208
|
export { Heading } from "./ui/components/Typography";
|
|
204
209
|
export { Label, Text, Span, Caption } from "./ui/components/Typography";
|
|
@@ -231,7 +236,7 @@ export { PageViewTracker } from "./features/analytics/components/PageViewTracker
|
|
|
231
236
|
export { PAGE_VIEW_ENTITY_TYPES } from "./features/analytics/types";
|
|
232
237
|
export { AuctionBidsTable } from "./features/auctions/components/AuctionBidsTable";
|
|
233
238
|
export { ProtectedRoute, AuthStatusPanel, ForgotPasswordView, LoginForm, RegisterForm, ResetPasswordView, VerifyEmailView } from "./features/auth/index";
|
|
234
|
-
export { useLogout, useLogin, useGoogleLogin, useLinkGoogleAccount, useRegister, useForgotPassword, useResetPassword, useVerifyEmail,
|
|
239
|
+
export { useLogout, useLogin, useGoogleLogin, useLinkGoogleAccount, useRegister, useForgotPassword, useResetPassword, useVerifyEmail, useChangeEmail } from "./features/auth/index";
|
|
235
240
|
export { CartView, CartItemRow, CartSummary, CartDrawer, CheckoutView, CheckoutSuccessView, CheckoutAddressStep, useGuestCart, useCartCount, useAddToCart, useCart, useGuestCartMerge, useCartQuery } from "./features/cart/index";
|
|
236
241
|
export { getCartOps, CART_OPS_CHANGE_EVENT } from "./features/cart/utils/pending-ops";
|
|
237
242
|
export { useAddresses, useCreateAddress, useUpdateAddress, useDeleteAddress, useSetDefaultAddress, useAddress } from "./features/account/index";
|
|
@@ -290,8 +295,13 @@ export { SellerOffersPanel } from "./features/seller/components/SellerOffersPane
|
|
|
290
295
|
export { UserOffersPanel } from "./features/account/components/UserOffersPanel";
|
|
291
296
|
export { SellerDashboardView as StoreDashboardView, SellerDashboardView, useSellerDashboard as useStoreDashboard, useSellerDashboard } from "./features/seller/index";
|
|
292
297
|
export { SellerPayoutSettingsView, SellerShippingView, SellerReviewsView, SellerPayoutRequestView, SellerAnalyticsStats, SellerTopProducts, SellerAnalyticsView, SellerPayoutsView, SellerCouponEditorView, SellerBidsView, SellerAddressesView, SellerPreOrdersView, SellerPrizeDrawsView, PrintCenterView, SellerOffersView, SellerGroupedListingsView, StoreGroupedListingsView, SellerAnalyticsAlertsView, StoreAnalyticsAlertsView, BarcodeField, FulfillmentView } from "./features/seller/components/index";
|
|
293
|
-
export { UserAccountHubView, UserOrdersView, OrderDetailView, UserNotificationsView, UserReturnsView, UserSupportView, useNotifications } from "./features/account/index";
|
|
298
|
+
export { UserAccountHubView, UserOrdersView, UserBidsView, OrderDetailView, UserNotificationsView, UserReturnsView, UserSupportView, useNotifications } from "./features/account/index";
|
|
294
299
|
export { useOrders, useOrder, OrdersList } from "./features/orders/index";
|
|
300
|
+
export { OrderStatusTimeline } from "./features/orders/components/OrderStatusTimeline";
|
|
301
|
+
// Manual-payment (cash / UPI / EMI) shared constants — pure data + predicates,
|
|
302
|
+
// no server deps. Used by the buyer proof-upload page and order-detail CTAs.
|
|
303
|
+
export { MANUAL_PAYMENT_METHODS, isManualPaymentMethod, PAYMENT_REVIEW_QUEUE_MODES, isPaymentReviewQueueMode, PAYMENT_WINDOW_MINUTES, } from "./features/orders/constants/payment-window";
|
|
304
|
+
export { UserOrderTrackView } from "./features/account/components/UserOrderTrackView";
|
|
295
305
|
export { useCouponValidate } from "./features/promotions/hooks/useCouponValidate";
|
|
296
306
|
export { BlogPostView } from "./features/blog/components/BlogPostView";
|
|
297
307
|
export { BlogCard, BlogCategoryTabs, BlogListView } from "./features/blog/components/BlogListView";
|
|
@@ -360,7 +370,7 @@ export { normalizeError, getErrorMessage, isApiNormalized, isAppNormalized, isFi
|
|
|
360
370
|
// never touches the sibling crypto-importing helpers.
|
|
361
371
|
export { buildPaymentProofReviewMessage } from "./features/whatsapp-bot/helpers/payment-proof-message";
|
|
362
372
|
export { CommandPalette, useCommandPaletteHotkey } from "./features/shell/index";
|
|
363
|
-
export { AdminBlogEditorView, AdminBundleEditorView, AdminCarouselEditorView, AdminCategoryEditorView, AdminCouponEditorView, AdminFaqEditorView, AdminOrderEditorView, AdminProductEditorView, AdminScammerEditorView, AdminSublistingCategoryEditorView, AdminSupportTicketDetailView, } from "./features/admin/index";
|
|
373
|
+
export { AdminBlogEditorView, AdminBundleEditorView, AdminCarouselEditorView, AdminCategoryEditorView, AdminCouponEditorView, AdminFaqEditorView, AdminOrderEditorView, AdminPayoutMarkPaidModal, AdminAuditLogView, ViewAuditLogEntryModal, AdminProductEditorView, AdminScammerEditorView, AdminStoreEditorView, AdminSublistingCategoryEditorView, AdminSupportTicketDetailView, } from "./features/admin/index";
|
|
364
374
|
export { ADMIN_CHECKOUT_BYPASS_FLAG_KEY } from "./features/admin/schemas/firestore";
|
|
365
375
|
export { SpinWheelView, EventRaffleEntryForm } from "./features/events/index";
|
|
366
376
|
export { Card, CardBody } from "./ui/index";
|
|
@@ -31,9 +31,6 @@ export declare const ACCOUNT_ENDPOINTS: {
|
|
|
31
31
|
/** @param userId — Firestore user document id */
|
|
32
32
|
readonly BY_ID: (userId: string) => string;
|
|
33
33
|
readonly PROFILE: "/api/user/profile";
|
|
34
|
-
readonly CHANGE_PASSWORD: "/api/user/change-password";
|
|
35
|
-
readonly CHANGE_PASSWORD_OTP_REQUEST: "/api/user/change-password/otp/request";
|
|
36
|
-
readonly CHANGE_PASSWORD_OTP_VERIFY: "/api/user/change-password/otp/verify";
|
|
37
34
|
/** @param userId — for public profile pages */
|
|
38
35
|
readonly PUBLIC_PROFILE: (userId: string) => string;
|
|
39
36
|
/** @param userId — seller profile page */
|
|
@@ -134,6 +131,8 @@ export declare const ADMIN_ENDPOINTS: {
|
|
|
134
131
|
readonly PAYOUT_BY_ID: (id: string) => string;
|
|
135
132
|
readonly PAYOUTS_WEEKLY: "/api/admin/payouts/weekly";
|
|
136
133
|
readonly PAYOUTS_EXPORT: "/api/admin/payouts/export";
|
|
134
|
+
readonly AUDIT_LOG: "/api/admin/audit-log";
|
|
135
|
+
readonly AUDIT_LOG_BY_ID: (id: string) => string;
|
|
137
136
|
readonly SHIPMENTS: "/api/admin/shipments";
|
|
138
137
|
readonly SHIPMENT_BY_ID: (id: string) => string;
|
|
139
138
|
readonly SHIPMENT_LOTS: (id: string) => string;
|
|
@@ -484,9 +483,6 @@ export declare const API_ENDPOINTS: {
|
|
|
484
483
|
/** @param userId — Firestore user document id */
|
|
485
484
|
readonly BY_ID: (userId: string) => string;
|
|
486
485
|
readonly PROFILE: "/api/user/profile";
|
|
487
|
-
readonly CHANGE_PASSWORD: "/api/user/change-password";
|
|
488
|
-
readonly CHANGE_PASSWORD_OTP_REQUEST: "/api/user/change-password/otp/request";
|
|
489
|
-
readonly CHANGE_PASSWORD_OTP_VERIFY: "/api/user/change-password/otp/verify";
|
|
490
486
|
/** @param userId — for public profile pages */
|
|
491
487
|
readonly PUBLIC_PROFILE: (userId: string) => string;
|
|
492
488
|
/** @param userId — seller profile page */
|
|
@@ -587,6 +583,8 @@ export declare const API_ENDPOINTS: {
|
|
|
587
583
|
readonly PAYOUT_BY_ID: (id: string) => string;
|
|
588
584
|
readonly PAYOUTS_WEEKLY: "/api/admin/payouts/weekly";
|
|
589
585
|
readonly PAYOUTS_EXPORT: "/api/admin/payouts/export";
|
|
586
|
+
readonly AUDIT_LOG: "/api/admin/audit-log";
|
|
587
|
+
readonly AUDIT_LOG_BY_ID: (id: string) => string;
|
|
590
588
|
readonly SHIPMENTS: "/api/admin/shipments";
|
|
591
589
|
readonly SHIPMENT_BY_ID: (id: string) => string;
|
|
592
590
|
readonly SHIPMENT_LOTS: (id: string) => string;
|
|
@@ -939,9 +937,6 @@ export declare const API_ROUTES: {
|
|
|
939
937
|
/** @param userId — Firestore user document id */
|
|
940
938
|
readonly BY_ID: (userId: string) => string;
|
|
941
939
|
readonly PROFILE: "/api/user/profile";
|
|
942
|
-
readonly CHANGE_PASSWORD: "/api/user/change-password";
|
|
943
|
-
readonly CHANGE_PASSWORD_OTP_REQUEST: "/api/user/change-password/otp/request";
|
|
944
|
-
readonly CHANGE_PASSWORD_OTP_VERIFY: "/api/user/change-password/otp/verify";
|
|
945
940
|
/** @param userId — for public profile pages */
|
|
946
941
|
readonly PUBLIC_PROFILE: (userId: string) => string;
|
|
947
942
|
/** @param userId — seller profile page */
|
|
@@ -1042,6 +1037,8 @@ export declare const API_ROUTES: {
|
|
|
1042
1037
|
readonly PAYOUT_BY_ID: (id: string) => string;
|
|
1043
1038
|
readonly PAYOUTS_WEEKLY: "/api/admin/payouts/weekly";
|
|
1044
1039
|
readonly PAYOUTS_EXPORT: "/api/admin/payouts/export";
|
|
1040
|
+
readonly AUDIT_LOG: "/api/admin/audit-log";
|
|
1041
|
+
readonly AUDIT_LOG_BY_ID: (id: string) => string;
|
|
1045
1042
|
readonly SHIPMENTS: "/api/admin/shipments";
|
|
1046
1043
|
readonly SHIPMENT_BY_ID: (id: string) => string;
|
|
1047
1044
|
readonly SHIPMENT_LOTS: (id: string) => string;
|
|
@@ -46,9 +46,6 @@ export const ACCOUNT_ENDPOINTS = {
|
|
|
46
46
|
/** @param userId — Firestore user document id */
|
|
47
47
|
BY_ID: (userId) => `/api/account/${userId}`,
|
|
48
48
|
PROFILE: "/api/user/profile",
|
|
49
|
-
CHANGE_PASSWORD: "/api/user/change-password",
|
|
50
|
-
CHANGE_PASSWORD_OTP_REQUEST: "/api/user/change-password/otp/request",
|
|
51
|
-
CHANGE_PASSWORD_OTP_VERIFY: "/api/user/change-password/otp/verify",
|
|
52
49
|
/** @param userId — for public profile pages */
|
|
53
50
|
PUBLIC_PROFILE: (userId) => `/api/profile/${userId}`,
|
|
54
51
|
/** @param userId — seller profile page */
|
|
@@ -161,6 +158,8 @@ export const ADMIN_ENDPOINTS = {
|
|
|
161
158
|
PAYOUT_BY_ID: (id) => `/api/admin/payouts/${id}`,
|
|
162
159
|
PAYOUTS_WEEKLY: "/api/admin/payouts/weekly",
|
|
163
160
|
PAYOUTS_EXPORT: "/api/admin/payouts/export",
|
|
161
|
+
AUDIT_LOG: "/api/admin/audit-log",
|
|
162
|
+
AUDIT_LOG_BY_ID: (id) => `/api/admin/audit-log/${id}`,
|
|
164
163
|
SHIPMENTS: "/api/admin/shipments",
|
|
165
164
|
SHIPMENT_BY_ID: (id) => `/api/admin/shipments/${id}`,
|
|
166
165
|
SHIPMENT_LOTS: (id) => `/api/admin/shipments/${id}/lots`,
|
|
@@ -9,19 +9,15 @@ export interface IClientAuthProvider {
|
|
|
9
9
|
signInWithEmailAndPassword(email: string, password: string): Promise<void>;
|
|
10
10
|
/** Apply an email verification action code */
|
|
11
11
|
applyActionCode(code: string): Promise<void>;
|
|
12
|
+
/** Send a verification email to the currently signed-in user's own address */
|
|
13
|
+
sendEmailVerification(): Promise<void>;
|
|
12
14
|
/** Send a password reset email */
|
|
13
15
|
sendPasswordResetEmail(email: string): Promise<void>;
|
|
14
16
|
/** Confirm a password reset with a code and new password */
|
|
15
17
|
confirmPasswordReset(code: string, newPassword: string): Promise<void>;
|
|
16
18
|
/** Re-authenticate with current password and change to new password */
|
|
17
19
|
reauthenticateAndChangePassword(currentPassword: string, newPassword: string): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Verify the current password only — does NOT change anything. Used to
|
|
20
|
-
* prove current-password knowledge before an OTP is sent, without the
|
|
21
|
-
* side effect of immediately applying a new password ahead of that OTP
|
|
22
|
-
* being verified (see password-change-otp.ts for why the two steps must
|
|
23
|
-
* stay separate).
|
|
24
|
-
*/
|
|
20
|
+
/** Verify the current password only — does NOT change anything. */
|
|
25
21
|
reauthenticateOnly(currentPassword: string): Promise<void>;
|
|
26
22
|
/** Re-authenticate and send a verification email to the new address; email updates after user clicks the link */
|
|
27
23
|
reauthenticateAndSendEmailUpdateVerification(currentPassword: string, newEmail: string): Promise<void>;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { normalizeError } from "../../../errors/normalize";
|
|
4
|
-
import { useState } from "react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
import { Button, Checkbox, FormField, FormGroup, Row, useToast } from "../../../ui";
|
|
6
7
|
import { Form } from "../../../ui/components/Form";
|
|
8
|
+
import { useFormShellState, FormErrorSummary } from "../../../ui/forms";
|
|
9
|
+
// Local form-input schema — `userAddressSchema` (account schemas) uses
|
|
10
|
+
// different field names (`line1`/`line2`, no `fullName`) and a required
|
|
11
|
+
// `id`, since it models the stored Firestore shape, not this form's input.
|
|
12
|
+
const addressFormSchema = z.object({
|
|
13
|
+
label: z.string().optional(),
|
|
14
|
+
fullName: z.string().min(1, "Full name is required"),
|
|
15
|
+
phone: z.string().min(1, "Phone number is required"),
|
|
16
|
+
addressLine1: z.string().min(1, "Address is required"),
|
|
17
|
+
addressLine2: z.string().optional(),
|
|
18
|
+
city: z.string().min(1, "City is required"),
|
|
19
|
+
state: z.string().min(1, "State is required"),
|
|
20
|
+
postalCode: z.string().min(1, "Postal code is required"),
|
|
21
|
+
country: z.string().optional(),
|
|
22
|
+
isDefault: z.boolean().optional(),
|
|
23
|
+
});
|
|
7
24
|
const DEFAULT_LABELS = {
|
|
8
25
|
label: "Address Label",
|
|
9
26
|
fullName: "Full Name",
|
|
@@ -47,10 +64,15 @@ export function AddressForm({ initialData, onSubmit, onCancel, isLoading = false
|
|
|
47
64
|
country: initialData?.country || defaultCountry,
|
|
48
65
|
isDefault: initialData?.isDefault || false,
|
|
49
66
|
});
|
|
67
|
+
const { shellCtx, validate } = useFormShellState(addressFormSchema);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
validate(formData);
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
}, [formData, validate]);
|
|
50
72
|
const handleChange = (field, value) => {
|
|
51
73
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
|
52
74
|
};
|
|
53
|
-
return (_jsx(Form, { onSubmit: (e) => e.preventDefault(), spacing: "md", children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FormField, { label: mergedLabels.label, name: "label", type: "text", value: formData.label, onChange: (value) => handleChange("label", value), placeholder: mergedPlaceholders.label, required: true }), _jsx(FormField, { label: mergedLabels.fullName, name: "fullName", type: "text", value: formData.fullName, onChange: (value) => handleChange("fullName", value), placeholder: mergedPlaceholders.fullName, required: true }), _jsx(FormField, { label: mergedLabels.phone, name: "phone", type: "tel", value: formData.phone, onChange: (value) => handleChange("phone", value), placeholder: mergedPlaceholders.phone, required: true }), _jsx(FormField, { label: mergedLabels.addressLine1, name: "addressLine1", type: "text", value: formData.addressLine1, onChange: (value) => handleChange("addressLine1", value), placeholder: mergedPlaceholders.addressLine1, required: true }), _jsx(FormField, { label: mergedLabels.addressLine2, name: "addressLine2", type: "text", value: formData.addressLine2, onChange: (value) => handleChange("addressLine2", value), placeholder: mergedPlaceholders.addressLine2 }), _jsxs(FormGroup, { columns: 3, children: [_jsx(FormField, { label: mergedLabels.city, name: "city", type: "text", value: formData.city, onChange: (value) => handleChange("city", value), placeholder: mergedPlaceholders.city, required: true }), _jsx(FormField, { label: mergedLabels.state, name: "state", type: "text", value: formData.state, onChange: (value) => handleChange("state", value), placeholder: mergedPlaceholders.state, required: true }), _jsx(FormField, { label: mergedLabels.postalCode, name: "postalCode", type: "text", value: formData.postalCode, onChange: (value) => handleChange("postalCode", value), placeholder: mergedPlaceholders.postalCode, required: true })] }), _jsx(FormField, { label: mergedLabels.country, name: "country", type: "text", value: formData.country, onChange: (value) => handleChange("country", value), placeholder: mergedPlaceholders.country, required: true }), _jsx(Checkbox, { checked: formData.isDefault, onChange: (e) => handleChange("isDefault", e.target.checked), label: mergedLabels.setDefault }), _jsxs(Row, { padding: "t-xs", align: "center", justify: "start", gap: "xs", children: [_jsx(Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isLoading, children: mergedLabels.cancel }), _jsx(Button, { type: "submit", variant: "primary", disabled: isLoading, isLoading: isLoading, onClick: async () => {
|
|
75
|
+
return (_jsx(Form, { onSubmit: (e) => e.preventDefault(), spacing: "md", shellCtx: shellCtx, children: ({ setFieldError, clearErrors }) => (_jsxs(_Fragment, { children: [_jsx(FormField, { label: mergedLabels.label, name: "label", type: "text", value: formData.label, onChange: (value) => handleChange("label", value), placeholder: mergedPlaceholders.label, required: true }), _jsx(FormField, { label: mergedLabels.fullName, name: "fullName", type: "text", value: formData.fullName, onChange: (value) => handleChange("fullName", value), placeholder: mergedPlaceholders.fullName, required: true }), _jsx(FormField, { label: mergedLabels.phone, name: "phone", type: "tel", value: formData.phone, onChange: (value) => handleChange("phone", value), placeholder: mergedPlaceholders.phone, required: true }), _jsx(FormField, { label: mergedLabels.addressLine1, name: "addressLine1", type: "text", value: formData.addressLine1, onChange: (value) => handleChange("addressLine1", value), placeholder: mergedPlaceholders.addressLine1, required: true }), _jsx(FormField, { label: mergedLabels.addressLine2, name: "addressLine2", type: "text", value: formData.addressLine2, onChange: (value) => handleChange("addressLine2", value), placeholder: mergedPlaceholders.addressLine2 }), _jsxs(FormGroup, { columns: 3, children: [_jsx(FormField, { label: mergedLabels.city, name: "city", type: "text", value: formData.city, onChange: (value) => handleChange("city", value), placeholder: mergedPlaceholders.city, required: true }), _jsx(FormField, { label: mergedLabels.state, name: "state", type: "text", value: formData.state, onChange: (value) => handleChange("state", value), placeholder: mergedPlaceholders.state, required: true }), _jsx(FormField, { label: mergedLabels.postalCode, name: "postalCode", type: "text", value: formData.postalCode, onChange: (value) => handleChange("postalCode", value), placeholder: mergedPlaceholders.postalCode, required: true })] }), _jsx(FormField, { label: mergedLabels.country, name: "country", type: "text", value: formData.country, onChange: (value) => handleChange("country", value), placeholder: mergedPlaceholders.country, required: true }), _jsx(Checkbox, { checked: formData.isDefault, onChange: (e) => handleChange("isDefault", e.target.checked), label: mergedLabels.setDefault }), _jsx(FormErrorSummary, {}), _jsxs(Row, { padding: "t-xs", align: "center", justify: "start", gap: "xs", children: [_jsx(Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isLoading, children: mergedLabels.cancel }), _jsx(Button, { type: "submit", variant: "primary", disabled: isLoading, isLoading: isLoading, onClick: async () => {
|
|
54
76
|
clearErrors();
|
|
55
77
|
const errs = {};
|
|
56
78
|
if (!formData.fullName.trim())
|
|
@@ -11,7 +11,6 @@ export interface BecomeSellerViewProps {
|
|
|
11
11
|
renderAlreadySeller?: () => React.ReactNode;
|
|
12
12
|
/** Which state to render. Shell exposes all three slots; consumer controls which is active. */
|
|
13
13
|
state?: "guide" | "success" | "already-seller";
|
|
14
|
-
isLoading?: boolean;
|
|
15
14
|
className?: string;
|
|
16
15
|
}
|
|
17
|
-
export declare function BecomeSellerView({ labels, renderGuide, renderSuccess, renderAlreadySeller, state,
|
|
16
|
+
export declare function BecomeSellerView({ labels, renderGuide, renderSuccess, renderAlreadySeller, state, className, }: BecomeSellerViewProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Div, Heading } from "../../../ui";
|
|
3
|
-
export function BecomeSellerView({ labels = {}, renderGuide, renderSuccess, renderAlreadySeller, state = "guide",
|
|
3
|
+
export function BecomeSellerView({ labels = {}, renderGuide, renderSuccess, renderAlreadySeller, state = "guide", className = "", }) {
|
|
4
4
|
return (_jsxs(Div, { className: className, children: [labels.title && state === "guide" && (_jsx(Heading, { level: 1, className: "mb-6", size: "2xl", weight: "bold", children: labels.title })), state === "guide" && renderGuide?.(), state === "success" && renderSuccess?.(), state === "already-seller" && renderAlreadySeller?.()] }));
|
|
5
5
|
}
|
|
@@ -32,7 +32,7 @@ const DEFAULT_ICONS = {
|
|
|
32
32
|
export function NotificationBell({ limit = 10, viewAllHref, labels, icons, renderLink, onMarkAllReadSuccess, onMarkAllReadError, buttonClassName = "", dropdownClassName = "", hideOnMobile = true, }) {
|
|
33
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
34
34
|
const dropdownRef = useRef(null);
|
|
35
|
-
const { showSuccess
|
|
35
|
+
const { showSuccess } = useMessage();
|
|
36
36
|
const { showToast } = useToast();
|
|
37
37
|
const { notifications, unreadCount, isLoading, refetch, markRead, markAllRead, isMarkingAll, } = useNotifications(limit);
|
|
38
38
|
const notificationIcons = { ...DEFAULT_ICONS, ...icons };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UserBidsView(): import("react").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy, sieveFilter, SIEVE_OP } from "../../../utils/sieve-builder";
|
|
4
|
+
import { ACCOUNT_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
5
|
+
import { ROUTES } from "../../../constants/index";
|
|
6
|
+
import { Div, Span, Stack, TextLink } from "../../../ui";
|
|
7
|
+
import { FieldSelect } from "../../../ui/forms";
|
|
8
|
+
import { AuctionBidsTable } from "../../auctions/components/AuctionBidsTable";
|
|
9
|
+
import { DataListingView } from "../../admin/components/DataListingView";
|
|
10
|
+
const SORT_OPTIONS = [
|
|
11
|
+
{ value: sortBy("bidDate", "DESC"), label: "Newest first" },
|
|
12
|
+
{ value: "bidDate", label: "Oldest first" },
|
|
13
|
+
{ value: sortBy("bidAmount", "DESC"), label: "Highest bid" },
|
|
14
|
+
{ value: "bidAmount", label: "Lowest bid" },
|
|
15
|
+
];
|
|
16
|
+
const STATUS_OPTIONS = [
|
|
17
|
+
{ value: "", label: "All statuses" },
|
|
18
|
+
{ value: "active", label: "Active" },
|
|
19
|
+
{ value: "outbid", label: "Outbid" },
|
|
20
|
+
{ value: "won", label: "Won" },
|
|
21
|
+
{ value: "cancelled", label: "Cancelled" },
|
|
22
|
+
];
|
|
23
|
+
export function UserBidsView() {
|
|
24
|
+
const config = {
|
|
25
|
+
portal: "user",
|
|
26
|
+
title: "My Bids",
|
|
27
|
+
searchPlaceholder: "Search by auction title…",
|
|
28
|
+
emptyLabel: "You haven't placed any bids yet.",
|
|
29
|
+
filterKeys: ["status"],
|
|
30
|
+
defaultSort: sortBy("bidDate", "DESC"),
|
|
31
|
+
queryKey: ["user", "bids", "listing"],
|
|
32
|
+
endpoint: ACCOUNT_ENDPOINTS.BIDS,
|
|
33
|
+
sortOptions: SORT_OPTIONS,
|
|
34
|
+
hideTableView: true,
|
|
35
|
+
mapRows: (response) => response.bids ?? [],
|
|
36
|
+
getTotal: (response, rows) => response.total ?? rows.length,
|
|
37
|
+
buildFilters: (state) => (state.status ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined),
|
|
38
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FieldSelect, { name: "status", label: "Bid status", value: pendingFilters.status || "", onChange: (v) => setPendingFilters((p) => ({ ...p, status: v })), options: STATUS_OPTIONS })),
|
|
39
|
+
renderCards: (rows, _view, _selection, isLoading) => {
|
|
40
|
+
if (isLoading) {
|
|
41
|
+
return (_jsx(Stack, { gap: "md", children: Array.from({ length: 3 }).map((_, i) => (_jsx(Div, { className: "h-16 animate-pulse border border-[var(--appkit-color-border)]", rounded: "xl" }, i))) }));
|
|
42
|
+
}
|
|
43
|
+
return (_jsx(AuctionBidsTable, { bids: rows, portal: "buyer", totalPages: 1, currentPage: 1, onPageChange: () => { }, emptyLabel: _jsxs(Span, { children: ["You haven't placed any bids yet.", " ", _jsx(TextLink, { href: String(ROUTES.PUBLIC.AUCTIONS), children: "Browse auctions" })] }) }));
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
return _jsx(DataListingView, { config: config });
|
|
47
|
+
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title?: string;
|
|
1
|
+
import type { Order } from "../../orders/types";
|
|
2
|
+
export interface UserOrdersViewProps {
|
|
3
|
+
onOrderClick?: (order: Order) => void;
|
|
5
4
|
}
|
|
6
|
-
export
|
|
7
|
-
labels?: UserOrdersViewLabels;
|
|
8
|
-
/** @deprecated Use `renderSearch` instead. */
|
|
9
|
-
renderToolbar?: () => React.ReactNode;
|
|
10
|
-
renderTable?: () => React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare function UserOrdersView({ renderToolbar, renderTable, ...props }: UserOrdersViewProps): React.JSX.Element;
|
|
5
|
+
export declare function UserOrdersView({ onOrderClick }: UserOrdersViewProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy, sieveFilter, SIEVE_OP } from "../../../utils/sieve-builder";
|
|
4
|
+
import { ACCOUNT_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
5
|
+
import { ROUTES } from "../../../constants/index";
|
|
6
|
+
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
7
|
+
import { Button, Div, Grid, Stack, Text, TextLink } from "../../../ui";
|
|
8
|
+
import { PaginatedSelect } from "../../../ui/components/PaginatedSelect";
|
|
9
|
+
import { DataListingView } from "../../admin/components/DataListingView";
|
|
10
|
+
import { OrderCard } from "../../orders/components/OrdersList";
|
|
11
|
+
const CANCELLABLE_STATUSES = new Set(["pending", "confirmed", "processing"]);
|
|
12
|
+
const TRACKABLE_STATUSES = new Set(["shipped"]);
|
|
13
|
+
const SORT_OPTIONS = [
|
|
14
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest first" },
|
|
15
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest first" },
|
|
16
|
+
{ value: sortBy("totalPrice", "DESC"), label: "Highest total" },
|
|
17
|
+
{ value: sortBy("totalPrice", "ASC"), label: "Lowest total" },
|
|
18
|
+
];
|
|
19
|
+
const STATUS_OPTIONS = [
|
|
20
|
+
{ value: "pending", label: "Pending" },
|
|
21
|
+
{ value: "processing", label: "Processing" },
|
|
22
|
+
{ value: "shipped", label: "Shipped" },
|
|
23
|
+
{ value: "delivered", label: "Delivered" },
|
|
24
|
+
{ value: "cancelled", label: "Cancelled" },
|
|
25
|
+
{ value: "refunded", label: "Refunded" },
|
|
26
|
+
{ value: "return_requested", label: "Return requested" },
|
|
27
|
+
];
|
|
28
|
+
export function UserOrdersView({ onOrderClick }) {
|
|
29
|
+
const config = {
|
|
30
|
+
portal: "user",
|
|
31
|
+
title: "My Orders",
|
|
32
|
+
searchPlaceholder: "Search by order id…",
|
|
33
|
+
emptyLabel: "You haven't placed any orders yet.",
|
|
34
|
+
filterKeys: ["status"],
|
|
35
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
36
|
+
queryKey: ["user", "orders", "listing"],
|
|
37
|
+
endpoint: ACCOUNT_ENDPOINTS.ORDERS,
|
|
38
|
+
sortOptions: SORT_OPTIONS,
|
|
39
|
+
hideTableView: true,
|
|
40
|
+
mapRows: (response) => response.items ?? [],
|
|
41
|
+
getTotal: (response, rows) => response.total ?? rows.length,
|
|
42
|
+
buildFilters: (state) => (state.status ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined),
|
|
43
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(Div, { children: _jsx(PaginatedSelect, { value: pendingFilters.status || null, onChange: (v) => setPendingFilters((p) => ({ ...p, status: v ?? "" })), options: STATUS_OPTIONS, placeholder: "All statuses", ariaLabel: "Filter by order status" }) })),
|
|
44
|
+
renderCards: (rows, _view, _selection, isLoading) => {
|
|
45
|
+
if (isLoading) {
|
|
46
|
+
return (_jsx(Stack, { gap: "md", children: Array.from({ length: 3 }).map((_, i) => (_jsx(Div, { className: "h-24 animate-pulse border border-[var(--appkit-color-border)]", rounded: "xl" }, i))) }));
|
|
47
|
+
}
|
|
48
|
+
if (rows.length === 0) {
|
|
49
|
+
return _jsx(Text, { color: "muted", children: "You haven't placed any orders yet." });
|
|
50
|
+
}
|
|
51
|
+
return (_jsx(Grid, { gap: "md", className: "grid-cols-1", children: rows.map((order) => (_jsx(OrderCard, { order: order, onClick: onOrderClick, renderActions: () => (_jsxs(_Fragment, { children: [_jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(TextLink, { href: String(ROUTES.USER.ORDER_DETAIL(order.id)), children: ACTIONS.USER["view-order"].label }) }), TRACKABLE_STATUSES.has(order.orderStatus) && (_jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsx(TextLink, { href: String(ROUTES.USER.ORDER_TRACK(order.id)), children: ACTIONS.USER["track-order"].label }) })), CANCELLABLE_STATUSES.has(order.orderStatus) && (_jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsx(TextLink, { href: String(ROUTES.USER.ORDER_CANCEL(order.id)), children: ACTIONS.USER["cancel-order"].label }) }))] })) }, order.id))) }));
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return _jsx(DataListingView, { config: config });
|
|
5
55
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title?: string;
|
|
1
|
+
import type { Order } from "../../orders/types";
|
|
2
|
+
export interface UserReturnsViewProps {
|
|
3
|
+
onOrderClick?: (order: Order) => void;
|
|
5
4
|
}
|
|
6
|
-
export
|
|
7
|
-
labels?: UserReturnsViewLabels;
|
|
8
|
-
renderTable?: () => React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare function UserReturnsView({ renderTable, ...props }: UserReturnsViewProps): React.JSX.Element;
|
|
5
|
+
export declare function UserReturnsView({ onOrderClick }: UserReturnsViewProps): import("react").JSX.Element;
|