@mohasinac/appkit 2.8.5 → 2.8.7

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.
Files changed (43) hide show
  1. package/dist/_internal/server/features/checkout/actions.js +2 -1
  2. package/dist/_internal/server/features/grouped/data.js +9 -8
  3. package/dist/_internal/server/features/products/data.js +2 -1
  4. package/dist/_internal/server/features/refunds/actions.js +2 -1
  5. package/dist/_internal/server/features/seo/sitemap.js +2 -1
  6. package/dist/_internal/server/jobs/core/countersReconcile.js +4 -4
  7. package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
  8. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +8 -8
  9. package/dist/client.d.ts +2 -0
  10. package/dist/client.js +1 -0
  11. package/dist/constants/field-names.d.ts +3 -0
  12. package/dist/constants/field-names.js +3 -0
  13. package/dist/features/admin/repository/chat.repository.js +7 -6
  14. package/dist/features/auctions/components/AuctionBottomActions.js +3 -4
  15. package/dist/features/auctions/repository/bid.repository.js +12 -12
  16. package/dist/features/blog/actions/blog-actions.d.ts +2 -2
  17. package/dist/features/blog/schemas/index.d.ts +1 -1
  18. package/dist/features/cart/repository/cart.repository.js +2 -1
  19. package/dist/features/categories/repository/categories.repository.js +26 -25
  20. package/dist/features/categories/schemas/firestore.d.ts +1 -0
  21. package/dist/features/categories/schemas/firestore.js +1 -0
  22. package/dist/features/categories/schemas/index.d.ts +10 -10
  23. package/dist/features/events/components/EventParticipateView.js +2 -1
  24. package/dist/features/events/schemas/index.d.ts +3 -3
  25. package/dist/features/faq/actions/faq-actions.d.ts +6 -6
  26. package/dist/features/faq/repository/faqs.repository.js +21 -20
  27. package/dist/features/faq/schemas/index.d.ts +2 -2
  28. package/dist/features/homepage/repository/carousel.repository.js +8 -7
  29. package/dist/features/homepage/repository/carousels.repository.js +2 -1
  30. package/dist/features/homepage/repository/homepage-sections.repository.js +6 -5
  31. package/dist/features/messages/repository/conversations.repository.js +5 -4
  32. package/dist/features/orders/repository/orders.repository.js +13 -13
  33. package/dist/features/products/repository/product-features.repository.js +7 -6
  34. package/dist/features/products/repository/product-templates.repository.js +4 -3
  35. package/dist/features/products/repository/products.repository.js +4 -4
  36. package/dist/features/promotions/repository/claimed-coupons.repository.js +2 -1
  37. package/dist/features/promotions/repository/coupons.repository.js +4 -4
  38. package/dist/features/reviews/repository/reviews.repository.js +2 -2
  39. package/dist/features/scams/repository/scammer.repository.js +3 -3
  40. package/dist/features/search/components/Search.js +11 -0
  41. package/dist/features/support/repository/support.repository.js +8 -7
  42. package/dist/seed/products-auctions-seed-data.js +107 -0
  43. package/package.json +1 -1
