@mohasinac/appkit 4.14.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/server/features/auctions/actions.js +2 -2
- package/dist/_internal/server/features/cart/service.d.ts +3 -3
- package/dist/_internal/server/features/checkout/actions.js +19 -0
- package/dist/_internal/server/features/checkout/source-context.d.ts +5 -0
- package/dist/_internal/server/features/checkout/source-context.js +157 -0
- package/dist/_internal/server/features/offers/adapters.d.ts +103 -0
- package/dist/_internal/server/features/offers/adapters.js +88 -0
- package/dist/_internal/server/features/offers/index.d.ts +2 -0
- package/dist/_internal/server/features/offers/index.js +1 -0
- package/dist/_internal/server/features/orders/adapters.js +24 -0
- package/dist/_internal/server/jobs/core/offerExpiry.js +10 -10
- package/dist/_internal/shared/actions/action-registry.d.ts +9 -2
- package/dist/_internal/shared/actions/action-registry.js +458 -7
- package/dist/_internal/shared/features/auctions/schema.d.ts +14 -2
- package/dist/_internal/shared/features/auctions/schema.js +13 -1
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/cart/schema.d.ts +25 -20
- package/dist/_internal/shared/features/cart/schema.js +15 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +22 -22
- package/dist/_internal/shared/features/orders/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +27 -27
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +2 -2
- package/dist/_internal/shared/history/history.d.ts +22 -0
- package/dist/_internal/shared/history/history.js +41 -1
- package/dist/client.d.ts +13 -2
- package/dist/client.js +20 -2
- package/dist/constants/field-names.d.ts +8 -6
- package/dist/constants/field-names.js +48 -6
- package/dist/contracts/extend.d.ts +29 -0
- package/dist/contracts/extend.js +20 -0
- package/dist/contracts/index.d.ts +2 -1
- package/dist/contracts/index.js +2 -0
- package/dist/features/account/components/UserBidsView.js +12 -4
- package/dist/features/account/components/UserReturnsView.d.ts +3 -0
- package/dist/features/account/components/UserReturnsView.js +17 -1
- package/dist/features/admin/components/AdminAuditLogView.js +1 -0
- package/dist/features/admin/components/AdminBidsView.js +15 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +65 -33
- package/dist/features/admin/components/AdminFeatureEditorView.js +35 -6
- package/dist/features/admin/components/AdminNavEditorView.js +15 -5
- package/dist/features/admin/components/AdminNewsletterView.js +18 -2
- package/dist/features/admin/components/AdminOffersView.js +62 -18
- package/dist/features/admin/components/AdminPaymentMethodsView.js +24 -4
- package/dist/features/admin/components/AdminScammerEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -13
- package/dist/features/admin/components/AdminScammersView.js +3 -8
- package/dist/features/admin/components/AdminSectionsView.js +32 -23
- package/dist/features/admin/components/AdminSessionsView.js +17 -2
- package/dist/features/admin/components/AdminViewCards.js +24 -17
- package/dist/features/admin/components/DataListingView.js +15 -1
- package/dist/features/admin/components/DataTable.js +7 -17
- package/dist/features/admin/components/ViewAuditLogEntryModal.js +1 -0
- package/dist/features/admin/components/sections/adminSectionsTypes.d.ts +4 -2
- package/dist/features/admin/components/sections/adminSectionsTypes.js +45 -27
- package/dist/features/admin/constants/filter-tabs.d.ts +3 -0
- package/dist/features/admin/constants/filter-tabs.js +1 -0
- package/dist/features/admin/schemas/homepage-section-form.d.ts +22 -0
- package/dist/features/admin/schemas/homepage-section-form.js +68 -0
- package/dist/features/admin/schemas/nav-item-form.d.ts +74 -0
- package/dist/features/admin/schemas/nav-item-form.js +72 -0
- package/dist/features/auctions/components/AuctionBidsTable.d.ts +10 -1
- package/dist/features/auctions/components/AuctionBidsTable.js +22 -4
- package/dist/features/auctions/components/bid-detail-fields.d.ts +29 -0
- package/dist/features/auctions/components/bid-detail-fields.js +103 -0
- package/dist/features/auctions/schemas/index.d.ts +14 -14
- package/dist/features/audit-log/schemas/firestore.d.ts +14 -0
- package/dist/features/audit-log/schemas/firestore.js +7 -0
- package/dist/features/auth/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +7 -7
- package/dist/features/blog/schemas/blog-form.d.ts +80 -0
- package/dist/features/blog/schemas/blog-form.js +100 -0
- package/dist/features/blog/schemas/index.d.ts +10 -10
- package/dist/features/cart/schemas/index.d.ts +3 -3
- package/dist/features/catalogue/schemas/validation.d.ts +12 -12
- package/dist/features/categories/schemas/index.d.ts +16 -16
- package/dist/features/collections/schemas/index.d.ts +8 -8
- package/dist/features/events/components/AdminEventEditorView.js +32 -54
- package/dist/features/events/components/AdminEventEntriesView.js +22 -3
- package/dist/features/events/schemas/event-form.d.ts +113 -0
- package/dist/features/events/schemas/event-form.js +82 -0
- package/dist/features/events/schemas/index.d.ts +2 -2
- package/dist/features/faq/actions/faq-actions.d.ts +6 -6
- package/dist/features/faq/schemas/index.d.ts +6 -6
- package/dist/features/grouped/schemas/grouped-listing-form.d.ts +101 -0
- package/dist/features/grouped/schemas/grouped-listing-form.js +89 -0
- package/dist/features/grouped/schemas/index.d.ts +4 -4
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +11 -3
- package/dist/features/homepage/actions/homepage-section-actions.js +33 -1
- package/dist/features/homepage/schemas/index.d.ts +71 -40
- package/dist/features/homepage/schemas/index.js +24 -0
- package/dist/features/messages/schemas/index.d.ts +2 -2
- package/dist/features/orders/components/OrderStatusTimeline.d.ts +5 -1
- package/dist/features/orders/components/OrderStatusTimeline.js +39 -20
- package/dist/features/orders/repository/orders.repository.js +5 -0
- package/dist/features/orders/schemas/firestore.d.ts +36 -1
- package/dist/features/orders/schemas/index.d.ts +24 -24
- package/dist/features/orders/types/index.d.ts +35 -7
- package/dist/features/pre-orders/schemas/index.d.ts +4 -4
- package/dist/features/products/components/GroupSettingsPanel.js +5 -1
- package/dist/features/products/schemas/index.d.ts +38 -38
- package/dist/features/products/schemas/product-features.validators.d.ts +75 -2
- package/dist/features/products/schemas/product-features.validators.js +63 -0
- package/dist/features/promotions/schemas/index.d.ts +14 -14
- package/dist/features/reviews/schemas/index.d.ts +14 -14
- package/dist/features/scams/constants/scammer-status-display.d.ts +28 -0
- package/dist/features/scams/constants/scammer-status-display.js +79 -0
- package/dist/features/scams/schemas/index.d.ts +2 -2
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/seller/actions/offer-actions.js +32 -2
- package/dist/features/seller/components/OfferPhaseTimeline.d.ts +59 -0
- package/dist/features/seller/components/OfferPhaseTimeline.js +107 -0
- package/dist/features/seller/components/SellerBidsView.js +11 -4
- package/dist/features/seller/components/SellerCouponEditorView.js +17 -17
- package/dist/features/seller/components/SellerOffersView.js +2 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +38 -14
- package/dist/features/seller/repository/offer.repository.d.ts +69 -8
- package/dist/features/seller/repository/offer.repository.js +127 -23
- package/dist/features/seller/schemas/coupon-form.d.ts +72 -0
- package/dist/features/seller/schemas/coupon-form.js +116 -0
- package/dist/features/seller/schemas/firestore.d.ts +56 -2
- package/dist/features/seller/schemas/firestore.js +27 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/seller/schemas/offer-forms.d.ts +21 -0
- package/dist/features/seller/schemas/offer-forms.js +21 -0
- package/dist/features/shell/build-sections.d.ts +63 -0
- package/dist/features/shell/build-sections.js +207 -0
- package/dist/features/shell/field-ui-meta.d.ts +115 -0
- package/dist/features/shell/field-ui-meta.js +324 -0
- package/dist/features/shell/index.d.ts +4 -0
- package/dist/features/shell/index.js +2 -0
- package/dist/features/shipments/schemas/validation.d.ts +22 -22
- package/dist/features/status-history/components/StatusTimeline.d.ts +74 -0
- package/dist/features/status-history/components/StatusTimeline.js +46 -0
- package/dist/features/status-history/index.d.ts +11 -0
- package/dist/features/status-history/index.js +10 -0
- package/dist/features/store-extensions/components/ReviewDecisionModal.d.ts +27 -0
- package/dist/features/store-extensions/components/ReviewDecisionModal.js +82 -0
- package/dist/features/store-extensions/index.d.ts +12 -0
- package/dist/features/store-extensions/index.js +12 -0
- package/dist/features/store-extensions/schemas/admin-notification-form.d.ts +36 -0
- package/dist/features/store-extensions/schemas/admin-notification-form.js +114 -0
- package/dist/features/store-extensions/schemas/analytics-forms.d.ts +57 -0
- package/dist/features/store-extensions/schemas/analytics-forms.js +158 -0
- package/dist/features/store-extensions/schemas/custom-role-form.d.ts +85 -0
- package/dist/features/store-extensions/schemas/custom-role-form.js +118 -0
- package/dist/features/store-extensions/schemas/firestore.d.ts +21 -1
- package/dist/features/store-extensions/schemas/firestore.js +60 -0
- package/dist/features/store-extensions/schemas/google-config-form.d.ts +53 -0
- package/dist/features/store-extensions/schemas/google-config-form.js +105 -0
- package/dist/features/store-extensions/schemas/item-request-create-form.d.ts +28 -0
- package/dist/features/store-extensions/schemas/item-request-create-form.js +80 -0
- package/dist/features/store-extensions/schemas/listing-template-form.d.ts +78 -0
- package/dist/features/store-extensions/schemas/listing-template-form.js +87 -0
- package/dist/features/store-extensions/schemas/moderation-review-form.d.ts +49 -0
- package/dist/features/store-extensions/schemas/moderation-review-form.js +101 -0
- package/dist/features/store-extensions/schemas/payout-method-form.d.ts +153 -0
- package/dist/features/store-extensions/schemas/payout-method-form.js +155 -0
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +25 -0
- package/dist/features/store-extensions/schemas/report-create-form.js +79 -0
- package/dist/features/store-extensions/schemas/report-review-form.d.ts +47 -0
- package/dist/features/store-extensions/schemas/report-review-form.js +111 -0
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +148 -0
- package/dist/features/store-extensions/schemas/shipping-config-form.js +104 -0
- package/dist/features/store-extensions/schemas/store-category-form.d.ts +54 -0
- package/dist/features/store-extensions/schemas/store-category-form.js +73 -0
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/features/support/schemas/index.d.ts +4 -4
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +350 -0
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +12 -2
- package/dist/next/routing/route-map.d.ts +16 -2
- package/dist/next/routing/route-map.js +9 -2
- package/dist/schemas/firestore-value.d.ts +8 -0
- package/dist/schemas/firestore-value.js +44 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/registry.d.ts +734 -101
- package/dist/schemas/registry.js +64 -1
- package/dist/seed/bids-seed-data.js +30 -0
- package/dist/seed/offers-seed-data.js +212 -7
- package/dist/seed/orders-seed-data.js +336 -1
- package/dist/seed/products-auctions-seed-data.js +41 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +5 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/DataTable.js +4 -2
- package/dist/ui/columns/build-columns.d.ts +6 -1
- package/dist/ui/columns/build-columns.js +53 -0
- package/dist/ui/columns/cell-renderers.d.ts +68 -0
- package/dist/ui/columns/cell-renderers.js +111 -0
- package/dist/ui/columns/column-renderers.d.ts +6 -1
- package/dist/ui/columns/column-renderers.js +6 -1
- package/dist/ui/columns/index.d.ts +2 -1
- package/dist/ui/columns/index.js +5 -1
- package/dist/ui/components/Button.js +27 -2
- package/dist/ui/components/RecordDetailModal.d.ts +10 -1
- package/dist/ui/components/RecordDetailModal.js +2 -2
- package/dist/ui/icons/icon-registry.d.ts +65 -0
- package/dist/ui/icons/icon-registry.js +115 -0
- package/package.json +2 -1
- package/scripts/node-esm-loader.mjs +65 -0
- package/scripts/seed-cli-loader.mjs +6 -49
- package/scripts/seed-cli.mjs +1 -1
|
@@ -338,13 +338,26 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
338
338
|
createdAt?: string | undefined;
|
|
339
339
|
updatedAt?: string | undefined;
|
|
340
340
|
storeId?: string | undefined;
|
|
341
|
-
|
|
342
|
-
description?: string | undefined;
|
|
343
|
-
slug?: string | undefined;
|
|
341
|
+
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
344
342
|
category?: string | undefined;
|
|
345
343
|
categorySlug?: string | undefined;
|
|
346
|
-
subcategory?: string | undefined;
|
|
347
344
|
stockQuantity?: number | undefined;
|
|
345
|
+
rating?: number | undefined;
|
|
346
|
+
publishedAt?: string | undefined;
|
|
347
|
+
slug?: string | undefined;
|
|
348
|
+
viewCount?: number | undefined;
|
|
349
|
+
features?: string[] | undefined;
|
|
350
|
+
media?: {
|
|
351
|
+
type: "video" | "image" | "file";
|
|
352
|
+
url: string;
|
|
353
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
354
|
+
alt?: string | undefined;
|
|
355
|
+
thumbnailUrl?: string | undefined;
|
|
356
|
+
youtubeId?: string | undefined;
|
|
357
|
+
duration?: number | undefined;
|
|
358
|
+
}[] | undefined;
|
|
359
|
+
description?: string | undefined;
|
|
360
|
+
subcategory?: string | undefined;
|
|
348
361
|
availableQuantity?: number | undefined;
|
|
349
362
|
mainImage?: string | undefined;
|
|
350
363
|
images?: string[] | undefined;
|
|
@@ -361,7 +374,6 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
361
374
|
insurance?: boolean | undefined;
|
|
362
375
|
insuranceCost?: number | undefined;
|
|
363
376
|
shippingPaidBy?: "seller" | "buyer" | undefined;
|
|
364
|
-
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
365
377
|
auctionEndDate?: string | Date | undefined;
|
|
366
378
|
startingBid?: number | undefined;
|
|
367
379
|
currentBid?: number | undefined;
|
|
@@ -377,11 +389,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
377
389
|
preOrderDepositAmount?: number | undefined;
|
|
378
390
|
preOrderMaxQuantity?: number | undefined;
|
|
379
391
|
preOrderCurrentCount?: number | undefined;
|
|
380
|
-
preOrderProductionStatus?: "
|
|
392
|
+
preOrderProductionStatus?: "upcoming" | "in_production" | "ready_to_ship" | undefined;
|
|
381
393
|
preOrderCancellable?: boolean | undefined;
|
|
382
394
|
isPromoted?: boolean | undefined;
|
|
383
395
|
pickupAddressId?: string | undefined;
|
|
384
|
-
viewCount?: number | undefined;
|
|
385
396
|
prizeRevealStatus?: "closed" | "open" | "pending" | undefined;
|
|
386
397
|
prizeRevealWindowStart?: string | Date | undefined;
|
|
387
398
|
prizeRevealWindowEnd?: string | Date | undefined;
|
|
@@ -390,17 +401,6 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
390
401
|
prizeCurrentEntries?: number | undefined;
|
|
391
402
|
prizeMaxEntries?: number | undefined;
|
|
392
403
|
pricePerEntry?: number | undefined;
|
|
393
|
-
rating?: number | undefined;
|
|
394
|
-
publishedAt?: string | undefined;
|
|
395
|
-
media?: {
|
|
396
|
-
type: "video" | "image" | "file";
|
|
397
|
-
url: string;
|
|
398
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
399
|
-
alt?: string | undefined;
|
|
400
|
-
thumbnailUrl?: string | undefined;
|
|
401
|
-
youtubeId?: string | undefined;
|
|
402
|
-
duration?: number | undefined;
|
|
403
|
-
}[] | undefined;
|
|
404
404
|
seo?: {
|
|
405
405
|
title?: string | undefined;
|
|
406
406
|
description?: string | undefined;
|
|
@@ -477,13 +477,26 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
477
477
|
createdAt?: string | undefined;
|
|
478
478
|
updatedAt?: string | undefined;
|
|
479
479
|
storeId?: string | undefined;
|
|
480
|
-
|
|
481
|
-
description?: string | undefined;
|
|
482
|
-
slug?: string | undefined;
|
|
480
|
+
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
483
481
|
category?: string | undefined;
|
|
484
482
|
categorySlug?: string | undefined;
|
|
485
|
-
subcategory?: string | undefined;
|
|
486
483
|
stockQuantity?: number | undefined;
|
|
484
|
+
rating?: number | undefined;
|
|
485
|
+
publishedAt?: string | undefined;
|
|
486
|
+
slug?: string | undefined;
|
|
487
|
+
viewCount?: number | undefined;
|
|
488
|
+
features?: string[] | undefined;
|
|
489
|
+
media?: {
|
|
490
|
+
type: "video" | "image" | "file";
|
|
491
|
+
url: string;
|
|
492
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
493
|
+
alt?: string | undefined;
|
|
494
|
+
thumbnailUrl?: string | undefined;
|
|
495
|
+
youtubeId?: string | undefined;
|
|
496
|
+
duration?: number | undefined;
|
|
497
|
+
}[] | undefined;
|
|
498
|
+
description?: string | undefined;
|
|
499
|
+
subcategory?: string | undefined;
|
|
487
500
|
availableQuantity?: number | undefined;
|
|
488
501
|
mainImage?: string | undefined;
|
|
489
502
|
images?: string[] | undefined;
|
|
@@ -500,7 +513,6 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
500
513
|
insurance?: boolean | undefined;
|
|
501
514
|
insuranceCost?: number | undefined;
|
|
502
515
|
shippingPaidBy?: "seller" | "buyer" | undefined;
|
|
503
|
-
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
504
516
|
auctionEndDate?: string | Date | undefined;
|
|
505
517
|
startingBid?: number | undefined;
|
|
506
518
|
currentBid?: number | undefined;
|
|
@@ -516,11 +528,10 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
516
528
|
preOrderDepositAmount?: number | undefined;
|
|
517
529
|
preOrderMaxQuantity?: number | undefined;
|
|
518
530
|
preOrderCurrentCount?: number | undefined;
|
|
519
|
-
preOrderProductionStatus?: "
|
|
531
|
+
preOrderProductionStatus?: "upcoming" | "in_production" | "ready_to_ship" | undefined;
|
|
520
532
|
preOrderCancellable?: boolean | undefined;
|
|
521
533
|
isPromoted?: boolean | undefined;
|
|
522
534
|
pickupAddressId?: string | undefined;
|
|
523
|
-
viewCount?: number | undefined;
|
|
524
535
|
prizeRevealStatus?: "closed" | "open" | "pending" | undefined;
|
|
525
536
|
prizeRevealWindowStart?: string | Date | undefined;
|
|
526
537
|
prizeRevealWindowEnd?: string | Date | undefined;
|
|
@@ -529,17 +540,6 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
529
540
|
prizeCurrentEntries?: number | undefined;
|
|
530
541
|
prizeMaxEntries?: number | undefined;
|
|
531
542
|
pricePerEntry?: number | undefined;
|
|
532
|
-
rating?: number | undefined;
|
|
533
|
-
publishedAt?: string | undefined;
|
|
534
|
-
media?: {
|
|
535
|
-
type: "video" | "image" | "file";
|
|
536
|
-
url: string;
|
|
537
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
538
|
-
alt?: string | undefined;
|
|
539
|
-
thumbnailUrl?: string | undefined;
|
|
540
|
-
youtubeId?: string | undefined;
|
|
541
|
-
duration?: number | undefined;
|
|
542
|
-
}[] | undefined;
|
|
543
543
|
seo?: {
|
|
544
544
|
title?: string | undefined;
|
|
545
545
|
description?: string | undefined;
|
|
@@ -625,10 +625,10 @@ export declare const productListParamsSchema: z.ZodObject<{
|
|
|
625
625
|
q?: string | undefined;
|
|
626
626
|
perPage?: number | undefined;
|
|
627
627
|
storeId?: string | undefined;
|
|
628
|
+
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
628
629
|
category?: string | undefined;
|
|
629
630
|
featured?: boolean | undefined;
|
|
630
631
|
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
631
|
-
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
632
632
|
minPrice?: number | undefined;
|
|
633
633
|
maxPrice?: number | undefined;
|
|
634
634
|
inStock?: boolean | undefined;
|
|
@@ -639,10 +639,10 @@ export declare const productListParamsSchema: z.ZodObject<{
|
|
|
639
639
|
q?: string | undefined;
|
|
640
640
|
perPage?: number | undefined;
|
|
641
641
|
storeId?: string | undefined;
|
|
642
|
+
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
642
643
|
category?: string | undefined;
|
|
643
644
|
featured?: boolean | undefined;
|
|
644
645
|
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
645
|
-
listingType?: "classified" | "standard" | "auction" | "pre-order" | "prize-draw" | "digital-code" | "live" | undefined;
|
|
646
646
|
minPrice?: number | undefined;
|
|
647
647
|
maxPrice?: number | undefined;
|
|
648
648
|
inStock?: boolean | undefined;
|
|
@@ -86,8 +86,8 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
|
|
|
86
86
|
}, "strip", z.ZodTypeAny, {
|
|
87
87
|
label?: string | undefined;
|
|
88
88
|
icon?: string | undefined;
|
|
89
|
-
description?: string | undefined;
|
|
90
89
|
category?: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder" | undefined;
|
|
90
|
+
description?: string | undefined;
|
|
91
91
|
isActive?: boolean | undefined;
|
|
92
92
|
displayOrder?: number | undefined;
|
|
93
93
|
iconColor?: string | undefined;
|
|
@@ -95,13 +95,86 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
|
|
|
95
95
|
}, {
|
|
96
96
|
label?: string | undefined;
|
|
97
97
|
icon?: string | undefined;
|
|
98
|
-
description?: string | undefined;
|
|
99
98
|
category?: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder" | undefined;
|
|
99
|
+
description?: string | undefined;
|
|
100
100
|
isActive?: boolean | undefined;
|
|
101
101
|
displayOrder?: number | undefined;
|
|
102
102
|
iconColor?: string | undefined;
|
|
103
103
|
productTypes?: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[] | undefined;
|
|
104
104
|
}>;
|
|
105
|
+
/**
|
|
106
|
+
* The FORM schema for the product-feature editor, with UI metadata.
|
|
107
|
+
*
|
|
108
|
+
* `AdminFeatureEditorView` had **no validation whatsoever** before W5 — ten
|
|
109
|
+
* `useState` fields, `required` on the inputs (an HTML attribute any
|
|
110
|
+
* programmatic submit bypasses), and nothing else. Meanwhile these validators
|
|
111
|
+
* had existed all along and simply were not wired: the "schema exists, the
|
|
112
|
+
* consumer ignores it" case the plan catalogues.
|
|
113
|
+
*
|
|
114
|
+
* It reuses `productFeatureAdminCreateSchema`'s field shapes rather than
|
|
115
|
+
* restating them — a second copy of the same bounds is how the two would come
|
|
116
|
+
* to disagree. Only the annotations are new.
|
|
117
|
+
*
|
|
118
|
+
* 🛑 `annotate()` must be the OUTERMOST call — it keys a WeakMap by schema
|
|
119
|
+
* instance and every zod wrapper returns a new one.
|
|
120
|
+
*/
|
|
121
|
+
export declare const productFeatureFormSchema: z.ZodEffects<z.ZodObject<{
|
|
122
|
+
label: z.ZodString;
|
|
123
|
+
description: z.ZodOptional<z.ZodString>;
|
|
124
|
+
icon: z.ZodString;
|
|
125
|
+
iconColor: z.ZodOptional<z.ZodString>;
|
|
126
|
+
category: z.ZodEnum<["shipping", "seller", "condition", "platform", "auction", "preorder", "custom"]>;
|
|
127
|
+
scope: z.ZodEnum<["platform", "store"]>;
|
|
128
|
+
productTypes: z.ZodArray<z.ZodEnum<["product", "auction", "preorder", "prize-draw", "classified", "digital-code", "live", "all"]>, "many">;
|
|
129
|
+
storeId: z.ZodOptional<z.ZodString>;
|
|
130
|
+
isActive: z.ZodBoolean;
|
|
131
|
+
displayOrder: z.ZodNumber;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
label: string;
|
|
134
|
+
scope: "store" | "platform";
|
|
135
|
+
icon: string;
|
|
136
|
+
category: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder";
|
|
137
|
+
isActive: boolean;
|
|
138
|
+
displayOrder: number;
|
|
139
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
140
|
+
storeId?: string | undefined;
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
iconColor?: string | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
label: string;
|
|
145
|
+
scope: "store" | "platform";
|
|
146
|
+
icon: string;
|
|
147
|
+
category: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder";
|
|
148
|
+
isActive: boolean;
|
|
149
|
+
displayOrder: number;
|
|
150
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
151
|
+
storeId?: string | undefined;
|
|
152
|
+
description?: string | undefined;
|
|
153
|
+
iconColor?: string | undefined;
|
|
154
|
+
}>, {
|
|
155
|
+
label: string;
|
|
156
|
+
scope: "store" | "platform";
|
|
157
|
+
icon: string;
|
|
158
|
+
category: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder";
|
|
159
|
+
isActive: boolean;
|
|
160
|
+
displayOrder: number;
|
|
161
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
162
|
+
storeId?: string | undefined;
|
|
163
|
+
description?: string | undefined;
|
|
164
|
+
iconColor?: string | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
label: string;
|
|
167
|
+
scope: "store" | "platform";
|
|
168
|
+
icon: string;
|
|
169
|
+
category: "shipping" | "custom" | "seller" | "condition" | "auction" | "platform" | "preorder";
|
|
170
|
+
isActive: boolean;
|
|
171
|
+
displayOrder: number;
|
|
172
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "product" | "preorder")[];
|
|
173
|
+
storeId?: string | undefined;
|
|
174
|
+
description?: string | undefined;
|
|
175
|
+
iconColor?: string | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
export type ProductFeatureFormValues = z.infer<typeof productFeatureFormSchema>;
|
|
105
178
|
export type ProductFeatureAdminCreatePayload = z.infer<typeof productFeatureAdminCreateSchema>;
|
|
106
179
|
export type ProductFeatureStoreCreatePayload = z.infer<typeof productFeatureStoreCreateSchema>;
|
|
107
180
|
export type ProductFeatureUpdatePayload = z.infer<typeof productFeatureUpdateSchema>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* of hand-rolling parallel schemas.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from "zod";
|
|
9
|
+
import { annotate } from "../../shell/field-ui-meta";
|
|
9
10
|
export const PRODUCT_FEATURE_PRODUCT_TYPE_ENUM = z.enum([
|
|
10
11
|
"product",
|
|
11
12
|
"auction",
|
|
@@ -66,3 +67,65 @@ export const productFeatureUpdateSchema = z.object({
|
|
|
66
67
|
isActive: z.boolean().optional(),
|
|
67
68
|
displayOrder: z.number().int().min(0).max(FEATURE_DISPLAY_ORDER_MAX).optional(),
|
|
68
69
|
});
|
|
70
|
+
/**
|
|
71
|
+
* The FORM schema for the product-feature editor, with UI metadata.
|
|
72
|
+
*
|
|
73
|
+
* `AdminFeatureEditorView` had **no validation whatsoever** before W5 — ten
|
|
74
|
+
* `useState` fields, `required` on the inputs (an HTML attribute any
|
|
75
|
+
* programmatic submit bypasses), and nothing else. Meanwhile these validators
|
|
76
|
+
* had existed all along and simply were not wired: the "schema exists, the
|
|
77
|
+
* consumer ignores it" case the plan catalogues.
|
|
78
|
+
*
|
|
79
|
+
* It reuses `productFeatureAdminCreateSchema`'s field shapes rather than
|
|
80
|
+
* restating them — a second copy of the same bounds is how the two would come
|
|
81
|
+
* to disagree. Only the annotations are new.
|
|
82
|
+
*
|
|
83
|
+
* 🛑 `annotate()` must be the OUTERMOST call — it keys a WeakMap by schema
|
|
84
|
+
* instance and every zod wrapper returns a new one.
|
|
85
|
+
*/
|
|
86
|
+
export const productFeatureFormSchema = z.object({
|
|
87
|
+
label: annotate(productFeatureAdminCreateSchema.shape.label, {
|
|
88
|
+
section: "basics", sectionLabel: "Feature", sectionRequired: true,
|
|
89
|
+
quick: true, order: 1, row: "full",
|
|
90
|
+
}),
|
|
91
|
+
description: annotate(productFeatureAdminCreateSchema.shape.description, {
|
|
92
|
+
section: "basics", order: 2, row: "full",
|
|
93
|
+
}),
|
|
94
|
+
icon: annotate(productFeatureAdminCreateSchema.shape.icon, {
|
|
95
|
+
section: "basics", quick: true, order: 3, row: "pair",
|
|
96
|
+
}),
|
|
97
|
+
iconColor: annotate(productFeatureAdminCreateSchema.shape.iconColor, {
|
|
98
|
+
section: "basics", order: 4, row: "pair",
|
|
99
|
+
}),
|
|
100
|
+
category: annotate(productFeatureAdminCreateSchema.shape.category, {
|
|
101
|
+
section: "scope", sectionLabel: "Scope & Applicability",
|
|
102
|
+
quick: true, order: 1, row: "pair",
|
|
103
|
+
}),
|
|
104
|
+
scope: annotate(productFeatureAdminCreateSchema.shape.scope, {
|
|
105
|
+
section: "scope", quick: true, order: 2, row: "pair",
|
|
106
|
+
}),
|
|
107
|
+
productTypes: annotate(productFeatureAdminCreateSchema.shape.productTypes, {
|
|
108
|
+
section: "scope", order: 3, row: "full", kind: "list",
|
|
109
|
+
}),
|
|
110
|
+
storeId: annotate(productFeatureAdminCreateSchema.shape.storeId, {
|
|
111
|
+
section: "scope", order: 4, row: "pair",
|
|
112
|
+
help: "Only used when scope is \"store\".",
|
|
113
|
+
}),
|
|
114
|
+
isActive: annotate(productFeatureAdminCreateSchema.shape.isActive, {
|
|
115
|
+
section: "visibility", sectionLabel: "Visibility", order: 1, row: "quarter",
|
|
116
|
+
}),
|
|
117
|
+
displayOrder: annotate(productFeatureAdminCreateSchema.shape.displayOrder, {
|
|
118
|
+
section: "visibility", order: 2, row: "pair",
|
|
119
|
+
}),
|
|
120
|
+
}).superRefine((v, ctx) => {
|
|
121
|
+
// The one rule no per-field bound can state: a store-scoped feature must
|
|
122
|
+
// name its store. The server enforces it too — this exists so the admin is
|
|
123
|
+
// told before submitting rather than by a 400.
|
|
124
|
+
if (v.scope === "store" && !v.storeId?.trim()) {
|
|
125
|
+
ctx.addIssue({
|
|
126
|
+
code: z.ZodIssueCode.custom,
|
|
127
|
+
path: ["storeId"],
|
|
128
|
+
message: "A store-scoped feature must name a store.",
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
});
|
|
@@ -269,7 +269,7 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
269
269
|
code: string;
|
|
270
270
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
271
271
|
id: string;
|
|
272
|
-
scope: "
|
|
272
|
+
scope: "admin" | "seller";
|
|
273
273
|
name: string;
|
|
274
274
|
createdAt: string | Date | z.objectOutputType<{
|
|
275
275
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -277,8 +277,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
277
277
|
updatedAt: string | Date | z.objectOutputType<{
|
|
278
278
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
279
279
|
}, z.ZodTypeAny, "passthrough">;
|
|
280
|
-
description: string;
|
|
281
280
|
createdBy: string;
|
|
281
|
+
description: string;
|
|
282
282
|
stats: {
|
|
283
283
|
totalUses: number;
|
|
284
284
|
totalRevenue: number;
|
|
@@ -327,7 +327,7 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
327
327
|
code: string;
|
|
328
328
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
329
329
|
id: string;
|
|
330
|
-
scope: "
|
|
330
|
+
scope: "admin" | "seller";
|
|
331
331
|
name: string;
|
|
332
332
|
createdAt: string | Date | z.objectInputType<{
|
|
333
333
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -335,8 +335,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
335
335
|
updatedAt: string | Date | z.objectInputType<{
|
|
336
336
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
337
337
|
}, z.ZodTypeAny, "passthrough">;
|
|
338
|
-
description: string;
|
|
339
338
|
createdBy: string;
|
|
339
|
+
description: string;
|
|
340
340
|
stats: {
|
|
341
341
|
totalUses: number;
|
|
342
342
|
totalRevenue: number;
|
|
@@ -459,7 +459,7 @@ export declare const claimedCouponSnapshotSchema: z.ZodObject<{
|
|
|
459
459
|
}>;
|
|
460
460
|
}, "strip", z.ZodTypeAny, {
|
|
461
461
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
462
|
-
scope: "
|
|
462
|
+
scope: "admin" | "seller";
|
|
463
463
|
name: string;
|
|
464
464
|
discount: {
|
|
465
465
|
value: number;
|
|
@@ -478,7 +478,7 @@ export declare const claimedCouponSnapshotSchema: z.ZodObject<{
|
|
|
478
478
|
description?: string | undefined;
|
|
479
479
|
}, {
|
|
480
480
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
481
|
-
scope: "
|
|
481
|
+
scope: "admin" | "seller";
|
|
482
482
|
name: string;
|
|
483
483
|
discount: {
|
|
484
484
|
value: number;
|
|
@@ -545,7 +545,7 @@ export declare const claimedCouponFirestoreSchema: z.ZodObject<{
|
|
|
545
545
|
}>;
|
|
546
546
|
}, "strip", z.ZodTypeAny, {
|
|
547
547
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
548
|
-
scope: "
|
|
548
|
+
scope: "admin" | "seller";
|
|
549
549
|
name: string;
|
|
550
550
|
discount: {
|
|
551
551
|
value: number;
|
|
@@ -564,7 +564,7 @@ export declare const claimedCouponFirestoreSchema: z.ZodObject<{
|
|
|
564
564
|
description?: string | undefined;
|
|
565
565
|
}, {
|
|
566
566
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
567
|
-
scope: "
|
|
567
|
+
scope: "admin" | "seller";
|
|
568
568
|
name: string;
|
|
569
569
|
discount: {
|
|
570
570
|
value: number;
|
|
@@ -624,7 +624,7 @@ export declare const claimedCouponFirestoreSchema: z.ZodObject<{
|
|
|
624
624
|
couponId: string;
|
|
625
625
|
couponSnapshot: {
|
|
626
626
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
627
|
-
scope: "
|
|
627
|
+
scope: "admin" | "seller";
|
|
628
628
|
name: string;
|
|
629
629
|
discount: {
|
|
630
630
|
value: number;
|
|
@@ -664,7 +664,7 @@ export declare const claimedCouponFirestoreSchema: z.ZodObject<{
|
|
|
664
664
|
couponId: string;
|
|
665
665
|
couponSnapshot: {
|
|
666
666
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
667
|
-
scope: "
|
|
667
|
+
scope: "admin" | "seller";
|
|
668
668
|
name: string;
|
|
669
669
|
discount: {
|
|
670
670
|
value: number;
|
|
@@ -738,7 +738,7 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
738
738
|
code: string;
|
|
739
739
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
740
740
|
id: string;
|
|
741
|
-
scope: "
|
|
741
|
+
scope: "admin" | "seller";
|
|
742
742
|
name: string;
|
|
743
743
|
createdAt: string;
|
|
744
744
|
updatedAt: string;
|
|
@@ -762,7 +762,7 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
762
762
|
code: string;
|
|
763
763
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
764
764
|
id: string;
|
|
765
|
-
scope: "
|
|
765
|
+
scope: "admin" | "seller";
|
|
766
766
|
name: string;
|
|
767
767
|
createdAt: string;
|
|
768
768
|
updatedAt: string;
|
|
@@ -794,7 +794,7 @@ export declare const promotionsListParamsSchema: z.ZodObject<{
|
|
|
794
794
|
}, "strip", z.ZodTypeAny, {
|
|
795
795
|
sort?: string | undefined;
|
|
796
796
|
page?: number | undefined;
|
|
797
|
-
scope?: "
|
|
797
|
+
scope?: "admin" | "seller" | undefined;
|
|
798
798
|
pageSize?: number | undefined;
|
|
799
799
|
storeId?: string | undefined;
|
|
800
800
|
isActive?: boolean | undefined;
|
|
@@ -802,7 +802,7 @@ export declare const promotionsListParamsSchema: z.ZodObject<{
|
|
|
802
802
|
}, {
|
|
803
803
|
sort?: string | undefined;
|
|
804
804
|
page?: number | undefined;
|
|
805
|
-
scope?: "
|
|
805
|
+
scope?: "admin" | "seller" | undefined;
|
|
806
806
|
pageSize?: number | undefined;
|
|
807
807
|
storeId?: string | undefined;
|
|
808
808
|
isActive?: boolean | undefined;
|
|
@@ -110,11 +110,11 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
110
110
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
111
111
|
}, z.ZodTypeAny, "passthrough">;
|
|
112
112
|
userId: string;
|
|
113
|
+
rating: number;
|
|
113
114
|
verified: boolean;
|
|
114
115
|
productId: string;
|
|
115
116
|
productTitle: string;
|
|
116
117
|
userName: string;
|
|
117
|
-
rating: number;
|
|
118
118
|
comment: string;
|
|
119
119
|
helpfulCount: number;
|
|
120
120
|
reportCount: number;
|
|
@@ -126,9 +126,10 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
126
126
|
trimStart?: number | undefined;
|
|
127
127
|
} | undefined;
|
|
128
128
|
storeId?: string | undefined;
|
|
129
|
+
listingType?: string | undefined;
|
|
130
|
+
storeName?: string | undefined;
|
|
129
131
|
images?: string[] | undefined;
|
|
130
132
|
featured?: boolean | undefined;
|
|
131
|
-
listingType?: string | undefined;
|
|
132
133
|
userAvatar?: string | undefined;
|
|
133
134
|
moderatorId?: string | undefined;
|
|
134
135
|
moderatorNote?: string | undefined;
|
|
@@ -139,7 +140,6 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
139
140
|
rejectedAt?: string | Date | z.objectOutputType<{
|
|
140
141
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
141
142
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
142
|
-
storeName?: string | undefined;
|
|
143
143
|
userSlug?: string | undefined;
|
|
144
144
|
hasImages?: boolean | undefined;
|
|
145
145
|
isAnonymous?: boolean | undefined;
|
|
@@ -158,11 +158,11 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
158
158
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
159
159
|
}, z.ZodTypeAny, "passthrough">;
|
|
160
160
|
userId: string;
|
|
161
|
+
rating: number;
|
|
161
162
|
verified: boolean;
|
|
162
163
|
productId: string;
|
|
163
164
|
productTitle: string;
|
|
164
165
|
userName: string;
|
|
165
|
-
rating: number;
|
|
166
166
|
comment: string;
|
|
167
167
|
helpfulCount: number;
|
|
168
168
|
reportCount: number;
|
|
@@ -174,9 +174,10 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
174
174
|
trimStart?: number | undefined;
|
|
175
175
|
} | undefined;
|
|
176
176
|
storeId?: string | undefined;
|
|
177
|
+
listingType?: string | undefined;
|
|
178
|
+
storeName?: string | undefined;
|
|
177
179
|
images?: string[] | undefined;
|
|
178
180
|
featured?: boolean | undefined;
|
|
179
|
-
listingType?: string | undefined;
|
|
180
181
|
userAvatar?: string | undefined;
|
|
181
182
|
moderatorId?: string | undefined;
|
|
182
183
|
moderatorNote?: string | undefined;
|
|
@@ -187,7 +188,6 @@ export declare const reviewFirestoreSchema: z.ZodObject<{
|
|
|
187
188
|
rejectedAt?: string | Date | z.objectInputType<{
|
|
188
189
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
189
190
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
190
|
-
storeName?: string | undefined;
|
|
191
191
|
userSlug?: string | undefined;
|
|
192
192
|
hasImages?: boolean | undefined;
|
|
193
193
|
isAnonymous?: boolean | undefined;
|
|
@@ -293,9 +293,9 @@ export declare const reviewSchema: z.ZodObject<{
|
|
|
293
293
|
status: "pending" | "approved" | "rejected";
|
|
294
294
|
id: string;
|
|
295
295
|
userId: string;
|
|
296
|
+
rating: 3 | 1 | 2 | 4 | 5;
|
|
296
297
|
productId: string;
|
|
297
298
|
userName: string;
|
|
298
|
-
rating: 3 | 1 | 2 | 4 | 5;
|
|
299
299
|
title?: string | undefined;
|
|
300
300
|
video?: {
|
|
301
301
|
url: string;
|
|
@@ -306,27 +306,27 @@ export declare const reviewSchema: z.ZodObject<{
|
|
|
306
306
|
} | undefined;
|
|
307
307
|
createdAt?: string | undefined;
|
|
308
308
|
updatedAt?: string | undefined;
|
|
309
|
+
listingType?: string | undefined;
|
|
310
|
+
storeName?: string | undefined;
|
|
309
311
|
verified?: boolean | undefined;
|
|
310
312
|
images?: {
|
|
311
313
|
url: string;
|
|
312
314
|
thumbnailUrl?: string | undefined;
|
|
313
315
|
}[] | undefined;
|
|
314
316
|
featured?: boolean | undefined;
|
|
315
|
-
listingType?: string | undefined;
|
|
316
317
|
productTitle?: string | undefined;
|
|
317
318
|
userAvatar?: string | undefined;
|
|
318
319
|
comment?: string | undefined;
|
|
319
320
|
helpfulCount?: number | undefined;
|
|
320
321
|
reportCount?: number | undefined;
|
|
321
|
-
storeName?: string | undefined;
|
|
322
322
|
storeSlug?: string | undefined;
|
|
323
323
|
}, {
|
|
324
324
|
status: "pending" | "approved" | "rejected";
|
|
325
325
|
id: string;
|
|
326
326
|
userId: string;
|
|
327
|
+
rating: 3 | 1 | 2 | 4 | 5;
|
|
327
328
|
productId: string;
|
|
328
329
|
userName: string;
|
|
329
|
-
rating: 3 | 1 | 2 | 4 | 5;
|
|
330
330
|
title?: string | undefined;
|
|
331
331
|
video?: {
|
|
332
332
|
url: string;
|
|
@@ -337,19 +337,19 @@ export declare const reviewSchema: z.ZodObject<{
|
|
|
337
337
|
} | undefined;
|
|
338
338
|
createdAt?: string | undefined;
|
|
339
339
|
updatedAt?: string | undefined;
|
|
340
|
+
listingType?: string | undefined;
|
|
341
|
+
storeName?: string | undefined;
|
|
340
342
|
verified?: boolean | undefined;
|
|
341
343
|
images?: {
|
|
342
344
|
url: string;
|
|
343
345
|
thumbnailUrl?: string | undefined;
|
|
344
346
|
}[] | undefined;
|
|
345
347
|
featured?: boolean | undefined;
|
|
346
|
-
listingType?: string | undefined;
|
|
347
348
|
productTitle?: string | undefined;
|
|
348
349
|
userAvatar?: string | undefined;
|
|
349
350
|
comment?: string | undefined;
|
|
350
351
|
helpfulCount?: number | undefined;
|
|
351
352
|
reportCount?: number | undefined;
|
|
352
|
-
storeName?: string | undefined;
|
|
353
353
|
storeSlug?: string | undefined;
|
|
354
354
|
}>;
|
|
355
355
|
/** Base schema for list-query parameters. */
|
|
@@ -370,9 +370,9 @@ export declare const reviewListParamsSchema: z.ZodObject<{
|
|
|
370
370
|
perPage?: number | undefined;
|
|
371
371
|
storeId?: string | undefined;
|
|
372
372
|
userId?: string | undefined;
|
|
373
|
+
rating?: number | undefined;
|
|
373
374
|
featured?: boolean | undefined;
|
|
374
375
|
productId?: string | undefined;
|
|
375
|
-
rating?: number | undefined;
|
|
376
376
|
}, {
|
|
377
377
|
sort?: string | undefined;
|
|
378
378
|
status?: "pending" | "approved" | "rejected" | undefined;
|
|
@@ -380,7 +380,7 @@ export declare const reviewListParamsSchema: z.ZodObject<{
|
|
|
380
380
|
perPage?: number | undefined;
|
|
381
381
|
storeId?: string | undefined;
|
|
382
382
|
userId?: string | undefined;
|
|
383
|
+
rating?: number | undefined;
|
|
383
384
|
featured?: boolean | undefined;
|
|
384
385
|
productId?: string | undefined;
|
|
385
|
-
rating?: number | undefined;
|
|
386
386
|
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ScammerStatus } from "../schemas/firestore";
|
|
2
|
+
/** Human-readable label. Replaces two `.replace(/_/g, " ")` call sites, which
|
|
3
|
+
* rendered "pending review" — mechanically correct, and not a written label. */
|
|
4
|
+
export declare const SCAMMER_STATUS_LABEL: Record<ScammerStatus, string>;
|
|
5
|
+
/**
|
|
6
|
+
* Inline-chip styling. Every entry is a `bg-{status}-surface` + `text-{status}`
|
|
7
|
+
* pair per Recurrent Root Cause #67 — the two tokens invert together with the
|
|
8
|
+
* theme, which a literal `text-white` would not.
|
|
9
|
+
*
|
|
10
|
+
* `removed` is the neutral case: it has no status colour because it is not a
|
|
11
|
+
* status outcome, it is a withdrawal. ONE background, ONE ink.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SCAMMER_STATUS_BADGE: Record<ScammerStatus, string>;
|
|
14
|
+
/** Dropdown options, derived from the union so one cannot go missing. */
|
|
15
|
+
export declare const SCAMMER_STATUS_OPTIONS: {
|
|
16
|
+
value: "verified" | "rejected" | "removed" | "pending_review";
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
/**
|
|
20
|
+
* Narrow an unknown API value to a real status.
|
|
21
|
+
*
|
|
22
|
+
* The list view used `toStringValue(item.status, "pending_review")`, which
|
|
23
|
+
* produces a `string` — so an unrecognised value flowed on as if it were a
|
|
24
|
+
* status and every consumer fell back to the pending styling. This maps
|
|
25
|
+
* anything unrecognised to `pending_review` explicitly, and the return type
|
|
26
|
+
* says so.
|
|
27
|
+
*/
|
|
28
|
+
export declare function toScammerStatus(value: unknown): ScammerStatus;
|