@mohasinac/appkit 3.8.2 → 3.9.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 (479) hide show
  1. package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
  2. package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +4 -4
  3. package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +8 -8
  4. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +1 -1
  5. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -2
  6. package/dist/_internal/server/features/bundles/actions.js +2 -2
  7. package/dist/_internal/server/features/bundles/og.d.ts +1 -1
  8. package/dist/_internal/server/features/bundles/og.js +4 -5
  9. package/dist/_internal/server/features/checkout/actions.js +57 -21
  10. package/dist/_internal/server/features/checkout/stock-restore.d.ts +19 -0
  11. package/dist/_internal/server/features/checkout/stock-restore.js +80 -0
  12. package/dist/_internal/server/features/checkout/upi-resolution.d.ts +11 -0
  13. package/dist/_internal/server/features/checkout/upi-resolution.js +28 -0
  14. package/dist/_internal/server/features/classified/og.js +1 -1
  15. package/dist/_internal/server/features/digital-code/og.js +1 -1
  16. package/dist/_internal/server/features/item-requests/og.d.ts +2 -2
  17. package/dist/_internal/server/features/item-requests/og.js +4 -5
  18. package/dist/_internal/server/features/live/og.js +1 -1
  19. package/dist/_internal/server/features/lottery/adapters.d.ts +2 -2
  20. package/dist/_internal/server/features/lottery/adapters.js +1 -1
  21. package/dist/_internal/server/features/orders/actions.d.ts +28 -0
  22. package/dist/_internal/server/features/orders/actions.js +239 -4
  23. package/dist/_internal/server/features/orders/adapters.js +3 -0
  24. package/dist/_internal/server/features/payments/data.js +3 -2
  25. package/dist/_internal/server/features/payouts/actions.d.ts +2 -2
  26. package/dist/_internal/server/features/payouts/actions.js +4 -3
  27. package/dist/_internal/server/features/pre-orders/service.d.ts +1 -1
  28. package/dist/_internal/server/features/pre-orders/service.js +3 -2
  29. package/dist/_internal/server/features/prize-draws/og.js +5 -5
  30. package/dist/_internal/server/features/products/og.js +1 -1
  31. package/dist/_internal/server/features/promotions/service.js +3 -1
  32. package/dist/_internal/server/features/refunds/actions.d.ts +2 -2
  33. package/dist/_internal/server/features/refunds/actions.js +7 -6
  34. package/dist/_internal/server/functions/firestore.js +1 -1
  35. package/dist/_internal/server/functions/scheduled.d.ts +4 -1
  36. package/dist/_internal/server/functions/scheduled.js +26 -2
  37. package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +1 -1
  38. package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +4 -0
  39. package/dist/_internal/server/jobs/core/hardBanCascade.js +15 -4
  40. package/dist/_internal/server/jobs/core/hardBanReinstatement.d.ts +16 -0
  41. package/dist/_internal/server/jobs/core/hardBanReinstatement.js +63 -0
  42. package/dist/_internal/server/jobs/core/jobRunners.js +3 -1
  43. package/dist/_internal/server/jobs/core/onScamReportCreate.js +1 -1
  44. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +10 -0
  45. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +60 -0
  46. package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +15 -0
  47. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +59 -0
  48. package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +7 -0
  49. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +32 -6
  50. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.d.ts +2 -0
  51. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.js +2 -0
  52. package/dist/_internal/server/jobs/handlers/index.d.ts +3 -0
  53. package/dist/_internal/server/jobs/handlers/index.js +3 -0
  54. package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -0
  55. package/dist/_internal/server/jobs/handlers/messages.js +4 -0
  56. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +3 -3
  57. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +12 -12
  58. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
  59. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +5 -5
  60. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.d.ts +2 -0
  61. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.js +2 -0
  62. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.d.ts +2 -0
  63. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.js +2 -0
  64. package/dist/_internal/shared/actions/action-registry.js +27 -0
  65. package/dist/_internal/shared/checkout/order-math.js +3 -2
  66. package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
  67. package/dist/_internal/shared/checkout/rules/preorder.rule.js +7 -0
  68. package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +7 -0
  69. package/dist/_internal/shared/checkout/rules/types.d.ts +11 -0
  70. package/dist/_internal/shared/features/auctions/errors.js +1 -1
  71. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +0 -1
  72. package/dist/_internal/shared/features/categories/bundle-copy.js +0 -1
  73. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +6 -6
  74. package/dist/_internal/shared/features/categories/bundle-schemas.js +2 -2
  75. package/dist/_internal/shared/features/checkout/config.d.ts +3 -3
  76. package/dist/_internal/shared/features/checkout/config.js +3 -3
  77. package/dist/_internal/shared/features/emi/schedule.d.ts +6 -6
  78. package/dist/_internal/shared/features/emi/schedule.js +10 -9
  79. package/dist/_internal/shared/features/promotions/errors.js +1 -1
  80. package/dist/_internal/shared/fees/calculator.d.ts +5 -5
  81. package/dist/_internal/shared/fees/calculator.js +19 -19
  82. package/dist/client.d.ts +1 -1
  83. package/dist/client.js +1 -1
  84. package/dist/constants/api-endpoints.d.ts +9 -0
  85. package/dist/constants/api-endpoints.js +3 -0
  86. package/dist/constants/field-names.d.ts +4 -0
  87. package/dist/constants/field-names.js +4 -0
  88. package/dist/features/admin/components/AdminArtView.js +2 -2
  89. package/dist/features/admin/components/AdminBidsView.js +2 -2
  90. package/dist/features/admin/components/AdminBundleEditorView.d.ts +1 -1
  91. package/dist/features/admin/components/AdminBundleEditorView.js +8 -8
  92. package/dist/features/admin/components/AdminBundlesView.js +6 -6
  93. package/dist/features/admin/components/AdminClassifiedView.js +2 -2
  94. package/dist/features/admin/components/AdminDigitalCodesView.js +2 -2
  95. package/dist/features/admin/components/AdminLiveView.js +2 -2
  96. package/dist/features/admin/components/AdminOrderEditorView.d.ts +6 -1
  97. package/dist/features/admin/components/AdminOrderEditorView.js +45 -5
  98. package/dist/features/admin/components/AdminOrdersView.js +8 -3
  99. package/dist/features/admin/components/AdminPayoutsView.js +2 -2
  100. package/dist/features/admin/components/AdminPrizeDrawsView.js +2 -2
  101. package/dist/features/admin/components/AdminReturnRequestsView.js +2 -2
  102. package/dist/features/admin/components/AdminSiteSettingsView.js +11 -11
  103. package/dist/features/admin/components/AdminStickersView.js +2 -2
  104. package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
  105. package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -1
  106. package/dist/features/admin/hooks/useAdminListingData.js +3 -2
  107. package/dist/features/admin/schemas/firestore.d.ts +9 -7
  108. package/dist/features/admin/schemas/firestore.js +4 -3
  109. package/dist/features/auctions/components/AuctionBidsTable.js +3 -3
  110. package/dist/features/auth/checkout-value-otp.d.ts +46 -0
  111. package/dist/features/auth/checkout-value-otp.js +73 -0
  112. package/dist/features/auth/repository/user.repository.d.ts +6 -0
  113. package/dist/features/auth/repository/user.repository.js +19 -0
  114. package/dist/features/auth/schemas/firestore.d.ts +10 -0
  115. package/dist/features/auth/schemas/firestore.js +2 -0
  116. package/dist/features/cart/actions/cart-actions.d.ts +1 -1
  117. package/dist/features/cart/actions/cart-actions.js +4 -4
  118. package/dist/features/cart/components/CartView.d.ts +2 -2
  119. package/dist/features/cart/components/ShippingPicker.d.ts +4 -4
  120. package/dist/features/cart/components/ShippingPicker.js +11 -11
  121. package/dist/features/cart/repository/cart.repository.d.ts +1 -1
  122. package/dist/features/cart/repository/cart.repository.js +2 -2
  123. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  124. package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
  125. package/dist/features/catalogue/components/PublicCatalogueView.js +2 -2
  126. package/dist/features/catalogue/schemas/validation.js +1 -1
  127. package/dist/features/categories/components/BundleCollage.js +2 -2
  128. package/dist/features/categories/components/BundleDetailView.js +2 -2
  129. package/dist/features/categories/components/BundleItemsPicker.d.ts +1 -1
  130. package/dist/features/categories/components/BundleItemsPicker.js +2 -2
  131. package/dist/features/categories/components/CategoryBundlesListing.js +2 -2
  132. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  133. package/dist/features/categories/schemas/index.d.ts +3 -3
  134. package/dist/features/categories/schemas/index.js +2 -2
  135. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +16 -0
  136. package/dist/features/checkout/actions/checkout-value-otp-actions.js +83 -0
  137. package/dist/features/checkout/actions/index.d.ts +1 -0
  138. package/dist/features/checkout/actions/index.js +1 -0
  139. package/dist/features/checkout/schemas/firestore.d.ts +1 -1
  140. package/dist/features/classified/components/index.d.ts +0 -4
  141. package/dist/features/classified/components/index.js +0 -2
  142. package/dist/features/digital-codes/components/index.d.ts +0 -4
  143. package/dist/features/digital-codes/components/index.js +0 -2
  144. package/dist/features/events/schemas/index.d.ts +1 -1
  145. package/dist/features/events/schemas/index.js +1 -1
  146. package/dist/features/homepage/components/FeaturedBundlesSection.js +2 -2
  147. package/dist/features/live/components/index.d.ts +0 -4
  148. package/dist/features/live/components/index.js +0 -2
  149. package/dist/features/lottery/types/index.d.ts +3 -3
  150. package/dist/features/lottery/types/index.js +5 -5
  151. package/dist/features/orders/components/OrderPaymentSummary.js +2 -2
  152. package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
  153. package/dist/features/orders/components/RefundHistoryTable.js +1 -1
  154. package/dist/features/orders/components/RefundRequestView.js +1 -1
  155. package/dist/features/orders/constants/payment-window.d.ts +10 -0
  156. package/dist/features/orders/constants/payment-window.js +10 -0
  157. package/dist/features/orders/repository/orders.repository.d.ts +25 -0
  158. package/dist/features/orders/repository/orders.repository.js +50 -1
  159. package/dist/features/orders/schemas/firestore.d.ts +50 -2
  160. package/dist/features/orders/schemas/index.d.ts +24 -24
  161. package/dist/features/orders/schemas/index.js +20 -20
  162. package/dist/features/orders/types/index.d.ts +4 -0
  163. package/dist/features/orders/utils/bundle-grouping.d.ts +1 -1
  164. package/dist/features/orders/utils/bundle-grouping.js +1 -1
  165. package/dist/features/payments/schemas/index.d.ts +10 -10
  166. package/dist/features/payments/schemas/index.js +9 -9
  167. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
  168. package/dist/features/products/components/ArtStickersListView.d.ts +7 -0
  169. package/dist/features/products/components/ArtStickersListView.js +57 -0
  170. package/dist/features/products/components/GroupSettingsPanel.js +1 -1
  171. package/dist/features/products/components/MakeOfferButton.js +3 -3
  172. package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
  173. package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
  174. package/dist/features/products/components/PrizeDrawCollage.js +2 -2
  175. package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
  176. package/dist/features/products/components/PrizeRevealModal.js +1 -1
  177. package/dist/features/products/components/ProductDetailPageView.js +2 -9
  178. package/dist/features/products/components/ProductForm.js +2 -2
  179. package/dist/features/products/components/ProductGrid.js +2 -2
  180. package/dist/features/products/components/ProductsIndexListing.d.ts +13 -1
  181. package/dist/features/products/components/ProductsIndexListing.js +7 -5
  182. package/dist/features/products/components/ProductsIndexPageView.js +6 -1
  183. package/dist/features/products/constants/listing-tabs.d.ts +42 -17
  184. package/dist/features/products/constants/listing-tabs.js +25 -6
  185. package/dist/features/products/schemas/catalog-product.d.ts +5 -5
  186. package/dist/features/products/schemas/catalog-product.js +1 -1
  187. package/dist/features/products/schemas/firestore.d.ts +5 -5
  188. package/dist/features/products/schemas/firestore.js +2 -2
  189. package/dist/features/products/types/index.d.ts +5 -2
  190. package/dist/features/promotions/components/CouponCard.js +2 -2
  191. package/dist/features/promotions/schemas/firestore.d.ts +2 -0
  192. package/dist/features/promotions/schemas/firestore.js +1 -0
  193. package/dist/features/promotions/schemas/index.d.ts +14 -14
  194. package/dist/features/promotions/schemas/index.js +6 -6
  195. package/dist/features/scams/components/ScamProfileView.js +3 -7
  196. package/dist/features/scams/components/ScamRegistryView.js +2 -6
  197. package/dist/features/scams/schemas/firestore.d.ts +1 -1
  198. package/dist/features/search/components/Search.d.ts +1 -1
  199. package/dist/features/seller/actions/offer-actions.js +1 -1
  200. package/dist/features/seller/components/PrintCenterView.js +2 -2
  201. package/dist/features/seller/components/QuickProductForm.js +5 -5
  202. package/dist/features/seller/components/SellerArtView.js +2 -2
  203. package/dist/features/seller/components/SellerAuctionsView.js +2 -2
  204. package/dist/features/seller/components/SellerBidsView.js +2 -2
  205. package/dist/features/seller/components/SellerBundlesView.js +6 -6
  206. package/dist/features/seller/components/SellerClassifiedView.js +2 -2
  207. package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
  208. package/dist/features/seller/components/SellerLiveView.js +2 -2
  209. package/dist/features/seller/components/SellerOffersView.js +2 -2
  210. package/dist/features/seller/components/SellerOrdersView.js +3 -3
  211. package/dist/features/seller/components/SellerPayoutRequestView.js +2 -2
  212. package/dist/features/seller/components/SellerPayoutSettingsView.js +2 -2
  213. package/dist/features/seller/components/SellerPayoutsView.js +2 -2
  214. package/dist/features/seller/components/SellerPreOrdersView.js +2 -2
  215. package/dist/features/seller/components/SellerPrizeDrawsView.js +2 -2
  216. package/dist/features/seller/components/SellerProductShell.js +8 -8
  217. package/dist/features/seller/components/SellerProductsView.js +1 -1
  218. package/dist/features/seller/components/SellerShippingView.js +6 -6
  219. package/dist/features/seller/components/SellerStickersView.js +2 -2
  220. package/dist/features/seller/hooks/useSellerListingData.d.ts +1 -1
  221. package/dist/features/seller/hooks/useSellerListingData.js +3 -2
  222. package/dist/features/shipments/components/AdminShipmentEditorView.js +10 -10
  223. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +4 -4
  224. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +5 -5
  225. package/dist/features/shipments/components/AdminShipmentsView.js +4 -4
  226. package/dist/features/shipments/repository/shipment-lots.repository.d.ts +2 -2
  227. package/dist/features/shipments/repository/shipment-lots.repository.js +8 -8
  228. package/dist/features/shipments/schemas/firestore.d.ts +21 -21
  229. package/dist/features/shipments/schemas/firestore.js +9 -9
  230. package/dist/features/shipments/schemas/validation.d.ts +30 -30
  231. package/dist/features/shipments/schemas/validation.js +6 -6
  232. package/dist/features/shipments/utils/cost-allocation.d.ts +5 -5
  233. package/dist/features/shipments/utils/cost-allocation.js +39 -38
  234. package/dist/features/store-extensions/schemas/firestore.d.ts +5 -5
  235. package/dist/features/stores/components/StoreDetailLayoutView.js +9 -13
  236. package/dist/features/stores/schemas/firestore.d.ts +7 -7
  237. package/dist/features/stores/schemas/index.d.ts +84 -84
  238. package/dist/features/stores/schemas/index.js +5 -5
  239. package/dist/features/tester/seed-data/categories-tester-seed-data.js +1 -1
  240. package/dist/features/tester/seed-data/products-tester-seed-data.js +6 -6
  241. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +9 -2
  242. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +8 -1
  243. package/dist/features/whatsapp-bot/helpers/whatsapp.js +13 -2
  244. package/dist/features/whatsapp-bot/types/index.d.ts +9 -1
  245. package/dist/index.d.ts +3 -7
  246. package/dist/index.js +7 -5
  247. package/dist/next/routing/route-map.d.ts +2 -0
  248. package/dist/next/routing/route-map.js +6 -0
  249. package/dist/schemas/firestore-helpers.d.ts +2 -2
  250. package/dist/schemas/firestore-helpers.js +2 -2
  251. package/dist/schemas/registry.d.ts +73 -73
  252. package/dist/seed/bids-seed-data.js +6 -6
  253. package/dist/seed/blog-posts-seed-data.js +1 -0
  254. package/dist/seed/cart-seed-data.js +13 -13
  255. package/dist/seed/catalogue-seed-data.js +6 -6
  256. package/dist/seed/categories-seed-data.js +5 -5
  257. package/dist/seed/claimed-coupons-seed-data.js +3 -3
  258. package/dist/seed/coupons-seed-data.js +20 -20
  259. package/dist/seed/events-seed-data.js +27 -27
  260. package/dist/seed/factories/bid.factory.js +1 -1
  261. package/dist/seed/faq-seed-data.js +20 -1
  262. package/dist/seed/grouped-listings-seed-data.d.ts +2 -2
  263. package/dist/seed/grouped-listings-seed-data.js +3 -3
  264. package/dist/seed/offers-seed-data.js +19 -19
  265. package/dist/seed/orders-seed-data.js +29 -29
  266. package/dist/seed/payouts-seed-data.js +7 -7
  267. package/dist/seed/products-auctions-seed-data.js +6 -6
  268. package/dist/seed/products-preorders-seed-data.d.ts +2 -2
  269. package/dist/seed/products-preorders-seed-data.js +1 -1
  270. package/dist/seed/products-standard-seed-data.js +8 -8
  271. package/dist/seed/scammers-seed-data.js +2 -2
  272. package/dist/seed/shipments-seed-data.js +29 -29
  273. package/dist/seed/site-settings-seed-data.js +3 -2
  274. package/dist/seed/store-extensions-seed-data.js +8 -8
  275. package/dist/seed/stores-seed-data.js +37 -8
  276. package/dist/seed/users-seed-data.js +38 -1
  277. package/dist/server-entry.d.ts +1 -3
  278. package/dist/server-entry.js +1 -3
  279. package/dist/server.d.ts +2 -1
  280. package/dist/server.js +3 -1
  281. package/dist/ui/components/PriceDisplay.js +3 -12
  282. package/dist/utils/number.formatter.d.ts +2 -7
  283. package/dist/utils/number.formatter.js +3 -8
  284. package/package.json +1 -1
  285. package/scripts/seed-cli.mjs +8 -3
  286. package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +0 -34
  287. package/dist/_internal/client/scaffolds/DashboardScaffold.js +0 -26
  288. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.d.ts +0 -1
  289. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.js +0 -109
  290. package/dist/_internal/server/features/auctions/__tests__/service.test.d.ts +0 -1
  291. package/dist/_internal/server/features/auctions/__tests__/service.test.js +0 -140
  292. package/dist/_internal/server/features/checkout/__tests__/actions.test.d.ts +0 -1
  293. package/dist/_internal/server/features/checkout/__tests__/actions.test.js +0 -600
  294. package/dist/_internal/server/features/refunds/__tests__/actions.test.d.ts +0 -1
  295. package/dist/_internal/server/features/refunds/__tests__/actions.test.js +0 -263
  296. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.d.ts +0 -1
  297. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.js +0 -249
  298. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +0 -1
  299. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +0 -65
  300. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +0 -1
  301. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +0 -163
  302. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +0 -1
  303. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +0 -115
  304. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.d.ts +0 -1
  305. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.js +0 -201
  306. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.d.ts +0 -1
  307. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.js +0 -169
  308. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.d.ts +0 -1
  309. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.js +0 -148
  310. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.d.ts +0 -1
  311. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.js +0 -210
  312. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.d.ts +0 -1
  313. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.js +0 -190
  314. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.d.ts +0 -1
  315. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.js +0 -161
  316. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.d.ts +0 -1
  317. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.js +0 -302
  318. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +0 -1
  319. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +0 -96
  320. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.d.ts +0 -1
  321. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.js +0 -252
  322. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.d.ts +0 -1
  323. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.js +0 -129
  324. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +0 -15
  325. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +0 -38
  326. package/dist/_internal/server/providers/index.d.ts +0 -11
  327. package/dist/_internal/server/providers/index.js +0 -11
  328. package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +0 -52
  329. package/dist/_internal/server/providers/payment/razorpay-mock.js +0 -118
  330. package/dist/_internal/server/providers/resolve.d.ts +0 -36
  331. package/dist/_internal/server/providers/resolve.js +0 -31
  332. package/dist/_internal/server/providers/shipping/shiprocket-mock.d.ts +0 -29
  333. package/dist/_internal/server/providers/shipping/shiprocket-mock.js +0 -152
  334. package/dist/_internal/shared/types/__tests__/action-result.test.d.ts +0 -1
  335. package/dist/_internal/shared/types/__tests__/action-result.test.js +0 -65
  336. package/dist/errors/__tests__/error-mapping.test.d.ts +0 -1
  337. package/dist/errors/__tests__/error-mapping.test.js +0 -122
  338. package/dist/errors/__tests__/safe-read.test.d.ts +0 -1
  339. package/dist/errors/__tests__/safe-read.test.js +0 -39
  340. package/dist/features/addresses/repository/__tests__/addresses.repository.test.d.ts +0 -1
  341. package/dist/features/addresses/repository/__tests__/addresses.repository.test.js +0 -386
  342. package/dist/features/admin/components/AdminListingScaffold.d.ts +0 -41
  343. package/dist/features/admin/components/AdminListingScaffold.js +0 -68
  344. package/dist/features/admin/components/QuickActionsPanel.d.ts +0 -15
  345. package/dist/features/admin/components/QuickActionsPanel.js +0 -5
  346. package/dist/features/admin/repository/__tests__/notification.repository.test.d.ts +0 -1
  347. package/dist/features/admin/repository/__tests__/notification.repository.test.js +0 -356
  348. package/dist/features/admin/repository/__tests__/site-settings.repository.test.d.ts +0 -1
  349. package/dist/features/admin/repository/__tests__/site-settings.repository.test.js +0 -298
  350. package/dist/features/auctions/repository/__tests__/bid.repository.test.d.ts +0 -1
  351. package/dist/features/auctions/repository/__tests__/bid.repository.test.js +0 -290
  352. package/dist/features/auctions/repository/auctions.repository.d.ts +0 -12
  353. package/dist/features/auctions/repository/auctions.repository.js +0 -42
  354. package/dist/features/auth/repository/__tests__/session.repository.test.d.ts +0 -1
  355. package/dist/features/auth/repository/__tests__/session.repository.test.js +0 -310
  356. package/dist/features/auth/repository/__tests__/session.test.d.ts +0 -1
  357. package/dist/features/auth/repository/__tests__/session.test.js +0 -146
  358. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.d.ts +0 -1
  359. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.js +0 -171
  360. package/dist/features/auth/repository/__tests__/sms-counter.test.d.ts +0 -1
  361. package/dist/features/auth/repository/__tests__/sms-counter.test.js +0 -88
  362. package/dist/features/auth/repository/__tests__/token.repository.test.d.ts +0 -1
  363. package/dist/features/auth/repository/__tests__/token.repository.test.js +0 -260
  364. package/dist/features/auth/repository/__tests__/token.test.d.ts +0 -1
  365. package/dist/features/auth/repository/__tests__/token.test.js +0 -140
  366. package/dist/features/auth/repository/__tests__/user.repository.test.d.ts +0 -1
  367. package/dist/features/auth/repository/__tests__/user.repository.test.js +0 -352
  368. package/dist/features/auth/repository/__tests__/user.test.d.ts +0 -1
  369. package/dist/features/auth/repository/__tests__/user.test.js +0 -226
  370. package/dist/features/before-after/repository/before-after.repository.d.ts +0 -13
  371. package/dist/features/before-after/repository/before-after.repository.js +0 -36
  372. package/dist/features/before-after/server.d.ts +0 -6
  373. package/dist/features/before-after/server.js +0 -6
  374. package/dist/features/cart/repository/__tests__/cart.repository.test.d.ts +0 -1
  375. package/dist/features/cart/repository/__tests__/cart.repository.test.js +0 -371
  376. package/dist/features/categories/repository/__tests__/categories.repository.test.d.ts +0 -1
  377. package/dist/features/categories/repository/__tests__/categories.repository.test.js +0 -813
  378. package/dist/features/collections/repository/collections.repository.d.ts +0 -8
  379. package/dist/features/collections/repository/collections.repository.js +0 -16
  380. package/dist/features/collections/server.d.ts +0 -6
  381. package/dist/features/collections/server.js +0 -6
  382. package/dist/features/events/repository/__tests__/event.repository.test.d.ts +0 -1
  383. package/dist/features/events/repository/__tests__/event.repository.test.js +0 -299
  384. package/dist/features/faq/repository/__tests__/faqs.repository.test.d.ts +0 -1
  385. package/dist/features/faq/repository/__tests__/faqs.repository.test.js +0 -311
  386. package/dist/features/forms/Form.d.ts +0 -25
  387. package/dist/features/forms/Form.js +0 -37
  388. package/dist/features/history/repository/__tests__/user-history.repository.test.d.ts +0 -1
  389. package/dist/features/history/repository/__tests__/user-history.repository.test.js +0 -180
  390. package/dist/features/homepage/repository/__tests__/carousel.repository.test.d.ts +0 -1
  391. package/dist/features/homepage/repository/__tests__/carousel.repository.test.js +0 -182
  392. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.d.ts +0 -1
  393. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.js +0 -185
  394. package/dist/features/layout/ListingLayout.d.ts +0 -34
  395. package/dist/features/layout/ListingLayout.js +0 -103
  396. package/dist/features/messages/repository/__tests__/conversations.repository.test.d.ts +0 -1
  397. package/dist/features/messages/repository/__tests__/conversations.repository.test.js +0 -257
  398. package/dist/features/orders/repository/__tests__/orders.repository.test.d.ts +0 -1
  399. package/dist/features/orders/repository/__tests__/orders.repository.test.js +0 -211
  400. package/dist/features/payments/repository/__tests__/payout.repository.test.d.ts +0 -1
  401. package/dist/features/payments/repository/__tests__/payout.repository.test.js +0 -292
  402. package/dist/features/pre-orders/repository/preorders.repository.d.ts +0 -8
  403. package/dist/features/pre-orders/repository/preorders.repository.js +0 -25
  404. package/dist/features/products/repository/__tests__/product-features.repository.test.d.ts +0 -1
  405. package/dist/features/products/repository/__tests__/product-features.repository.test.js +0 -329
  406. package/dist/features/products/repository/__tests__/products.repository.test.d.ts +0 -1
  407. package/dist/features/products/repository/__tests__/products.repository.test.js +0 -607
  408. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.d.ts +0 -1
  409. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.js +0 -219
  410. package/dist/features/promotions/repository/__tests__/coupons.repository.test.d.ts +0 -1
  411. package/dist/features/promotions/repository/__tests__/coupons.repository.test.js +0 -480
  412. package/dist/features/promotions/repository/promotions.repository.d.ts +0 -14
  413. package/dist/features/promotions/repository/promotions.repository.js +0 -43
  414. package/dist/features/reviews/repository/__tests__/reviews.repository.test.d.ts +0 -1
  415. package/dist/features/reviews/repository/__tests__/reviews.repository.test.js +0 -327
  416. package/dist/features/scams/repository/__tests__/scammer.repository.test.d.ts +0 -1
  417. package/dist/features/scams/repository/__tests__/scammer.repository.test.js +0 -385
  418. package/dist/features/search/repository/__tests__/search.repository.test.d.ts +0 -1
  419. package/dist/features/search/repository/__tests__/search.repository.test.js +0 -369
  420. package/dist/features/seller/components/SellerStatCard.d.ts +0 -14
  421. package/dist/features/seller/components/SellerStatCard.js +0 -6
  422. package/dist/features/seller/components/seller-products-styles.d.ts +0 -7
  423. package/dist/features/seller/components/seller-products-styles.js +0 -14
  424. package/dist/features/seller/repository/__tests__/offer.repository.test.d.ts +0 -1
  425. package/dist/features/seller/repository/__tests__/offer.repository.test.js +0 -458
  426. package/dist/features/seller/repository/seller.repository.d.ts +0 -22
  427. package/dist/features/seller/repository/seller.repository.js +0 -72
  428. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.d.ts +0 -1
  429. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.js +0 -37
  430. package/dist/features/stores/repository/__tests__/store.repository.test.d.ts +0 -1
  431. package/dist/features/stores/repository/__tests__/store.repository.test.js +0 -261
  432. package/dist/features/stores/repository/stores.repository.d.ts +0 -11
  433. package/dist/features/stores/repository/stores.repository.js +0 -37
  434. package/dist/features/support/repository/__tests__/support.repository.test.d.ts +0 -1
  435. package/dist/features/support/repository/__tests__/support.repository.test.js +0 -312
  436. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.d.ts +0 -1
  437. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.js +0 -139
  438. package/dist/features/wishlist/repository/wishlist.repository.d.ts +0 -13
  439. package/dist/features/wishlist/repository/wishlist.repository.js +0 -31
  440. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +0 -1
  441. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +0 -93
  442. package/dist/providers/shipping-shiprocket/index.d.ts +0 -297
  443. package/dist/providers/shipping-shiprocket/index.js +0 -194
  444. package/dist/providers/shipping-shiprocket/shiprocket-provider.d.ts +0 -45
  445. package/dist/providers/shipping-shiprocket/shiprocket-provider.js +0 -168
  446. package/dist/react/contexts/ThemeContext.d.ts +0 -13
  447. package/dist/react/contexts/ThemeContext.js +0 -64
  448. package/dist/schemas/webhooks/shiprocket.d.ts +0 -30
  449. package/dist/schemas/webhooks/shiprocket.js +0 -22
  450. package/dist/seed/actions/demo-seed-actions.d.ts +0 -42
  451. package/dist/seed/actions/demo-seed-actions.js +0 -36
  452. package/dist/seed/actions/index.d.ts +0 -1
  453. package/dist/seed/actions/index.js +0 -1
  454. package/dist/seed/sub-listings-seed-data.d.ts +0 -123
  455. package/dist/seed/sub-listings-seed-data.js +0 -447
  456. package/dist/seed/tester-checklist-seed-data.d.ts +0 -2
  457. package/dist/seed/tester-checklist-seed-data.js +0 -248
  458. package/dist/ui/components/DashboardStatsCard.d.ts +0 -15
  459. package/dist/ui/components/DashboardStatsCard.js +0 -27
  460. package/dist/ui/components/DashboardStatsCard.style.css +0 -68
  461. package/dist/ui/components/DynamicSelect.d.ts +0 -23
  462. package/dist/ui/components/DynamicSelect.js +0 -77
  463. package/dist/ui/components/DynamicSelect.style.css +0 -101
  464. package/dist/ui/components/InlineCreateSelect.d.ts +0 -48
  465. package/dist/ui/components/InlineCreateSelect.js +0 -75
  466. package/dist/ui/components/ListingViewShell.d.ts +0 -37
  467. package/dist/ui/components/ListingViewShell.js +0 -9
  468. package/dist/ui/components/PaginatedMultiSelect.d.ts +0 -28
  469. package/dist/ui/components/PaginatedMultiSelect.js +0 -141
  470. package/dist/ui/components/PaginatedMultiSelect.style.css +0 -272
  471. package/dist/ui/components/SectionTabs.d.ts +0 -19
  472. package/dist/ui/components/SectionTabs.js +0 -66
  473. package/dist/ui/components/SectionTabs.style.css +0 -164
  474. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +0 -1
  475. package/dist/ui/components/__tests__/BulkActionBar.test.js +0 -96
  476. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +0 -1
  477. package/dist/ui/components/__tests__/ListingToolbar.test.js +0 -125
  478. package/dist/ui/components/__tests__/new-primitives.test.d.ts +0 -1
  479. package/dist/ui/components/__tests__/new-primitives.test.js +0 -187