@@ -97,8 +97,8 @@ export class CouponsRepository extends BaseRepository {
97
97
  try {
98
98
  const snapshot = await this.db
99
99
  .collection(this.collection)
100
- .where("type", "==", type)
101
- .orderBy("createdAt", "desc")
100
+ .where(COUPON_FIELDS.TYPE, "==", type)
101
+ .orderBy(COUPON_FIELDS.CREATED_AT, "desc")
102
102
  .get();
103
103
  return snapshot.docs.map((doc) => this.mapDoc(doc));
104
104
  }
@@ -116,8 +116,8 @@ export class CouponsRepository extends BaseRepository {
116
116
  try {
117
117
  const snapshot = await this.db
118
118
  .collection(this.collection)
119
- .where("createdBy", "==", userId)
120
- .orderBy("createdAt", "desc")
119
+ .where(COUPON_FIELDS.CREATED_BY, "==", userId)
120
+ .orderBy(COUPON_FIELDS.CREATED_AT, "desc")
121
121
  .get();
122
122
  return snapshot.docs.map((doc) => this.mapDoc(doc));
123
123
  }
@@ -67,7 +67,7 @@ class ReviewRepository extends BaseRepository {
67
67
  .collection(this.collection)
68
68
  .where(REVIEW_FIELDS.PRODUCT_ID, "==", productId)
69
69
  .where(REVIEW_FIELDS.STATUS, "==", "approved")
70
- .orderBy("createdAt", "desc")
70
+ .orderBy(REVIEW_FIELDS.CREATED_AT, "desc")
71
71
  .get();
72
72
  return snapshot.docs.map((doc) => this.mapDoc(doc));
73
73
  }
@@ -76,7 +76,7 @@ class ReviewRepository extends BaseRepository {
76
76
  .collection(this.collection)
77
77
  .where(REVIEW_FIELDS.STORE_ID, "==", storeId)
78
78
  .where(REVIEW_FIELDS.STATUS, "==", "approved")
79
- .orderBy("createdAt", "desc")
79
+ .orderBy(REVIEW_FIELDS.CREATED_AT, "desc")
80
80
  .limit(50)
81
81
  .get();
82
82
  return snapshot.docs.map((doc) => this.mapDoc(doc));
@@ -105,8 +105,8 @@ class ScammerRepository extends BaseRepository {
105
105
  .collection(SCAMMER_COLLECTION)
106
106
  .doc(scammerId)
107
107
  .collection(SCAMMER_INCIDENTS_SUBCOLLECTION)
108
- .where("status", "==", "verified")
109
- .orderBy("createdAt", "desc")
108
+ .where(SCAMMER_FIELDS.STATUS, "==", "verified")
109
+ .orderBy(SCAMMER_FIELDS.CREATED_AT, "desc")
110
110
  .limit(20)
111
111
  .get();
112
112
  return snap.docs.map((d) => this.mapDoc(d));
@@ -122,7 +122,7 @@ class ScammerRepository extends BaseRepository {
122
122
  .doc(scammerId)
123
123
  .collection(SCAMMER_COMMENTS_SUBCOLLECTION)
124
124
  .where("isHidden", "==", false)
125
- .orderBy("createdAt", "desc")
125
+ .orderBy(SCAMMER_FIELDS.CREATED_AT, "desc")
126
126
  .limit(30)
127
127
  .get();
128
128
  return snap.docs.map((d) => this.mapDoc(d));
@@ -114,6 +114,17 @@ export function Search({ isOpen, onClose, onSearch, onOpen, value, onChange, pla
114
114
  const handleSuggestionClick = (record) => {
115
115
  setIsInlineOpen(false);
116
116
  onClose?.();
117
+ // For "page" suggestions, the target is a listing page that filters by ?q=
118
+ // — carry the typed query into the URL so the destination pre-fills its
119
+ // search input and applies the filter immediately. For non-page records
120
+ // (product/category/blog/event), the URL already targets a specific
121
+ // detail page so the query is irrelevant.
122
+ const trimmed = query.trim();
123
+ if (record.type === "page" && trimmed) {
124
+ const sep = record.url.includes("?") ? "&" : "?";
125
+ router.push(`${record.url}${sep}q=${encodeURIComponent(trimmed)}`);
126
+ return;
127
+ }
117
128
  router.push(record.url);
118
129
  };
119
130
  const handleOverlaySearch = () => {
@@ -1,6 +1,7 @@
1
1
  import { firebaseFieldOps } from "../../../providers/db-firebase";
2
2
  import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase";
3
3
  import { DatabaseError } from "../../../errors";
4
+ import { SUPPORT_TICKET_FIELDS } from "../../../constants/field-names";
4
5
  import { SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, } from "../schemas/firestore";
5
6
  export class SupportRepository extends BaseRepository {
6
7
  constructor() {
@@ -38,8 +39,8 @@ export class SupportRepository extends BaseRepository {
38
39
  async countActiveTickets(userId) {
39
40
  const col = this.db.collection(SUPPORT_TICKET_COLLECTION);
40
41
  const snaps = await Promise.all(ACTIVE_TICKET_STATUSES.map((s) => col
41
- .where("userId", "==", userId)
42
- .where("status", "==", s)
42
+ .where(SUPPORT_TICKET_FIELDS.USER_ID, "==", userId)
43
+ .where(SUPPORT_TICKET_FIELDS.STATUS, "==", s)
43
44
  .select()
44
45
  .get()));
45
46
  return snaps.reduce((total, snap) => total + snap.size, 0);
@@ -47,9 +48,9 @@ export class SupportRepository extends BaseRepository {
47
48
  async getActiveOrderTicket(userId, orderId) {
48
49
  const col = this.db.collection(SUPPORT_TICKET_COLLECTION);
49
50
  const snap = await col
50
- .where("userId", "==", userId)
51
+ .where(SUPPORT_TICKET_FIELDS.USER_ID, "==", userId)
51
52
  .where("orderId", "==", orderId)
52
- .where("status", "in", ACTIVE_TICKET_STATUSES)
53
+ .where(SUPPORT_TICKET_FIELDS.STATUS, "in", ACTIVE_TICKET_STATUSES)
53
54
  .limit(1)
54
55
  .get();
55
56
  if (snap.empty)
@@ -60,9 +61,9 @@ export class SupportRepository extends BaseRepository {
60
61
  async getActiveCategoryTicket(userId, category) {
61
62
  const col = this.db.collection(SUPPORT_TICKET_COLLECTION);
62
63
  const snap = await col
63
- .where("userId", "==", userId)
64
- .where("category", "==", category)
65
- .where("status", "==", "waiting_on_user")
64
+ .where(SUPPORT_TICKET_FIELDS.USER_ID, "==", userId)
65
+ .where(SUPPORT_TICKET_FIELDS.CATEGORY, "==", category)
66
+ .where(SUPPORT_TICKET_FIELDS.STATUS, "==", "waiting_on_user")
66
67
  .limit(1)
67
68
  .get();
68
69
  if (snap.empty)
@@ -676,6 +676,113 @@ const _adminAuctionsSeedData = [
676
676
  createdAt: new Date("2026-05-05"),
677
677
  updatedAt: new Date("2026-05-21"),
678
678
  },
679
+ // ===== Category-coverage backfill (BGS / CGC / Raw NM / set-specific era tags) =====
680
+ {
681
+ id: "auction-bgs-blue-eyes-sdk",
682
+ slug: "auction-bgs-blue-eyes-sdk",
683
+ title: "Blue-Eyes White Dragon (SDK BGS 9.5)",
684
+ description: "Starter Deck Kaiba Blue-Eyes White Dragon graded BGS 9.5 (Gem Mint).",
685
+ categorySlugs: ["category-graded-cards", "category-bgs-graded", "category-duel-monsters-era"],
686
+ categoryNames: ["Graded Cards", "BGS Slabs", "Duel Monsters Era"],
687
+ brandSlug: "brand-konami",
688
+ brand: "Konami",
689
+ startingBid: 1899900,
690
+ buyItNowPriceInPaise: 3499900,
691
+ currentBid: 2399900,
692
+ currency: "INR",
693
+ auctionEndDate: new Date(Date.now() + 4 * 24 * 60 * 60 * 1000),
694
+ bidCount: 5,
695
+ bidsHaveStarted: true,
696
+ isSold: false,
697
+ mainImage: `https://images.ygoprodeck.com/images/cards/${CARD_IDS.blueEyesWhiteDragon}.jpg`,
698
+ images: [`https://images.ygoprodeck.com/images/cards/${CARD_IDS.blueEyesWhiteDragon}.jpg`],
699
+ status: PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED,
700
+ grading: { service: "BGS", grade: 9.5, certNumber: "BGS-YGO-557788" },
701
+ condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW,
702
+ storeId: "store-kaiba-corp-cards",
703
+ storeName: "Kaiba Corp Card Vault",
704
+ createdAt: new Date("2026-05-20"),
705
+ updatedAt: new Date("2026-05-22"),
706
+ },
707
+ {
708
+ id: "auction-cgc-jinzo-psv",
709
+ slug: "auction-cgc-jinzo-psv",
710
+ title: "Jinzo (PSV 1st Ed CGC 9)",
711
+ description: "Pharaoh's Servant 1st Edition Jinzo graded CGC 9 (Mint).",
712
+ categorySlugs: ["category-graded-cards", "category-cgc-graded", "category-pharaoh-servant", "category-duel-monsters-era"],
713
+ categoryNames: ["Graded Cards", "CGC Slabs", "Pharaoh's Servant", "Duel Monsters Era"],
714
+ brandSlug: "brand-konami",
715
+ brand: "Konami",
716
+ startingBid: 1199900,
717
+ buyItNowPriceInPaise: 2299900,
718
+ currentBid: 1599900,
719
+ currency: "INR",
720
+ auctionEndDate: new Date(Date.now() + 6 * 24 * 60 * 60 * 1000),
721
+ bidCount: 3,
722
+ bidsHaveStarted: true,
723
+ isSold: false,
724
+ mainImage: `https://images.ygoprodeck.com/images/cards/${CARD_IDS.jinzo}.jpg`,
725
+ images: [`https://images.ygoprodeck.com/images/cards/${CARD_IDS.jinzo}.jpg`],
726
+ status: PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED,
727
+ grading: { service: "CGC", grade: 9, certNumber: "CGC-YGO-220033" },
728
+ condition: PRODUCT_FIELDS.CONDITION_VALUES.NEW,
729
+ storeId: "store-kaiba-corp-cards",
730
+ storeName: "Kaiba Corp Card Vault",
731
+ createdAt: new Date("2026-05-19"),
732
+ updatedAt: new Date("2026-05-22"),
733
+ },
734
+ {
735
+ id: "auction-raw-nm-gate-guardian-mrd",
736
+ slug: "auction-raw-nm-gate-guardian-mrd",
737
+ title: "Gate Guardian (MRD 1st Ed, Raw NM)",
738
+ description: "Metal Raiders 1st Edition Gate Guardian, ungraded, certified near-mint by independent reviewer.",
739
+ categorySlugs: ["category-monster-cards", "category-singles", "category-raw-near-mint", "category-metal-raiders", "category-duel-monsters-era"],
740
+ categoryNames: ["Monster Cards", "Singles", "Raw NM", "Metal Raiders", "Duel Monsters Era"],
741
+ brandSlug: "brand-konami",
742
+ brand: "Konami",
743
+ startingBid: 499900,
744
+ buyItNowPriceInPaise: 999900,
745
+ currentBid: 699900,
746
+ currency: "INR",
747
+ auctionEndDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
748
+ bidCount: 2,
749
+ bidsHaveStarted: true,
750
+ isSold: false,
751
+ mainImage: `https://images.ygoprodeck.com/images/cards/${CARD_IDS.gateGuardian}.jpg`,
752
+ images: [`https://images.ygoprodeck.com/images/cards/${CARD_IDS.gateGuardian}.jpg`],
753
+ status: PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED,
754
+ condition: PRODUCT_FIELDS.CONDITION_VALUES.USED,
755
+ storeId: "store-kaiba-corp-cards",
756
+ storeName: "Kaiba Corp Card Vault",
757
+ createdAt: new Date("2026-05-18"),
758
+ updatedAt: new Date("2026-05-22"),
759
+ },
760
+ {
761
+ id: "auction-soi-rainbow-dragon",
762
+ slug: "auction-soi-rainbow-dragon",
763
+ title: "Rainbow Dragon (SOI 1st Ed)",
764
+ description: "Shadow of Infinity 1st Edition Rainbow Dragon. GX-era ultimate beast.",
765
+ categorySlugs: ["category-extra-deck-cards", "category-singles", "category-shadow-of-infinity", "category-gx-era"],
766
+ categoryNames: ["Extra Deck Cards", "Singles", "Shadow of Infinity", "GX Era"],
767
+ brandSlug: "brand-konami",
768
+ brand: "Konami",
769
+ startingBid: 799900,
770
+ buyItNowPriceInPaise: 1599900,
771
+ currentBid: 1099900,
772
+ currency: "INR",
773
+ auctionEndDate: new Date(Date.now() + 9 * 24 * 60 * 60 * 1000),
774
+ bidCount: 4,
775
+ bidsHaveStarted: true,
776
+ isSold: false,
777
+ mainImage: `https://images.ygoprodeck.com/images/cards/${CARD_IDS.rainbowDragon}.jpg`,
778
+ images: [`https://images.ygoprodeck.com/images/cards/${CARD_IDS.rainbowDragon}.jpg`],
779
+ status: PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED,
780
+ condition: PRODUCT_FIELDS.CONDITION_VALUES.USED,
781
+ storeId: "store-kaiba-corp-cards",
782
+ storeName: "Kaiba Corp Card Vault",
783
+ createdAt: new Date("2026-05-17"),
784
+ updatedAt: new Date("2026-05-22"),
785
+ },
679
786
  ];
680
787
  export const productsAuctionsSeedData = [
681
788
  ..._kaibaAuctionsSeedData.map((a) => withTokens({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.8.5",
3
+ "version": "2.8.7",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"