@mohasinac/appkit 3.0.4 → 3.0.6

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 (149) hide show
  1. package/dist/_internal/server/features/auctions/data.d.ts +2 -4
  2. package/dist/_internal/server/features/auctions/data.js +3 -9
  3. package/dist/_internal/server/features/classified/adapters.d.ts +2 -15
  4. package/dist/_internal/server/features/classified/adapters.js +2 -17
  5. package/dist/_internal/server/features/classified/data.d.ts +1 -6
  6. package/dist/_internal/server/features/classified/data.js +2 -10
  7. package/dist/_internal/server/features/digital-code/adapters.d.ts +2 -15
  8. package/dist/_internal/server/features/digital-code/adapters.js +2 -17
  9. package/dist/_internal/server/features/digital-code/data.d.ts +1 -6
  10. package/dist/_internal/server/features/digital-code/data.js +2 -10
  11. package/dist/_internal/server/features/live/adapters.d.ts +2 -15
  12. package/dist/_internal/server/features/live/adapters.js +2 -17
  13. package/dist/_internal/server/features/live/data.d.ts +1 -6
  14. package/dist/_internal/server/features/live/data.js +2 -10
  15. package/dist/_internal/server/features/pre-orders/data.d.ts +2 -4
  16. package/dist/_internal/server/features/pre-orders/data.js +3 -9
  17. package/dist/_internal/server/features/prize-draws/actions.d.ts +2 -0
  18. package/dist/_internal/server/features/prize-draws/actions.js +22 -0
  19. package/dist/_internal/server/features/prize-draws/data.d.ts +1 -17
  20. package/dist/_internal/server/features/prize-draws/data.js +2 -20
  21. package/dist/_internal/server/features/prize-draws/index.d.ts +3 -1
  22. package/dist/_internal/server/features/prize-draws/index.js +2 -0
  23. package/dist/_internal/server/features/prize-draws/service.d.ts +3 -0
  24. package/dist/_internal/server/features/prize-draws/service.js +19 -0
  25. package/dist/_internal/server/features/shared/listing-adapters.d.ts +19 -0
  26. package/dist/_internal/server/features/shared/listing-adapters.js +20 -0
  27. package/dist/_internal/server/features/shared/listing-data-factory.d.ts +9 -0
  28. package/dist/_internal/server/features/shared/listing-data-factory.js +33 -0
  29. package/dist/_internal/server/features/stores/data.d.ts +3 -14
  30. package/dist/_internal/server/features/stores/data.js +6 -44
  31. package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
  32. package/dist/_internal/shared/features/cart/schema.js +3 -0
  33. package/dist/_internal/shared/listing-types/_registry.js +2 -0
  34. package/dist/_internal/shared/listing-types/auction/schema.d.ts +3 -1
  35. package/dist/_internal/shared/listing-types/auction/schema.js +7 -1
  36. package/dist/_internal/shared/listing-types/classified/schema.d.ts +2 -1
  37. package/dist/_internal/shared/listing-types/classified/schema.js +3 -1
  38. package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +3 -1
  39. package/dist/_internal/shared/listing-types/digital-code/schema.js +7 -1
  40. package/dist/_internal/shared/listing-types/live/schema.d.ts +2 -1
  41. package/dist/_internal/shared/listing-types/live/schema.js +3 -1
  42. package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +3 -1
  43. package/dist/_internal/shared/listing-types/pre-order/schema.js +7 -1
  44. package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +3 -1
  45. package/dist/_internal/shared/listing-types/prize-draw/schema.js +13 -1
  46. package/dist/_internal/shared/listing-types/standard/schema.d.ts +2 -1
  47. package/dist/_internal/shared/listing-types/standard/schema.js +4 -1
  48. package/dist/_internal/shared/types/base-document.d.ts +15 -0
  49. package/dist/_internal/shared/types/base-document.js +1 -0
  50. package/dist/_internal/shared/types/index.d.ts +2 -0
  51. package/dist/_internal/shared/types/index.js +1 -0
  52. package/dist/client.d.ts +4 -4
  53. package/dist/client.js +2 -2
  54. package/dist/constants/api-endpoints.d.ts +12 -0
  55. package/dist/constants/api-endpoints.js +4 -0
  56. package/dist/features/addresses/schemas/firestore.d.ts +2 -4
  57. package/dist/features/admin/components/AdminFulfillmentView.d.ts +6 -0
  58. package/dist/features/admin/components/AdminFulfillmentView.js +107 -0
  59. package/dist/features/admin/components/AdminProductEditorView.js +21 -9
  60. package/dist/features/admin/components/AdminProductsView.js +3 -0
  61. package/dist/features/admin/components/DataListingView.d.ts +1 -0
  62. package/dist/features/admin/components/index.d.ts +2 -0
  63. package/dist/features/admin/components/index.js +1 -0
  64. package/dist/features/admin/schemas/firestore.d.ts +3 -8
  65. package/dist/features/auctions/schemas/firestore.d.ts +2 -4
  66. package/dist/features/auctions/schemas/index.d.ts +2 -2
  67. package/dist/features/before-after/schemas/index.d.ts +2 -2
  68. package/dist/features/blog/schemas/firestore.d.ts +2 -4
  69. package/dist/features/blog/schemas/index.d.ts +4 -4
  70. package/dist/features/cart/schemas/firestore.d.ts +2 -4
  71. package/dist/features/categories/schemas/firestore.d.ts +2 -4
  72. package/dist/features/categories/schemas/index.d.ts +4 -4
  73. package/dist/features/events/schemas/firestore.d.ts +2 -4
  74. package/dist/features/events/schemas/index.d.ts +2 -2
  75. package/dist/features/faq/schemas/firestore.d.ts +2 -4
  76. package/dist/features/faq/schemas/index.d.ts +2 -2
  77. package/dist/features/grouped/schemas/index.d.ts +2 -2
  78. package/dist/features/homepage/schemas/firestore.d.ts +4 -12
  79. package/dist/features/homepage/schemas/index.d.ts +2 -2
  80. package/dist/features/messages/schemas/firestore.d.ts +2 -4
  81. package/dist/features/messages/schemas/index.d.ts +2 -2
  82. package/dist/features/orders/repository/orders.repository.d.ts +5 -0
  83. package/dist/features/orders/repository/orders.repository.js +26 -0
  84. package/dist/features/orders/schemas/firestore.d.ts +9 -5
  85. package/dist/features/orders/schemas/firestore.js +3 -0
  86. package/dist/features/payments/schemas/firestore.d.ts +2 -4
  87. package/dist/features/pre-orders/schemas/index.d.ts +2 -2
  88. package/dist/features/products/constants/action-defs.d.ts +16 -0
  89. package/dist/features/products/constants/action-defs.js +16 -0
  90. package/dist/features/products/constants/listing-tabs.d.ts +48 -0
  91. package/dist/features/products/constants/listing-tabs.js +12 -0
  92. package/dist/features/products/repository/products.repository.d.ts +37 -0
  93. package/dist/features/products/repository/products.repository.js +28 -1
  94. package/dist/features/products/schemas/firestore.d.ts +8 -6
  95. package/dist/features/products/schemas/firestore.js +2 -0
  96. package/dist/features/products/schemas/index.d.ts +6 -6
  97. package/dist/features/products/types/index.d.ts +2 -0
  98. package/dist/features/promotions/schemas/firestore.d.ts +2 -4
  99. package/dist/features/promotions/schemas/index.d.ts +4 -4
  100. package/dist/features/reviews/schemas/firestore.d.ts +2 -4
  101. package/dist/features/reviews/schemas/index.d.ts +2 -2
  102. package/dist/features/scams/schemas/firestore.d.ts +2 -4
  103. package/dist/features/scams/schemas/index.d.ts +4 -4
  104. package/dist/features/search/schemas/index.d.ts +2 -2
  105. package/dist/features/seller/components/BarcodeField.d.ts +17 -0
  106. package/dist/features/seller/components/BarcodeField.js +30 -0
  107. package/dist/features/seller/components/FulfillmentView.d.ts +5 -0
  108. package/dist/features/seller/components/FulfillmentView.js +120 -0
  109. package/dist/features/seller/components/PrintCenterView.d.ts +3 -1
  110. package/dist/features/seller/components/PrintCenterView.js +52 -4
  111. package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
  112. package/dist/features/seller/components/SellerProductShell.js +2 -1
  113. package/dist/features/seller/components/index.d.ts +4 -0
  114. package/dist/features/seller/components/index.js +2 -0
  115. package/dist/features/seller/schemas/index.d.ts +2 -2
  116. package/dist/features/store-extensions/schemas/firestore.d.ts +12 -44
  117. package/dist/features/stores/components/StoreClassifiedsListing.d.ts +5 -0
  118. package/dist/features/stores/components/StoreClassifiedsListing.js +48 -0
  119. package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -0
  120. package/dist/features/stores/components/StoreClassifiedsPageView.js +20 -0
  121. package/dist/features/stores/components/StoreDetailLayoutView.js +23 -2
  122. package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +5 -0
  123. package/dist/features/stores/components/StoreDigitalCodesListing.js +48 -0
  124. package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -0
  125. package/dist/features/stores/components/StoreDigitalCodesPageView.js +20 -0
  126. package/dist/features/stores/components/StoreLiveItemsListing.d.ts +5 -0
  127. package/dist/features/stores/components/StoreLiveItemsListing.js +48 -0
  128. package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -0
  129. package/dist/features/stores/components/StoreLiveItemsPageView.js +20 -0
  130. package/dist/features/stores/components/index.d.ts +9 -0
  131. package/dist/features/stores/components/index.js +3 -0
  132. package/dist/features/stores/schemas/firestore.d.ts +2 -4
  133. package/dist/features/stores/schemas/index.d.ts +4 -4
  134. package/dist/features/support/schemas/firestore.d.ts +2 -4
  135. package/dist/features/support/schemas/index.d.ts +2 -2
  136. package/dist/next/routing/route-map.d.ts +11 -0
  137. package/dist/next/routing/route-map.js +5 -0
  138. package/dist/schemas/registry.d.ts +24 -24
  139. package/dist/seed/grouped-listings-seed-data.d.ts +2 -1
  140. package/dist/seed/products-preorders-seed-data.d.ts +2 -1
  141. package/dist/seed/products-standard-seed-data.js +8 -0
  142. package/dist/server-entry.d.ts +3 -0
  143. package/dist/server-entry.js +3 -0
  144. package/dist/server.d.ts +4 -4
  145. package/dist/styles.css +1 -1
  146. package/dist/tailwind-utilities.css +1 -1
  147. package/dist/utils/id-generators.d.ts +8 -0
  148. package/dist/utils/id-generators.js +14 -0
  149. package/package.json +2 -1
