@mohasinac/appkit 4.61.0 → 4.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +19 -3
  3. package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +1 -1
  4. package/dist/_internal/client/features/maintenance/views/CloudLogsListView.js +1 -1
  5. package/dist/_internal/server/features/checkout/actions.d.ts +80 -0
  6. package/dist/_internal/server/features/checkout/actions.js +542 -26
  7. package/dist/_internal/server/features/invoicing/allocate.d.ts +63 -0
  8. package/dist/_internal/server/features/invoicing/allocate.js +162 -0
  9. package/dist/_internal/server/features/invoicing/credit-note.d.ts +57 -0
  10. package/dist/_internal/server/features/invoicing/credit-note.js +126 -0
  11. package/dist/_internal/server/features/invoicing/gstr1.d.ts +74 -0
  12. package/dist/_internal/server/features/invoicing/gstr1.js +251 -0
  13. package/dist/_internal/server/features/invoicing/issue.d.ts +96 -0
  14. package/dist/_internal/server/features/invoicing/issue.js +202 -0
  15. package/dist/_internal/server/features/orders/actions.d.ts +8 -1
  16. package/dist/_internal/server/features/orders/actions.js +81 -8
  17. package/dist/_internal/server/features/orders/adapters.js +33 -0
  18. package/dist/_internal/server/features/orders/cancellation-refund.d.ts +15 -9
  19. package/dist/_internal/server/features/orders/cancellation-refund.js +15 -9
  20. package/dist/_internal/server/features/points/award.js +46 -4
  21. package/dist/_internal/server/features/refunds/actions.js +26 -0
  22. package/dist/_internal/server/features/shipping/courier-block.d.ts +69 -0
  23. package/dist/_internal/server/features/shipping/courier-block.js +239 -0
  24. package/dist/_internal/server/features/site-settings/adapters.d.ts +1 -1
  25. package/dist/_internal/server/features/site-settings/adapters.js +15 -0
  26. package/dist/_internal/server/features/stores/adapters.d.ts +2 -2
  27. package/dist/_internal/server/features/stores/adapters.js +51 -0
  28. package/dist/_internal/server/functions/scheduled.js +38 -1
  29. package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +9 -2
  30. package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +4 -0
  31. package/dist/_internal/server/jobs/core/dailyStatusDigest.js +19 -2
  32. package/dist/_internal/server/jobs/core/index.d.ts +2 -1
  33. package/dist/_internal/server/jobs/core/index.js +2 -1
  34. package/dist/_internal/server/jobs/core/onJobCreated.d.ts +30 -7
  35. package/dist/_internal/server/jobs/core/onJobCreated.js +78 -45
  36. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +7 -0
  37. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +62 -0
  38. package/dist/_internal/server/jobs/core/paymentReconcile.js +87 -97
  39. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +33 -0
  40. package/dist/_internal/server/jobs/core/runJobOnce.d.ts +48 -0
  41. package/dist/_internal/server/jobs/core/runJobOnce.js +195 -0
  42. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +10 -2
  43. package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +17 -0
  44. package/dist/_internal/server/notifications/channel-health.d.ts +26 -3
  45. package/dist/_internal/shared/actions/action-registry.js +177 -9
  46. package/dist/_internal/shared/checkout/coupon-discount.d.ts +43 -1
  47. package/dist/_internal/shared/checkout/coupon-discount.js +26 -1
  48. package/dist/_internal/shared/checkout/order-math.d.ts +145 -0
  49. package/dist/_internal/shared/checkout/order-math.js +173 -0
  50. package/dist/_internal/shared/checkout/refundable-base.d.ts +25 -0
  51. package/dist/_internal/shared/checkout/refundable-base.js +13 -1
  52. package/dist/_internal/shared/checkout/split.d.ts +87 -0
  53. package/dist/_internal/shared/checkout/split.js +100 -0
  54. package/dist/_internal/shared/content/disclaimers.d.ts +88 -0
  55. package/dist/_internal/shared/content/disclaimers.js +217 -0
  56. package/dist/_internal/shared/content/published-values.d.ts +88 -0
  57. package/dist/_internal/shared/content/published-values.js +198 -0
  58. package/dist/_internal/shared/features/admin/integrations.d.ts +109 -0
  59. package/dist/_internal/shared/features/admin/integrations.js +253 -0
  60. package/dist/_internal/shared/features/orders/dispute-reasons.d.ts +113 -0
  61. package/dist/_internal/shared/features/orders/dispute-reasons.js +181 -0
  62. package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
  63. package/dist/_internal/shared/features/orders/refund-copy.js +18 -1
  64. package/dist/_internal/shared/features/points/accepts.d.ts +36 -0
  65. package/dist/_internal/shared/features/points/accepts.js +43 -0
  66. package/dist/_internal/shared/features/shipping/shared-purchase.d.ts +91 -0
  67. package/dist/_internal/shared/features/shipping/shared-purchase.js +108 -0
  68. package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
  69. package/dist/_internal/shared/fees/calculator.d.ts +33 -1
  70. package/dist/_internal/shared/fees/calculator.js +32 -2
  71. package/dist/_internal/shared/media/limits.d.ts +10 -0
  72. package/dist/_internal/shared/media/limits.js +10 -0
  73. package/dist/_internal/shared/types/action-result.js +15 -1
  74. package/dist/client/api/surface-error.js +16 -2
  75. package/dist/client/api/useApiMutation.js +17 -1
  76. package/dist/client.d.ts +12 -1
  77. package/dist/client.js +31 -1
  78. package/dist/constants/api-endpoints.d.ts +45 -0
  79. package/dist/constants/api-endpoints.js +15 -0
  80. package/dist/constants/field-names.d.ts +18 -0
  81. package/dist/constants/field-names.js +28 -0
  82. package/dist/contracts/index.d.ts +1 -1
  83. package/dist/contracts/shipping.d.ts +45 -0
  84. package/dist/contracts/shipping.js +15 -0
  85. package/dist/core/server-action.js +19 -3
  86. package/dist/errors/error-mapping.js +26 -1
  87. package/dist/features/about/components/AboutView.js +1 -1
  88. package/dist/features/account/components/BuyerAuctionsGuideView.js +4 -1
  89. package/dist/features/account/components/UserOffersPanel.js +5 -3
  90. package/dist/features/account/components/UserOrdersView.js +19 -33
  91. package/dist/features/admin/components/AdminActionIndexView.js +100 -5
  92. package/dist/features/admin/components/AdminAddressClustersView.js +21 -2
  93. package/dist/features/admin/components/AdminBlogEditorView.js +8 -8
  94. package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
  95. package/dist/features/admin/components/AdminCarouselView.js +96 -4
  96. package/dist/features/admin/components/AdminCouponEditorView.js +17 -0
  97. package/dist/features/admin/components/AdminFulfillmentView.js +3 -2
  98. package/dist/features/admin/components/AdminInvoicingView.d.ts +2 -0
  99. package/dist/features/admin/components/AdminInvoicingView.js +65 -0
  100. package/dist/features/admin/components/AdminMediaView.js +36 -3
  101. package/dist/features/admin/components/AdminNavigationView.js +4 -1
  102. package/dist/features/admin/components/AdminOffersView.js +2 -1
  103. package/dist/features/admin/components/AdminOrderEditorView.d.ts +18 -1
  104. package/dist/features/admin/components/AdminOrderEditorView.js +11 -2
  105. package/dist/features/admin/components/AdminOrdersGuideView.js +23 -2
  106. package/dist/features/admin/components/AdminOrdersView.js +67 -5
  107. package/dist/features/admin/components/AdminPaymentClustersView.js +19 -2
  108. package/dist/features/admin/components/AdminProductEditorView.js +2 -2
  109. package/dist/features/admin/components/AdminSectionsView.d.ts +10 -0
  110. package/dist/features/admin/components/AdminSectionsView.js +486 -224
  111. package/dist/features/admin/components/OwnerQuickActions.js +24 -2
  112. package/dist/features/admin/components/ReferenceRecordEditor.js +1 -1
  113. package/dist/features/admin/constants/filter-tabs.d.ts +6 -0
  114. package/dist/features/admin/constants/filter-tabs.js +6 -0
  115. package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
  116. package/dist/features/admin/hooks/useAdminListingData.js +16 -0
  117. package/dist/features/admin/hooks/useOptimisticRowFlag.d.ts +33 -0
  118. package/dist/features/admin/hooks/useOptimisticRowFlag.js +87 -0
  119. package/dist/features/admin/repository/notification.repository.d.ts +15 -0
  120. package/dist/features/admin/repository/notification.repository.js +32 -0
  121. package/dist/features/admin/schemas/action-index-form.d.ts +34 -0
  122. package/dist/features/admin/schemas/action-index-form.js +115 -0
  123. package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
  124. package/dist/features/admin/schemas/firestore.d.ts +30 -0
  125. package/dist/features/admin/schemas/firestore.js +5 -0
  126. package/dist/features/audit-log/schemas/firestore.d.ts +30 -0
  127. package/dist/features/audit-log/schemas/firestore.js +15 -0
  128. package/dist/features/auth/components/RegisterForm.js +2 -1
  129. package/dist/features/auth/permissions/constants.js +13 -0
  130. package/dist/features/cart/components/CartPriceBreakdown.d.ts +13 -0
  131. package/dist/features/cart/components/CartPriceBreakdown.js +6 -2
  132. package/dist/features/cart/components/PointsTenderPicker.d.ts +61 -0
  133. package/dist/features/cart/components/PointsTenderPicker.js +15 -0
  134. package/dist/features/cart/components/StoreAddonsPicker.js +2 -1
  135. package/dist/features/cart/components/index.d.ts +2 -0
  136. package/dist/features/cart/components/index.js +1 -0
  137. package/dist/features/cart/repository/cart.repository.d.ts +19 -0
  138. package/dist/features/cart/repository/cart.repository.js +27 -0
  139. package/dist/features/cart/schemas/firestore.d.ts +92 -0
  140. package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
  141. package/dist/features/contact/email.d.ts +27 -10
  142. package/dist/features/contact/email.js +20 -3
  143. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.d.ts +38 -0
  144. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.js +80 -0
  145. package/dist/features/dispute-reasons/schemas/firestore.d.ts +64 -0
  146. package/dist/features/dispute-reasons/schemas/firestore.js +40 -0
  147. package/dist/features/events/components/AdminEventEditorView.js +8 -6
  148. package/dist/features/faq/components/FAQAccordion.d.ts +13 -1
  149. package/dist/features/faq/components/FAQAccordion.js +29 -4
  150. package/dist/features/invoicing/schemas/firestore.d.ts +112 -0
  151. package/dist/features/invoicing/schemas/firestore.js +45 -0
  152. package/dist/features/invoicing/utils/financial-year.d.ts +43 -0
  153. package/dist/features/invoicing/utils/financial-year.js +53 -0
  154. package/dist/features/jobs/actions/enqueue-job.js +18 -1
  155. package/dist/features/jobs/repository/jobs.repository.d.ts +62 -1
  156. package/dist/features/jobs/repository/jobs.repository.js +84 -1
  157. package/dist/features/jobs/schemas/firestore.d.ts +80 -0
  158. package/dist/features/jobs/schemas/firestore.js +37 -0
  159. package/dist/features/layout/hooks/useFormBottomActions.js +20 -1
  160. package/dist/features/lottery/schemas/zod.d.ts +6 -6
  161. package/dist/features/media/MediaImage.js +22 -1
  162. package/dist/features/media/upload/ImageUpload.js +1 -1
  163. package/dist/features/obligations/constants/policies.js +24 -1
  164. package/dist/features/orders/components/EmiInstallmentsPanel.js +25 -7
  165. package/dist/features/orders/components/OrderPaymentSummary.js +10 -1
  166. package/dist/features/orders/components/OrderProvenanceCard.d.ts +8 -0
  167. package/dist/features/orders/components/OrderProvenanceCard.js +185 -0
  168. package/dist/features/orders/components/RaiseDisputeForm.d.ts +14 -0
  169. package/dist/features/orders/components/RaiseDisputeForm.js +111 -0
  170. package/dist/features/orders/components/RefundRequestView.js +22 -4
  171. package/dist/features/orders/components/index.d.ts +4 -0
  172. package/dist/features/orders/components/index.js +2 -0
  173. package/dist/features/orders/constants/order-lane-tabs.d.ts +69 -0
  174. package/dist/features/orders/constants/order-lane-tabs.js +88 -0
  175. package/dist/features/orders/repository/orders.repository.d.ts +57 -0
  176. package/dist/features/orders/repository/orders.repository.js +145 -0
  177. package/dist/features/orders/schemas/firestore.d.ts +196 -1
  178. package/dist/features/orders/schemas/index.d.ts +60 -12
  179. package/dist/features/orders/schemas/index.js +12 -0
  180. package/dist/features/orders/types/index.d.ts +26 -0
  181. package/dist/features/orders/utils/courier-block.d.ts +25 -0
  182. package/dist/features/orders/utils/courier-block.js +23 -0
  183. package/dist/features/payment-cases/schemas/firestore.d.ts +26 -1
  184. package/dist/features/payment-cases/schemas/firestore.js +1 -0
  185. package/dist/features/products/components/GroupMemberPicker.js +4 -1
  186. package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
  187. package/dist/features/products/components/PrizeDrawEntryActions.js +2 -1
  188. package/dist/features/products/components/ProductDetailActions.js +2 -1
  189. package/dist/features/products/components/ProductDetailPageView.d.ts +17 -1
  190. package/dist/features/products/components/ProductDetailPageView.js +2 -2
  191. package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
  192. package/dist/features/promotions/actions/coupon-stacking.d.ts +30 -3
  193. package/dist/features/promotions/actions/coupon-stacking.js +21 -2
  194. package/dist/features/promotions/components/CouponCard.js +13 -0
  195. package/dist/features/promotions/constants/coupon-help.d.ts +2 -2
  196. package/dist/features/promotions/constants/coupon-help.js +9 -1
  197. package/dist/features/promotions/schemas/firestore.d.ts +24 -0
  198. package/dist/features/promotions/schemas/firestore.js +4 -0
  199. package/dist/features/promotions/types/index.d.ts +19 -1
  200. package/dist/features/scams/components/ScamProfileView.js +2 -2
  201. package/dist/features/scams/components/ScamRegistryView.js +2 -2
  202. package/dist/features/search/action-index/tab-entries.js +1 -1
  203. package/dist/features/seller/actions/seller-actions.js +33 -3
  204. package/dist/features/seller/components/FulfillmentView.js +3 -2
  205. package/dist/features/seller/components/SellerAddressesView.js +32 -4
  206. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +62 -3
  207. package/dist/features/seller/components/SellerBundlesView.js +53 -14
  208. package/dist/features/seller/components/SellerGroupedListingsView.js +23 -3
  209. package/dist/features/seller/components/SellerListingTypeView.js +56 -10
  210. package/dist/features/seller/components/SellerOrdersView.js +129 -27
  211. package/dist/features/seller/components/SellerPayoutMethodsView.js +33 -1
  212. package/dist/features/seller/components/SellerPayoutSettingsView.js +48 -9
  213. package/dist/features/seller/components/SellerProductsView.js +5 -1
  214. package/dist/features/seller/components/SellerShippingConfigsView.js +33 -1
  215. package/dist/features/seller/components/SellerShippingView.js +2 -1
  216. package/dist/features/seller/components/SellerStoreCategoriesView.js +33 -1
  217. package/dist/features/seller/components/SellerSupportView.js +69 -2
  218. package/dist/features/seller/hooks/useSellerListingData.js +25 -0
  219. package/dist/features/shell/SectionForm.js +20 -16
  220. package/dist/features/shell/build-sections.js +14 -1
  221. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +54 -1
  222. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +3 -2
  223. package/dist/features/shipments/schemas/validation.d.ts +4 -4
  224. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.d.ts +43 -0
  225. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.js +90 -0
  226. package/dist/features/shipping-boxes/schemas/firestore.d.ts +82 -0
  227. package/dist/features/shipping-boxes/schemas/firestore.js +53 -0
  228. package/dist/features/sticker-trace/components/StickerCommitPanel.js +2 -1
  229. package/dist/features/sticker-trace/components/StickerPrintPanel.js +2 -1
  230. package/dist/features/sticker-trace/components/StickerRetryPanel.js +24 -4
  231. package/dist/features/sticker-trace/components/StickerTraceStudio.js +2 -1
  232. package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
  233. package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +2 -2
  234. package/dist/features/stores/components/StoreOrdersGuideView.js +6 -1
  235. package/dist/features/stores/schemas/firestore.d.ts +71 -0
  236. package/dist/features/stores/types/index.d.ts +19 -0
  237. package/dist/features/support/schemas/index.d.ts +6 -6
  238. package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +3 -2
  239. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
  240. package/dist/index.d.ts +11 -2
  241. package/dist/index.js +17 -2
  242. package/dist/next/routing/route-map.d.ts +24 -0
  243. package/dist/next/routing/route-map.js +19 -0
  244. package/dist/providers/shipping-shiprocket/index.d.ts +27 -1
  245. package/dist/providers/shipping-shiprocket/index.js +84 -1
  246. package/dist/schemas/registry.d.ts +51 -22
  247. package/dist/schemas/sieve.d.ts +5 -5
  248. package/dist/server-entry.d.ts +2 -2
  249. package/dist/server-entry.js +8 -1
  250. package/dist/server.d.ts +11 -2
  251. package/dist/server.js +40 -2
  252. package/dist/styles.css +64 -80
  253. package/dist/tailwind-utilities.css +1 -1
  254. package/dist/tokens/themes/default-dark.js +1 -0
  255. package/dist/tokens/themes/default-light.js +1 -0
  256. package/dist/tokens/themes/required.d.ts +1 -1
  257. package/dist/tokens/themes/required.js +1 -0
  258. package/dist/tokens/tokens.css +15 -0
  259. package/dist/ui/components/Checkbox.js +10 -2
  260. package/dist/ui/components/DateInput.js +8 -1
  261. package/dist/ui/components/Disclaimer.d.ts +19 -0
  262. package/dist/ui/components/Disclaimer.js +74 -0
  263. package/dist/ui/components/Input.js +22 -2
  264. package/dist/ui/components/PaginatedSelect.d.ts +8 -19
  265. package/dist/ui/components/PaginatedSelect.js +43 -9
  266. package/dist/ui/components/Radio.js +8 -1
  267. package/dist/ui/components/Select.js +10 -2
  268. package/dist/ui/components/TagInput.d.ts +8 -1
  269. package/dist/ui/components/TagInput.js +4 -3
  270. package/dist/ui/components/Textarea.js +10 -2
  271. package/dist/ui/components/tabs-overflow.js +64 -11
  272. package/dist/ui/forms/FieldCheckbox.js +1 -1
  273. package/dist/ui/forms/FormErrorList.d.ts +0 -16
  274. package/dist/ui/forms/FormErrorList.js +34 -1
  275. package/dist/ui/forms/apply-zod-issues.d.ts +19 -1
  276. package/dist/ui/forms/apply-zod-issues.js +23 -1
  277. package/dist/ui/index.d.ts +2 -0
  278. package/dist/ui/index.js +6 -0
  279. package/dist/ui/rich-text/RichText.style.css +48 -79
  280. package/package.json +1 -1
  281. package/scripts/seed-cli.mjs +1831 -1822
