@mohasinac/appkit 4.1.1 → 4.2.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.
Files changed (225) hide show
  1. package/dist/_internal/client/features/maintenance/index.d.ts +2 -0
  2. package/dist/_internal/client/features/maintenance/index.js +1 -0
  3. package/dist/_internal/client/features/maintenance/views/CloudLogsListView.d.ts +9 -0
  4. package/dist/_internal/client/features/maintenance/views/CloudLogsListView.js +55 -0
  5. package/dist/_internal/server/features/auctions/index.d.ts +1 -1
  6. package/dist/_internal/server/features/auctions/index.js +1 -1
  7. package/dist/_internal/server/features/auctions/service.js +2 -2
  8. package/dist/_internal/server/features/checkout/actions.d.ts +15 -0
  9. package/dist/_internal/server/features/checkout/actions.js +245 -182
  10. package/dist/_internal/server/features/maintenance/cloud-logs-data.d.ts +50 -0
  11. package/dist/_internal/server/features/maintenance/cloud-logs-data.js +152 -0
  12. package/dist/_internal/server/functions/scheduled.d.ts +2 -1
  13. package/dist/_internal/server/functions/scheduled.js +9 -1
  14. package/dist/_internal/server/jobs/core/jobRunners.js +10 -0
  15. package/dist/_internal/server/jobs/core/newsletterExport.d.ts +15 -0
  16. package/dist/_internal/server/jobs/core/newsletterExport.js +43 -0
  17. package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +4 -12
  18. package/dist/_internal/server/jobs/core/onOrderCreate.js +3 -3
  19. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +2 -0
  20. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +1 -0
  21. package/dist/_internal/server/jobs/core/onProductWrite.js +14 -2
  22. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +1 -0
  23. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +1 -0
  24. package/dist/_internal/server/jobs/core/revenueRollup.d.ts +13 -0
  25. package/dist/_internal/server/jobs/core/revenueRollup.js +22 -0
  26. package/dist/_internal/server/jobs/core/whatsappNotify.d.ts +35 -0
  27. package/dist/_internal/server/jobs/core/whatsappNotify.js +82 -0
  28. package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
  29. package/dist/_internal/server/jobs/handlers/index.js +1 -0
  30. package/dist/_internal/server/jobs/handlers/revenueRollup.d.ts +2 -0
  31. package/dist/_internal/server/jobs/handlers/revenueRollup.js +2 -0
  32. package/dist/_internal/shared/features/auctions/config.d.ts +1 -1
  33. package/dist/_internal/shared/features/auctions/config.js +1 -1
  34. package/dist/_internal/shared/features/auctions/schema.js +1 -1
  35. package/dist/_internal/shared/features/cart/schema.js +2 -2
  36. package/dist/_internal/shared/features/checkout/config.d.ts +7 -0
  37. package/dist/_internal/shared/features/checkout/config.js +7 -0
  38. package/dist/_internal/shared/features/events/schema.js +1 -1
  39. package/dist/_internal/shared/features/orders/schema.js +1 -1
  40. package/dist/_internal/shared/features/products/schema.js +3 -3
  41. package/dist/_internal/shared/features/promotions/schema.js +3 -3
  42. package/dist/_internal/shared/fees/calculator.d.ts +32 -7
  43. package/dist/_internal/shared/fees/calculator.js +25 -0
  44. package/dist/client.d.ts +4 -4
  45. package/dist/client.js +4 -2
  46. package/dist/constants/api-endpoints.d.ts +9 -6
  47. package/dist/constants/api-endpoints.js +3 -2
  48. package/dist/contracts/client-payment-gateway.d.ts +1 -2
  49. package/dist/features/about/components/AboutView.d.ts +6 -16
  50. package/dist/features/about/components/AboutView.js +3 -3
  51. package/dist/features/about/components/FeesView.js +18 -0
  52. package/dist/features/about/index.d.ts +2 -1
  53. package/dist/features/about/schemas/firestore.d.ts +47 -0
  54. package/dist/features/about/schemas/firestore.js +6 -0
  55. package/dist/features/about/schemas/index.d.ts +210 -0
  56. package/dist/features/about/schemas/index.js +45 -0
  57. package/dist/features/account/hooks/useProfile.js +3 -0
  58. package/dist/features/admin/actions/notification-actions.d.ts +4 -1
  59. package/dist/features/admin/actions/notification-actions.js +56 -10
  60. package/dist/features/admin/components/AdminAdsView.js +1 -1
  61. package/dist/features/admin/components/AdminCarouselGroupEditorView.d.ts +6 -0
  62. package/dist/features/admin/components/AdminCarouselGroupEditorView.js +50 -0
  63. package/dist/features/admin/components/AdminCartsView.js +16 -3
  64. package/dist/features/admin/components/AdminCouponEditorView.js +2 -2
  65. package/dist/features/admin/components/AdminCouponsView.js +14 -4
  66. package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -42
  67. package/dist/features/admin/components/AdminMediaView.js +1 -1
  68. package/dist/features/admin/components/AdminNewsletterView.js +42 -11
  69. package/dist/features/admin/components/AdminNotificationsView.js +31 -19
  70. package/dist/features/admin/components/AdminOrdersView.js +7 -0
  71. package/dist/features/admin/components/AdminPayoutsView.js +18 -3
  72. package/dist/features/admin/components/AdminProductsView.js +17 -2
  73. package/dist/features/admin/components/AdminReviewsView.js +16 -2
  74. package/dist/features/admin/components/AdminScammersView.js +7 -0
  75. package/dist/features/admin/components/AdminSectionsView.js +4 -0
  76. package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
  77. package/dist/features/admin/components/AdminSiteSettingsView.js +127 -8
  78. package/dist/features/admin/components/AdminStoreEditorView.d.ts +2 -1
  79. package/dist/features/admin/components/AdminStoreEditorView.js +4 -4
  80. package/dist/features/admin/components/AdminStoresView.js +1 -1
  81. package/dist/features/admin/components/AdminSupportTicketDetailView.js +23 -5
  82. package/dist/features/admin/components/AdminSupportTicketsView.js +20 -2
  83. package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +4 -1
  84. package/dist/features/admin/components/AdminTesterChecklistView.js +8 -0
  85. package/dist/features/admin/components/index.d.ts +2 -0
  86. package/dist/features/admin/components/index.js +1 -0
  87. package/dist/features/admin/constants/filter-tabs.d.ts +55 -41
  88. package/dist/features/admin/constants/filter-tabs.js +55 -27
  89. package/dist/features/admin/repository/analytics-rollup.repository.d.ts +25 -0
  90. package/dist/features/admin/repository/analytics-rollup.repository.js +31 -0
  91. package/dist/features/admin/repository/site-settings.repository.js +8 -1
  92. package/dist/features/admin/schemas/firestore.d.ts +46 -0
  93. package/dist/features/admin/schemas/firestore.js +62 -24
  94. package/dist/features/auctions/actions/bid-actions.js +1 -1
  95. package/dist/features/auctions/components/AuctionDetailPageView.js +2 -2
  96. package/dist/features/auctions/components/AuctionsListView.js +8 -1
  97. package/dist/features/auth/components/LoginForm.js +2 -2
  98. package/dist/features/auth/components/RegisterForm.js +2 -2
  99. package/dist/features/auth/permissions/constants.d.ts +16 -0
  100. package/dist/features/auth/permissions/constants.js +53 -0
  101. package/dist/features/auth/schemas/firestore.js +1 -0
  102. package/dist/features/blog/components/BlogFilters.js +1 -1
  103. package/dist/features/cart/schemas/firestore.d.ts +1 -1
  104. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  105. package/dist/features/consultation/components/ConsultationForm.js +1 -1
  106. package/dist/features/events/components/EventFilters.js +2 -0
  107. package/dist/features/homepage/components/WelcomeSection.js +2 -2
  108. package/dist/features/layout/BackToTop.d.ts +9 -5
  109. package/dist/features/layout/BackToTop.js +17 -21
  110. package/dist/features/layout/TitleBarLayout.d.ts +2 -2
  111. package/dist/features/layout/TitleBarLayout.js +4 -4
  112. package/dist/features/media/AvatarUpload.js +7 -3
  113. package/dist/features/media/MediaVideo.js +1 -1
  114. package/dist/features/media/finalize.d.ts +9 -13
  115. package/dist/features/media/finalize.js +23 -74
  116. package/dist/features/media/server.d.ts +1 -1
  117. package/dist/features/media/server.js +1 -1
  118. package/dist/features/orders/actions/refund-actions.js +1 -0
  119. package/dist/features/orders/hooks/useOrders.js +16 -4
  120. package/dist/features/orders/schemas/firestore.d.ts +19 -5
  121. package/dist/features/payments/schemas/firestore.d.ts +2 -2
  122. package/dist/features/pre-orders/components/PreOrdersListView.js +7 -0
  123. package/dist/features/products/components/ArtStickersListView.js +5 -0
  124. package/dist/features/products/components/ProductDetailPageView.d.ts +7 -1
  125. package/dist/features/products/components/ProductForm.js +14 -1
  126. package/dist/features/products/components/ProductsIndexPageView.js +7 -0
  127. package/dist/features/products/constants/action-defs.d.ts +29 -3
  128. package/dist/features/products/constants/action-defs.js +77 -1
  129. package/dist/features/products/schemas/firestore.d.ts +1 -1
  130. package/dist/features/products/schemas/product-templates.d.ts +1 -1
  131. package/dist/features/products/types/index.d.ts +4 -0
  132. package/dist/features/scams/schemas/index.js +2 -2
  133. package/dist/features/search/components/Search.js +3 -3
  134. package/dist/features/seller/components/SellerAuctionsView.js +27 -2
  135. package/dist/features/seller/components/SellerOrdersView.js +2 -2
  136. package/dist/features/seller/components/SellerPayoutsView.js +24 -10
  137. package/dist/features/seller/components/SellerPreOrdersView.js +12 -4
  138. package/dist/features/seller/components/SellerPrizeDrawsView.js +23 -5
  139. package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
  140. package/dist/features/seller/components/SellerProductShell.js +1 -1
  141. package/dist/features/seller/components/SellerProductsView.js +8 -6
  142. package/dist/features/seller/components/SellerReviewsView.js +27 -6
  143. package/dist/features/seller/components/index.d.ts +0 -2
  144. package/dist/features/seller/components/index.js +0 -1
  145. package/dist/features/stores/components/StoreListingsGuideView.js +2 -1
  146. package/dist/features/stores/components/StoreProductsView.js +1 -1
  147. package/dist/features/stores/schemas/firestore.d.ts +11 -0
  148. package/dist/features/stores/schemas/firestore.js +5 -0
  149. package/dist/features/stores/schemas/index.d.ts +2 -2
  150. package/dist/features/tester/actions/checklist-item-actions.d.ts +6 -0
  151. package/dist/features/tester/actions/checklist-item-actions.js +2 -0
  152. package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +13 -2
  153. package/dist/features/tester/components/AdminTesterFeedbackListView.js +2 -1
  154. package/dist/features/tester/components/AdminTesterFeedbackReportView.js +9 -5
  155. package/dist/features/tester/components/TesterHubView.js +34 -21
  156. package/dist/features/tester/repository/tester-checklist-item.repository.js +1 -0
  157. package/dist/features/tester/repository/tester-checklist-response.repository.d.ts +18 -4
  158. package/dist/features/tester/repository/tester-checklist-response.repository.js +43 -8
  159. package/dist/features/tester/schemas/firestore.d.ts +8 -3
  160. package/dist/features/tester/schemas/firestore.js +6 -0
  161. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +21 -9
  162. package/dist/features/tester/utils/phases.d.ts +31 -0
  163. package/dist/features/tester/utils/phases.js +46 -0
  164. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +1 -1
  165. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +10 -1
  166. package/dist/features/whatsapp-bot/helpers/whatsapp.js +47 -0
  167. package/dist/features/whatsapp-bot/types/index.d.ts +20 -1
  168. package/dist/features/wishlist/types/index.d.ts +3 -0
  169. package/dist/index.d.ts +15 -6
  170. package/dist/index.js +19 -9
  171. package/dist/next/components/NotFoundView.js +2 -1
  172. package/dist/next/routing/route-map.d.ts +6 -12
  173. package/dist/next/routing/route-map.js +3 -4
  174. package/dist/providers/db-firebase/admin.d.ts +1 -0
  175. package/dist/providers/db-firebase/admin.js +1 -1
  176. package/dist/repositories/index.d.ts +2 -0
  177. package/dist/repositories/index.js +1 -0
  178. package/dist/schemas/registry.d.ts +2 -2
  179. package/dist/seed/addresses-seed-data.js +18 -18
  180. package/dist/seed/bids-seed-data.js +4 -4
  181. package/dist/seed/blog-posts-seed-data.js +82 -82
  182. package/dist/seed/carousel-slides-seed-data.js +14 -10
  183. package/dist/seed/carousels-seed-data.js +3 -3
  184. package/dist/seed/cart-seed-data.js +92 -92
  185. package/dist/seed/claimed-coupons-seed-data.js +10 -10
  186. package/dist/seed/conversations-seed-data.js +75 -75
  187. package/dist/seed/coupon-usage-seed-data.js +12 -12
  188. package/dist/seed/coupons-seed-data.js +41 -41
  189. package/dist/seed/events-seed-data.js +105 -105
  190. package/dist/seed/grouped-listings-seed-data.d.ts +2 -137
  191. package/dist/seed/grouped-listings-seed-data.js +79 -143
  192. package/dist/seed/history-seed-data.js +38 -38
  193. package/dist/seed/homepage-sections-seed-data.js +9 -9
  194. package/dist/seed/notifications-seed-data.js +56 -56
  195. package/dist/seed/offers-seed-data.js +91 -91
  196. package/dist/seed/orders-seed-data.js +121 -106
  197. package/dist/seed/payouts-seed-data.js +42 -42
  198. package/dist/seed/products-auctions-seed-data.js +10 -2
  199. package/dist/seed/products-standard-seed-data.js +40 -8
  200. package/dist/seed/reviews-seed-data.js +42 -23
  201. package/dist/seed/scammers-seed-data.js +22 -22
  202. package/dist/seed/sessions-seed-data.js +7 -7
  203. package/dist/seed/shipments-seed-data.js +10 -10
  204. package/dist/seed/site-settings-seed-data.js +89 -0
  205. package/dist/seed/store-addresses-seed-data.js +2 -2
  206. package/dist/seed/store-extensions-seed-data.js +93 -93
  207. package/dist/seed/stores-seed-data.js +2 -0
  208. package/dist/seed/support-tickets-seed-data.js +47 -47
  209. package/dist/seed/users-seed-data.js +55 -89
  210. package/dist/seed/wishlists-seed-data.js +22 -22
  211. package/dist/server.d.ts +4 -3
  212. package/dist/server.js +7 -7
  213. package/dist/styles.css +1 -1
  214. package/dist/tailwind-utilities.css +1 -1
  215. package/dist/ui/components/PageLoader.js +8 -3
  216. package/dist/ui/components/Select.d.ts +8 -1
  217. package/dist/ui/components/Select.js +2 -2
  218. package/dist/ui/components/SiteMark.d.ts +23 -0
  219. package/dist/ui/components/SiteMark.js +76 -0
  220. package/dist/ui/index.d.ts +2 -0
  221. package/dist/ui/index.js +1 -0
  222. package/dist/validation/schemas.d.ts +0 -2
  223. package/dist/validation/schemas.js +0 -2
  224. package/package.json +1 -1
  225. package/scripts/seed-cli.mjs +17 -15