@@ -200,7 +200,7 @@ export function SellerProductsView({ onDeleteProduct, onCreateClick, children, .
200
200
  updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
201
201
  imageUrl: toStringValue(item.mainImage ?? item.images?.[0], undefined),
202
202
  listingKind: kind,
203
- price: priceRaw ? `₹${(priceRaw / 100).toLocaleString("en-IN")}` : "—",
203
+ price: priceRaw ? `₹${priceRaw.toLocaleString("en-IN")}` : "—",
204
204
  physicalLocation: item.physicalLocation &&
205
205
  typeof item.physicalLocation.zone === "string"
206
206
  ? item.physicalLocation
@@ -30,13 +30,13 @@ export function SellerShippingView({ apiBase = SELLER_ENDPOINTS.SHIPPING }) {
30
30
  setCurrent(cfg);
31
31
  setDraft({
32
32
  customCarrierName: cfg.customCarrierName ?? "",
33
- customShippingPrice: cfg.customShippingPrice ? String(cfg.customShippingPrice / 100) : "",
33
+ customShippingPrice: cfg.customShippingPrice ? String(cfg.customShippingPrice) : "",
34
34
  pickupAddressId: "",
35
35
  freeShippingThreshold: (res?.data?.freeShippingThreshold ?? 0)
36
- ? String(res.data.freeShippingThreshold / 100)
36
+ ? String(res.data.freeShippingThreshold)
37
37
  : "",
38
38
  fragileSurcharge: (res?.data?.fragileSurcharge ?? 0)
39
- ? String(res.data.fragileSurcharge / 100)
39
+ ? String(res.data.fragileSurcharge)
40
40
  : "",
41
41
  });
42
42
  })
@@ -54,10 +54,10 @@ export function SellerShippingView({ apiBase = SELLER_ENDPOINTS.SHIPPING }) {
54
54
  try {
55
55
  const body = {
56
56
  customCarrierName: draft.customCarrierName.trim(),
57
- customShippingPrice: Math.round(parseFloat(draft.customShippingPrice || "0") * 100),
57
+ customShippingPrice: Math.round(parseFloat(draft.customShippingPrice || "0") * 100) / 100,
58
58
  ...(draft.pickupAddressId ? { pickupAddressId: draft.pickupAddressId } : {}),
59
- freeShippingThreshold: Math.round(parseFloat(draft.freeShippingThreshold || "0") * 100),
60
- fragileSurcharge: Math.round(parseFloat(draft.fragileSurcharge || "0") * 100),
59
+ freeShippingThreshold: Math.round(parseFloat(draft.freeShippingThreshold || "0") * 100) / 100,
60
+ fragileSurcharge: Math.round(parseFloat(draft.fragileSurcharge || "0") * 100) / 100,
61
61
  };
62
62
  const res = await fetch(apiBase, {
63
63
  method: "PATCH",
@@ -11,7 +11,7 @@ import { ConfirmDeleteModal, RowActionMenu, Text } from "../../../ui";
11
11
  import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
12
12
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
13
13
  import { ROUTES } from "../../..";
14
- import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../../admin/hooks/useAdminListingData";
14
+ import { toRecordArray, toRelativeDate, toCurrency, toStringValue, } from "../../admin/hooks/useAdminListingData";
15
15
  import { DataListingView } from "../../admin/components/DataListingView";
16
16
  import { SELLER_BULK_ACTIONS, ROW_ACTION_META } from "../../products/constants/action-defs";
17
17
  const COLUMNS = [
@@ -79,7 +79,7 @@ export function SellerStickersView({ onCreateClick, onEditClick, onDelete, onBul
79
79
  return {
80
80
  id: toStringValue(item.id, `stickers-${index}`),
81
81
  title: toStringValue(item.productTitle ?? item.title, "Untitled"),
82
- price: toRupees(item.price),
82
+ price: toCurrency(item.price),
83
83
  size: toStringValue(printMeta.size, ""),
84
84
  status: toStringValue(item.status, "draft"),
85
85
  createdAt: toRelativeDate(item.createdAt),
@@ -27,6 +27,6 @@ export declare function useSellerListingData<TResponse, TRow extends {
27
27
  }>({ queryKey, endpoint, page, pageSize, sorts, filters, q, mapRows, getTotal, }: UseSellerListingDataOptions<TResponse, TRow>): UseSellerListingDataResult<TRow>;
28
28
  export declare function toRecordArray(value: unknown): UnknownRecord[];
29
29
  export declare function toStringValue(value: unknown, fallback?: string): string;
30
- export declare function toRupees(value: unknown): string;
30
+ export declare function toCurrency(value: unknown): string;
31
31
  export declare function toRelativeDate(value: unknown): string;
32
32
  export {};
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { useQuery } from "@tanstack/react-query";
3
3
  import { apiClient, ApiClientError } from "../../../http";
4
+ import { formatCurrency } from "../../../utils/number.formatter";
4
5
  function withQueryParams(endpoint, params) {
5
6
  const hasQuery = endpoint.includes("?");
6
7
  const query = new URLSearchParams(params).toString();
@@ -49,11 +50,11 @@ export function toStringValue(value, fallback = "-") {
49
50
  }
50
51
  return fallback;
51
52
  }
52
- export function toRupees(value) {
53
+ export function toCurrency(value) {
53
54
  if (typeof value !== "number" || Number.isNaN(value)) {
54
55
  return "-";
55
56
  }
56
- return `₹${value.toLocaleString("en-IN")}`;
57
+ return formatCurrency(value);
57
58
  }
58
59
  export function toRelativeDate(value) {
59
60
  const date = parseDate(value);
@@ -10,7 +10,7 @@ import { ROUTES } from "../../../next/routing/route-map";
10
10
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
11
11
  import { createShipmentSchema } from "../schemas/validation";
12
12
  import { useShipment } from "../hooks/useShipments";
13
- import { formatPaise } from "../../../utils/number.formatter";
13
+ import { formatCurrency } from "../../../utils/number.formatter";
14
14
  const STATUS_OPTIONS = [
15
15
  { label: "Planning", value: "planning" },
16
16
  { label: "Ordered", value: "ordered" },
@@ -47,8 +47,8 @@ export function AdminShipmentEditorView({ shipmentId, onSaved }) {
47
47
  setCarrier(shipment.carrier ?? "");
48
48
  setEtaDate(shipment.etaDate ? new Date(shipment.etaDate).toISOString().slice(0, 10) : "");
49
49
  setNotes(shipment.notes ?? "");
50
- setCustomsTotalRupees(String(shipment.customsTotalPaise / 100));
51
- setShippingTotalRupees(String(shipment.shippingTotalPaise / 100));
50
+ setCustomsTotalRupees(String(shipment.customsTotal));
51
+ setShippingTotalRupees(String(shipment.shippingTotal));
52
52
  setLaborHoursSpent(String(shipment.laborHoursSpent ?? 0));
53
53
  }, [shipment]);
54
54
  const saveMutation = useApiMutation({
@@ -63,8 +63,8 @@ export function AdminShipmentEditorView({ shipmentId, onSaved }) {
63
63
  carrier: carrier || undefined,
64
64
  etaDate: etaDate || undefined,
65
65
  notes: notes || undefined,
66
- customsTotalPaise: Math.round(Number(customsTotalRupees) * 100),
67
- shippingTotalPaise: Math.round(Number(shippingTotalRupees) * 100),
66
+ customsTotal: Math.round(Number(customsTotalRupees) * 100) / 100,
67
+ shippingTotal: Math.round(Number(shippingTotalRupees) * 100) / 100,
68
68
  laborHoursSpent: Number(laborHoursSpent),
69
69
  };
70
70
  if (isCreate) {
@@ -77,13 +77,13 @@ export function AdminShipmentEditorView({ shipmentId, onSaved }) {
77
77
  onSaved?.(saved.id);
78
78
  },
79
79
  });
80
- return (_jsx(Form, { schema: createShipmentSchema, spacing: "md", children: ({ setFieldError }) => (_jsxs(_Fragment, { children: [_jsxs(Grid, { cols: 2, gap: "md", children: [_jsx(FieldInput, { name: "shipmentNumber", label: "Shipment Number", required: true, value: shipmentNumber, onChange: setShipmentNumber, placeholder: "SH-2026-0001" }), _jsx(FieldInput, { name: "supplierName", label: "Supplier Name", required: true, value: supplierName, onChange: setSupplierName }), _jsx(FieldInput, { name: "originCountry", label: "Origin Country", value: originCountry, onChange: setOriginCountry }), _jsx(FieldSelect, { name: "status", label: "Status", required: true, value: status, onChange: setStatus, options: STATUS_OPTIONS }), _jsx(FieldInput, { name: "trackingNumber", label: "Tracking Number", value: trackingNumber, onChange: setTrackingNumber }), _jsx(FieldInput, { name: "carrier", label: "Carrier", value: carrier, onChange: setCarrier }), _jsx(FieldInput, { name: "etaDate", label: "ETA Date", type: "date", value: etaDate, onChange: setEtaDate }), _jsx(FieldInput, { name: "laborHoursSpent", label: "Labor Hours Spent", type: "number", min: "0", value: laborHoursSpent, onChange: setLaborHoursSpent }), _jsx(FieldInput, { name: "customsTotalPaise", label: "Customs Total (\u20B9)", type: "number", min: "0", value: customsTotalRupees, onChange: setCustomsTotalRupees, hint: "Split across lots by declared value" }), _jsx(FieldInput, { name: "shippingTotalPaise", label: "Shipping Total (\u20B9)", type: "number", min: "0", value: shippingTotalRupees, onChange: setShippingTotalRupees, hint: "Split across lots by weight" })] }), _jsx(FieldTextarea, { name: "notes", label: "Notes", value: notes, onChange: setNotes, rows: 3 }), _jsx(Button, { type: "button", isLoading: saveMutation.isPending, onClick: () => {
80
+ return (_jsx(Form, { schema: createShipmentSchema, spacing: "md", children: ({ setFieldError }) => (_jsxs(_Fragment, { children: [_jsxs(Grid, { cols: 2, gap: "md", children: [_jsx(FieldInput, { name: "shipmentNumber", label: "Shipment Number", required: true, value: shipmentNumber, onChange: setShipmentNumber, placeholder: "SH-2026-0001" }), _jsx(FieldInput, { name: "supplierName", label: "Supplier Name", required: true, value: supplierName, onChange: setSupplierName }), _jsx(FieldInput, { name: "originCountry", label: "Origin Country", value: originCountry, onChange: setOriginCountry }), _jsx(FieldSelect, { name: "status", label: "Status", required: true, value: status, onChange: setStatus, options: STATUS_OPTIONS }), _jsx(FieldInput, { name: "trackingNumber", label: "Tracking Number", value: trackingNumber, onChange: setTrackingNumber }), _jsx(FieldInput, { name: "carrier", label: "Carrier", value: carrier, onChange: setCarrier }), _jsx(FieldInput, { name: "etaDate", label: "ETA Date", type: "date", value: etaDate, onChange: setEtaDate }), _jsx(FieldInput, { name: "laborHoursSpent", label: "Labor Hours Spent", type: "number", min: "0", value: laborHoursSpent, onChange: setLaborHoursSpent }), _jsx(FieldInput, { name: "customsTotal", label: "Customs Total (\u20B9)", type: "number", min: "0", value: customsTotalRupees, onChange: setCustomsTotalRupees, hint: "Split across lots by declared value" }), _jsx(FieldInput, { name: "shippingTotal", label: "Shipping Total (\u20B9)", type: "number", min: "0", value: shippingTotalRupees, onChange: setShippingTotalRupees, hint: "Split across lots by weight" })] }), _jsx(FieldTextarea, { name: "notes", label: "Notes", value: notes, onChange: setNotes, rows: 3 }), _jsx(Button, { type: "button", isLoading: saveMutation.isPending, onClick: () => {
81
81
  const parsed = createShipmentSchema.safeParse({
82
82
  shipmentNumber,
83
83
  supplierName,
84
84
  status,
85
- customsTotalPaise: Math.round(Number(customsTotalRupees) * 100),
86
- shippingTotalPaise: Math.round(Number(shippingTotalRupees) * 100),
85
+ customsTotal: Math.round(Number(customsTotalRupees) * 100) / 100,
86
+ shippingTotal: Math.round(Number(shippingTotalRupees) * 100) / 100,
87
87
  laborHoursSpent: Number(laborHoursSpent),
88
88
  });
89
89
  if (!parsed.success) {
@@ -104,7 +104,7 @@ function ShipmentLotsSection({ shipmentId, lots, onLotsChanged, }) {
104
104
  mutationFn: () => apiClient.post(ADMIN_ENDPOINTS.SHIPMENT_LOTS(shipmentId), {
105
105
  lotName,
106
106
  weightGrams: Number(weightGrams),
107
- purchaseCostPaise: Math.round(Number(purchaseCostRupees) * 100),
107
+ purchaseCost: Math.round(Number(purchaseCostRupees) * 100) / 100,
108
108
  }),
109
109
  onSuccess: () => {
110
110
  setLotName("");
@@ -119,5 +119,5 @@ function ShipmentLotsSection({ shipmentId, lots, onLotsChanged, }) {
119
119
  mutationFn: (lotId) => apiClient.delete(ADMIN_ENDPOINTS.SHIPMENT_LOT_BY_ID(shipmentId, lotId)),
120
120
  onSuccess: () => onLotsChanged(),
121
121
  });
122
- return (_jsxs(Stack, { gap: "md", className: "border-t pt-[var(--appkit-space-4)]", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsxs(Heading, { level: 4, children: ["Lots (", lots.length, "/10)"] }), lots.length < 10 && (_jsx(Button, { size: "sm", variant: "secondary", type: "button", onClick: () => setShowAddLot((v) => !v), children: showAddLot ? "Cancel" : "+ Add Lot" }))] }), showAddLot && (_jsxs(Grid, { cols: 3, gap: "sm", children: [_jsx(FieldInput, { name: "lotName", label: "Lot Name", value: lotName, onChange: setLotName }), _jsx(FieldInput, { name: "weightGrams", label: "Weight (g)", type: "number", min: "0", value: weightGrams, onChange: setWeightGrams }), _jsx(FieldInput, { name: "purchaseCostPaise", label: "Purchase Cost (\u20B9)", type: "number", min: "0", value: purchaseCostRupees, onChange: setPurchaseCostRupees }), _jsx(Button, { type: "button", size: "sm", isLoading: addLotMutation.isPending, disabled: !lotName, onClick: () => addLotMutation.mutate(), children: "Save Lot" })] })), lots.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No lots yet. Add a lot, then manage its items." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Lot" }), _jsx(Th, { children: "Weight (g)" }), _jsx(Th, { children: "Items" }), _jsx(Th, { children: "Projected Profit" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: lots.map((lot) => (_jsxs(Tr, { children: [_jsx(Td, { children: lot.lotName }), _jsx(Td, { children: lot.weightGrams }), _jsx(Td, { children: lot.itemCount }), _jsx(Td, { children: formatPaise(lot.projectedProfitPaise) }), _jsxs(Td, { className: "flex gap-[var(--appkit-space-2)]", children: [_jsx(TextLink, { href: ROUTES.ADMIN.SHIPMENT_LOT_ITEMS(shipmentId, lot.id), children: "Manage Items \u2192" }), _jsx(Button, { size: "sm", variant: "ghost", type: "button", action: ACTIONS.SHIPMENT["delete"], isLoading: deleteLotMutation.isPending, onClick: () => deleteLotMutation.mutate(lot.id), children: "Delete" })] })] }, lot.id))) })] })), lots.length > 0 && (_jsx(Alert, { variant: "info", children: "Customs/shipping allocation and profit totals recompute in the background a few seconds after any lot or item change \u2014 reload if a number looks stale." }))] }));
122
+ return (_jsxs(Stack, { gap: "md", className: "border-t pt-[var(--appkit-space-4)]", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsxs(Heading, { level: 4, children: ["Lots (", lots.length, "/10)"] }), lots.length < 10 && (_jsx(Button, { size: "sm", variant: "secondary", type: "button", onClick: () => setShowAddLot((v) => !v), children: showAddLot ? "Cancel" : "+ Add Lot" }))] }), showAddLot && (_jsxs(Grid, { cols: 3, gap: "sm", children: [_jsx(FieldInput, { name: "lotName", label: "Lot Name", value: lotName, onChange: setLotName }), _jsx(FieldInput, { name: "weightGrams", label: "Weight (g)", type: "number", min: "0", value: weightGrams, onChange: setWeightGrams }), _jsx(FieldInput, { name: "purchaseCost", label: "Purchase Cost (\u20B9)", type: "number", min: "0", value: purchaseCostRupees, onChange: setPurchaseCostRupees }), _jsx(Button, { type: "button", size: "sm", isLoading: addLotMutation.isPending, disabled: !lotName, onClick: () => addLotMutation.mutate(), children: "Save Lot" })] })), lots.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No lots yet. Add a lot, then manage its items." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Lot" }), _jsx(Th, { children: "Weight (g)" }), _jsx(Th, { children: "Items" }), _jsx(Th, { children: "Projected Profit" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: lots.map((lot) => (_jsxs(Tr, { children: [_jsx(Td, { children: lot.lotName }), _jsx(Td, { children: lot.weightGrams }), _jsx(Td, { children: lot.itemCount }), _jsx(Td, { children: formatCurrency(lot.projectedProfit) }), _jsxs(Td, { className: "flex gap-[var(--appkit-space-2)]", children: [_jsx(TextLink, { href: ROUTES.ADMIN.SHIPMENT_LOT_ITEMS(shipmentId, lot.id), children: "Manage Items \u2192" }), _jsx(Button, { size: "sm", variant: "ghost", type: "button", action: ACTIONS.SHIPMENT["delete"], isLoading: deleteLotMutation.isPending, onClick: () => deleteLotMutation.mutate(lot.id), children: "Delete" })] })] }, lot.id))) })] })), lots.length > 0 && (_jsx(Alert, { variant: "info", children: "Customs/shipping allocation and profit totals recompute in the background a few seconds after any lot or item change \u2014 reload if a number looks stale." }))] }));
123
123
  }
@@ -8,7 +8,7 @@ import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
8
8
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
9
9
  import { useShipmentItems } from "../hooks/useShipments";
10
10
  import { ShipmentItemLinkModal } from "./ShipmentItemLinkModal";
11
- import { formatPaise } from "../../../utils/number.formatter";
11
+ import { formatCurrency } from "../../../utils/number.formatter";
12
12
  function parseBulkText(text) {
13
13
  return text
14
14
  .split("\n")
@@ -21,7 +21,7 @@ function parseBulkText(text) {
21
21
  return {
22
22
  title: title ?? "",
23
23
  quantity: Number(quantityStr) || 1,
24
- price: isForSelfUse ? undefined : priceStr ? Math.round(Number(priceStr) * 100) : undefined,
24
+ price: isForSelfUse ? undefined : priceStr ? Math.round(Number(priceStr) * 100) / 100 : undefined,
25
25
  isForSelfUse,
26
26
  };
27
27
  })
@@ -46,7 +46,7 @@ export function AdminShipmentLotItemsView({ shipmentId, lotId }) {
46
46
  title,
47
47
  quantity: Number(quantity),
48
48
  isForSelfUse,
49
- price: isForSelfUse ? undefined : Math.round(Number(priceRupees) * 100),
49
+ price: isForSelfUse ? undefined : Math.round(Number(priceRupees) * 100) / 100,
50
50
  }),
51
51
  onSuccess: () => {
52
52
  setTitle("");
@@ -88,7 +88,7 @@ export function AdminShipmentLotItemsView({ shipmentId, lotId }) {
88
88
  }),
89
89
  onSuccess: () => refetch(),
90
90
  });
91
- return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsxs(Heading, { level: 3, children: ["Lot Items (", meta?.total ?? items.length, "/500)"] }), _jsxs(Div, { className: "flex gap-[var(--appkit-space-2)]", children: [_jsx(Button, { size: "sm", variant: "secondary", onClick: () => setShowAddItem((v) => !v), children: showAddItem ? "Cancel" : "+ Add Item" }), _jsx(Button, { size: "sm", variant: "secondary", onClick: () => setShowBulkImport(true), children: "Bulk Import" })] })] }), _jsx(Alert, { variant: "info", children: "Only individually notable \"main\" items need a row here \u2014 everything else in the lot can be captured as a single remainder estimate on the lot itself. Linking an item to a product does not sync future edits either way." }), showAddItem && (_jsxs(Grid, { cols: 4, gap: "sm", children: [_jsx(FieldInput, { name: "title", label: "Title", required: true, value: title, onChange: setTitle }), _jsx(FieldInput, { name: "quantity", label: "Quantity", type: "number", min: "1", value: quantity, onChange: setQuantity }), _jsx(FieldInput, { name: "price", label: "Projected Sale Price (\u20B9)", type: "number", min: "0", value: priceRupees, onChange: setPriceRupees, disabled: isForSelfUse }), _jsx(FieldCheckbox, { name: "isForSelfUse", label: "For self use (no resale)", checked: isForSelfUse, onChange: setIsForSelfUse }), _jsx(Button, { size: "sm", isLoading: addItemMutation.isPending, disabled: !title || (!isForSelfUse && Number(priceRupees) <= 0), onClick: () => addItemMutation.mutate(), children: "Save Item" })] })), isLoading ? (_jsxs(Stack, { gap: "sm", children: [_jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" })] })) : items.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No items tracked yet." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Title" }), _jsx(Th, { children: "Qty" }), _jsx(Th, { children: "Price" }), _jsx(Th, { children: "Status" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: items.map((item) => (_jsxs(Tr, { children: [_jsx(Td, { children: item.title }), _jsx(Td, { children: item.quantity }), _jsx(Td, { children: item.isForSelfUse ? "—" : formatPaise(item.price ?? 0) }), _jsx(Td, { children: item.isForSelfUse ? (_jsx(Badge, { variant: "secondary", children: "Self use" })) : item.linkedProductId ? (_jsx(Badge, { variant: "success", children: "Linked" })) : (_jsx(Badge, { variant: "default", children: "Unlinked" })) }), _jsxs(Td, { className: "flex gap-[var(--appkit-space-2)]", children: [!item.isForSelfUse &&
91
+ return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsxs(Heading, { level: 3, children: ["Lot Items (", meta?.total ?? items.length, "/500)"] }), _jsxs(Div, { className: "flex gap-[var(--appkit-space-2)]", children: [_jsx(Button, { size: "sm", variant: "secondary", onClick: () => setShowAddItem((v) => !v), children: showAddItem ? "Cancel" : "+ Add Item" }), _jsx(Button, { size: "sm", variant: "secondary", onClick: () => setShowBulkImport(true), children: "Bulk Import" })] })] }), _jsx(Alert, { variant: "info", children: "Only individually notable \"main\" items need a row here \u2014 everything else in the lot can be captured as a single remainder estimate on the lot itself. Linking an item to a product does not sync future edits either way." }), showAddItem && (_jsxs(Grid, { cols: 4, gap: "sm", children: [_jsx(FieldInput, { name: "title", label: "Title", required: true, value: title, onChange: setTitle }), _jsx(FieldInput, { name: "quantity", label: "Quantity", type: "number", min: "1", value: quantity, onChange: setQuantity }), _jsx(FieldInput, { name: "price", label: "Projected Sale Price (\u20B9)", type: "number", min: "0", value: priceRupees, onChange: setPriceRupees, disabled: isForSelfUse }), _jsx(FieldCheckbox, { name: "isForSelfUse", label: "For self use (no resale)", checked: isForSelfUse, onChange: setIsForSelfUse }), _jsx(Button, { size: "sm", isLoading: addItemMutation.isPending, disabled: !title || (!isForSelfUse && Number(priceRupees) <= 0), onClick: () => addItemMutation.mutate(), children: "Save Item" })] })), isLoading ? (_jsxs(Stack, { gap: "sm", children: [_jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" })] })) : items.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No items tracked yet." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Title" }), _jsx(Th, { children: "Qty" }), _jsx(Th, { children: "Price" }), _jsx(Th, { children: "Status" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: items.map((item) => (_jsxs(Tr, { children: [_jsx(Td, { children: item.title }), _jsx(Td, { children: item.quantity }), _jsx(Td, { children: item.isForSelfUse ? "—" : formatCurrency(item.price ?? 0) }), _jsx(Td, { children: item.isForSelfUse ? (_jsx(Badge, { variant: "secondary", children: "Self use" })) : item.linkedProductId ? (_jsx(Badge, { variant: "success", children: "Linked" })) : (_jsx(Badge, { variant: "default", children: "Unlinked" })) }), _jsxs(Td, { className: "flex gap-[var(--appkit-space-2)]", children: [!item.isForSelfUse &&
92
92
  (item.linkedProductId ? (_jsx(Button, { size: "sm", variant: "ghost", isLoading: unlinkItemMutation.isPending, onClick: () => unlinkItemMutation.mutate(item.id), children: "Unlink" })) : (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setLinkTarget({ itemId: item.id, title: item.title }), children: "Create pre-order link" }))), _jsx(Button, { size: "sm", variant: "ghost", action: ACTIONS.SHIPMENT["delete"], isLoading: deleteItemMutation.isPending, onClick: () => deleteItemMutation.mutate(item.id), children: "Delete" })] })] }, item.id))) })] })), meta && meta.totalPages > 1 && (_jsx(Pagination, { currentPage: page, totalPages: meta.totalPages, onPageChange: setPage, pageSize: pageSize, onPageSizeChange: (size) => {
93
93
  setPageSize(size);
94
94
  setPage(1);
@@ -4,12 +4,12 @@ import React from "react";
4
4
  import { Button, Div, Heading, Modal, Pagination, Select, Skeleton, Stack, Table, Thead, Tbody, Tr, Th, Td, Text } from "../../../ui";
5
5
  import { useShipmentProjections, useShipmentItems } from "../hooks/useShipments";
6
6
  import { ShipmentItemLinkModal } from "./ShipmentItemLinkModal";
7
- import { formatPaise } from "../../../utils/number.formatter";
7
+ import { formatCurrency } from "../../../utils/number.formatter";
8
8
  import { sortBy } from "../../../constants/sort";
9
9
  const SORT_OPTIONS = [
10
- { value: sortBy("projectedProfitPaise", "DESC"), label: "Highest projected profit" },
11
- { value: sortBy("projectedProfitPaise", "ASC"), label: "Lowest projected profit" },
12
- { value: sortBy("projectedRevenuePaise", "DESC"), label: "Highest projected revenue" },
10
+ { value: sortBy("projectedProfit", "DESC"), label: "Highest projected profit" },
11
+ { value: sortBy("projectedProfit", "ASC"), label: "Lowest projected profit" },
12
+ { value: sortBy("projectedRevenue", "DESC"), label: "Highest projected revenue" },
13
13
  { value: sortBy("createdAt", "DESC"), label: "Newest" },
14
14
  ];
15
15
  /**
@@ -25,7 +25,7 @@ export function AdminShipmentProjectionsView() {
25
25
  const [sorts, setSorts] = React.useState(SORT_OPTIONS[0].value);
26
26
  const { lots, meta, isLoading, refetch } = useShipmentProjections({ page, pageSize, sorts });
27
27
  const [pickerLot, setPickerLot] = React.useState(null);
28
- return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsx(Heading, { level: 2, children: "Projections" }), _jsx(Select, { "aria-label": "Sort by", value: sorts, onValueChange: setSorts, options: SORT_OPTIONS })] }), isLoading ? (_jsxs(Stack, { gap: "sm", children: [_jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" })] })) : lots.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No lots to project yet." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Lot" }), _jsx(Th, { children: "Items" }), _jsx(Th, { children: "Landed Cost" }), _jsx(Th, { children: "Projected Revenue" }), _jsx(Th, { children: "Projected Profit" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: lots.map((lot) => (_jsxs(Tr, { children: [_jsx(Td, { children: lot.lotName }), _jsx(Td, { children: lot.itemCount }), _jsx(Td, { children: formatPaise(lot.totalLandedCostPaise) }), _jsx(Td, { children: formatPaise(lot.projectedRevenuePaise) }), _jsx(Td, { className: lot.projectedProfitPaise < 0 ? "text-error" : "text-success", children: formatPaise(lot.projectedProfitPaise) }), _jsx(Td, { children: _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setPickerLot(lot), children: "Create pre-order link" }) })] }, lot.id))) })] })), meta && meta.totalPages > 1 && (_jsx(Pagination, { currentPage: page, totalPages: meta.totalPages, onPageChange: setPage, pageSize: pageSize, onPageSizeChange: (size) => {
28
+ return (_jsxs(Stack, { gap: "md", children: [_jsxs(Div, { layout: "flex", align: "center", justify: "between", children: [_jsx(Heading, { level: 2, children: "Projections" }), _jsx(Select, { "aria-label": "Sort by", value: sorts, onValueChange: setSorts, options: SORT_OPTIONS })] }), isLoading ? (_jsxs(Stack, { gap: "sm", children: [_jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" }), _jsx(Skeleton, { variant: "rectangular", height: "32px" })] })) : lots.length === 0 ? (_jsx(Text, { variant: "secondary", children: "No lots to project yet." })) : (_jsxs(Table, { children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "Lot" }), _jsx(Th, { children: "Items" }), _jsx(Th, { children: "Landed Cost" }), _jsx(Th, { children: "Projected Revenue" }), _jsx(Th, { children: "Projected Profit" }), _jsx(Th, {})] }) }), _jsx(Tbody, { children: lots.map((lot) => (_jsxs(Tr, { children: [_jsx(Td, { children: lot.lotName }), _jsx(Td, { children: lot.itemCount }), _jsx(Td, { children: formatCurrency(lot.totalLandedCost) }), _jsx(Td, { children: formatCurrency(lot.projectedRevenue) }), _jsx(Td, { className: lot.projectedProfit < 0 ? "text-error" : "text-success", children: formatCurrency(lot.projectedProfit) }), _jsx(Td, { children: _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setPickerLot(lot), children: "Create pre-order link" }) })] }, lot.id))) })] })), meta && meta.totalPages > 1 && (_jsx(Pagination, { currentPage: page, totalPages: meta.totalPages, onPageChange: setPage, pageSize: pageSize, onPageSizeChange: (size) => {
29
29
  setPageSize(size);
30
30
  setPage(1);
31
31
  } })), pickerLot && (_jsx(LotItemPickerModal, { lot: pickerLot, onClose: () => setPickerLot(null), onLinked: refetch }))] }));
@@ -9,7 +9,7 @@ import { toRecordArray, toRelativeDate, toStringValue, } from "../../admin/hooks
9
9
  import { DataListingView } from "../../admin/components/DataListingView";
10
10
  import { AdminShipmentEditorView } from "./AdminShipmentEditorView";
11
11
  import { ADMIN_BULK_ACTIONS, ROW_ACTION_META } from "../../products/constants/action-defs";
12
- import { formatPaise } from "../../../utils/number.formatter";
12
+ import { formatCurrency } from "../../../utils/number.formatter";
13
13
  const STATUS_OPTIONS = [
14
14
  { id: "All", label: "All" },
15
15
  { id: "planning", label: "Planning" },
@@ -37,7 +37,7 @@ export function AdminShipmentsView({ children, ...props }) {
37
37
  sortOptions: [
38
38
  { value: sortBy("createdAt", "DESC"), label: "Newest" },
39
39
  { value: sortBy("etaDate", "ASC"), label: "ETA soonest" },
40
- { value: sortBy("projectedProfitPaise", "DESC"), label: "Highest projected profit" },
40
+ { value: sortBy("projectedProfit", "DESC"), label: "Highest projected profit" },
41
41
  { value: "shipmentNumber", label: "Shipment # A–Z" },
42
42
  ],
43
43
  mapRows: (response) => toRecordArray(response.shipments).map((item, index) => {
@@ -52,8 +52,8 @@ export function AdminShipmentsView({ children, ...props }) {
52
52
  .join(" · "),
53
53
  status: toStringValue(item.status, "planning"),
54
54
  updatedAt: toRelativeDate(updatedAt),
55
- totalCost: formatPaise(Number(totals.totalShipmentCostPaise ?? 0)),
56
- projectedProfit: formatPaise(Number(totals.projectedProfitPaise ?? 0)),
55
+ totalCost: formatCurrency(Number(totals.totalShipmentCost ?? 0)),
56
+ projectedProfit: formatCurrency(Number(totals.projectedProfit ?? 0)),
57
57
  recalculating: !totalsComputedAt || (!!updatedAt && String(updatedAt) > String(totalsComputedAt)),
58
58
  };
59
59
  }),
@@ -31,11 +31,11 @@ export declare class ShipmentLotsRepository extends BaseRepository<ShipmentLot>
31
31
  canFilter: boolean;
32
32
  canSort: boolean;
33
33
  };
34
- projectedProfitPaise: {
34
+ projectedProfit: {
35
35
  canFilter: boolean;
36
36
  canSort: boolean;
37
37
  };
38
- projectedRevenuePaise: {
38
+ projectedRevenue: {
39
39
  canFilter: boolean;
40
40
  canSort: boolean;
41
41
  };
@@ -20,12 +20,12 @@ export class ShipmentLotsRepository extends BaseRepository {
20
20
  shipmentId,
21
21
  shipmentStatus,
22
22
  itemCount: 0,
23
- mainItemsProjectedRevenuePaise: 0,
24
- customsAllocatedPaise: 0,
25
- shippingAllocatedPaise: 0,
26
- totalLandedCostPaise: input.purchaseCostPaise,
27
- projectedRevenuePaise: input.remainderEstimatedValuePaise ?? 0,
28
- projectedProfitPaise: (input.remainderEstimatedValuePaise ?? 0) - input.purchaseCostPaise,
23
+ mainItemsProjectedRevenue: 0,
24
+ customsAllocated: 0,
25
+ shippingAllocated: 0,
26
+ totalLandedCost: input.purchaseCost,
27
+ projectedRevenue: input.remainderEstimatedValue ?? 0,
28
+ projectedProfit: (input.remainderEstimatedValue ?? 0) - input.purchaseCost,
29
29
  });
30
30
  }
31
31
  async updateLot(lotId, input) {
@@ -48,8 +48,8 @@ ShipmentLotsRepository.SIEVE_FIELDS = {
48
48
  shipmentId: { canFilter: true, canSort: false },
49
49
  shipmentStatus: { canFilter: true, canSort: false },
50
50
  lotName: { canFilter: true, canSort: true },
51
- projectedProfitPaise: { canFilter: true, canSort: true },
52
- projectedRevenuePaise: { canFilter: true, canSort: true },
51
+ projectedProfit: { canFilter: true, canSort: true },
52
+ projectedRevenue: { canFilter: true, canSort: true },
53
53
  createdAt: { canFilter: true, canSort: true },
54
54
  };
55
55
  export const shipmentLotsRepository = new ShipmentLotsRepository();
@@ -24,14 +24,14 @@ export type ShipmentStatus = "planning" | "ordered" | "in_transit" | "customs" |
24
24
  export declare const MAX_ITEMS_PER_LOT = 500;
25
25
  export declare const MAX_LOTS_PER_SHIPMENT = 10;
26
26
  export interface ShipmentTotals {
27
- lotsCostPaise: number;
28
- customsTotalPaise: number;
29
- shippingTotalPaise: number;
30
- laborCostPaise: number;
31
- totalShipmentCostPaise: number;
32
- totalProjectedRevenuePaise: number;
33
- projectedProfitPaise: number;
34
- projectedProfitAfterLaborPaise: number;
27
+ lotsCost: number;
28
+ customsTotal: number;
29
+ shippingTotal: number;
30
+ laborCost: number;
31
+ totalShipmentCost: number;
32
+ totalProjectedRevenue: number;
33
+ projectedProfit: number;
34
+ projectedProfitAfterLabor: number;
35
35
  projectedMarginPercent: number;
36
36
  projectedRoiPercent: number;
37
37
  totalWeightGrams: number;
@@ -50,10 +50,10 @@ export interface ShipmentDocument extends BaseDocument {
50
50
  etaDate?: Date;
51
51
  receivedDate?: Date;
52
52
  notes?: string;
53
- customsTotalPaise: number;
54
- shippingTotalPaise: number;
53
+ customsTotal: number;
54
+ shippingTotal: number;
55
55
  laborHoursSpent?: number;
56
- laborRatePaisePerHour?: number;
56
+ laborRatePerHour?: number;
57
57
  totals: ShipmentTotals;
58
58
  totalsComputedAt?: Date;
59
59
  createdBy: string;
@@ -64,17 +64,17 @@ export interface ShipmentLot extends BaseDocument {
64
64
  lotName: string;
65
65
  supplierOrderRef?: string;
66
66
  weightGrams: number;
67
- purchaseCostPaise: number;
67
+ purchaseCost: number;
68
68
  images: MediaField[];
69
69
  remainderItemCount?: number;
70
- remainderEstimatedValuePaise?: number;
70
+ remainderEstimatedValue?: number;
71
71
  itemCount: number;
72
- mainItemsProjectedRevenuePaise: number;
73
- customsAllocatedPaise: number;
74
- shippingAllocatedPaise: number;
75
- totalLandedCostPaise: number;
76
- projectedRevenuePaise: number;
77
- projectedProfitPaise: number;
72
+ mainItemsProjectedRevenue: number;
73
+ customsAllocated: number;
74
+ shippingAllocated: number;
75
+ totalLandedCost: number;
76
+ projectedRevenue: number;
77
+ projectedProfit: number;
78
78
  }
79
79
  /**
80
80
  * Reused everywhere a "this will eventually become a real product" record is
@@ -127,7 +127,7 @@ export declare const SHIPMENT_LOT_FIELDS: {
127
127
  readonly ID: "id";
128
128
  readonly SHIPMENT_ID: "shipmentId";
129
129
  readonly SHIPMENT_STATUS: "shipmentStatus";
130
- readonly PROJECTED_PROFIT_PAISE: "projectedProfitPaise";
130
+ readonly PROJECTED_PROFIT: "projectedProfit";
131
131
  readonly CREATED_AT: "createdAt";
132
132
  };
133
133
  export declare const SHIPMENT_ITEM_FIELDS: {
@@ -139,7 +139,7 @@ export declare const SHIPMENT_ITEM_FIELDS: {
139
139
  };
140
140
  export type ShipmentCreateInput = Omit<ShipmentDocument, "id" | "createdAt" | "updatedAt" | "totals" | "totalsComputedAt">;
141
141
  export type ShipmentUpdateInput = Partial<Omit<ShipmentDocument, "id" | "createdAt" | "createdBy" | "totals" | "totalsComputedAt">>;
142
- export type ShipmentLotCreateInput = Omit<ShipmentLot, "id" | "createdAt" | "updatedAt" | "shipmentId" | "shipmentStatus" | "itemCount" | "mainItemsProjectedRevenuePaise" | "customsAllocatedPaise" | "shippingAllocatedPaise" | "totalLandedCostPaise" | "projectedRevenuePaise" | "projectedProfitPaise">;
142
+ export type ShipmentLotCreateInput = Omit<ShipmentLot, "id" | "createdAt" | "updatedAt" | "shipmentId" | "shipmentStatus" | "itemCount" | "mainItemsProjectedRevenue" | "customsAllocated" | "shippingAllocated" | "totalLandedCost" | "projectedRevenue" | "projectedProfit">;
143
143
  export type ShipmentLotUpdateInput = Partial<Omit<ShipmentLot, "id" | "createdAt" | "shipmentId">>;
144
144
  export type ShipmentItemCreateInput = Omit<ShipmentItem, "id" | "createdAt" | "updatedAt" | "shipmentId" | "lotId">;
145
145
  export type ShipmentItemUpdateInput = Partial<Omit<ShipmentItem, "id" | "createdAt" | "shipmentId" | "lotId">>;
@@ -20,14 +20,14 @@ export const SHIPMENT_ITEM_COLLECTION = "shipmentItems";
20
20
  export const MAX_ITEMS_PER_LOT = 500;
21
21
  export const MAX_LOTS_PER_SHIPMENT = 10;
22
22
  export const DEFAULT_SHIPMENT_TOTALS = {
23
- lotsCostPaise: 0,
24
- customsTotalPaise: 0,
25
- shippingTotalPaise: 0,
26
- laborCostPaise: 0,
27
- totalShipmentCostPaise: 0,
28
- totalProjectedRevenuePaise: 0,
29
- projectedProfitPaise: 0,
30
- projectedProfitAfterLaborPaise: 0,
23
+ lotsCost: 0,
24
+ customsTotal: 0,
25
+ shippingTotal: 0,
26
+ laborCost: 0,
27
+ totalShipmentCost: 0,
28
+ totalProjectedRevenue: 0,
29
+ projectedProfit: 0,
30
+ projectedProfitAfterLabor: 0,
31
31
  projectedMarginPercent: 0,
32
32
  projectedRoiPercent: 0,
33
33
  totalWeightGrams: 0,
@@ -57,7 +57,7 @@ export const SHIPMENT_LOT_FIELDS = {
57
57
  ID: "id",
58
58
  SHIPMENT_ID: "shipmentId",
59
59
  SHIPMENT_STATUS: "shipmentStatus",
60
- PROJECTED_PROFIT_PAISE: "projectedProfitPaise",
60
+ PROJECTED_PROFIT: "projectedProfit",
61
61
  CREATED_AT: "createdAt",
62
62
  };
63
63
  export const SHIPMENT_ITEM_FIELDS = {
@@ -10,16 +10,16 @@ export declare const createShipmentSchema: z.ZodObject<{
10
10
  etaDate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
11
11
  receivedDate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
12
12
  notes: z.ZodOptional<z.ZodString>;
13
- customsTotalPaise: z.ZodNumber;
14
- shippingTotalPaise: z.ZodNumber;
13
+ customsTotal: z.ZodNumber;
14
+ shippingTotal: z.ZodNumber;
15
15
  laborHoursSpent: z.ZodOptional<z.ZodNumber>;
16
- laborRatePaisePerHour: z.ZodOptional<z.ZodNumber>;
16
+ laborRatePerHour: z.ZodOptional<z.ZodNumber>;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  status: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs";
19
19
  shipmentNumber: string;
20
20
  supplierName: string;
21
- customsTotalPaise: number;
22
- shippingTotalPaise: number;
21
+ customsTotal: number;
22
+ shippingTotal: number;
23
23
  notes?: string | undefined;
24
24
  trackingNumber?: string | undefined;
25
25
  etaDate?: string | Date | undefined;
@@ -27,13 +27,13 @@ export declare const createShipmentSchema: z.ZodObject<{
27
27
  carrier?: string | undefined;
28
28
  receivedDate?: string | Date | undefined;
29
29
  laborHoursSpent?: number | undefined;
30
- laborRatePaisePerHour?: number | undefined;
30
+ laborRatePerHour?: number | undefined;
31
31
  }, {
32
32
  status: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs";
33
33
  shipmentNumber: string;
34
34
  supplierName: string;
35
- customsTotalPaise: number;
36
- shippingTotalPaise: number;
35
+ customsTotal: number;
36
+ shippingTotal: number;
37
37
  notes?: string | undefined;
38
38
  trackingNumber?: string | undefined;
39
39
  etaDate?: string | Date | undefined;
@@ -41,7 +41,7 @@ export declare const createShipmentSchema: z.ZodObject<{
41
41
  carrier?: string | undefined;
42
42
  receivedDate?: string | Date | undefined;
43
43
  laborHoursSpent?: number | undefined;
44
- laborRatePaisePerHour?: number | undefined;
44
+ laborRatePerHour?: number | undefined;
45
45
  }>;
46
46
  export declare const updateShipmentSchema: z.ZodObject<{
47
47
  shipmentNumber: z.ZodOptional<z.ZodString>;
@@ -53,10 +53,10 @@ export declare const updateShipmentSchema: z.ZodObject<{
53
53
  etaDate: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>>;
54
54
  receivedDate: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>>;
55
55
  notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
56
- customsTotalPaise: z.ZodOptional<z.ZodNumber>;
57
- shippingTotalPaise: z.ZodOptional<z.ZodNumber>;
56
+ customsTotal: z.ZodOptional<z.ZodNumber>;
57
+ shippingTotal: z.ZodOptional<z.ZodNumber>;
58
58
  laborHoursSpent: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
59
- laborRatePaisePerHour: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
59
+ laborRatePerHour: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  status?: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs" | undefined;
62
62
  notes?: string | undefined;
@@ -67,10 +67,10 @@ export declare const updateShipmentSchema: z.ZodObject<{
67
67
  originCountry?: string | undefined;
68
68
  carrier?: string | undefined;
69
69
  receivedDate?: string | Date | undefined;
70
- customsTotalPaise?: number | undefined;
71
- shippingTotalPaise?: number | undefined;
70
+ customsTotal?: number | undefined;
71
+ shippingTotal?: number | undefined;
72
72
  laborHoursSpent?: number | undefined;
73
- laborRatePaisePerHour?: number | undefined;
73
+ laborRatePerHour?: number | undefined;
74
74
  }, {
75
75
  status?: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs" | undefined;
76
76
  notes?: string | undefined;
@@ -81,16 +81,16 @@ export declare const updateShipmentSchema: z.ZodObject<{
81
81
  originCountry?: string | undefined;
82
82
  carrier?: string | undefined;
83
83
  receivedDate?: string | Date | undefined;
84
- customsTotalPaise?: number | undefined;
85
- shippingTotalPaise?: number | undefined;
84
+ customsTotal?: number | undefined;
85
+ shippingTotal?: number | undefined;
86
86
  laborHoursSpent?: number | undefined;
87
- laborRatePaisePerHour?: number | undefined;
87
+ laborRatePerHour?: number | undefined;
88
88
  }>;
89
89
  export declare const createShipmentLotSchema: z.ZodObject<{
90
90
  lotName: z.ZodString;
91
91
  supplierOrderRef: z.ZodOptional<z.ZodString>;
92
92
  weightGrams: z.ZodNumber;
93
- purchaseCostPaise: z.ZodNumber;
93
+ purchaseCost: z.ZodNumber;
94
94
  images: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
95
95
  url: z.ZodString;
96
96
  type: z.ZodEnum<["image", "video", "file"]>;
@@ -114,7 +114,7 @@ export declare const createShipmentLotSchema: z.ZodObject<{
114
114
  youtubeId?: string | undefined;
115
115
  }>, "many">>>;
116
116
  remainderItemCount: z.ZodOptional<z.ZodNumber>;
117
- remainderEstimatedValuePaise: z.ZodOptional<z.ZodNumber>;
117
+ remainderEstimatedValue: z.ZodOptional<z.ZodNumber>;
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  images: {
120
120
  type: "video" | "image" | "file";
@@ -126,14 +126,14 @@ export declare const createShipmentLotSchema: z.ZodObject<{
126
126
  }[];
127
127
  lotName: string;
128
128
  weightGrams: number;
129
- purchaseCostPaise: number;
129
+ purchaseCost: number;
130
130
  supplierOrderRef?: string | undefined;
131
131
  remainderItemCount?: number | undefined;
132
- remainderEstimatedValuePaise?: number | undefined;
132
+ remainderEstimatedValue?: number | undefined;
133
133
  }, {
134
134
  lotName: string;
135
135
  weightGrams: number;
136
- purchaseCostPaise: number;
136
+ purchaseCost: number;
137
137
  images?: {
138
138
  type: "video" | "image" | "file";
139
139
  url: string;
@@ -144,13 +144,13 @@ export declare const createShipmentLotSchema: z.ZodObject<{
144
144
  }[] | undefined;
145
145
  supplierOrderRef?: string | undefined;
146
146
  remainderItemCount?: number | undefined;
147
- remainderEstimatedValuePaise?: number | undefined;
147
+ remainderEstimatedValue?: number | undefined;
148
148
  }>;
149
149
  export declare const updateShipmentLotSchema: z.ZodObject<{
150
150
  lotName: z.ZodOptional<z.ZodString>;
151
151
  supplierOrderRef: z.ZodOptional<z.ZodOptional<z.ZodString>>;
152
152
  weightGrams: z.ZodOptional<z.ZodNumber>;
153
- purchaseCostPaise: z.ZodOptional<z.ZodNumber>;
153
+ purchaseCost: z.ZodOptional<z.ZodNumber>;
154
154
  images: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
155
155
  url: z.ZodString;
156
156
  type: z.ZodEnum<["image", "video", "file"]>;
@@ -174,7 +174,7 @@ export declare const updateShipmentLotSchema: z.ZodObject<{
174
174
  youtubeId?: string | undefined;
175
175
  }>, "many">>>>;
176
176
  remainderItemCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
177
- remainderEstimatedValuePaise: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
177
+ remainderEstimatedValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
178
178
  }, "strip", z.ZodTypeAny, {
179
179
  images?: {
180
180
  type: "video" | "image" | "file";
@@ -187,9 +187,9 @@ export declare const updateShipmentLotSchema: z.ZodObject<{
187
187
  lotName?: string | undefined;
188
188
  supplierOrderRef?: string | undefined;
189
189
  weightGrams?: number | undefined;
190
- purchaseCostPaise?: number | undefined;
190
+ purchaseCost?: number | undefined;
191
191
  remainderItemCount?: number | undefined;
192
- remainderEstimatedValuePaise?: number | undefined;
192
+ remainderEstimatedValue?: number | undefined;
193
193
  }, {
194
194
  images?: {
195
195
  type: "video" | "image" | "file";
@@ -202,9 +202,9 @@ export declare const updateShipmentLotSchema: z.ZodObject<{
202
202
  lotName?: string | undefined;
203
203
  supplierOrderRef?: string | undefined;
204
204
  weightGrams?: number | undefined;
205
- purchaseCostPaise?: number | undefined;
205
+ purchaseCost?: number | undefined;
206
206
  remainderItemCount?: number | undefined;
207
- remainderEstimatedValuePaise?: number | undefined;
207
+ remainderEstimatedValue?: number | undefined;
208
208
  }>;
209
209
  export declare const createShipmentItemSchema: z.ZodEffects<z.ZodObject<{
210
210
  title: z.ZodString;