@@ -0,0 +1,82 @@
1
+ /**
2
+ * `shippingBoxes` — a GLOBAL library of named carton presets.
3
+ *
4
+ * ## Why global rather than per-store
5
+ *
6
+ * A box is a real physical carton size. Scoping presets per store would give
7
+ * every seller their own private copy of "Medium", each with slightly
8
+ * different numbers, and the second seller to ship a Beyblade in a standard
9
+ * carton would re-measure instead of picking what already exists.
10
+ *
11
+ * `createdByName` is what keeps a shared library accountable: a wrong preset
12
+ * has an author, and the next seller can see who added the one they are about
13
+ * to trust.
14
+ *
15
+ * ## 🛑 A preset is a DEFAULT, never a lock
16
+ *
17
+ * The dimensions are COPIED onto the shipment when a seller uses one. Editing
18
+ * a preset later must not retroactively change what an already-dispatched
19
+ * parcel was declared as — the courier billed against the figures at dispatch,
20
+ * and a stored reference would make a past declaration mutable. Same snapshot
21
+ * discipline as the checkout's fee terms (D61).
22
+ *
23
+ * ## 🛑 Weight is not a formality
24
+ *
25
+ * An understated weight is re-billed by the courier AFTER delivery as a
26
+ * weight-discrepancy adjustment — real money, arriving on a reconciliation we
27
+ * cannot dispute without the parcel. The form says so rather than treating it
28
+ * as a required field to get past.
29
+ */
30
+ /** `box-` prefixed slug, so the id reads as what it is. */
31
+ export declare const SHIPPING_BOX_COLLECTION = "shippingBoxes";
32
+ export interface ShippingBoxDocument {
33
+ id: string;
34
+ /** What a seller picks it by: "Standard Beyblade carton", "Poly mailer S". */
35
+ name: string;
36
+ /** cm. */
37
+ length: number;
38
+ width: number;
39
+ height: number;
40
+ /**
41
+ * kg, the EMPTY box. The parcel's weight is this plus contents, entered on
42
+ * the dispatch form — a preset cannot know what went inside it.
43
+ *
44
+ * 🛑 Separate from the shipment's `weight` for exactly that reason. Storing
45
+ * one "weight" on a preset and reusing it as the parcel weight is how every
46
+ * parcel gets declared at the same figure regardless of contents.
47
+ */
48
+ tareWeight?: number;
49
+ /** Who added it. Display name, so a seller can see whose preset this is. */
50
+ createdByName: string;
51
+ /** The uid, for moderation. Never rendered. */
52
+ createdByUid: string;
53
+ /**
54
+ * Soft-retire rather than delete. A preset in use by a draft shipment must
55
+ * not vanish mid-dispatch, and a deleted row takes its author with it.
56
+ */
57
+ isActive: boolean;
58
+ createdAt: Date;
59
+ updatedAt: Date;
60
+ }
61
+ export declare const SHIPPING_BOX_FIELDS: {
62
+ readonly ID: "id";
63
+ readonly NAME: "name";
64
+ readonly IS_ACTIVE: "isActive";
65
+ readonly CREATED_BY_UID: "createdByUid";
66
+ readonly CREATED_AT: "createdAt";
67
+ };
68
+ /**
69
+ * Bounds, so a typo cannot reach a courier API as a 4-metre parcel.
70
+ *
71
+ * 🛑 Generous on purpose — these are a sanity check, not a tariff. India Post
72
+ * and most couriers cap a single parcel well below these, and the right place
73
+ * to learn a real limit is `checkServiceability`, which quotes against the
74
+ * actual weight. A client-side rule that refuses a legitimate large parcel is
75
+ * worse than one that lets it through to be priced.
76
+ */
77
+ export declare const SHIPPING_BOX_LIMITS: {
78
+ readonly minCm: 1;
79
+ readonly maxCm: 200;
80
+ readonly minKg: 0;
81
+ readonly maxKg: 50;
82
+ };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `shippingBoxes` — a GLOBAL library of named carton presets.
3
+ *
4
+ * ## Why global rather than per-store
5
+ *
6
+ * A box is a real physical carton size. Scoping presets per store would give
7
+ * every seller their own private copy of "Medium", each with slightly
8
+ * different numbers, and the second seller to ship a Beyblade in a standard
9
+ * carton would re-measure instead of picking what already exists.
10
+ *
11
+ * `createdByName` is what keeps a shared library accountable: a wrong preset
12
+ * has an author, and the next seller can see who added the one they are about
13
+ * to trust.
14
+ *
15
+ * ## 🛑 A preset is a DEFAULT, never a lock
16
+ *
17
+ * The dimensions are COPIED onto the shipment when a seller uses one. Editing
18
+ * a preset later must not retroactively change what an already-dispatched
19
+ * parcel was declared as — the courier billed against the figures at dispatch,
20
+ * and a stored reference would make a past declaration mutable. Same snapshot
21
+ * discipline as the checkout's fee terms (D61).
22
+ *
23
+ * ## 🛑 Weight is not a formality
24
+ *
25
+ * An understated weight is re-billed by the courier AFTER delivery as a
26
+ * weight-discrepancy adjustment — real money, arriving on a reconciliation we
27
+ * cannot dispute without the parcel. The form says so rather than treating it
28
+ * as a required field to get past.
29
+ */
30
+ /** `box-` prefixed slug, so the id reads as what it is. */
31
+ export const SHIPPING_BOX_COLLECTION = "shippingBoxes";
32
+ export const SHIPPING_BOX_FIELDS = {
33
+ ID: "id",
34
+ NAME: "name",
35
+ IS_ACTIVE: "isActive",
36
+ CREATED_BY_UID: "createdByUid",
37
+ CREATED_AT: "createdAt",
38
+ };
39
+ /**
40
+ * Bounds, so a typo cannot reach a courier API as a 4-metre parcel.
41
+ *
42
+ * 🛑 Generous on purpose — these are a sanity check, not a tariff. India Post
43
+ * and most couriers cap a single parcel well below these, and the right place
44
+ * to learn a real limit is `checkServiceability`, which quotes against the
45
+ * actual weight. A client-side rule that refuses a legitimate large parcel is
46
+ * worse than one that lets it through to be priced.
47
+ */
48
+ export const SHIPPING_BOX_LIMITS = {
49
+ minCm: 1,
50
+ maxCm: 200,
51
+ minKg: 0,
52
+ maxKg: 50,
53
+ };
@@ -37,6 +37,7 @@ import { Alert, Button, Card, Form, Heading, Stack, Text } from "../../../ui/ind
37
37
  import { FieldInput } from "../../../ui/forms/FieldInput.js";