@@ -4,9 +4,9 @@
4
4
  */
5
5
  export declare const ADMIN_CHECKOUT_BYPASS_FLAG_KEY: "adminCheckoutBypass";
6
6
  export type NotificationType = "order_placed" | "order_confirmed" | "order_shipped" | "order_delivered" | "order_cancelled" | "bid_placed" | "bid_outbid" | "bid_won" | "bid_lost" | "review_approved" | "review_replied" | "product_available" | "promotion" | "system" | "welcome" | "account_action" | "offer_received" | "offer_responded" | "offer_expired" | "offer_counter_accepted" | "refund_initiated" | "prize_reveal_ready" | "prize_reveal_expired" | "prize_reveal_reminder";
7
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
7
8
  export type NotificationPriority = "low" | "normal" | "high";
8
- export interface NotificationDocument {
9
- id: string;
9
+ export interface NotificationDocument extends BaseDocument {
10
10
  userId: string;
11
11
  type: NotificationType;
12
12
  priority: NotificationPriority;
@@ -19,8 +19,6 @@ export interface NotificationDocument {
19
19
  readAt?: Date;
20
20
  relatedId?: string;
21
21
  relatedType?: "order" | "product" | "bid" | "review" | "blog" | "user" | "offer" | "support_ticket" | "scammer";
22
- createdAt: Date;
23
- updatedAt: Date;
24
22
  }
25
23
  export declare const NOTIFICATIONS_COLLECTION: "notifications";
26
24
  export declare const NOTIFICATIONS_INDEXED_FIELDS: readonly ["userId", "isRead", "createdAt", "type"];
@@ -81,8 +79,7 @@ export declare const notificationQueryHelpers: {
81
79
  readonly unread: (userId: string) => readonly [readonly ["userId", "==", string], readonly ["isRead", "==", false]];
82
80
  readonly byType: (type: NotificationType) => readonly ["type", "==", NotificationType];
83
81
  };
84
- export interface ChatRoomDocument {
85
- id: string;
82
+ export interface ChatRoomDocument extends BaseDocument {
86
83
  buyerId: string;
87
84
  ownerId: string;
88
85
  orderId: string;
@@ -92,8 +89,6 @@ export interface ChatRoomDocument {
92
89
  ownerName: string;
93
90
  lastMessage?: string;
94
91
  lastMessageAt?: Date;
95
- createdAt: Date;
96
- updatedAt: Date;
97
92
  /** UIDs of participants who soft-deleted this room on their side. */
98
93
  deletedBy: string[];
99
94
  /** True for admin-created group chats (> 2 participants). */
@@ -2,6 +2,7 @@
2
2
  * Bids/Auctions Firestore Document Types & Constants
3
3
  */
4
4
  import { type GenerateBidIdInput } from "../../../utils/id-generators";
5
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
5
6
  export type BidStatus = "active" | "outbid" | "won" | "lost" | "cancelled";
6
7
  /** Runtime-accessible bid status values — use instead of bare string literals. */
7
8
  export declare const BidStatusValues: {
@@ -11,8 +12,7 @@ export declare const BidStatusValues: {
11
12
  readonly LOST: "lost";
12
13
  readonly CANCELLED: "cancelled";
13
14
  };
14
- export interface BidDocument {
15
- id: string;
15
+ export interface BidDocument extends BaseDocument {
16
16
  productId: string;
17
17
  productTitle: string;
18
18
  userId: string;
@@ -25,8 +25,6 @@ export interface BidDocument {
25
25
  previousBidAmount?: number;
26
26
  bidDate: Date;
27
27
  autoMaxBid?: number;
28
- createdAt: Date;
29
- updatedAt: Date;
30
28
  }
31
29
  export declare const BID_COLLECTION: "bids";
32
30
  export declare const BID_INDEXED_FIELDS: readonly ["productId", "userId", "status", "isWinning", "bidDate", "createdAt"];
@@ -63,13 +63,13 @@ export declare const auctionItemSchema: z.ZodObject<{
63
63
  featured: boolean;
64
64
  listingType: "auction";
65
65
  createdAt: string;
66
- id: string;
67
66
  title: string;
68
67
  slug: string;
69
68
  price: number;
70
69
  auctionEndDate: string;
71
70
  startingBid: number;
72
71
  bidCount: number;
72
+ id: string;
73
73
  updatedAt: string;
74
74
  sellerId: string;
75
75
  storeId?: string | undefined;
@@ -92,13 +92,13 @@ export declare const auctionItemSchema: z.ZodObject<{
92
92
  featured: boolean;
93
93
  listingType: "auction";
94
94
  createdAt: string;
95
- id: string;
96
95
  title: string;
97
96
  slug: string;
98
97
  price: number;
99
98
  auctionEndDate: string;
100
99
  startingBid: number;
101
100
  bidCount: number;
101
+ id: string;
102
102
  updatedAt: string;
103
103
  sellerId: string;
104
104
  storeId?: string | undefined;
@@ -22,8 +22,8 @@ export declare const beforeAfterItemSchema: z.ZodObject<{
22
22
  sortOrder: z.ZodDefault<z.ZodNumber>;
23
23
  createdAt: z.ZodOptional<z.ZodString>;
24
24
  }, "strip", z.ZodTypeAny, {
25
- id: string;
26
25
  title: string;
26
+ id: string;
27
27
  sortOrder: number;
28
28
  isActive: boolean;
29
29
  createdAt?: string | undefined;
@@ -34,8 +34,8 @@ export declare const beforeAfterItemSchema: z.ZodObject<{
34
34
  afterImageUrl?: string | undefined;
35
35
  durationWeeks?: number | undefined;
36
36
  }, {
37
- id: string;
38
37
  title: string;
38
+ id: string;
39
39
  createdAt?: string | undefined;
40
40
  description?: string | undefined;
41
41
  sortOrder?: number | undefined;
@@ -3,14 +3,14 @@
3
3
  */
4
4
  import type { MediaFieldInput, MediaField } from "../../media/types";
5
5
  import type { BlogPostStatus, BlogPostCategory } from "../types";
6
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
6
7
  /** Runtime-accessible blog post status values — use instead of bare string literals. */
7
8
  export declare const BlogPostStatusValues: {
8
9
  readonly DRAFT: BlogPostStatus;
9
10
  readonly PUBLISHED: BlogPostStatus;
10
11
  readonly ARCHIVED: BlogPostStatus;
11
12
  };
12
- export interface BlogPostDocument {
13
- id: string;
13
+ export interface BlogPostDocument extends BaseDocument {
14
14
  title: string;
15
15
  slug: string;
16
16
  excerpt: string;
@@ -30,8 +30,6 @@ export interface BlogPostDocument {
30
30
  views: number;
31
31
  metaTitle?: string;
32
32
  metaDescription?: string;
33
- createdAt: Date;
34
- updatedAt: Date;
35
33
  }
36
34
  export declare const BLOG_POSTS_COLLECTION: "blogPosts";
37
35
  export declare const BLOG_POSTS_INDEXED_FIELDS: readonly ["status", "publishedAt", "isFeatured", "category", "slug"];
@@ -111,10 +111,10 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
111
111
  createdAt: string | Date | z.objectOutputType<{
112
112
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
113
113
  }, z.ZodTypeAny, "passthrough">;
114
- id: string;
115
114
  title: string;
116
115
  slug: string;
117
116
  tags: string[];
117
+ id: string;
118
118
  updatedAt: string | Date | z.objectOutputType<{
119
119
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
120
120
  }, z.ZodTypeAny, "passthrough">;
@@ -161,10 +161,10 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
161
161
  createdAt: string | Date | z.objectInputType<{
162
162
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
163
163
  }, z.ZodTypeAny, "passthrough">;
164
- id: string;
165
164
  title: string;
166
165
  slug: string;
167
166
  tags: string[];
167
+ id: string;
168
168
  updatedAt: string | Date | z.objectInputType<{
169
169
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
170
170
  }, z.ZodTypeAny, "passthrough">;
@@ -331,9 +331,9 @@ export declare const blogPostSchema: z.ZodObject<{
331
331
  }, "strip", z.ZodTypeAny, {
332
332
  status: "draft" | "published" | "archived";
333
333
  category: "news" | "tips" | "guides" | "updates" | "community";
334
- id: string;
335
334
  title: string;
336
335
  slug: string;
336
+ id: string;
337
337
  coverImage: {
338
338
  url: string;
339
339
  type: "image" | "video" | "file";
@@ -378,9 +378,9 @@ export declare const blogPostSchema: z.ZodObject<{
378
378
  }, {
379
379
  status: "draft" | "published" | "archived";
380
380
  category: "news" | "tips" | "guides" | "updates" | "community";
381
- id: string;
382
381
  title: string;
383
382
  slug: string;
383
+ id: string;
384
384
  createdAt?: string | undefined;
385
385
  tags?: string[] | undefined;
386
386
  updatedAt?: string | undefined;
@@ -4,6 +4,7 @@
4
4
  * Canonical Firestore document interfaces, collection names, field constants
5
5
  * for the cart feature.
6
6
  */
7
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
7
8
  export interface CartItemDocument {
8
9
  itemId: string;
9
10
  productId: string;
@@ -66,16 +67,13 @@ export interface CartAppliedCoupon {
66
67
  /** Mirrors CouponDocument.restrictions.combineWithSellerCoupons — used for conflict detection when adding future coupons */
67
68
  combineWithSellerCoupons?: boolean;
68
69
  }
69
- export interface CartDocument {
70
- id: string;
70
+ export interface CartDocument extends BaseDocument {
71
71
  userId: string;
72
72
  items: CartItemDocument[];
73
73
  /** Multiple coupons/deals applied at cart level */
74
74
  appliedCoupons?: CartAppliedCoupon[];
75
75
  /** Item IDs the user has selected for the next checkout (undefined = all items) */
76
76
  selectedItemIds?: string[];
77
- createdAt: Date;
78
- updatedAt: Date;
79
77
  }
80
78
  export declare const CART_COLLECTION: "carts";
81
79
  export declare const CART_INDEXED_FIELDS: string[];
@@ -5,6 +5,7 @@
5
5
  * and hierarchy helpers for the categories feature.
6
6
  */
7
7
  import type { CategoryAncestor, CategoryMetrics, CategoryDisplay } from "../types";
8
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
8
9
  export type { CategoryAncestor, CategoryMetrics };
9
10
  /**
10
11
  * How a bundle resolves its member products.
@@ -77,8 +78,7 @@ export interface CategoryDocumentMetrics {
77
78
  totalItemCount: number;
78
79
  lastUpdated: Date;
79
80
  }
80
- export interface CategoryDocument {
81
- id: string;
81
+ export interface CategoryDocument extends BaseDocument {
82
82
  name: string;
83
83
  slug: string;
84
84
  description?: string;
@@ -159,8 +159,6 @@ export interface CategoryDocument {
159
159
  createdByStoreId?: string;
160
160
  /** Display name of the store that requested this category. */
161
161
  createdByStoreName?: string;
162
- createdAt: Date;
163
- updatedAt: Date;
164
162
  ancestors: CategoryAncestor[];
165
163
  }
166
164
  export declare const CATEGORIES_COLLECTION: "categories";
@@ -370,8 +370,8 @@ export declare const categoryFirestoreSchema: z.ZodObject<{
370
370
  createdAt: string | Date | z.objectOutputType<{
371
371
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
372
372
  }, z.ZodTypeAny, "passthrough">;
373
- id: string;
374
373
  slug: string;
374
+ id: string;
375
375
  updatedAt: string | Date | z.objectOutputType<{
376
376
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
377
377
  }, z.ZodTypeAny, "passthrough">;
@@ -464,8 +464,8 @@ export declare const categoryFirestoreSchema: z.ZodObject<{
464
464
  createdAt: string | Date | z.objectInputType<{
465
465
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
466
466
  }, z.ZodTypeAny, "passthrough">;
467
- id: string;
468
467
  slug: string;
468
+ id: string;
469
469
  updatedAt: string | Date | z.objectInputType<{
470
470
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
471
471
  }, z.ZodTypeAny, "passthrough">;
@@ -669,8 +669,8 @@ export declare const categoryItemSchema: z.ZodObject<{
669
669
  createdAt: z.ZodOptional<z.ZodString>;
670
670
  updatedAt: z.ZodOptional<z.ZodString>;
671
671
  }, "strip", z.ZodTypeAny, {
672
- id: string;
673
672
  slug: string;
673
+ id: string;
674
674
  name: string;
675
675
  tier: number;
676
676
  type?: "category" | "brand" | "collection" | "concern" | undefined;
@@ -702,8 +702,8 @@ export declare const categoryItemSchema: z.ZodObject<{
702
702
  lastUpdated?: string | undefined;
703
703
  } | undefined;
704
704
  }, {
705
- id: string;
706
705
  slug: string;
706
+ id: string;
707
707
  name: string;
708
708
  tier: number;
709
709
  type?: "category" | "brand" | "collection" | "concern" | undefined;
@@ -3,11 +3,11 @@
3
3
  */
4
4
  import type { MediaField } from "../../media/types";
5
5
  import type { JsonValue } from "@mohasinac/appkit";
6
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
6
7
  import type { EventType, EventStatus, EntryReviewStatus, SaleConfig, OfferConfig, PollConfig, SurveyConfig, FeedbackConfig, RaffleType, SpinPrize } from "../types";
7
8
  export declare const EVENTS_COLLECTION: "events";
8
9
  export declare const EVENT_ENTRIES_COLLECTION: "eventEntries";
9
- export interface EventDocument {
10
- id: string;
10
+ export interface EventDocument extends BaseDocument {
11
11
  slug?: string;
12
12
  type: EventType;
13
13
  title: string;
@@ -48,8 +48,6 @@ export interface EventDocument {
48
48
  flaggedEntries: number;
49
49
  };
50
50
  createdBy: string;
51
- createdAt: Date;
52
- updatedAt: Date;
53
51
  }
54
52
  export interface EventEntryDocument {
55
53
  id: string;
@@ -266,9 +266,9 @@ export declare const eventItemSchema: z.ZodObject<{
266
266
  status: "draft" | "ended" | "active" | "paused";
267
267
  type: "offer" | "feedback" | "sale" | "poll" | "survey";
268
268
  createdAt: string;
269
- id: string;
270
269
  title: string;
271
270
  description: string;
271
+ id: string;
272
272
  updatedAt: string;
273
273
  stats: {
274
274
  totalEntries: number;
@@ -337,9 +337,9 @@ export declare const eventItemSchema: z.ZodObject<{
337
337
  status: "draft" | "ended" | "active" | "paused";
338
338
  type: "offer" | "feedback" | "sale" | "poll" | "survey";
339
339
  createdAt: string;
340
- id: string;
341
340
  title: string;
342
341
  description: string;
342
+ id: string;
343
343
  updatedAt: string;
344
344
  stats: {
345
345
  totalEntries: number;
@@ -3,13 +3,13 @@
3
3
  */
4
4
  import type { FAQCategory, FAQAnswer, FAQStats } from "../types";
5
5
  export type { FAQCategory, FAQAnswer, FAQStats } from "../types";
6
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
6
7
  export interface FAQSEO {
7
8
  slug: string;
8
9
  metaTitle?: string;
9
10
  metaDescription?: string;
10
11
  }
11
- export interface FAQDocument {
12
- id: string;
12
+ export interface FAQDocument extends BaseDocument {
13
13
  question: string;
14
14
  answer: FAQAnswer;
15
15
  category: FAQCategory;
@@ -29,8 +29,6 @@ export interface FAQDocument {
29
29
  seo: FAQSEO;
30
30
  isActive: boolean;
31
31
  createdBy: string;
32
- createdAt: Date;
33
- updatedAt: Date;
34
32
  }
35
33
  export declare const FAQS_COLLECTION: "faqs";
36
34
  export declare const FAQS_INDEXED_FIELDS: readonly ["slug", "seo.slug", "category", "order", "showOnHomepage", "showInFooter", "isPinned", "priority", "tags", "searchTokens", "isActive", "stats.helpful", "createdBy", "createdAt"];
@@ -278,8 +278,8 @@ export declare const faqFirestoreSchema: z.ZodObject<{
278
278
  createdAt: string | Date | z.objectOutputType<{
279
279
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
280
280
  }, z.ZodTypeAny, "passthrough">;
281
- id: string;
282
281
  tags: string[];
282
+ id: string;
283
283
  updatedAt: string | Date | z.objectOutputType<{
284
284
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
285
285
  }, z.ZodTypeAny, "passthrough">;
@@ -317,8 +317,8 @@ export declare const faqFirestoreSchema: z.ZodObject<{
317
317
  createdAt: string | Date | z.objectInputType<{
318
318
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
319
319
  }, z.ZodTypeAny, "passthrough">;
320
- id: string;
321
320
  tags: string[];
321
+ id: string;
322
322
  updatedAt: string | Date | z.objectInputType<{
323
323
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
324
324
  }, z.ZodTypeAny, "passthrough">;
@@ -37,9 +37,9 @@ export declare const groupedListingFirestoreSchema: z.ZodObject<{
37
37
  createdAt: string | Date | z.objectOutputType<{
38
38
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
39
39
  }, z.ZodTypeAny, "passthrough">;
40
- id: string;
41
40
  title: string;
42
41
  slug: string;
42
+ id: string;
43
43
  updatedAt: string | Date | z.objectOutputType<{
44
44
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
45
45
  }, z.ZodTypeAny, "passthrough">;
@@ -60,9 +60,9 @@ export declare const groupedListingFirestoreSchema: z.ZodObject<{
60
60
  createdAt: string | Date | z.objectInputType<{
61
61
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
62
62
  }, z.ZodTypeAny, "passthrough">;
63
- id: string;
64
63
  title: string;
65
64
  slug: string;
65
+ id: string;
66
66
  updatedAt: string | Date | z.objectInputType<{
67
67
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
68
68
  }, z.ZodTypeAny, "passthrough">;
@@ -2,6 +2,7 @@
2
2
  * Homepage Feature Firestore Document Types & Constants
3
3
  * Covers: carousel slides, homepage sections
4
4
  */
5
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
5
6
  /** Unified background for a slide or card — supports image, video, solid color, or gradient. */
6
7
  export interface CarouselBackground {
7
8
  type: "image" | "video" | "color" | "gradient";
@@ -63,14 +64,11 @@ export interface CarouselCard {
63
64
  }
64
65
  export type GridCardCreateInput = Omit<CarouselCard, "id">;
65
66
  /** A named carousel that holds up to MAX_SLIDES_PER_CAROUSEL slide references. */
66
- export interface CarouselDocument {
67
- id: string;
67
+ export interface CarouselDocument extends BaseDocument {
68
68
  name: string;
69
69
  status: "active" | "draft";
70
70
  /** Ordered slide IDs (max MAX_SLIDES_PER_CAROUSEL). */
71
71
  slideIds: string[];
72
- createdAt: Date;
73
- updatedAt: Date;
74
72
  createdBy: string;
75
73
  }
76
74
  export type CarouselCreateInput = Omit<CarouselDocument, "id" | "createdAt" | "updatedAt">;
@@ -78,8 +76,7 @@ export type CarouselUpdateInput = Partial<Pick<CarouselDocument, "name" | "statu
78
76
  export declare class TooManySlidesError extends Error {
79
77
  constructor();
80
78
  }
81
- export interface CarouselSlideDocument {
82
- id: string;
79
+ export interface CarouselSlideDocument extends BaseDocument {
83
80
  /**
84
81
  * Reference to a named CarouselDocument (EX2).
85
82
  * null = default hero carousel (backward-compat with pre-EX2 slides).
@@ -131,8 +128,6 @@ export interface CarouselSlideDocument {
131
128
  views: number;
132
129
  lastViewed?: Date;
133
130
  };
134
- createdAt: Date;
135
- updatedAt: Date;
136
131
  createdBy: string;
137
132
  }
138
133
  export declare const CAROUSEL_SLIDES_COLLECTION: "carouselSlides";
@@ -552,14 +547,11 @@ export interface GoogleReviewsSectionConfig {
552
547
  }
553
548
  export type SectionType = "welcome" | "carousel" | "stats" | "trust-indicators" | "categories" | "brands" | "products" | "pre-orders" | "auctions" | "banner" | "features" | "reviews" | "whatsapp-community" | "faq" | "blog-articles" | "newsletter" | "stores" | "events" | "social-feed" | "custom-cards" | "google-reviews" | "featured-bundles" | "prize-draws" | "event-raffles" | "collection-cards";
554
549
  export type SectionConfig = CarouselSectionConfig | WelcomeSectionConfig | StatsSectionConfig | TrustIndicatorsSectionConfig | CategoriesSectionConfig | BrandsSectionConfig | ProductsSectionConfig | PreOrdersSectionConfig | AuctionsSectionConfig | BannerSectionConfig | FeaturesSectionConfig | ReviewsSectionConfig | WhatsAppCommunitySectionConfig | FAQSectionConfig | BlogArticlesSectionConfig | NewsletterSectionConfig | StoresSectionConfig | EventsSectionConfig | SocialFeedSectionConfig | CustomCardsSectionConfig | GoogleReviewsSectionConfig | FeaturedBundlesSectionConfig | PrizeDrawsSectionConfig | EventRafflesSectionConfig | CollectionCardsSectionConfig;
555
- export interface HomepageSectionDocument {
556
- id: string;
550
+ export interface HomepageSectionDocument extends BaseDocument {
557
551
  type: SectionType;
558
552
  order: number;
559
553
  enabled: boolean;
560
554
  config: SectionConfig;
561
- createdAt: Date;
562
- updatedAt: Date;
563
555
  }
564
556
  export declare const HOMEPAGE_SECTIONS_COLLECTION: "homepageSections";
565
557
  export declare const HOMEPAGE_SECTIONS_INDEXED_FIELDS: readonly ["enabled", "order", "type"];
@@ -713,8 +713,8 @@ export declare const carouselSlideFirestoreSchema: z.ZodObject<{
713
713
  createdAt: string | Date | z.objectOutputType<{
714
714
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
715
715
  }, z.ZodTypeAny, "passthrough">;
716
- id: string;
717
716
  title: string;
717
+ id: string;
718
718
  updatedAt: string | Date | z.objectOutputType<{
719
719
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
720
720
  }, z.ZodTypeAny, "passthrough">;
@@ -822,8 +822,8 @@ export declare const carouselSlideFirestoreSchema: z.ZodObject<{
822
822
  createdAt: string | Date | z.objectInputType<{
823
823
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
824
824
  }, z.ZodTypeAny, "passthrough">;
825
- id: string;
826
825
  title: string;
826
+ id: string;
827
827
  updatedAt: string | Date | z.objectInputType<{
828
828
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
829
829
  }, z.ZodTypeAny, "passthrough">;
@@ -5,6 +5,7 @@
5
5
  * Messages are embedded as an array for seed purposes; production can migrate to
6
6
  * a subcollection when the thread exceeds ~200 messages.
7
7
  */
8
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
8
9
  export interface ConversationMessage {
9
10
  id: string;
10
11
  senderId: string;
@@ -14,8 +15,7 @@ export interface ConversationMessage {
14
15
  sentAt: Date;
15
16
  attachments?: string[];
16
17
  }
17
- export interface ConversationDocument {
18
- id: string;
18
+ export interface ConversationDocument extends BaseDocument {
19
19
  buyerId: string;
20
20
  buyerDisplayName: string;
21
21
  storeId: string;
@@ -29,8 +29,6 @@ export interface ConversationDocument {
29
29
  unreadBuyer: number;
30
30
  unreadSeller: number;
31
31
  status: "active" | "archived" | "blocked";
32
- createdAt: Date;
33
- updatedAt: Date;
34
32
  }
35
33
  export declare const CONVERSATIONS_COLLECTION: "conversations";
36
34
  export declare const CONVERSATIONS_INDEXED_FIELDS: readonly ["buyerId", "storeId", "productId", "status", "lastMessageAt", "createdAt"];
@@ -112,8 +112,8 @@ export declare const conversationFirestoreSchema: z.ZodObject<{
112
112
  createdAt: string | Date | z.objectOutputType<{
113
113
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
114
114
  }, z.ZodTypeAny, "passthrough">;
115
- id: string;
116
115
  storeName: string;
116
+ id: string;
117
117
  updatedAt: string | Date | z.objectOutputType<{
118
118
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
119
119
  }, z.ZodTypeAny, "passthrough">;
@@ -145,8 +145,8 @@ export declare const conversationFirestoreSchema: z.ZodObject<{
145
145
  createdAt: string | Date | z.objectInputType<{
146
146
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
147
147
  }, z.ZodTypeAny, "passthrough">;
148
- id: string;
149
148
  storeName: string;
149
+ id: string;
150
150
  updatedAt: string | Date | z.objectInputType<{
151
151
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
152
152
  }, z.ZodTypeAny, "passthrough">;
@@ -15,6 +15,11 @@ declare class OrderRepository extends BaseRepository<OrderDocument> {
15
15
  findConfirmed(): Promise<OrderDocument[]>;
16
16
  findPending(): Promise<OrderDocument[]>;
17
17
  updateStatus(orderId: string, status: OrderStatus, additionalData?: Partial<OrderDocument>): Promise<OrderDocument>;
18
+ assignWorker(orderId: string, workerId: string): Promise<OrderDocument>;
19
+ unassignWorker(orderId: string): Promise<OrderDocument>;
20
+ markPicked(orderId: string): Promise<OrderDocument>;
21
+ markPacked(orderId: string): Promise<OrderDocument>;
22
+ findFulfillmentQueue(storeId: string): Promise<OrderDocument[]>;
18
23
  updatePaymentStatus(orderId: string, paymentStatus: PaymentStatus, paymentId?: string): Promise<OrderDocument>;
19
24
  cancelOrder(orderId: string, reason: string, refundAmount?: number): Promise<OrderDocument>;
20
25
  findRecentByUser(userId: string): Promise<OrderDocument[]>;
@@ -71,6 +71,32 @@ class OrderRepository extends BaseRepository {
71
71
  updatedAt: new Date(),
72
72
  });
73
73
  }
74
+ async assignWorker(orderId, workerId) {
75
+ return this.update(orderId, { assignedWorkerId: workerId, updatedAt: new Date() });
76
+ }
77
+ async unassignWorker(orderId) {
78
+ return this.update(orderId, { assignedWorkerId: undefined, updatedAt: new Date() });
79
+ }
80
+ async markPicked(orderId) {
81
+ const order = await this.findById(orderId);
82
+ if (!order)
83
+ throw new NotFoundError(`Order ${orderId} not found`);
84
+ const nextStatus = order.status === "confirmed" ? "processing" : order.status;
85
+ return this.update(orderId, { pickedAt: new Date(), status: nextStatus, updatedAt: new Date() });
86
+ }
87
+ async markPacked(orderId) {
88
+ return this.update(orderId, { packedAt: new Date(), updatedAt: new Date() });
89
+ }
90
+ async findFulfillmentQueue(storeId) {
91
+ const snap = await this.db
92
+ .collection(this.collection)
93
+ .where(ORDER_FIELDS.STORE_ID, "==", storeId)
94
+ .where(ORDER_FIELDS.STATUS, "in", ["confirmed", "processing"])
95
+ .orderBy(ORDER_FIELDS.CREATED_AT, "asc")
96
+ .limit(200)
97
+ .get();
98
+ return snap.docs.map((doc) => this.decryptOrder({ id: doc.id, ...doc.data() }));
99
+ }
74
100
  async updatePaymentStatus(orderId, paymentStatus, paymentId) {
75
101
  return this.update(orderId, {
76
102
  paymentStatus,
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import type { OrderStatus, PaymentStatus } from "../types";
5
5
  import type { OrderType } from "../utils/order-splitter";
6
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
6
7
  export type ShippingMethod = "custom" | "shiprocket";
7
8
  export type RefundType = "full" | "partial";
8
9
  export type OrderPayoutStatus = "eligible" | "requested" | "paid";
@@ -99,8 +100,7 @@ export interface AppliedOrderDiscount {
99
100
  scope?: "admin" | "seller";
100
101
  storeId?: string;
101
102
  }
102
- export interface OrderDocument {
103
- id: string;
103
+ export interface OrderDocument extends BaseDocument {
104
104
  productId: string;
105
105
  productTitle: string;
106
106
  userId: string;
@@ -203,11 +203,15 @@ export interface OrderDocument {
203
203
  shelf: string;
204
204
  bin: string;
205
205
  };
206
- createdAt: Date;
207
- updatedAt: Date;
206
+ /** UID of the employee or seller assigned to fulfil this order. */
207
+ assignedWorkerId?: string;
208
+ /** Timestamp when all items in this order were physically confirmed picked. */
209
+ pickedAt?: Date;
210
+ /** Timestamp when the order was packed and ready for courier handoff. */
211
+ packedAt?: Date;
208
212
  }
209
213
  export declare const ORDER_COLLECTION: "orders";
210
- export declare const ORDER_INDEXED_FIELDS: readonly ["userId", "productId", "storeId", "status", "paymentStatus", "payoutStatus", "shippingMethod", "orderDate", "createdAt"];
214
+ export declare const ORDER_INDEXED_FIELDS: readonly ["userId", "productId", "storeId", "status", "paymentStatus", "payoutStatus", "shippingMethod", "orderDate", "createdAt", "assignedWorkerId", "pickedAt", "packedAt"];
211
215
  export declare const DEFAULT_ORDER_DATA: Partial<OrderDocument>;
212
216
  export declare const ORDER_PUBLIC_FIELDS: readonly ["id", "productId", "productTitle", "quantity", "unitPrice", "totalPrice", "currency", "status", "paymentStatus", "shippingAddress", "trackingNumber", "notes", "orderDate", "shippingDate", "deliveryDate", "createdAt"];
213
217
  export declare const ORDER_UPDATABLE_FIELDS: readonly ["notes", "shippingAddress"];
@@ -54,6 +54,9 @@ export const ORDER_INDEXED_FIELDS = [
54
54
  "shippingMethod",
55
55
  "orderDate",
56
56
  "createdAt",
57
+ "assignedWorkerId",
58
+ "pickedAt",
59
+ "packedAt",
57
60
  ];
58
61
  export const DEFAULT_ORDER_DATA = {
59
62
  status: "pending",
@@ -2,6 +2,7 @@
2
2
  * Payouts Firestore Document Types & Constants
3
3
  */
4
4
  import { type GeneratePayoutIdInput } from "../../../utils/id-generators";
5
+ import type { BaseDocument } from "../../../_internal/shared/types/base-document";
5
6
  export interface PayoutBankAccount {
6
7
  accountHolderName: string;
7
8
  accountNumberMasked: string;
@@ -32,8 +33,7 @@ export declare const PayoutStatusValues: {
32
33
  readonly FAILED: "failed";
33
34
  };
34
35
  export type PayoutPaymentMethod = "bank_transfer" | "upi";
35
- export interface PayoutDocument {
36
- id: string;
36
+ export interface PayoutDocument extends BaseDocument {
37
37
  storeId: string;
38
38
  sellerName: string;
39
39
  sellerEmail: string;
@@ -66,8 +66,6 @@ export interface PayoutDocument {
66
66
  netAmount?: number;
67
67
  requestedAt: Date;
68
68
  processedAt?: Date;
69
- createdAt: Date;
70
- updatedAt: Date;
71
69
  }
72
70
  export declare const PAYOUT_COLLECTION: "payouts";
73
71
  export declare const PAYOUT_INDEXED_FIELDS: readonly ["storeId", "status", "requestedAt", "createdAt"];