@@ -17,6 +17,7 @@
17
17
  * @tag consumers:seed/index.ts,seed/runner.ts
18
18
  * @tag sideEffects:none
19
19
  */
20
+ import { assignDefaultPhases } from "../utils/phases";
20
21
  function group(groupKey, groupLabel, pages, opts) {
21
22
  const items = [];
22
23
  pages.forEach((page, pageIdx) => {
@@ -38,17 +39,23 @@ function group(groupKey, groupLabel, pages, opts) {
38
39
  });
39
40
  return items;
40
41
  }
41
- export const testerChecklistSeedData = [
42
+ /**
43
+ * Array order below IS the intended catalog order (groups concatenated via
44
+ * spread, in authoring order) — `assignDefaultPhases` walks it directly
45
+ * rather than sorting by `order`, since `order` restarts at 0 within each
46
+ * group and is not globally unique across groups.
47
+ */
48
+ const rawTesterChecklistItems = [
42
49
  ...group("account-auth", "Account & Auth", [
43
50
  {
44
51
  pageKey: "signup-login",
45
52
  pageLabel: "Signup & Login",
46
53
  cases: [
47
- { key: "email-signup", label: "Sign up with email works", href: "/register" },
48
- { key: "google-oauth", label: "Sign up / log in with Google works", href: "/login" },
54
+ { key: "email-signup", label: "Sign up with email works", href: "/auth/register" },
55
+ { key: "google-oauth", label: "Sign up / log in with Google works", href: "/auth/login" },
49
56
  { key: "google-link-existing", label: "Linking Google sign-in to an existing email/password account works" },
50
57
  { key: "google-popup-blocked-fallback", label: "If the Google sign-in popup is blocked, the fallback (RTDB signal + postMessage) still completes sign-in" },
51
- { key: "login", label: "Log in with email + password works", href: "/login" },
58
+ { key: "login", label: "Log in with email + password works", href: "/auth/login" },
52
59
  { key: "logout", label: "Log out works and clears the session" },
53
60
  { key: "email-verify", label: "Email verification link works" },
54
61
  { key: "password-reset", label: "Forgot-password / reset-password flow works" },
@@ -110,7 +117,7 @@ export const testerChecklistSeedData = [
110
117
  { key: "add-to-cart", label: "Add to cart works from the product page" },
111
118
  { key: "add-to-cart-out-of-stock", label: "Add to cart is disabled/blocked once a listing's stock reaches zero" },
112
119
  { key: "add-to-cart-max-quantity", label: "Increasing quantity in the cart is capped at the listing's available stock, with a clear message" },
113
- { key: "checkout-flow", label: "Checkout flow completes without errors", href: "/cart" },
120
+ { key: "checkout-flow", label: "Checkout flow completes without errors", href: "/checkout" },
114
121
  { key: "checkout-order-review", label: "The order-review step before payment shows correct items, quantities, addresses, and totals" },
115
122
  { key: "checkout-multi-seller-split", label: "A cart with items from multiple sellers correctly splits into separate orders at checkout" },
116
123
  { key: "shipping-address", label: "Selecting/adding a shipping address works" },
@@ -147,7 +154,7 @@ export const testerChecklistSeedData = [
147
154
  pageKey: "wishlist-history",
148
155
  pageLabel: "Wishlist & History",
149
156
  cases: [
150
- { key: "add-wishlist-pdp", label: "Adding a product to the wishlist from the product detail page works", href: "/user/wishlist" },
157
+ { key: "add-wishlist-pdp", label: "Adding a product to the wishlist from the product detail page works", href: "/wishlist" },
151
158
  { key: "add-wishlist-card", label: "Adding a product to the wishlist from a listing card (checkbox/long-press) works on both listing and search pages" },
152
159
  { key: "remove-wishlist", label: "Removing a product from the wishlist works" },
153
160
  { key: "wishlist-persists-guest-to-login", label: "Wishlist items added as a guest are preserved after logging in" },
@@ -156,7 +163,7 @@ export const testerChecklistSeedData = [
156
163
  { key: "wishlist-across-listing-types", label: "Auctions and pre-orders (not just standard products) can be added to and viewed correctly in the wishlist" },
157
164
  { key: "wishlist-price-drop-accuracy", label: "A wishlist item's displayed price matches the product's current price, not a stale snapshot" },
158
165
  { key: "wishlist-sold-out-item", label: "A wishlist item whose product later sells out or is removed still displays gracefully (no crash) with an appropriate indicator" },
159
- { key: "wishlist-empty-state", label: "The empty-wishlist state renders correctly with no items", href: "/user/wishlist" },
166
+ { key: "wishlist-empty-state", label: "The empty-wishlist state renders correctly with no items", href: "/wishlist" },
160
167
  { key: "wishlist-add-to-cart-from-list", label: "Adding a wishlist item directly to the cart from the wishlist page works" },
161
168
  { key: "view-history", label: "Recently viewed history shows accurate items in most-recent-first order", href: "/user/history" },
162
169
  { key: "history-revisit-reorders", label: "Re-visiting a product already in history removes the old entry and moves it to the front, rather than duplicating it" },
@@ -311,7 +318,7 @@ export const testerChecklistSeedData = [
311
318
  { key: "seller-messages", label: "Seller messages list and thread view both work", href: "/store/messages" },
312
319
  { key: "seller-fulfillment-queue", label: "Seller fulfillment queue shows accurate pending items", href: "/store/fulfillment" },
313
320
  { key: "seller-print-center", label: "Seller print-center generates labels/invoices correctly", href: "/store/print-center" },
314
- { key: "seller-inventory-print", label: "Seller inventory print view works", href: "/store/inventory/print" },
321
+ { key: "seller-inventory-print", label: "Seller inventory print view works", href: "/store/print-center" },
315
322
  ],
316
323
  },
317
324
  {
@@ -514,7 +521,7 @@ export const testerChecklistSeedData = [
514
521
  pageKey: "auth-error-pages",
515
522
  pageLabel: "Remaining Auth & Error Pages",
516
523
  cases: [
517
- { key: "register-page", label: "The register page loads and account creation works", href: "/register" },
524
+ { key: "register-page", label: "The register page loads and account creation works", href: "/auth/register" },
518
525
  { key: "forgot-reset-password-pages", label: "Forgot-password and reset-password pages both work" },
519
526
  { key: "verify-email-page", label: "The verify-email page correctly confirms a pending verification" },
520
527
  { key: "oauth-loading-redirect", label: "The OAuth-loading redirect page transitions correctly after a Google sign-in" },
@@ -676,3 +683,8 @@ export const testerChecklistSeedData = [
676
683
  },
677
684
  ], { adminOnly: true }),
678
685
  ];
686
+ const defaultPhases = assignDefaultPhases(rawTesterChecklistItems);
687
+ export const testerChecklistSeedData = rawTesterChecklistItems.map((item, index) => ({
688
+ ...item,
689
+ phase: defaultPhases[index],
690
+ }));
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Computes default `phase` numbers for the tester checklist catalog.
3
+ *
4
+ * `phase` is a real, stored, admin-editable field on `TesterChecklistItemDocument`
5
+ * (see schemas/firestore.ts) — not something recomputed on every read. This
6
+ * module only supplies the INITIAL assignment: given the catalog in its
7
+ * existing groupKey/pageKey/order sequence, bucket whole pages together into
8
+ * phases of roughly `targetPhaseSize` items each (never splitting a single
9
+ * page's items across two phases), so a tester works through ~10-50 cases
10
+ * per session instead of the full catalog at once.
11
+ *
12
+ * Used once at seed-authoring time (tester-checklist-seed-data.ts) and by
13
+ * the one-off Firestore backfill for already-seeded items that predate the
14
+ * `phase` field. After that, every read path (TesterHubView, admin results
15
+ * views, the markdown report) just groups by the stored `item.phase` value —
16
+ * no chunking logic at read time.
17
+ */
18
+ export interface TesterPhaseAssignable {
19
+ groupKey: string;
20
+ pageKey: string;
21
+ }
22
+ /** Target item count per phase — real phase sizes vary a little around this
23
+ * since a page's items are never split across two phases. */
24
+ export declare const DEFAULT_TESTER_PHASE_SIZE = 25;
25
+ /**
26
+ * Returns a same-length array of 1-based phase numbers, one per input item,
27
+ * computed by greedily packing whole pages (consecutive runs of the same
28
+ * groupKey+pageKey) into phases of ~`targetPhaseSize` items. `items` MUST
29
+ * already be in catalog order (e.g. sorted by the `order` field).
30
+ */
31
+ export declare function assignDefaultPhases<T extends TesterPhaseAssignable>(itemsInCatalogOrder: T[], targetPhaseSize?: number): number[];
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Computes default `phase` numbers for the tester checklist catalog.
3
+ *
4
+ * `phase` is a real, stored, admin-editable field on `TesterChecklistItemDocument`
5
+ * (see schemas/firestore.ts) — not something recomputed on every read. This
6
+ * module only supplies the INITIAL assignment: given the catalog in its
7
+ * existing groupKey/pageKey/order sequence, bucket whole pages together into
8
+ * phases of roughly `targetPhaseSize` items each (never splitting a single
9
+ * page's items across two phases), so a tester works through ~10-50 cases
10
+ * per session instead of the full catalog at once.
11
+ *
12
+ * Used once at seed-authoring time (tester-checklist-seed-data.ts) and by
13
+ * the one-off Firestore backfill for already-seeded items that predate the
14
+ * `phase` field. After that, every read path (TesterHubView, admin results
15
+ * views, the markdown report) just groups by the stored `item.phase` value —
16
+ * no chunking logic at read time.
17
+ */
18
+ /** Target item count per phase — real phase sizes vary a little around this
19
+ * since a page's items are never split across two phases. */
20
+ export const DEFAULT_TESTER_PHASE_SIZE = 25;
21
+ /**
22
+ * Returns a same-length array of 1-based phase numbers, one per input item,
23
+ * computed by greedily packing whole pages (consecutive runs of the same
24
+ * groupKey+pageKey) into phases of ~`targetPhaseSize` items. `items` MUST
25
+ * already be in catalog order (e.g. sorted by the `order` field).
26
+ */
27
+ export function assignDefaultPhases(itemsInCatalogOrder, targetPhaseSize = DEFAULT_TESTER_PHASE_SIZE) {
28
+ const phaseNumbers = new Array(itemsInCatalogOrder.length);
29
+ let currentPhase = 1;
30
+ let currentPhaseCount = 0;
31
+ let lastPageKey = null;
32
+ for (let i = 0; i < itemsInCatalogOrder.length; i++) {
33
+ const item = itemsInCatalogOrder[i];
34
+ const pageId = `${item.groupKey}␟${item.pageKey}`;
35
+ const isNewPage = pageId !== lastPageKey;
36
+ // Only allow a phase boundary between pages, never mid-page.
37
+ if (isNewPage && currentPhaseCount >= targetPhaseSize) {
38
+ currentPhase += 1;
39
+ currentPhaseCount = 0;
40
+ }
41
+ phaseNumbers[i] = currentPhase;
42
+ currentPhaseCount += 1;
43
+ lastPageKey = pageId;
44
+ }
45
+ return phaseNumbers;
46
+ }
@@ -166,7 +166,7 @@ export function SellerWhatsAppSettingsView({ hasCapability }) {
166
166
  buyerName: "Ravi K.",
167
167
  firstItemName: "Charizard PSA 9",
168
168
  additionalItemCount: 2,
169
- totalAmount: 450000,
169
+ totalAmount: 4500,
170
170
  orderId: "order-3-20260510-a1b2c3",
171
171
  }) })] }), _jsxs(Section, { className: CLS_SECTION_CARD, children: [_jsx(Heading, { level: 2, className: "mb-2", color: "primary", size: "sm", weight: "semibold", children: "Catalog Preview" }), _jsx(Text, { className: "mb-4", color: "muted", size: "xs", children: "This is how your products appear in the WhatsApp Catalog when a buyer taps \"View Catalog\" in the chat. Only published standard products are included." }), _jsxs(Div, { className: `${__O.hidden} bg-[var(--appkit-color-whatsapp-bg)] bg-[var(--appkit-color-surface-elevated)] ${__P.p3}`, rounded: "xl", border: "default", children: [_jsxs(Row, { gap: "sm", align: "center", className: "mb-3", children: [_jsx(Row, { className: "w-8 h-8 bg-[var(--appkit-color-whatsapp)]", align: "center", justify: "center", rounded: "full", children: _jsx(Text, { color: "inverse", size: "xs", weight: "bold", children: "W" }) }), _jsxs(Div, { children: [_jsx(Text, { size: "xs", weight: "semibold", color: "primary", children: cfg?.connected ? "Your Store" : "Store Name" }), _jsx(Text, { className: "text-[10px]", color: "muted", children: "WhatsApp Business" })] })] }), _jsx(Div, { layout: "grid", gap: "2", className: "grid-cols-2", children: SAMPLE_CATALOG_ITEMS.map((item) => (_jsxs(Div, { surface: "card", className: `${__O.hidden}`, children: [_jsx(Row, { className: "aspect-square", surface: "subtle", align: "center", justify: "center", children: _jsx(Text, { size: "2xl", children: item.emoji }) }), _jsxs(Div, { padding: "xs", children: [_jsx(Text, { className: "line-clamp-2 leading-tight", color: "primary", size: "xs", weight: "medium", children: item.name }), _jsx(Text, { className: "text-[var(--appkit-color-whatsapp)] mt-0.5", size: "xs", weight: "semibold", children: item.price })] })] }, item.id))) }), _jsx(Div, { className: "mt-3 text-center", children: _jsx(Text, { className: "text-[10px]", color: "muted", children: cfg?.lastSyncCount
172
172
  ? `${cfg.lastSyncCount} products synced to catalog`
@@ -1,4 +1,4 @@
1
- import type { CheckoutMessageInput, StatusNotificationInput, WebhookVerifyInput, IncomingWebhookPayload, SendWhatsAppInput, StatusMessageInput, WaBusinessSendInput, CatalogSyncInput, CatalogSyncResult, PurchaseAnnouncementInput, PaymentProofReviewMessageInput } from "../types";
1
+ import type { CheckoutMessageInput, StatusNotificationInput, WebhookVerifyInput, IncomingWebhookPayload, SendWhatsAppInput, StatusMessageInput, WaBusinessSendInput, WaBusinessTemplateSendInput, CatalogSyncInput, CatalogSyncResult, PurchaseAnnouncementInput, PaymentProofReviewMessageInput } from "../types";
2
2
  export declare function buildCheckoutMessageURL(input: CheckoutMessageInput): string;
3
3
  export declare function buildStatusNotificationURL(input: StatusNotificationInput): string;
4
4
  export declare function verifyWebhookSignature(input: WebhookVerifyInput): boolean;
@@ -19,6 +19,15 @@ export declare function buildStatusMessage(input: StatusMessageInput, statusMess
19
19
  * platform announcements. Returns true on success, false on any failure.
20
20
  */
21
21
  export declare function sendWhatsAppBusinessMessage(input: WaBusinessSendInput): Promise<boolean>;
22
+ /**
23
+ * Send a pre-approved Meta message TEMPLATE via WhatsApp Business Cloud API.
24
+ * Required for business-initiated sends outside the 24h customer-service
25
+ * window (proactive order/status notifications) — Meta rejects free-form
26
+ * `sendWhatsAppBusinessMessage` `type: "text"` sends in that case. Returns
27
+ * true on success, false on any failure (including a missing/unapproved
28
+ * template — Meta returns a 4xx with an error body, not a network failure).
29
+ */
30
+ export declare function sendWhatsAppTemplateMessage(input: WaBusinessTemplateSendInput): Promise<boolean>;
22
31
  /**
23
32
  * Sync a store's products to a Meta Commerce Catalog via items_batch API.
24
33
  * Batches at 50 items per call (Meta limit). Returns aggregate results.
@@ -131,6 +131,53 @@ export async function sendWhatsAppBusinessMessage(input) {
131
131
  return false;
132
132
  }
133
133
  }
134
+ /**
135
+ * Send a pre-approved Meta message TEMPLATE via WhatsApp Business Cloud API.
136
+ * Required for business-initiated sends outside the 24h customer-service
137
+ * window (proactive order/status notifications) — Meta rejects free-form
138
+ * `sendWhatsAppBusinessMessage` `type: "text"` sends in that case. Returns
139
+ * true on success, false on any failure (including a missing/unapproved
140
+ * template — Meta returns a 4xx with an error body, not a network failure).
141
+ */
142
+ export async function sendWhatsAppTemplateMessage(input) {
143
+ const { toPhone, phoneNumberId, accessToken, templateName, languageCode, bodyParams } = input;
144
+ const cleanPhone = toPhone.replace(/\D/g, "");
145
+ if (!cleanPhone || !phoneNumberId || !accessToken || !templateName)
146
+ return false;
147
+ try {
148
+ const res = await fetch(`${META_GRAPH_BASE}/${phoneNumberId}/messages`, {
149
+ method: "POST",
150
+ headers: {
151
+ "Content-Type": "application/json",
152
+ Authorization: `Bearer ${accessToken}`,
153
+ },
154
+ body: JSON.stringify({
155
+ messaging_product: "whatsapp",
156
+ to: cleanPhone,
157
+ type: "template",
158
+ template: {
159
+ name: templateName,
160
+ language: { code: languageCode },
161
+ ...(bodyParams?.length
162
+ ? {
163
+ components: [
164
+ {
165
+ type: "body",
166
+ parameters: bodyParams.map((text) => ({ type: "text", text })),
167
+ },
168
+ ],
169
+ }
170
+ : {}),
171
+ },
172
+ }),
173
+ });
174
+ return res.ok;
175
+ }
176
+ catch (_err) {
177
+ void normalizeError(_err);
178
+ return false;
179
+ }
180
+ }
134
181
  /**
135
182
  * Sync a store's products to a Meta Commerce Catalog via items_batch API.
136
183
  * Batches at 50 items per call (Meta limit). Returns aggregate results.
@@ -50,6 +50,25 @@ export interface WaBusinessSendInput {
50
50
  /** Meta system user access token */
51
51
  accessToken: string;
52
52
  }
53
+ /**
54
+ * Input for sending a pre-approved Meta message TEMPLATE. Required for any
55
+ * business-initiated WhatsApp send outside the 24h customer-service window —
56
+ * Meta rejects free-form `type: "text"` sends in that case.
57
+ */
58
+ export interface WaBusinessTemplateSendInput {
59
+ /** Digits-only phone number with country code, e.g. "919876543210" */
60
+ toPhone: string;
61
+ /** Meta Phone Number ID (from Meta for Developers > App > WhatsApp > API Setup) */
62
+ phoneNumberId: string;
63
+ /** Meta system user access token */
64
+ accessToken: string;
65
+ /** Exact approved template name from Meta WhatsApp Manager (not the display label). */
66
+ templateName: string;
67
+ /** BCP-47 language code the template was approved in, e.g. "en" or "en_US". */
68
+ languageCode: string;
69
+ /** Positional {{1}}, {{2}}… body parameters, in order. */
70
+ bodyParams?: string[];
71
+ }
53
72
  /** A product mapped to the Meta Commerce API catalog item format. */
54
73
  export interface CatalogSyncProduct {
55
74
  /** Firestore product ID — used as Meta `retailer_id` */
@@ -85,7 +104,7 @@ export interface PurchaseAnnouncementInput {
85
104
  firstItemName: string;
86
105
  /** 0 if only one item in the order */
87
106
  additionalItemCount: number;
88
- /** Total order amount in paise */
107
+ /** Total order amount in decimal rupees */
89
108
  totalAmount: number;
90
109
  orderId: string;
91
110
  }
@@ -26,6 +26,9 @@ export interface WishlistProductData {
26
26
  isFeatured?: boolean;
27
27
  /** Canonical listing-kind discriminator (SB1-G Phase 4). */
28
28
  listingType?: ListingType;
29
+ /** Already present on the wire — GET /api/user/wishlist spreads the full
30
+ * ProductDocument into `product`, this was just untyped. */
31
+ isSold?: boolean;
29
32
  }
30
33
  /** WishlistItem enriched with inline product details returned by the wishlist GET endpoint. */
31
34
  export interface EnrichedWishlistItem extends WishlistItem {
package/dist/index.d.ts CHANGED
@@ -549,6 +549,8 @@ export type { PageViewDocument, PageViewEntityType } from "./repositories/index"
549
549
  export { reviewRepository } from "./repositories/index";
550
550
  export { sessionRepository } from "./repositories/index";
551
551
  export { siteSettingsRepository } from "./repositories/index";
552
+ export { analyticsRollupRepository } from "./repositories/index";
553
+ export type { AnalyticsRollupDocument } from "./repositories/index";
552
554
  export { ADMIN_CHECKOUT_BYPASS_FLAG_KEY } from "./features/admin/schemas/firestore";
553
555
  export { smsCounterRepository } from "./repositories/index";
554
556
  export { storeRepository } from "./repositories/index";
@@ -913,6 +915,8 @@ export type { AboutHowItem } from "./features/about/index";
913
915
  export type { AboutMilestone } from "./features/about/index";
914
916
  export type { AboutValueItem } from "./features/about/index";
915
917
  export type { AboutViewProps } from "./features/about/index";
918
+ export type { AboutTeamMember } from "./features/about/index";
919
+ export type { AboutContentDocument } from "./features/about/index";
916
920
  export type { FAQPageViewProps } from "./features/about/index";
917
921
  export type { FeesViewProps } from "./features/about/index";
918
922
  export type { HelpPageViewProps } from "./features/about/index";
@@ -1149,6 +1153,10 @@ export { AdminNotificationsView } from "./features/admin/index";
1149
1153
  export { AdminCartsView } from "./features/admin/index";
1150
1154
  export { AdminWishlistsView } from "./features/admin/index";
1151
1155
  export { AdminHistoryView } from "./features/admin/index";
1156
+ export { AdminGroupedListingsView } from "./features/admin/index";
1157
+ export type { AdminGroupedListingsViewProps } from "./features/admin/index";
1158
+ export { AdminCarouselGroupEditorView } from "./features/admin/index";
1159
+ export type { AdminCarouselGroupEditorViewProps } from "./features/admin/index";
1152
1160
  export { AdminContactEditorView } from "./features/admin/index";
1153
1161
  export type { AdminContactEditorViewProps } from "./features/admin/index";
1154
1162
  export { AdminReturnRequestsView } from "./features/admin/index";
@@ -1180,6 +1188,10 @@ export { DEFAULT_TRUST_BAR_ITEMS } from "./features/admin/index";
1180
1188
  export { DashboardStatsGrid } from "./features/admin/index";
1181
1189
  export { AdminTeamView } from "./features/admin/index";
1182
1190
  export { AdminEmployeeEditorView } from "./features/admin/index";
1191
+ export { PERMISSION_GROUPS } from "./features/auth/permissions/constants";
1192
+ export { PERMISSION_DOMAINS } from "./features/auth/permissions/constants";
1193
+ export { getPermissionsForDomain } from "./features/auth/permissions/constants";
1194
+ export { formatPermLabel } from "./features/auth/permissions/constants";
1183
1195
  export { AdminSupportTicketsView } from "./features/admin/index";
1184
1196
  export { AdminSupportTicketDetailView } from "./features/admin/index";
1185
1197
  export { DrawerFormFooter } from "./features/admin/index";
@@ -2206,7 +2218,6 @@ export type { MediaUploadResult } from "./features/media/index";
2206
2218
  export type { MediaVideoProps } from "./features/media/index";
2207
2219
  export type { VideoThumbnailSelectorProps } from "./features/media/index";
2208
2220
  export type { VideoTrimModalProps } from "./features/media/index";
2209
- export { extractStoragePathFromUrl } from "./features/media/server";
2210
2221
  export { finalizeStagedMediaArray } from "./features/media/server";
2211
2222
  export { finalizeStagedMediaField } from "./features/media/server";
2212
2223
  export { finalizeStagedMediaObject } from "./features/media/server";
@@ -2444,8 +2455,8 @@ export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type Actio
2444
2455
  export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
2445
2456
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, type ActionDef, type ActionKind, type ActionResource, type ActionTree, type ActionConfirmation, } from "./_internal/shared/actions/action-registry";
2446
2457
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers";
2447
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, calculateGst, } from "./_internal/shared/fees/calculator";
2448
- export type { FeeCommissionRates, CheckoutFees, PayoutDeduction, CodHandlingFeeRates, GstBreakdown, } from "./_internal/shared/fees/calculator";
2458
+ export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeWhatsAppNotifyFee, computeGiftWrapFee, computeShipmentProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
2459
+ export type { FeeCommissionRates, CheckoutFees, PayoutDeduction, CodHandlingFeeRates, WhatsAppNotifyFeeRates, GiftWrapFeeRates, ShipmentProtectionFeeRates, GstBreakdown, } from "./_internal/shared/fees/calculator";
2449
2460
  export { checkEmiEligibility, computeEmiSchedule } from "./_internal/shared/features/emi/schedule";
2450
2461
  export type { EmiSettings, EmiIneligibleReason, EmiEligibility, EmiInstallmentPlan, EmiScheduleResult, } from "./_internal/shared/features/emi/schedule";
2451
2462
  export { isAdminUser, isSellerUser, isModeratorUser, isEmployeeUser, isBuyerUser, isEffectiveAdminUser, } from "./features/auth/role-predicates";
@@ -3088,7 +3099,7 @@ export { SUCCESS_MESSAGES } from "./values/index";
3088
3099
  export { splitCartIntoOrderGroups } from "./features/orders/index";
3089
3100
  export { groupOrderItemsByBundle, type BundleOrderGroup, type OrderItemForBundleGrouping, } from "./features/orders/index";
3090
3101
  export { buildSieveFilters } from "./utils/filter.helper";
3091
- export { formatFileSize } from "./utils/number.formatter";
3102
+ export { formatCurrency, formatFileSize } from "./utils/number.formatter";
3092
3103
  export { formatMonthYear } from "./utils/date.formatter";
3093
3104
  export { generateMediaFilename } from "./utils/id-generators";
3094
3105
  export { deriveContextTypeFromFilename } from "./utils/id-generators";
@@ -3217,8 +3228,6 @@ export { MarketplaceBundleCard } from "./features/products/index";
3217
3228
  export type { MarketplaceBundleCardProps, MarketplaceBundleCardData, MarketplaceBundleCardLabels, } from "./features/products/index";
3218
3229
  export { SellerStoreCategoriesView } from "./features/seller/components/SellerStoreCategoriesView";
3219
3230
  export type { SellerStoreCategoriesViewProps } from "./features/seller/components/SellerStoreCategoriesView";
3220
- export { SellerTemplatesView } from "./features/seller/components/SellerTemplatesView";
3221
- export type { SellerTemplatesViewProps } from "./features/seller/components/SellerTemplatesView";
3222
3231
  export { SellerPayoutMethodsView } from "./features/seller/components/SellerPayoutMethodsView";
3223
3232
  export type { SellerPayoutMethodsViewProps } from "./features/seller/components/SellerPayoutMethodsView";
3224
3233
  export { SellerShippingConfigsView } from "./features/seller/components/SellerShippingConfigsView";
package/dist/index.js CHANGED
@@ -1070,6 +1070,8 @@ export { sessionRepository } from "./repositories/index";
1070
1070
  // [DB]-Database layer â€" uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
1071
1071
  // siteSettingsRepository - Shared export for site settings repository.
1072
1072
  export { siteSettingsRepository } from "./repositories/index";
1073
+ // analyticsRollupRepository - reads the pre-computed admin-dashboard revenue rollup.
1074
+ export { analyticsRollupRepository } from "./repositories/index";
1073
1075
  // ADMIN_CHECKOUT_BYPASS_FLAG_KEY - field name for the admin checkout bypass flag.
1074
1076
  export { ADMIN_CHECKOUT_BYPASS_FLAG_KEY } from "./features/admin/schemas/firestore";
1075
1077
  // [DB]-Database layer â€" uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
@@ -1790,10 +1792,10 @@ export { createRazorpayRefund } from "./providers/payment-razorpay/index";
1790
1792
  // fetchRazorpayOrder - Shared export for fetch razorpay order.
1791
1793
  export { fetchRazorpayOrder } from "./providers/payment-razorpay/index";
1792
1794
  // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
1793
- // paiseToRupees - Shared export for paise to rupees.
1795
+ // paiseToRupees - Shared export for paise to rupees. // audit-money-units-ok: names the boundary conversion function itself
1794
1796
  export { paiseToRupees } from "./providers/payment-razorpay/index";
1795
1797
  // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
1796
- // rupeesToPaise - Shared export for rupees to paise.
1798
+ // rupeesToPaise - Shared export for rupees to paise. // audit-money-units-ok: names the boundary conversion function itself
1797
1799
  export { rupeesToPaise } from "./providers/payment-razorpay/index";
1798
1800
  // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
1799
1801
  // verifyPaymentSignature - Shared export for verify payment signature.
@@ -2219,6 +2221,10 @@ export { AdminCartsView } from "./features/admin/index";
2219
2221
  export { AdminWishlistsView } from "./features/admin/index";
2220
2222
  // AdminHistoryView - Admin read-only history insights listing (S44 follow-up).
2221
2223
  export { AdminHistoryView } from "./features/admin/index";
2224
+ // AdminGroupedListingsView - Admin cross-store grouped-listings moderation view (W1-29).
2225
+ export { AdminGroupedListingsView } from "./features/admin/index";
2226
+ // AdminCarouselGroupEditorView - Create form for named carousel groups (EX2 nav-wiring fix).
2227
+ export { AdminCarouselGroupEditorView } from "./features/admin/index";
2222
2228
  // AdminContactEditorView - Admin contact submission detail SideDrawer (B7/VA15).
2223
2229
  export { AdminContactEditorView } from "./features/admin/index";
2224
2230
  // AdminReturnRequestsView - Admin return requests queue filtered to RETURN_REQUESTED (LL16).
@@ -2279,6 +2285,14 @@ export { DashboardStatsGrid } from "./features/admin/index";
2279
2285
  export { AdminTeamView } from "./features/admin/index";
2280
2286
  // AdminEmployeeEditorView - Invite/edit employee permissions SideDrawer.
2281
2287
  export { AdminEmployeeEditorView } from "./features/admin/index";
2288
+ // PERMISSION_GROUPS - Preset employee-group -> Permission[] bundles (S-ADMIN-7).
2289
+ export { PERMISSION_GROUPS } from "./features/auth/permissions/constants";
2290
+ // PERMISSION_DOMAINS - Domain label/prefix groupings for the permissions catalog page.
2291
+ export { PERMISSION_DOMAINS } from "./features/auth/permissions/constants";
2292
+ // getPermissionsForDomain - Every distinct permission across PERMISSION_GROUPS matching a domain prefix.
2293
+ export { getPermissionsForDomain } from "./features/auth/permissions/constants";
2294
+ // formatPermLabel - "admin:orders:read" -> "Read" display formatting.
2295
+ export { formatPermLabel } from "./features/auth/permissions/constants";
2282
2296
  // AdminSupportTicketsView - Admin support ticket list view.
2283
2297
  export { AdminSupportTicketsView } from "./features/admin/index";
2284
2298
  // AdminSupportTicketDetailView - Admin support ticket detail/reply SideDrawer.
@@ -4066,9 +4080,6 @@ export { useMediaTrim } from "./features/media/index";
4066
4080
  export { useMediaUpload } from "./features/media/index";
4067
4081
  // ./features/media/server
4068
4082
  // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
4069
- // extractStoragePathFromUrl - Shared export for extract storage path from url.
4070
- export { extractStoragePathFromUrl } from "./features/media/server";
4071
- // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
4072
4083
  // finalizeStagedMediaArray - Shared export for finalize staged media array.
4073
4084
  export { finalizeStagedMediaArray } from "./features/media/server";
4074
4085
  // [SERVER-ONLY]-Server-only â€" uses Node.js, Next.js server internals, or third-party server SDKs (auth, email, payment, shipping).
@@ -4489,8 +4500,8 @@ export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_int
4489
4500
  // SB-UNI-W-1 2026-05-13 â€" CTA action registry shell.
4490
4501
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, } from "./_internal/shared/actions/action-registry";
4491
4502
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers";
4492
- // Shared fee calculator — platform/gateway/GST/COD handling fee math (pure, client-safe).
4493
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, calculateGst, } from "./_internal/shared/fees/calculator";
4503
+ // Shared fee calculator — platform/gateway/GST/COD handling/WhatsApp-addon fee math (pure, client-safe).
4504
+ export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeWhatsAppNotifyFee, computeGiftWrapFee, computeShipmentProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
4494
4505
  // EMI eligibility + schedule computation (pure, client-safe — used for checkout quotes).
4495
4506
  export { checkEmiEligibility, computeEmiSchedule } from "./_internal/shared/features/emi/schedule";
4496
4507
  // User-role predicates â€" SB-UNI-E 2026-05-13.
@@ -5517,7 +5528,7 @@ export { splitCartIntoOrderGroups } from "./features/orders/index";
5517
5528
  export { groupOrderItemsByBundle, } from "./features/orders/index";
5518
5529
  // -- Missing utils
5519
5530
  export { buildSieveFilters } from "./utils/filter.helper";
5520
- export { formatFileSize } from "./utils/number.formatter";
5531
+ export { formatCurrency, formatFileSize } from "./utils/number.formatter";
5521
5532
  export { formatMonthYear } from "./utils/date.formatter";
5522
5533
  export { generateMediaFilename } from "./utils/id-generators"; // generateProductImageFilename already exported from "./utils/id-generators";
5523
5534
  export { deriveContextTypeFromFilename } from "./utils/id-generators";
@@ -5646,7 +5657,6 @@ export { getLiveItemForDetail } from "./_internal/server/features/live/data";
5646
5657
  export { MarketplaceBundleCard } from "./features/products/index";
5647
5658
  // ── Wave 4 Seller management views ───────────────────────────────────────────
5648
5659
  export { SellerStoreCategoriesView } from "./features/seller/components/SellerStoreCategoriesView";
5649
- export { SellerTemplatesView } from "./features/seller/components/SellerTemplatesView";
5650
5660
  export { SellerPayoutMethodsView } from "./features/seller/components/SellerPayoutMethodsView";
5651
5661
  export { SellerShippingConfigsView } from "./features/seller/components/SellerShippingConfigsView";
5652
5662
  export { SellerGoogleReviewsView } from "./features/seller/components/SellerGoogleReviewsView";
@@ -18,8 +18,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
18
  */
19
19
  import { Heading, Text } from "../../ui/components/Typography";
20
20
  import { TextLink } from "../../ui/components/TextLink";
21
+ import { SiteMark } from "../../ui/components/SiteMark";
21
22
  import { DEFAULT_ROUTE_MAP } from "../routing/route-map";
22
23
  import { Stack } from "@mohasinac/appkit";
23
24
  export function NotFoundView({ heading = "404 — Page not found", description = "The page you are looking for does not exist.", homeLabel = "Go home", homeHref = DEFAULT_ROUTE_MAP.HOME, }) {
24
- return (_jsxs(Stack, { justify: "center", className: "min-h-[60vh] text-center", padding: "x-xl", align: "center", children: [_jsx(Heading, { level: 1, variant: "primary", size: "7xl", className: "mb-2", weight: "bold", children: "404" }), _jsx(Heading, { level: 2, className: "mb-3", children: heading }), _jsx(Text, { variant: "secondary", className: "mb-8", children: description }), _jsx(TextLink, { href: homeHref, children: homeLabel })] }));
25
+ return (_jsxs(Stack, { justify: "center", className: "min-h-[60vh] text-center", padding: "x-xl", align: "center", children: [_jsx(SiteMark, { size: "xl" }), _jsx(Heading, { level: 1, variant: "primary", size: "7xl", className: "mb-2", weight: "bold", children: "404" }), _jsx(Heading, { level: 2, className: "mb-3", children: heading }), _jsx(Text, { variant: "secondary", className: "mb-8", children: description }), _jsx(TextLink, { href: homeHref, children: homeLabel })] }));
25
26
  }
@@ -116,6 +116,7 @@ export declare const DEFAULT_ROUTE_MAP: {
116
116
  readonly CLOSE: "/auth/close";
117
117
  };
118
118
  readonly USER: {
119
+ readonly DASHBOARD: "/user";
119
120
  readonly PROFILE: "/user/profile";
120
121
  readonly SETTINGS: "/user/settings";
121
122
  readonly ORDERS: "/user/orders";
@@ -170,9 +171,6 @@ export declare const DEFAULT_ROUTE_MAP: {
170
171
  readonly COUPONS: "/store/coupons";
171
172
  readonly COUPONS_NEW: "/store/coupons/new";
172
173
  readonly COUPONS_EDIT: (id: string) => string;
173
- readonly TEMPLATES: "/store/templates";
174
- readonly TEMPLATES_NEW: "/store/templates/new";
175
- readonly TEMPLATES_EDIT: (id: string) => string;
176
174
  readonly ANALYTICS: "/store/analytics";
177
175
  readonly PAYOUTS: "/store/payouts";
178
176
  readonly STOREFRONT: "/store/storefront";
@@ -214,7 +212,6 @@ export declare const DEFAULT_ROUTE_MAP: {
214
212
  readonly STICKERS_NEW: "/store/stickers/new";
215
213
  readonly STICKERS_EDIT: (id: string) => string;
216
214
  readonly PRINT_CENTER: "/store/print-center";
217
- readonly INVENTORY_PRINT: "/store/inventory/print";
218
215
  readonly FULFILLMENT: "/store/fulfillment";
219
216
  readonly PAYOUT_METHODS: "/store/payout-methods";
220
217
  readonly PAYOUT_METHODS_NEW: "/store/payout-methods/new";
@@ -251,6 +248,7 @@ export declare const DEFAULT_ROUTE_MAP: {
251
248
  readonly CATALOGUE_APPROVALS: "/admin/catalogue-approvals";
252
249
  readonly USERS: "/admin/users";
253
250
  readonly SITE: "/admin/site";
251
+ readonly INTEGRATION_GUIDES: "/admin/integration-guides";
254
252
  readonly CAROUSEL: "/admin/carousel";
255
253
  readonly CAROUSEL_NEW: "/admin/carousel/new";
256
254
  readonly CAROUSEL_EDIT: (id: string) => string;
@@ -338,6 +336,7 @@ export declare const DEFAULT_ROUTE_MAP: {
338
336
  readonly SETTINGS_ACTIONS: "/admin/settings/actions";
339
337
  readonly SETTINGS_NAVIGATION: "/admin/settings/navigation";
340
338
  readonly PRINT_CENTER: "/admin/print-center";
339
+ readonly MAINTENANCE: "/admin/maintenance";
341
340
  readonly FULFILLMENT: "/admin/fulfillment";
342
341
  readonly MODERATION: "/admin/moderation";
343
342
  readonly MODERATION_DETAIL: (id: string) => string;
@@ -477,6 +476,7 @@ export declare const ROUTES: {
477
476
  readonly CLOSE: "/auth/close";
478
477
  };
479
478
  readonly USER: {
479
+ readonly DASHBOARD: "/user";
480
480
  readonly PROFILE: "/user/profile";
481
481
  readonly SETTINGS: "/user/settings";
482
482
  readonly ORDERS: "/user/orders";
@@ -531,9 +531,6 @@ export declare const ROUTES: {
531
531
  readonly COUPONS: "/store/coupons";
532
532
  readonly COUPONS_NEW: "/store/coupons/new";
533
533
  readonly COUPONS_EDIT: (id: string) => string;
534
- readonly TEMPLATES: "/store/templates";
535
- readonly TEMPLATES_NEW: "/store/templates/new";
536
- readonly TEMPLATES_EDIT: (id: string) => string;
537
534
  readonly ANALYTICS: "/store/analytics";
538
535
  readonly PAYOUTS: "/store/payouts";
539
536
  readonly STOREFRONT: "/store/storefront";
@@ -575,7 +572,6 @@ export declare const ROUTES: {
575
572
  readonly STICKERS_NEW: "/store/stickers/new";
576
573
  readonly STICKERS_EDIT: (id: string) => string;
577
574
  readonly PRINT_CENTER: "/store/print-center";
578
- readonly INVENTORY_PRINT: "/store/inventory/print";
579
575
  readonly FULFILLMENT: "/store/fulfillment";
580
576
  readonly PAYOUT_METHODS: "/store/payout-methods";
581
577
  readonly PAYOUT_METHODS_NEW: "/store/payout-methods/new";
@@ -612,6 +608,7 @@ export declare const ROUTES: {
612
608
  readonly CATALOGUE_APPROVALS: "/admin/catalogue-approvals";
613
609
  readonly USERS: "/admin/users";
614
610
  readonly SITE: "/admin/site";
611
+ readonly INTEGRATION_GUIDES: "/admin/integration-guides";
615
612
  readonly CAROUSEL: "/admin/carousel";
616
613
  readonly CAROUSEL_NEW: "/admin/carousel/new";
617
614
  readonly CAROUSEL_EDIT: (id: string) => string;
@@ -699,6 +696,7 @@ export declare const ROUTES: {
699
696
  readonly SETTINGS_ACTIONS: "/admin/settings/actions";
700
697
  readonly SETTINGS_NAVIGATION: "/admin/settings/navigation";
701
698
  readonly PRINT_CENTER: "/admin/print-center";
699
+ readonly MAINTENANCE: "/admin/maintenance";
702
700
  readonly FULFILLMENT: "/admin/fulfillment";
703
701
  readonly MODERATION: "/admin/moderation";
704
702
  readonly MODERATION_DETAIL: (id: string) => string;
@@ -749,9 +747,6 @@ export declare const SELLER_ROUTES: {
749
747
  readonly COUPONS: "/store/coupons";
750
748
  readonly COUPONS_NEW: "/store/coupons/new";
751
749
  readonly COUPONS_EDIT: (id: string) => string;
752
- readonly TEMPLATES: "/store/templates";
753
- readonly TEMPLATES_NEW: "/store/templates/new";
754
- readonly TEMPLATES_EDIT: (id: string) => string;
755
750
  readonly ANALYTICS: "/store/analytics";
756
751
  readonly PAYOUTS: "/store/payouts";
757
752
  readonly STOREFRONT: "/store/storefront";
@@ -793,7 +788,6 @@ export declare const SELLER_ROUTES: {
793
788
  readonly STICKERS_NEW: "/store/stickers/new";
794
789
  readonly STICKERS_EDIT: (id: string) => string;
795
790
  readonly PRINT_CENTER: "/store/print-center";
796
- readonly INVENTORY_PRINT: "/store/inventory/print";
797
791
  readonly FULFILLMENT: "/store/fulfillment";
798
792
  readonly PAYOUT_METHODS: "/store/payout-methods";
799
793
  readonly PAYOUT_METHODS_NEW: "/store/payout-methods/new";
@@ -110,6 +110,7 @@ export const DEFAULT_ROUTE_MAP = {
110
110
  CLOSE: "/auth/close",
111
111
  },
112
112
  USER: {
113
+ DASHBOARD: "/user",
113
114
  PROFILE: "/user/profile",
114
115
  SETTINGS: "/user/settings",
115
116
  ORDERS: "/user/orders",
@@ -164,9 +165,6 @@ export const DEFAULT_ROUTE_MAP = {
164
165
  COUPONS: "/store/coupons",
165
166
  COUPONS_NEW: "/store/coupons/new",
166
167
  COUPONS_EDIT: (id) => `/store/coupons/${id}/edit`,
167
- TEMPLATES: "/store/templates",
168
- TEMPLATES_NEW: "/store/templates/new",
169
- TEMPLATES_EDIT: (id) => `/store/templates/${id}/edit`,
170
168
  ANALYTICS: "/store/analytics",
171
169
  PAYOUTS: "/store/payouts",
172
170
  STOREFRONT: "/store/storefront",
@@ -211,7 +209,6 @@ export const DEFAULT_ROUTE_MAP = {
211
209
  STICKERS_NEW: "/store/stickers/new",
212
210
  STICKERS_EDIT: (id) => `/store/stickers/${id}/edit`,
213
211
  PRINT_CENTER: "/store/print-center",
214
- INVENTORY_PRINT: "/store/inventory/print",
215
212
  FULFILLMENT: "/store/fulfillment",
216
213
  // S-STORE Tier — new extension routes
217
214
  PAYOUT_METHODS: "/store/payout-methods",
@@ -250,6 +247,7 @@ export const DEFAULT_ROUTE_MAP = {
250
247
  CATALOGUE_APPROVALS: "/admin/catalogue-approvals",
251
248
  USERS: "/admin/users",
252
249
  SITE: "/admin/site",
250
+ INTEGRATION_GUIDES: "/admin/integration-guides",
253
251
  CAROUSEL: "/admin/carousel",
254
252
  CAROUSEL_NEW: "/admin/carousel/new",
255
253
  CAROUSEL_EDIT: (id) => `/admin/carousel/${id}/edit`,
@@ -340,6 +338,7 @@ export const DEFAULT_ROUTE_MAP = {
340
338
  SETTINGS_ACTIONS: "/admin/settings/actions",
341
339
  SETTINGS_NAVIGATION: "/admin/settings/navigation",
342
340
  PRINT_CENTER: "/admin/print-center",
341
+ MAINTENANCE: "/admin/maintenance",
343
342
  FULFILLMENT: "/admin/fulfillment",
344
343
  // S-STORE Tier — admin moderation + reports + item requests
345
344
  MODERATION: "/admin/moderation",