38
38
  import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
39
39
  import { TIER_HELP } from "../constants/help-content.js";
40
+ import { toUserMessage } from "../../../errors/error-display-map.js";
40
41
  /** Every tier, unlike the studio — see the header. */
41
42
  const TIERS = ["draft", "standard", "precise", "max"];
42
43
  export function StickerCommitPanel({ file, dimensions, onCommit, onCommitted, }) {
@@ -80,7 +81,7 @@ export function StickerCommitPanel({ file, dimensions, onCommit, onCommitted, })
80
81
  * buyer, which this is not — and the routes already map their own
81
82
  * failures to user-safe text.
82
83
  */
83
- setError(n.message);
84
+ setError(toUserMessage(n.code, undefined, { fallback: "We couldn't commit that sheet. Please try again." }));
84
85
  }
85
86
  finally {
86
87
  setPending(false);
@@ -32,6 +32,7 @@ import { useCallback, useEffect, useState } from "react";
32
32
  import { normalizeError } from "../../../errors/normalize.js";
33
33
  import { Alert, Badge, Button, Card, Heading, Row, Span, Stack, Text, } from "../../../ui/index.js";
34
34
  import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
35
+ import { toUserMessage } from "../../../errors/error-display-map.js";
35
36
  const PROFILES = [
36
37
  { value: "print-shop", label: "Print shop (Roland / Graphtec)" },
37
38
  { value: "cricut-cut", label: "Cricut Joy 2 — cut only" },
@@ -83,7 +84,7 @@ export function StickerPrintPanel({ loadReport, onDownloadCutFile, onDownloadMos
83
84
  * Rendering both the same way would have an operator confirming a DPI to
84
85
  * fix a lapsed session.
85
86
  */
86
- setError(n.message);
87
+ setError(toUserMessage(n.code, undefined, { fallback: "We couldn't prepare that print. Please try again." }));
87
88
  setReport(null);
88
89
  }
89
90
  finally {
@@ -23,11 +23,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  * belongs to which stage.
24
24
  *
25
25
  * 🛑 Built on `<SectionForm>`, not a hand-rolled `<Form>`. Three controls is
26
- * where a form stops being trivial, and sectionising is what buys the error
27
- * summary, the jump-to-field link and the pinned mobile action bar for free —
26
+ * where a form stops being trivial, and sectionising is what buys the
27
+ * jump-to-field link and the pinned mobile action bar —
28
28
  * audit-form-sectionised is strict-zero on exactly this, and its grandfather
29
29
  * list is empty and closed.
30
30
  *
31
+ * 🛑 The error summary is NOT free, and this comment used to claim it was.
32
+ * `SectionForm` deliberately does not own a `FormShellContext` — it consumes
33
+ * whichever one the owning view mounts, and tolerates none. So a view that
34
+ * only renders `<SectionForm schema={…}>` gets section badges and no readable
35
+ * message at all. The view must mount the context and render
36
+ * `<FormErrorSummary>` itself, which is what the bottom of this file now does.
37
+ *
31
38
  * EXPORTS: StickerRetryPanel
32
39
  *
33
40
  * @tag domain:sticker-trace
@@ -43,11 +50,14 @@ import { normalizeError } from "../../../errors/normalize.js";
43
50
  import { Alert, Card, Stack, Text } from "../../../ui/index.js";
44
51
  import { FieldInput } from "../../../ui/forms/FieldInput.js";
45
52
  import { FieldSelect } from "../../../ui/forms/FieldSelect.js";
53
+ import { FormErrorSummary } from "../../../ui/forms/FormErrorSummary.js";
54
+ import { FormShellContext, useFormShellState } from "../../../ui/forms/FormShell.js";
46
55
  import { SectionForm } from "../../shell/SectionForm.js";
47
56
  import { TRACE_STAGES } from "../../../_internal/shared/features/sticker-trace/types.js";
48
57
  import { resolveResumeStage, explainResume, } from "../../../_internal/shared/features/sticker-trace/resume.js";
49
58
  import { paramsForTier } from "../../../_internal/shared/features/sticker-trace/config.js";
50
59
  import { TIER_HELP } from "../constants/help-content.js";
60
+ import { toUserMessage } from "../../../errors/error-display-map.js";
51
61
  const TIERS = ["draft", "standard", "precise", "max"];
52
62
  /**
53
63
  * 🛑 `.min(1)` on the name, mirroring `requireName` on the server.
@@ -103,7 +113,7 @@ export function StickerRetryPanel({ source, artifactsPruned = false, onSubmit, o
103
113
  * operator looking at a form that did nothing — and the likeliest causes,
104
114
  * a lapsed session or a rejected name, are both named by the message.
105
115
  */
106
- setError(n.message);
116
+ setError(toUserMessage(n.code, undefined, { fallback: "We couldn't retry that run. Please try again." }));
107
117
  }
108
118
  finally {
109
119
  setPending(false);
@@ -124,5 +134,15 @@ export function StickerRetryPanel({ source, artifactsPruned = false, onSubmit, o
124
134
  render: ({ values: v, onChange: set }) => (_jsxs(Stack, { gap: "comfortable", children: [_jsx(FieldSelect, { name: "requested", label: "Resume from", value: v.requested, options: TRACE_STAGES.map((s) => ({ value: s, label: s })), onChange: (next) => set({ requested: next }) }), notice ? _jsx(Alert, { variant: "warning", children: notice }) : null, artifactsPruned ? (_jsx(Alert, { variant: "warning", children: "This run's artifacts have been cleared, so the retry starts from the beginning whatever you pick here." })) : null, !source.params ? (_jsx(Text, { size: "xs", color: "muted", children: "This run predates parameter recording, so the resume point cannot be checked ahead of time \u2014 the server will decide and tell you." })) : null] })),
125
135
  },
126
136
  ], [source.name, source.params, notice, artifactsPruned]);
127
- return (_jsx(Card, { variant: "default", children: _jsxs(Stack, { gap: "comfortable", children: [error ? _jsx(Alert, { variant: "error", children: error }) : null, _jsx(SectionForm, { sections: sections, values: values, onChange: onChange, onSubmit: submit, schema: retrySchema, submitLabel: "Start retry", isLoading: pending, onCancel: onCancel, cancelLabel: "Cancel" })] }) }));
137
+ /*
138
+ * 🛑 `SectionForm` does NOT provide a FormShellContext — it reads whichever
139
+ * one the owning view mounts, and may legitimately get none. The header of
140
+ * this file says sectionising buys "the error summary … for free", and that
141
+ * was wrong: nothing here mounted a context or rendered a summary, so a
142
+ * schema rejection set the section badge and produced no readable message
143
+ * anywhere. The file passed `audit-form-error-summary` only because a bare
144
+ * `<SectionForm schema=>` was not a recognised call site.
145
+ */
146
+ const { shellCtx } = useFormShellState(retrySchema);
147
+ return (_jsx(Card, { variant: "default", children: _jsx(FormShellContext.Provider, { value: shellCtx, children: _jsxs(Stack, { gap: "comfortable", children: [error ? _jsx(Alert, { variant: "error", children: error }) : null, _jsx(FormErrorSummary, {}), _jsx(SectionForm, { sections: sections, values: values, onChange: onChange, onSubmit: submit, schema: retrySchema, submitLabel: "Start retry", isLoading: pending, onCancel: onCancel, cancelLabel: "Cancel" })] }) }) }));
128
148
  }
@@ -30,6 +30,7 @@ import { PARAM_HELP, TIER_HELP } from "../constants/help-content.js";
30
30
  import { useLiveTrace } from "../hooks/useLiveTrace.js";
31
31
  import { canvasCodec } from "../../../_internal/client/features/sticker-trace/canvas-codec.js";
32
32
  import { normalizeError } from "../../../errors/normalize.js";
33
+ import { toUserMessage } from "../../../errors/error-display-map.js";
33
34
  /*
34
35
  * Only `draft` is offered. The hook runs on the main thread and draft's
35
36
  * 1200px cap is what keeps one trace near a second; `standard`'s 3000 would
@@ -103,7 +104,7 @@ export function StickerTraceStudio({ renderCommit }) {
103
104
  // the operator is the one who needs to know the commit is blocked.
104
105
  if (live) {
105
106
  setNatural(null);
106
- setProbeError(n.message);
107
+ setProbeError(toUserMessage(n.code, undefined, { fallback: "That probe could not be run." }));
107
108
  }
108
109
  });
109
110
  return () => {
@@ -12,14 +12,14 @@ export declare const reportCreateSchema: z.ZodObject<{
12
12
  }, "strict", z.ZodTypeAny, {
13
13
  entityId: string;
14
14
  entityType: import("./firestore").ReportEntityType;
15
- detail: string;
16
15
  reason: import("./firestore").ReportReason;
16
+ detail: string;
17
17
  evidenceUrls?: string[] | undefined;
18
18
  }, {
19
19
  entityId: string;
20
20
  entityType: import("./firestore").ReportEntityType;
21
- detail: string;
22
21
  reason: import("./firestore").ReportReason;
22
+ detail: string;
23
23
  evidenceUrls?: string[] | undefined;
24
24
  }>;
25
25
  export type ReportCreateValues = z.infer<typeof reportCreateSchema>;
@@ -133,8 +133,8 @@ export declare const shippingConfigUpdateSchema: z.ZodObject<{
133
133
  label?: string | undefined;
134
134
  isActive?: boolean | undefined;
135
135
  isDefault?: boolean | undefined;
136
- method?: ShippingMethod | undefined;
137
136
  estimatedDays?: number | undefined;
137
+ method?: ShippingMethod | undefined;
138
138
  flatRate?: number | undefined;
139
139
  pricePerKg?: number | undefined;
140
140
  freeAbove?: number | undefined;
@@ -144,8 +144,8 @@ export declare const shippingConfigUpdateSchema: z.ZodObject<{
144
144
  label?: string | undefined;
145
145
  isActive?: boolean | undefined;
146
146
  isDefault?: boolean | undefined;
147
- method?: ShippingMethod | undefined;
148
147
  estimatedDays?: number | undefined;
148
+ method?: ShippingMethod | undefined;
149
149
  flatRate?: number | undefined;
150
150
  pricePerKg?: number | undefined;
151
151
  freeAbove?: number | undefined;
@@ -2,6 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ArrowLeft } from "lucide-react";
3
3
  import { Accordion, Alert, Code, Div, Heading, Li, Ol, Row, Section, Span, Stack, Table, Tbody, Td, Text, TextLink, Th, Thead, Tr, Ul } from "../../../ui/index.js";
4
4
  import { ROUTES } from "../../../next/routing/route-map.js";
5
+ import { resolvePublishedValues } from "../../../_internal/shared/content/published-values.js";
6
+ /* Phase 9 — one definition of the refund timeline. */
7
+ const { refundBusinessDaysMin: REFUND_DAYS_MIN, refundBusinessDaysMax: REFUND_DAYS_MAX } = resolvePublishedValues();
5
8
  const SUBHEADING = "mb-1 font-semibold text-[var(--appkit-color-text)]";
6
9
  const LIST_DISC = "list-disc leading-relaxed";
7
10
  const SECTION_BODY = "space-y-4 text-[length:var(--appkit-text-sm)] text-[var(--appkit-color-text-muted)]";
@@ -41,7 +44,9 @@ const STATUS_ROWS = [
41
44
  {
42
45
  status: "CANCELLED",
43
46
  meaning: "Order was cancelled before shipping (by buyer or seller).",
44
- action: "Refund is automatic via Razorpay (3–7 business days).",
47
+ // Phase 9 — one definition, and no gateway name. See the identical note in
48
+ // AdminOrdersGuideView.
49
+ action: `Refund is automatic (${REFUND_DAYS_MIN}–${REFUND_DAYS_MAX} business days).`,
45
50
  },
46
51
  {
47
52
  status: "RETURN_REQUESTED",
@@ -233,6 +233,77 @@ export interface StoreDocument extends BaseDocument {
233
233
  */
234
234
  supportsShippingProtection?: boolean;
235
235
  supportsSaleProtection?: boolean;
236
+ /**
237
+ * This store accepts buyer points as part-payment.
238
+ *
239
+ * ## 🛑 OPT-IN, because the accepting store ABSORBS the redemption
240
+ *
241
+ * Decision 3: a redeemed point reduces THAT store's payout for THAT order.
242
+ * Earning is mandatory (it costs the seller nothing at issue time); accepting
243
+ * is optional, because accepting is where the money actually moves. So this
244
+ * follows `supportsSaleProtection` above exactly — **absent means NOT
245
+ * accepted, never "unknown"** — and for the identical reason: defaulting it
246
+ * `true` would enrol every existing seller in funding discounts they never
247
+ * agreed to, and retrofitting consent later means switching a working feature
248
+ * off for them.
249
+ *
250
+ * 🛑 Live currently has ONE store, so this flag is inert today. It is still
251
+ * built now rather than later: the day a second seller exists, enabling
252
+ * redemption for them without asking is taking their money, and the cost of
253
+ * the field today is one boolean and one check.
254
+ *
255
+ * `store-letitrip-official` is always treated as accepting — the platform's
256
+ * own storefront cannot decline to fund its own programme. That is resolved
257
+ * in code rather than seeded, so it cannot be switched off by an edit.
258
+ */
259
+ acceptsPoints?: boolean;
260
+ /**
261
+ * ── S5a: this store allows a SHARED PURCHASE (one payer, N destinations) ──
262
+ *
263
+ * The coordinator buys everything and assigns a destination per item, so the
264
+ * seller packs one order into several parcels. That is real extra work —
265
+ * picking, packing and labelling N shipments instead of one — which is why
266
+ * it is an opt-in with its own fees rather than a free platform behaviour.
267
+ *
268
+ * 🛑 **Absent means NOT allowed**, matching `supportsSaleProtection` and
269
+ * `acceptsPoints` above, and for the same reason: the cost falls on the
270
+ * seller, so enrolling them without asking is taking their labour. Every
271
+ * existing store therefore starts with it off, which is the correct state
272
+ * rather than a migration problem.
273
+ *
274
+ * 🛑 This is S5a ONLY — one payer. It is NOT the N-party flow (S5b), which
275
+ * needs multi-party payment, a coordinator deposit, an approval cascade, a
276
+ * stock-reservation primitive that does not exist, and per-buyer invoicing
277
+ * and GST. A seller enabling this is agreeing to split one paid order across
278
+ * destinations, not to be paid by several people.
279
+ */
280
+ allowSharedPurchase?: boolean;
281
+ /**
282
+ * Flat fee per shared-purchase arrangement, in decimal rupees.
283
+ *
284
+ * Covers picking, packing and labelling one order into N parcels. Borne by
285
+ * the COORDINATOR — they chose the arrangement — which keeps each
286
+ * destination's own cost to goods plus that destination's shipping.
287
+ *
288
+ * 🛑 SNAPSHOTTED onto the order at checkout, never re-read later. The
289
+ * precedent is exact: the refund path reads `finalSale` from the ORDER
290
+ * snapshot rather than the live product, because "re-reading the live
291
+ * product would let a seller flip the switch afterwards" (D61). A fee read
292
+ * late is the same hole.
293
+ */
294
+ sharedPurchaseHandlingFee?: number;
295
+ /**
296
+ * Extra shipping per destination BEYOND THE FIRST, in decimal rupees.
297
+ *
298
+ * The first destination is the shipping the order would have paid anyway;
299
+ * this is the marginal cost of each additional parcel. Borne by the buyer at
300
+ * that destination in the full N-party flow — in S5a there is one payer, so
301
+ * the coordinator pays all of it, which is correct because they are the
302
+ * person who asked for the extra legs.
303
+ *
304
+ * Snapshotted with the handling fee, for the same reason.
305
+ */
306
+ sharedPurchaseExtraShippingPerDestination?: number;
236
307
  /**
237
308
  * ── C5g: ADMIN-GRANTED trust. Routes even a protected claim to the seller ──
238
309
  *
@@ -24,6 +24,25 @@ export interface StoreListItem {
24
24
  */
25
25
  supportsShippingProtection: boolean;
26
26
  supportsSaleProtection: boolean;
27
+ /**
28
+ * S5a — this seller will split one paid order across several destinations.
29
+ *
30
+ * Not optional, for the same reason as the two above: the projection
31
+ * resolves absence to `false`, so the client never decides what `undefined`
32
+ * means.
33
+ */
34
+ allowSharedPurchase: boolean;
35
+ /**
36
+ * The two shared-purchase fees, in decimal rupees.
37
+ *
38
+ * 🛑 OPTIONAL here where `allowSharedPurchase` is not, and the asymmetry is
39
+ * the point: a flag's absence means "no", but a fee's absence means "not
40
+ * configured" — which is not ₹0. A client that defaulted these to zero would
41
+ * quote a free arrangement from a store that has simply not priced one, and
42
+ * the coordinator commits against that quote.
43
+ */
44
+ sharedPurchaseHandlingFee?: number;
45
+ sharedPurchaseExtraShippingPerDestination?: number;
27
46
  createdAt?: string;
28
47
  }
29
48
  export interface StoreDetail extends StoreListItem {
@@ -175,11 +175,11 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
175
175
  attachments?: string[] | undefined;
176
176
  }[];
177
177
  orderId?: string | undefined;
178
- assignedTo?: string | undefined;
179
- resolvedAt?: string | Date | z.objectOutputType<{
178
+ closedAt?: string | Date | z.objectOutputType<{
180
179
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
181
180
  }, z.ZodTypeAny, "passthrough"> | undefined;
182
- closedAt?: string | Date | z.objectOutputType<{
181
+ assignedTo?: string | undefined;
182
+ resolvedAt?: string | Date | z.objectOutputType<{
183
183
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
184
184
  }, z.ZodTypeAny, "passthrough"> | undefined;
185
185
  assignedToName?: string | undefined;
@@ -218,11 +218,11 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
218
218
  attachments?: string[] | undefined;
219
219
  }[];
220
220
  orderId?: string | undefined;
221
- assignedTo?: string | undefined;
222
- resolvedAt?: string | Date | z.objectInputType<{
221
+ closedAt?: string | Date | z.objectInputType<{
223
222
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
224
223
  }, z.ZodTypeAny, "passthrough"> | undefined;
225
- closedAt?: string | Date | z.objectInputType<{
224
+ assignedTo?: string | undefined;
225
+ resolvedAt?: string | Date | z.objectInputType<{
226
226
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
227
227
  }, z.ZodTypeAny, "passthrough"> | undefined;
228
228
  assignedToName?: string | undefined;
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useQuery, useQueryClient } from "@tanstack/react-query";
4
- import { Button, Card, Details, Div, Row, Stack, Summary, Text } from "../../../ui/index.js";
4
+ import { Button, Card, Details, Div, Row, Stack, Summary, Text, TextLink } from "../../../ui/index.js";
5
+ import { ROUTES } from "../../../next/routing/route-map.js";
5
6
  import { MediaImage } from "../../media/MediaImage.js";
6
7
  import { apiClient } from "../../../http/index.js";
7
8
  import { useApiMutation } from "../../../client/api/useApiMutation.js";
@@ -50,6 +51,6 @@ export function AdminTesterFeedbackIssuesView() {
50
51
  const sortedPhases = Array.from(byPhase.keys()).sort((a, b) => a - b);
51
52
  return (_jsx(Stack, { gap: "md", children: sortedPhases.map((phase) => {
52
53
  const phaseIssues = byPhase.get(phase);
53
- return (_jsxs(Details, { tone: "card", defaultOpen: sortedPhases.length === 1, children: [_jsxs(Summary, { size: "lg", weight: "bold", children: ["Phase ", phase, " (", phaseIssues.length, " issue", phaseIssues.length === 1 ? "" : "s", ")"] }), _jsx(Div, { padding: "t-sm", children: _jsx(Stack, { gap: "sm", children: phaseIssues.map((issue) => (_jsx(Card, { padding: "md", variant: "default", children: _jsxs(Stack, { gap: "xs", children: [_jsx(Text, { weight: "semibold", children: issue.label }), _jsxs(Text, { size: "sm", color: "muted", children: [issue.groupLabel, " \u203A ", issue.pageLabel] }), _jsxs(Text, { size: "sm", color: "muted", children: ["Reported by ", issue.testerDisplayName] }), issue.comment && _jsx(Text, { size: "sm", children: issue.comment }), issue.screenshotUrl && (_jsx(MediaImage, { src: issue.screenshotUrl, alt: "Tester screenshot", size: "card" })), issue.bugConfirmed ? (_jsxs(Row, { gap: "sm", align: "center", wrap: true, children: [_jsxs(Text, { size: "sm", weight: "semibold", color: "success", children: ["\uD83D\uDC1B Confirmed \u2014 credited to ", issue.bugHunterName ?? "unknown tester"] }), !issue.supersededByItemId && (_jsx(Button, { size: "sm", action: ACTIONS.ADMIN["reopen-checklist-item"], isLoading: reopenMutation.isPending, onClick: () => reopenMutation.mutate(issue.checklistItemId) }))] })) : (_jsx(Div, { children: _jsx(Button, { size: "sm", action: ACTIONS.ADMIN["confirm-bug"], isLoading: confirmBugMutation.isPending, onClick: () => confirmBugMutation.mutate(issue.id) }) }))] }) }, issue.id))) }) })] }, phase));
54
+ return (_jsxs(Details, { tone: "card", defaultOpen: sortedPhases.length === 1, children: [_jsxs(Summary, { size: "lg", weight: "bold", children: ["Phase ", phase, " (", phaseIssues.length, " issue", phaseIssues.length === 1 ? "" : "s", ")"] }), _jsx(Div, { padding: "t-sm", children: _jsx(Stack, { gap: "sm", children: phaseIssues.map((issue) => (_jsx(Card, { padding: "md", variant: "default", children: _jsxs(Stack, { gap: "xs", children: [_jsx(TextLink, { href: String(ROUTES.ADMIN.TESTER_CHECKLIST_EDIT(issue.checklistItemId)), weight: "semibold", children: issue.label }), _jsxs(Text, { size: "sm", color: "muted", children: [issue.groupLabel, " \u203A ", issue.pageLabel] }), _jsxs(Text, { size: "sm", color: "muted", children: ["Reported by ", issue.testerDisplayName] }), issue.comment && _jsx(Text, { size: "sm", children: issue.comment }), issue.screenshotUrl && (_jsx(MediaImage, { src: issue.screenshotUrl, alt: "Tester screenshot", size: "card" })), issue.bugConfirmed ? (_jsxs(Row, { gap: "sm", align: "center", wrap: true, children: [_jsxs(Text, { size: "sm", weight: "semibold", color: "success", children: ["\uD83D\uDC1B Confirmed \u2014 credited to ", issue.bugHunterName ?? "unknown tester"] }), !issue.supersededByItemId && (_jsx(Button, { size: "sm", action: ACTIONS.ADMIN["reopen-checklist-item"], isLoading: reopenMutation.isPending, onClick: () => reopenMutation.mutate(issue.checklistItemId) }))] })) : (_jsx(Div, { children: _jsx(Button, { size: "sm", action: ACTIONS.ADMIN["confirm-bug"], isLoading: confirmBugMutation.isPending, onClick: () => confirmBugMutation.mutate(issue.id) }) }))] }) }, issue.id))) }) })] }, phase));
54
55
  }) }));
55
56
  }
@@ -29,7 +29,7 @@ export declare function useWishlistWithGuest(userId: string | null | undefined,
29
29
  productPrice: number;
30
30
  productSlug: string;
31
31
  addedAt: string | undefined;
32
- type: "category" | "store" | "classified" | "auction" | "digital-code" | "live" | "product" | "preorder";
32
+ type: "category" | "store" | "classified" | "auction" | "digital-code" | "live" | "preorder" | "product";
33
33
  }[];
34
34
  total: number;
35
35
  wishlistedIds: Set<string>;
package/dist/index.d.ts CHANGED
@@ -52,6 +52,10 @@ export type { FieldSelectProps } from "./ui/index";
52
52
  export { FieldSelect } from "./ui/index";
53
53
  export type { FieldCheckboxProps } from "./ui/index";
54
54
  export { FieldCheckbox } from "./ui/index";
55
+ export type { FieldTextareaProps } from "./ui/index";
56
+ export { FieldTextarea } from "./ui/index";
57
+ export type { FormErrorSummaryProps } from "./ui/index";
58
+ export { FormErrorSummary } from "./ui/index";
55
59
  export { GRID_MAP } from "./ui/index";
56
60
  export { ImageGallery } from "./ui/index";
57
61
  export { ImageLightbox } from "./ui/index";
@@ -1958,6 +1962,8 @@ export type { OrderSiblingPaymentsProps } from "./features/orders/index";
1958
1962
  export { OrderPaymentSummary } from "./features/orders/index";
1959
1963
  export type { OrderPaymentSummaryProps } from "./features/orders/index";
1960
1964
  export { OrderStatusTimeline } from "./features/orders/index";
1965
+ export { OrderProvenanceCard } from "./features/orders/index";
1966
+ export type { OrderProvenanceCardProps } from "./features/orders/index";
1961
1967
  export { OrderCompletionPanel } from "./features/orders/index";
1962
1968
  export { StatusTimeline, stepsFromEntries } from "./features/status-history/index";
1963
1969
  export type { StatusTimelineProps, TimelineEntry, TimelineStep } from "./features/status-history/index";
@@ -1996,6 +2002,7 @@ export type { OrderAdminUpdateInput } from "./features/orders/index";
1996
2002
  export type { AppliedOrderDiscount } from "./features/orders/index";
1997
2003
  export type { OrderCreateInput } from "./features/orders/index";
1998
2004
  export type { OrderDocument } from "./features/orders/index";
2005
+ export type { OrderSourceContext } from "./features/orders/index";
1999
2006
  export type { OrderRefundEvent, RefundType } from "./features/orders/schemas/firestore";
2000
2007
  export { MANUAL_PAYMENT_METHODS, isManualPaymentMethod, PAYMENT_REVIEW_QUEUE_MODES, isPaymentReviewQueueMode, PAYMENT_REVIEW_QUEUE_SCAN_LIMIT, } from "./features/orders/constants/payment-window";
2001
2008
  export type { PaymentReviewQueueMode } from "./features/orders/constants/payment-window";
@@ -2186,7 +2193,7 @@ export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type Actio
2186
2193
  export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
2187
2194
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, type ActionDef, type ActionKind, type ActionResource, type ActionTree, type ActionConfirmation, } from "./_internal/shared/actions/action-registry";
2188
2195
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers";
2189
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
2196
+ export { computeCheckoutFees, allocateCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
2190
2197
  export { searchPriceIndex, PRICE_INDEX_SEARCH_LIMIT, PRICE_INDEX_MIN_QUERY_LENGTH } from "./_internal/server/features/price-index/search";
2191
2198
  export type { PriceIndexSearchResponse, PriceIndexSearchResult, PriceIndexSearchResultBand, } from "./_internal/server/features/price-index/search";
2192
2199
  export { protectionAvailability, computeProtectionFees, adjudicateClaim, badgesFor, showsRiskNotice, showsSafetyBadge, returnDestination, rtoDestination, PROTECTION_KINDS, } from "./_internal/shared/features/shipping/protections";
@@ -2848,6 +2855,8 @@ export { BUNDLE_COPY, BUNDLE_STOCK_VARIANT, } from "./_internal/shared/features/
2848
2855
  export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy";
2849
2856
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons";
2850
2857
  export type { ReturnReason } from "./_internal/shared/features/orders/return-reasons";
2858
+ export { DISPUTE_KIND, DISPUTE_KIND_LABEL, DISPUTE_GATE, DISPUTE_TRANSIT_WINDOW_DAYS, DISPUTE_NOT_REACHED_GRACE_DAYS, isDisputeKind, checkDisputeGate, resolveDisputeEtd, disputeNotReachedFilableFrom, } from "./_internal/shared/features/orders/dispute-reasons";
2859
+ export type { DisputeKind, DisputeGateOrder, DisputeGateResult, } from "./_internal/shared/features/orders/dispute-reasons";
2851
2860
  export { bundleCreateSchema, bundleUpdateSchema, bundleQueryRuleSchema, bundleDisplaySchema, type BundleCreateBody, type BundleUpdateBody, } from "./_internal/shared/features/categories/bundle-schemas";
2852
2861
  export type { GroupedListingDocument, GroupTheme, GroupVisibility } from "./features/grouped/schemas/firestore";
2853
2862
  export { navItemFormSchema, navItemCreateSchema, navItemUpdateSchema, type NavItemFormValues, } from "./features/admin/schemas/nav-item-form";
@@ -2940,7 +2949,7 @@ export type { OwnerQuickActionsProps, OwnerQuickActionsResource } from "./featur
2940
2949
  export type { ListingTypePlugin } from "./_internal/shared/listing-types/_registry";
2941
2950
  export { getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPreflight, CHECKOUT_RULES, CATEGORY_CHECKOUT_RULES, CHECKOUT_MAX_ORDERS_PER_TX, PRIZE_DRAW_MAX_REVEALS_PER_ORDER, BUNDLE_MAX_QTY_PER_TX, STANDARD_MAX_QTY_PER_LINE, } from "./_internal/shared/checkout/rules";
2942
2951
  export type { ListingCheckoutRule, CategoryCheckoutRule, CartItemProductPair, OrderItemInput, RefundPolicy, } from "./_internal/shared/checkout/rules";
2943
- export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits";
2952
+ export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, REVIEW_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits";
2944
2953
  export type { MediaKind, AllowedImageMime, AllowedVideoMime, AllowedDocMime, AllowedMime, } from "./_internal/shared/media/limits";
2945
2954
  export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, AD_TRACKED_FIELDS, BLOG_FIELDS, BRAND_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, COUPON_USAGE_FIELDS, CAROUSEL_FIELDS, FAQ_FIELDS, HOMEPAGE_SECTION_FIELDS, SITE_SETTINGS_FIELDS, COMMON_FIELDS, OAUTH_STATE_VALUES, SCHEMA_DEFAULTS, } from "./constants/field-names";
2946
2955
  export { SORT_DIR, sortBy } from "./constants/sort";
package/dist/index.js CHANGED
@@ -138,6 +138,8 @@ export { FormGroup } from "./ui/index.js";
138
138
  export { FieldInput } from "./ui/index.js";
139
139
  export { FieldSelect } from "./ui/index.js";
140
140
  export { FieldCheckbox } from "./ui/index.js";
141
+ export { FieldTextarea } from "./ui/index.js";
142
+ export { FormErrorSummary } from "./ui/index.js";
141
143
  // [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
142
144
  // GRID_MAP - Constant used across modules.
143
145
  export { GRID_MAP } from "./ui/index.js";
@@ -3689,6 +3691,9 @@ export { OrdersList } from "./features/orders/index.js";
3689
3691
  export { OrderSiblingPayments } from "./features/orders/index.js";
3690
3692
  export { OrderPaymentSummary } from "./features/orders/index.js";
3691
3693
  export { OrderStatusTimeline } from "./features/orders/index.js";
3694
+ // OrderProvenanceCard — renders sourceContext, the record of HOW the buyer
3695
+ // earned this price. Mounted on the buyer, seller AND admin order detail.
3696
+ export { OrderProvenanceCard } from "./features/orders/index.js";
3692
3697
  // OrderCompletionPanel - Per-line ratings + Mark complete, the buyer's fast path.
3693
3698
  export { OrderCompletionPanel } from "./features/orders/index.js";
3694
3699
  // [CLIENT] StatusTimeline — the ONE rail both orders and offers render.
@@ -4073,7 +4078,14 @@ export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_int
4073
4078
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, } from "./_internal/shared/actions/action-registry.js";
4074
4079
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers.js";
4075
4080
  // Shared fee calculator — platform/gateway/GST/COD handling/addon fee math (pure, client-safe).
4076
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator.js";
4081
+ export { computeCheckoutFees,
4082
+ // The per-group split of the ONE capped commission. Exported for the capture
4083
+ // route's points tender: the tender is applied per order group against the
4084
+ // same base the order path uses, and that base includes this share. Without
4085
+ // it the route would have to re-derive the apportionment — and the allocator
4086
+ // also carries the `minimumTransactionFee` floor (D41), which already spent
4087
+ // a release being re-implemented by hand in that very file.
4088
+ allocateCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator.js";
4077
4089
  // C5e buyer protections — the pure three-tier gate plus the one fee pair
4078
4090
  // every money path must agree on. Public API because the capture route
4079
4091
  // (/api/payment/create-order) is one of the three sites that must agree.
@@ -5119,6 +5131,9 @@ export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy.js";
5119
5131
  // See the module docstring for why the exempt set is "seller or carrier fault"
5120
5132
  // rather than "serious reasons".
5121
5133
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons.js";
5134
+ // Dispute KINDS and their gates. `_internal/*` is not a subpath export, so a
5135
+ // consumer route reaches these only through a barrel.
5136
+ export { DISPUTE_KIND, DISPUTE_KIND_LABEL, DISPUTE_GATE, DISPUTE_TRANSIT_WINDOW_DAYS, DISPUTE_NOT_REACHED_GRACE_DAYS, isDisputeKind, checkDisputeGate, resolveDisputeEtd, disputeNotReachedFilableFrom, } from "./_internal/shared/features/orders/dispute-reasons.js";
5122
5137
  // S-SBUNI-4 follow-up â€" shared admin bundle zod schemas.
5123
5138
  export { bundleCreateSchema, bundleUpdateSchema, bundleQueryRuleSchema, bundleDisplaySchema, } from "./_internal/shared/features/categories/bundle-schemas.js";
5124
5139
  export { navItemFormSchema, navItemCreateSchema, navItemUpdateSchema, } from "./features/admin/schemas/nav-item-form.js";
@@ -5249,7 +5264,7 @@ export { RecordOwnerQuickActions } from "./features/admin/components/RecordOwner
5249
5264
  // Checkout rule registry â€" pure TS, safe in both client and server bundles.
5250
5265
  export { getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPreflight, CHECKOUT_RULES, CATEGORY_CHECKOUT_RULES, CHECKOUT_MAX_ORDERS_PER_TX, PRIZE_DRAW_MAX_REVEALS_PER_ORDER, BUNDLE_MAX_QTY_PER_TX, STANDARD_MAX_QTY_PER_LINE, } from "./_internal/shared/checkout/rules/index.js";
5251
5266
  // Media upload limits â€" pure constants, safe in both client and server bundles.
5252
- export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits.js";
5267
+ export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, REVIEW_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits.js";
5253
5268
  // ── Field name constants — canonical source of truth for all Firestore field names ──
5254
5269
  // NOTE: STORE_FIELDS, CATEGORY_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS,
5255
5270
  // COUPON_FIELDS, CART_FIELDS, USER_FIELDS, ADDRESS_FIELDS, NOTIFICATION_FIELDS,