@aglyn/plugins-commerce 1.0.0-beta.285 → 1.0.0-beta.287

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 (420) hide show
  1. package/README.md +1 -1
  2. package/package.json +13 -13
  3. package/src/lib/components/cart.js +25 -12
  4. package/src/lib/components/cart.js.map +1 -1
  5. package/src/lib/components/commerce-console-page.js +70 -13
  6. package/src/lib/components/commerce-console-page.js.map +1 -1
  7. package/src/lib/components/console/order-detail-dialog.component.js +2 -1
  8. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
  9. package/src/lib/components/console/payment-methods-card.component.js +1 -1
  10. package/src/lib/components/console/payment-methods-card.component.js.map +1 -1
  11. package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +5 -0
  12. package/src/lib/components/console/pos/pos-cart-panel.component.js +18 -12
  13. package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -1
  14. package/src/lib/components/console/pos/pos-hardware-api.d.ts +76 -5
  15. package/src/lib/components/console/pos/pos-hardware-api.js +53 -11
  16. package/src/lib/components/console/pos/pos-hardware-api.js.map +1 -1
  17. package/src/lib/components/console/pos/pos-hardware-buyer.component.d.ts +18 -0
  18. package/src/lib/components/console/pos/pos-hardware-buyer.component.js +629 -0
  19. package/src/lib/components/console/pos/pos-hardware-buyer.component.js.map +1 -0
  20. package/src/lib/components/console/pos/pos-hardware-sale-api.d.ts +162 -0
  21. package/src/lib/components/console/pos/pos-hardware-sale-api.js +122 -0
  22. package/src/lib/components/console/pos/pos-hardware-sale-api.js.map +1 -0
  23. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.d.ts +39 -0
  24. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js +251 -0
  25. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js.map +1 -0
  26. package/src/lib/components/console/pos/use-pos-display.js +50 -0
  27. package/src/lib/components/console/pos/use-pos-display.js.map +1 -1
  28. package/src/lib/components/console/pos-cellular-control.component.d.ts +41 -0
  29. package/src/lib/components/console/pos-cellular-control.component.js +211 -0
  30. package/src/lib/components/console/pos-cellular-control.component.js.map +1 -0
  31. package/src/lib/components/console/pos-devices-card.component.d.ts +9 -1
  32. package/src/lib/components/console/pos-devices-card.component.js +47 -15
  33. package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
  34. package/src/lib/components/console/pos-display/pos-display-api.d.ts +6 -0
  35. package/src/lib/components/console/pos-display/pos-display-api.js +8 -1
  36. package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -1
  37. package/src/lib/components/console/pos-display-page.component.d.ts +13 -0
  38. package/src/lib/components/console/pos-display-page.component.js +44 -2
  39. package/src/lib/components/console/pos-display-page.component.js.map +1 -1
  40. package/src/lib/components/console/pos-hardware-card.component.d.ts +12 -4
  41. package/src/lib/components/console/pos-hardware-card.component.js +157 -36
  42. package/src/lib/components/console/pos-hardware-card.component.js.map +1 -1
  43. package/src/lib/components/console/pos-hardware-orders-staff-page.component.js +360 -80
  44. package/src/lib/components/console/pos-hardware-orders-staff-page.component.js.map +1 -1
  45. package/src/lib/components/console/pos-hardware-terms-page.component.d.ts +34 -0
  46. package/src/lib/components/console/pos-hardware-terms-page.component.js +257 -0
  47. package/src/lib/components/console/pos-hardware-terms-page.component.js.map +1 -0
  48. package/src/lib/components/console/pos-hardware-terms-sign-page.component.d.ts +27 -0
  49. package/src/lib/components/console/pos-hardware-terms-sign-page.component.js +104 -0
  50. package/src/lib/components/console/pos-hardware-terms-sign-page.component.js.map +1 -0
  51. package/src/lib/components/console/pos-hardware-waiting-card.component.d.ts +24 -0
  52. package/src/lib/components/console/pos-hardware-waiting-card.component.js +205 -0
  53. package/src/lib/components/console/pos-hardware-waiting-card.component.js.map +1 -0
  54. package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js +297 -201
  55. package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js.map +1 -1
  56. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.d.ts +3 -0
  57. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js +260 -92
  58. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js.map +1 -1
  59. package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +9 -0
  60. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +15 -6
  61. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -1
  62. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.d.ts +25 -0
  63. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js +136 -0
  64. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js.map +1 -0
  65. package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +6 -0
  66. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +48 -31
  67. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -1
  68. package/src/lib/components/console/pos-page.component.d.ts +1 -1
  69. package/src/lib/components/console/pos-page.component.js +63 -12
  70. package/src/lib/components/console/pos-page.component.js.map +1 -1
  71. package/src/lib/components/console/pos-reader-splash-setting.component.js +1 -1
  72. package/src/lib/components/console/pos-reader-splash-setting.component.js.map +1 -1
  73. package/src/lib/components/console/product-check-in-fields.component.d.ts +4 -2
  74. package/src/lib/components/console/product-check-in-fields.component.js +60 -14
  75. package/src/lib/components/console/product-check-in-fields.component.js.map +1 -1
  76. package/src/lib/components/console/product-editor-dialog.component.js +44 -1
  77. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  78. package/src/lib/components/console/product-hardware-sku-field.component.d.ts +19 -0
  79. package/src/lib/components/console/product-hardware-sku-field.component.js +92 -0
  80. package/src/lib/components/console/product-hardware-sku-field.component.js.map +1 -0
  81. package/src/lib/components/console/product-kiosk-offer-field.component.d.ts +22 -0
  82. package/src/lib/components/console/product-kiosk-offer-field.component.js +94 -0
  83. package/src/lib/components/console/product-kiosk-offer-field.component.js.map +1 -0
  84. package/src/lib/components/console/product-register-fields.component.d.ts +4 -0
  85. package/src/lib/components/console/product-register-fields.component.js +31 -2
  86. package/src/lib/components/console/product-register-fields.component.js.map +1 -1
  87. package/src/lib/components/console/products-hub-card.component.js +11 -2
  88. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  89. package/src/lib/components/console/register-hardware-card.component.d.ts +11 -0
  90. package/src/lib/components/console/register-hardware-card.component.js +56 -27
  91. package/src/lib/components/console/register-hardware-card.component.js.map +1 -1
  92. package/src/lib/components/console/reservation-guests-dialog.component.d.ts +28 -0
  93. package/src/lib/components/console/reservation-guests-dialog.component.js +189 -0
  94. package/src/lib/components/console/reservation-guests-dialog.component.js.map +1 -0
  95. package/src/lib/components/console/reservations-card.component.d.ts +9 -0
  96. package/src/lib/components/console/reservations-card.component.js +158 -23
  97. package/src/lib/components/console/reservations-card.component.js.map +1 -1
  98. package/src/lib/components/console/shippingeasy-card.component.js +1 -1
  99. package/src/lib/components/console/shippingeasy-card.component.js.map +1 -1
  100. package/src/lib/components/console/shipstation-card.component.d.ts +1 -1
  101. package/src/lib/components/console/shipstation-card.component.js +3 -3
  102. package/src/lib/components/console/shipstation-card.component.js.map +1 -1
  103. package/src/lib/components/product-detail.d.ts +4 -0
  104. package/src/lib/components/product-detail.js +40 -5
  105. package/src/lib/components/product-detail.js.map +1 -1
  106. package/src/lib/components/product-reviews.js +28 -11
  107. package/src/lib/components/product-reviews.js.map +1 -1
  108. package/src/lib/components/reservation-widget.js +28 -5
  109. package/src/lib/components/reservation-widget.js.map +1 -1
  110. package/src/lib/components/use-day-picker.d.ts +25 -0
  111. package/src/lib/components/use-day-picker.js +57 -0
  112. package/src/lib/components/use-day-picker.js.map +1 -0
  113. package/src/lib/constants/operator-alerts.d.ts +55 -0
  114. package/src/lib/constants/operator-alerts.js +156 -1
  115. package/src/lib/constants/operator-alerts.js.map +1 -1
  116. package/src/lib/declarations.console-server.js +54 -1
  117. package/src/lib/declarations.console-server.js.map +1 -1
  118. package/src/lib/declarations.d.ts +4 -2
  119. package/src/lib/declarations.js +11 -4
  120. package/src/lib/declarations.js.map +1 -1
  121. package/src/lib/declarations.server.js +9 -0
  122. package/src/lib/declarations.server.js.map +1 -1
  123. package/src/lib/model/commerce-cart.d.ts +9 -1
  124. package/src/lib/model/commerce-cart.js +4 -3
  125. package/src/lib/model/commerce-cart.js.map +1 -1
  126. package/src/lib/model/commerce-check-in-product.d.ts +26 -0
  127. package/src/lib/model/commerce-check-in-product.js +64 -2
  128. package/src/lib/model/commerce-check-in-product.js.map +1 -1
  129. package/src/lib/model/commerce-check-in-record.d.ts +127 -0
  130. package/src/lib/model/commerce-check-in-record.js +36 -0
  131. package/src/lib/model/commerce-check-in-record.js.map +1 -0
  132. package/src/lib/model/commerce-check-in.d.ts +91 -87
  133. package/src/lib/model/commerce-check-in.js +186 -62
  134. package/src/lib/model/commerce-check-in.js.map +1 -1
  135. package/src/lib/model/commerce-kiosk-offer.d.ts +31 -0
  136. package/src/lib/model/commerce-kiosk-offer.js +35 -0
  137. package/src/lib/model/commerce-kiosk-offer.js.map +1 -0
  138. package/src/lib/model/commerce-orders.d.ts +76 -0
  139. package/src/lib/model/commerce-orders.js +6 -0
  140. package/src/lib/model/commerce-orders.js.map +1 -1
  141. package/src/lib/model/commerce-pos-day-report.d.ts +54 -1
  142. package/src/lib/model/commerce-pos-day-report.js +39 -2
  143. package/src/lib/model/commerce-pos-day-report.js.map +1 -1
  144. package/src/lib/model/commerce-pos-offline.d.ts +1 -1
  145. package/src/lib/model/commerce-pos-offline.js +6 -1
  146. package/src/lib/model/commerce-pos-offline.js.map +1 -1
  147. package/src/lib/model/commerce-pos-ops.js +3 -2
  148. package/src/lib/model/commerce-pos-ops.js.map +1 -1
  149. package/src/lib/model/commerce-pos.d.ts +36 -3
  150. package/src/lib/model/commerce-pos.js +14 -6
  151. package/src/lib/model/commerce-pos.js.map +1 -1
  152. package/src/lib/model/commerce-receipt.js +3 -2
  153. package/src/lib/model/commerce-receipt.js.map +1 -1
  154. package/src/lib/model/commerce-reservations.d.ts +69 -4
  155. package/src/lib/model/commerce-reservations.js +57 -5
  156. package/src/lib/model/commerce-reservations.js.map +1 -1
  157. package/src/lib/model/commerce.d.ts +66 -0
  158. package/src/lib/model/commerce.js +15 -0
  159. package/src/lib/model/commerce.js.map +1 -1
  160. package/src/lib/model/order-list-fields.d.ts +11 -0
  161. package/src/lib/model/order-list-fields.js +17 -1
  162. package/src/lib/model/order-list-fields.js.map +1 -1
  163. package/src/lib/model/own-store-tax-summary.d.ts +152 -0
  164. package/src/lib/model/own-store-tax-summary.js +288 -0
  165. package/src/lib/model/own-store-tax-summary.js.map +1 -0
  166. package/src/lib/model/plugin-permissions.d.ts +67 -0
  167. package/src/lib/model/plugin-permissions.js +224 -7
  168. package/src/lib/model/plugin-permissions.js.map +1 -1
  169. package/src/lib/model/pos-cellular.d.ts +223 -0
  170. package/src/lib/model/pos-cellular.js +293 -0
  171. package/src/lib/model/pos-cellular.js.map +1 -0
  172. package/src/lib/model/pos-hardware-in-person.d.ts +98 -0
  173. package/src/lib/model/pos-hardware-in-person.js +224 -0
  174. package/src/lib/model/pos-hardware-in-person.js.map +1 -0
  175. package/src/lib/model/pos-hardware-tax-summary.d.ts +166 -0
  176. package/src/lib/model/pos-hardware-tax-summary.js +225 -0
  177. package/src/lib/model/pos-hardware-tax-summary.js.map +1 -0
  178. package/src/lib/model/pos-hardware-terms.d.ts +74 -0
  179. package/src/lib/model/pos-hardware-terms.js +115 -0
  180. package/src/lib/model/pos-hardware-terms.js.map +1 -0
  181. package/src/lib/model/pos-hardware.d.ts +349 -7
  182. package/src/lib/model/pos-hardware.js +291 -20
  183. package/src/lib/model/pos-hardware.js.map +1 -1
  184. package/src/lib/model/product-write.d.ts +10 -0
  185. package/src/lib/model/product-write.js +4 -2
  186. package/src/lib/model/product-write.js.map +1 -1
  187. package/src/lib/plugin.js +16 -0
  188. package/src/lib/plugin.js.map +1 -1
  189. package/src/lib/server/billing-webhook.js +25 -1
  190. package/src/lib/server/billing-webhook.js.map +1 -1
  191. package/src/lib/server/cancel-order.js +7 -5
  192. package/src/lib/server/cancel-order.js.map +1 -1
  193. package/src/lib/server/cart-checkout.js +20 -8
  194. package/src/lib/server/cart-checkout.js.map +1 -1
  195. package/src/lib/server/cart.js +29 -0
  196. package/src/lib/server/cart.js.map +1 -1
  197. package/src/lib/server/checkout.js +42 -13
  198. package/src/lib/server/checkout.js.map +1 -1
  199. package/src/lib/server/collection-membership.d.ts +4 -0
  200. package/src/lib/server/collection-membership.js +5 -10
  201. package/src/lib/server/collection-membership.js.map +1 -1
  202. package/src/lib/server/commerce-site-keys.d.ts +29 -0
  203. package/src/lib/server/commerce-site-keys.js +40 -0
  204. package/src/lib/server/commerce-site-keys.js.map +1 -0
  205. package/src/lib/server/draft-order.js +8 -5
  206. package/src/lib/server/draft-order.js.map +1 -1
  207. package/src/lib/server/fulfill-order.js +7 -5
  208. package/src/lib/server/fulfill-order.js.map +1 -1
  209. package/src/lib/server/gift-cards.js +8 -5
  210. package/src/lib/server/gift-cards.js.map +1 -1
  211. package/src/lib/server/local-fulfillment-status.js +9 -6
  212. package/src/lib/server/local-fulfillment-status.js.map +1 -1
  213. package/src/lib/server/member-post.js +6 -5
  214. package/src/lib/server/member-post.js.map +1 -1
  215. package/src/lib/server/membership-admin-password.d.ts +4 -2
  216. package/src/lib/server/membership-admin-password.js +10 -8
  217. package/src/lib/server/membership-admin-password.js.map +1 -1
  218. package/src/lib/server/membership-admin-remove.d.ts +7 -5
  219. package/src/lib/server/membership-admin-remove.js +9 -9
  220. package/src/lib/server/membership-admin-remove.js.map +1 -1
  221. package/src/lib/server/order-notifications.js +5 -2
  222. package/src/lib/server/order-notifications.js.map +1 -1
  223. package/src/lib/server/order-print.js +7 -5
  224. package/src/lib/server/order-print.js.map +1 -1
  225. package/src/lib/server/order-receipt-send.js +8 -5
  226. package/src/lib/server/order-receipt-send.js.map +1 -1
  227. package/src/lib/server/orders-shipping-prepare.js +9 -6
  228. package/src/lib/server/orders-shipping-prepare.js.map +1 -1
  229. package/src/lib/server/own-store-tax-return-source.d.ts +47 -0
  230. package/src/lib/server/own-store-tax-return-source.js +312 -0
  231. package/src/lib/server/own-store-tax-return-source.js.map +1 -0
  232. package/src/lib/server/payment-methods.js +13 -9
  233. package/src/lib/server/payment-methods.js.map +1 -1
  234. package/src/lib/server/pos-auth.d.ts +37 -6
  235. package/src/lib/server/pos-auth.js +40 -15
  236. package/src/lib/server/pos-auth.js.map +1 -1
  237. package/src/lib/server/pos-cellular-billing.d.ts +81 -0
  238. package/src/lib/server/pos-cellular-billing.js +711 -0
  239. package/src/lib/server/pos-cellular-billing.js.map +1 -0
  240. package/src/lib/server/pos-cellular-notify.d.ts +47 -0
  241. package/src/lib/server/pos-cellular-notify.js +150 -0
  242. package/src/lib/server/pos-cellular-notify.js.map +1 -0
  243. package/src/lib/server/pos-cellular.d.ts +88 -0
  244. package/src/lib/server/pos-cellular.js +339 -0
  245. package/src/lib/server/pos-cellular.js.map +1 -0
  246. package/src/lib/server/pos-check-in.d.ts +5 -1
  247. package/src/lib/server/pos-check-in.js +296 -28
  248. package/src/lib/server/pos-check-in.js.map +1 -1
  249. package/src/lib/server/pos-day-report.js +29 -3
  250. package/src/lib/server/pos-day-report.js.map +1 -1
  251. package/src/lib/server/pos-display.d.ts +16 -0
  252. package/src/lib/server/pos-display.js +129 -2
  253. package/src/lib/server/pos-display.js.map +1 -1
  254. package/src/lib/server/pos-hardware-admin.d.ts +10 -1
  255. package/src/lib/server/pos-hardware-admin.js +250 -84
  256. package/src/lib/server/pos-hardware-admin.js.map +1 -1
  257. package/src/lib/server/pos-hardware-attach.d.ts +105 -0
  258. package/src/lib/server/pos-hardware-attach.js +443 -0
  259. package/src/lib/server/pos-hardware-attach.js.map +1 -0
  260. package/src/lib/server/pos-hardware-buyer-lookup.d.ts +58 -0
  261. package/src/lib/server/pos-hardware-buyer-lookup.js +180 -0
  262. package/src/lib/server/pos-hardware-buyer-lookup.js.map +1 -0
  263. package/src/lib/server/pos-hardware-buyer-record.d.ts +29 -0
  264. package/src/lib/server/pos-hardware-buyer-record.js +86 -0
  265. package/src/lib/server/pos-hardware-buyer-record.js.map +1 -0
  266. package/src/lib/server/pos-hardware-cancel.d.ts +58 -0
  267. package/src/lib/server/pos-hardware-cancel.js +147 -0
  268. package/src/lib/server/pos-hardware-cancel.js.map +1 -0
  269. package/src/lib/server/pos-hardware-closure-notices.d.ts +27 -0
  270. package/src/lib/server/pos-hardware-closure-notices.js +85 -0
  271. package/src/lib/server/pos-hardware-closure-notices.js.map +1 -0
  272. package/src/lib/server/pos-hardware-closure.d.ts +60 -0
  273. package/src/lib/server/pos-hardware-closure.js +153 -0
  274. package/src/lib/server/pos-hardware-closure.js.map +1 -0
  275. package/src/lib/server/pos-hardware-in-person.d.ts +61 -0
  276. package/src/lib/server/pos-hardware-in-person.js +236 -0
  277. package/src/lib/server/pos-hardware-in-person.js.map +1 -0
  278. package/src/lib/server/pos-hardware-notify.d.ts +40 -2
  279. package/src/lib/server/pos-hardware-notify.js +195 -14
  280. package/src/lib/server/pos-hardware-notify.js.map +1 -1
  281. package/src/lib/server/pos-hardware-readers.d.ts +115 -0
  282. package/src/lib/server/pos-hardware-readers.js +430 -0
  283. package/src/lib/server/pos-hardware-readers.js.map +1 -0
  284. package/src/lib/server/pos-hardware-returns.d.ts +116 -0
  285. package/src/lib/server/pos-hardware-returns.js +502 -0
  286. package/src/lib/server/pos-hardware-returns.js.map +1 -0
  287. package/src/lib/server/pos-hardware-sale-fields.d.ts +28 -0
  288. package/src/lib/server/pos-hardware-sale-fields.js +44 -0
  289. package/src/lib/server/pos-hardware-sale-fields.js.map +1 -0
  290. package/src/lib/server/pos-hardware-sale.d.ts +54 -0
  291. package/src/lib/server/pos-hardware-sale.js +369 -0
  292. package/src/lib/server/pos-hardware-sale.js.map +1 -0
  293. package/src/lib/server/pos-hardware-tax-return-source.d.ts +99 -0
  294. package/src/lib/server/pos-hardware-tax-return-source.js +462 -0
  295. package/src/lib/server/pos-hardware-tax-return-source.js.map +1 -0
  296. package/src/lib/server/pos-hardware-terms.d.ts +64 -0
  297. package/src/lib/server/pos-hardware-terms.js +154 -0
  298. package/src/lib/server/pos-hardware-terms.js.map +1 -0
  299. package/src/lib/server/pos-hardware-user-eraser.d.ts +3 -0
  300. package/src/lib/server/pos-hardware-user-eraser.js +31 -7
  301. package/src/lib/server/pos-hardware-user-eraser.js.map +1 -1
  302. package/src/lib/server/pos-hardware-webhook.d.ts +5 -0
  303. package/src/lib/server/pos-hardware-webhook.js +51 -6
  304. package/src/lib/server/pos-hardware-webhook.js.map +1 -1
  305. package/src/lib/server/pos-hardware.d.ts +74 -1
  306. package/src/lib/server/pos-hardware.js +175 -10
  307. package/src/lib/server/pos-hardware.js.map +1 -1
  308. package/src/lib/server/pos-kiosk.d.ts +2 -0
  309. package/src/lib/server/pos-kiosk.js +17 -12
  310. package/src/lib/server/pos-kiosk.js.map +1 -1
  311. package/src/lib/server/pos-offline-card-order.d.ts +64 -0
  312. package/src/lib/server/pos-offline-card-order.js +102 -0
  313. package/src/lib/server/pos-offline-card-order.js.map +1 -0
  314. package/src/lib/server/pos-offline-card-reconcile.d.ts +67 -1
  315. package/src/lib/server/pos-offline-card-reconcile.js +215 -18
  316. package/src/lib/server/pos-offline-card-reconcile.js.map +1 -1
  317. package/src/lib/server/pos-offline-sync.d.ts +39 -0
  318. package/src/lib/server/pos-offline-sync.js +190 -55
  319. package/src/lib/server/pos-offline-sync.js.map +1 -1
  320. package/src/lib/server/pos-ops-gate.d.ts +15 -4
  321. package/src/lib/server/pos-ops-gate.js +42 -9
  322. package/src/lib/server/pos-ops-gate.js.map +1 -1
  323. package/src/lib/server/pos-ops-routes.js +24 -0
  324. package/src/lib/server/pos-ops-routes.js.map +1 -1
  325. package/src/lib/server/pos-order-refund-ids.d.ts +28 -0
  326. package/src/lib/server/pos-order-refund-ids.js +31 -0
  327. package/src/lib/server/pos-order-refund-ids.js.map +1 -0
  328. package/src/lib/server/pos-order.js +52 -49
  329. package/src/lib/server/pos-order.js.map +1 -1
  330. package/src/lib/server/pos-payment.js +1 -1
  331. package/src/lib/server/pos-payment.js.map +1 -1
  332. package/src/lib/server/pos-reader-splash-admin.js +30 -32
  333. package/src/lib/server/pos-reader-splash-admin.js.map +1 -1
  334. package/src/lib/server/pos-reader-splash-images-route.d.ts +17 -0
  335. package/src/lib/server/pos-reader-splash-images-route.js +113 -0
  336. package/src/lib/server/pos-reader-splash-images-route.js.map +1 -0
  337. package/src/lib/server/pos-reader-splash-images.d.ts +51 -0
  338. package/src/lib/server/pos-reader-splash-images.js +123 -0
  339. package/src/lib/server/pos-reader-splash-images.js.map +1 -0
  340. package/src/lib/server/pos-reader-splash.d.ts +68 -1
  341. package/src/lib/server/pos-reader-splash.js +182 -11
  342. package/src/lib/server/pos-reader-splash.js.map +1 -1
  343. package/src/lib/server/pos-readers.d.ts +29 -0
  344. package/src/lib/server/pos-readers.js +134 -35
  345. package/src/lib/server/pos-readers.js.map +1 -1
  346. package/src/lib/server/pos-return.d.ts +10 -0
  347. package/src/lib/server/pos-return.js +26 -1
  348. package/src/lib/server/pos-return.js.map +1 -1
  349. package/src/lib/server/pos-sale.js +6 -1
  350. package/src/lib/server/pos-sale.js.map +1 -1
  351. package/src/lib/server/pos-shift.js +11 -0
  352. package/src/lib/server/pos-shift.js.map +1 -1
  353. package/src/lib/server/pos-staff-pin.js +25 -20
  354. package/src/lib/server/pos-staff-pin.js.map +1 -1
  355. package/src/lib/server/pos-terminal.d.ts +14 -4
  356. package/src/lib/server/pos-terminal.js +34 -38
  357. package/src/lib/server/pos-terminal.js.map +1 -1
  358. package/src/lib/server/printers.d.ts +7 -3
  359. package/src/lib/server/printers.js +18 -12
  360. package/src/lib/server/printers.js.map +1 -1
  361. package/src/lib/server/product-drafts.d.ts +11 -1
  362. package/src/lib/server/product-drafts.js +12 -8
  363. package/src/lib/server/product-drafts.js.map +1 -1
  364. package/src/lib/server/product.d.ts +15 -1
  365. package/src/lib/server/product.js +16 -3
  366. package/src/lib/server/product.js.map +1 -1
  367. package/src/lib/server/products-write.d.ts +26 -2
  368. package/src/lib/server/products-write.js +19 -7
  369. package/src/lib/server/products-write.js.map +1 -1
  370. package/src/lib/server/refund.js +34 -11
  371. package/src/lib/server/refund.js.map +1 -1
  372. package/src/lib/server/reservation-availability-query.d.ts +8 -0
  373. package/src/lib/server/reservation-availability-query.js +11 -1
  374. package/src/lib/server/reservation-availability-query.js.map +1 -1
  375. package/src/lib/server/reservation-availability.d.ts +1 -1
  376. package/src/lib/server/reservation-availability.js +7 -2
  377. package/src/lib/server/reservation-availability.js.map +1 -1
  378. package/src/lib/server/reservation-guests.d.ts +32 -0
  379. package/src/lib/server/reservation-guests.js +285 -0
  380. package/src/lib/server/reservation-guests.js.map +1 -0
  381. package/src/lib/server/reservation-walk-in.d.ts +11 -1
  382. package/src/lib/server/reservation-walk-in.js +56 -12
  383. package/src/lib/server/reservation-walk-in.js.map +1 -1
  384. package/src/lib/server/reserve.js +18 -5
  385. package/src/lib/server/reserve.js.map +1 -1
  386. package/src/lib/server/returns.js +9 -6
  387. package/src/lib/server/returns.js.map +1 -1
  388. package/src/lib/server/reviews.d.ts +22 -2
  389. package/src/lib/server/reviews.js +88 -20
  390. package/src/lib/server/reviews.js.map +1 -1
  391. package/src/lib/server/shipping-connectors.js +10 -11
  392. package/src/lib/server/shipping-connectors.js.map +1 -1
  393. package/src/lib/server/site-page-resolver.js +20 -3
  394. package/src/lib/server/site-page-resolver.js.map +1 -1
  395. package/src/lib/server/store-day.d.ts +33 -0
  396. package/src/lib/server/store-day.js +46 -0
  397. package/src/lib/server/store-day.js.map +1 -0
  398. package/src/lib/server/store-setup-ai-writer.d.ts +2 -1
  399. package/src/lib/server/store-setup-ai-writer.js +5 -6
  400. package/src/lib/server/store-setup-ai-writer.js.map +1 -1
  401. package/src/lib/server/storefront-tax.d.ts +13 -0
  402. package/src/lib/server/storefront-tax.js +8 -1
  403. package/src/lib/server/storefront-tax.js.map +1 -1
  404. package/src/lib/server/tax-return-source.d.ts +32 -3
  405. package/src/lib/server/tax-return-source.js +99 -20
  406. package/src/lib/server/tax-return-source.js.map +1 -1
  407. package/src/lib/server.js +100 -2
  408. package/src/lib/server.js.map +1 -1
  409. package/src/lib/testing/fake-firestore.js +58 -16
  410. package/src/lib/testing/fake-firestore.js.map +1 -1
  411. package/src/lib/testing/pos-ops-memory-firestore.js +18 -4
  412. package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -1
  413. package/src/lib/testing/site-register-permissions.d.ts +29 -0
  414. package/src/lib/testing/site-register-permissions.js +38 -0
  415. package/src/lib/testing/site-register-permissions.js.map +1 -0
  416. package/src/lib/transfer/tracking.server.js +8 -5
  417. package/src/lib/transfer/tracking.server.js.map +1 -1
  418. package/src/lib/utils/add-to-cart.d.ts +2 -0
  419. package/src/lib/utils/add-to-cart.js +6 -3
  420. package/src/lib/utils/add-to-cart.js.map +1 -1
@@ -14,6 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ import type { PosHardwareTermsAcceptance } from './pos-hardware-terms';
17
18
  /** The register's currency, and so the shop's: US dollars. */
18
19
  export declare const POS_HARDWARE_CURRENCY = "usd";
19
20
  /**
@@ -42,6 +43,16 @@ export declare const POS_HARDWARE_ENV: {
42
43
  readonly shipping: "POS_HARDWARE_SHIPPING";
43
44
  /** `true` turns Stripe automatic tax on for hardware checkouts. */
44
45
  readonly automaticTax: "POS_HARDWARE_AUTOMATIC_TAX";
46
+ /**
47
+ * `true` lets the platform's own store sell hardware IN PERSON at its
48
+ * register (AGL-4038): a reader handed over at an event, attached to the
49
+ * buyer's workspace. Absent or anything else keeps it off.
50
+ */
51
+ readonly inPersonEnabled: "POS_HARDWARE_IN_PERSON_ENABLED";
52
+ /** The site id of the platform's own store whose register sells hardware in person. */
53
+ readonly sellerHostId: "POS_HARDWARE_SELLER_HOST_ID";
54
+ /** The workspace that owns that store. */
55
+ readonly sellerOrgId: "POS_HARDWARE_SELLER_ORG_ID";
45
56
  };
46
57
  /**
47
58
  * The markup when the deployment sets none: 3000 basis points on Stripe's
@@ -49,7 +60,7 @@ export declare const POS_HARDWARE_ENV: {
49
60
  * `POS_HARDWARE_MARKUP_BPS` overrides it.
50
61
  */
51
62
  export declare const POS_HARDWARE_DEFAULT_MARKUP_BPS = 3000;
52
- export type PosHardwareSkuId = 'stripe-reader-s710' | 'stripe-reader-s700' | 'stripe-reader-m2' | 'bbpos-wisepos-e' | 'stripe-reader-s700-dock' | 'bbpos-wisepos-e-dock' | 'stripe-reader-m2-mount';
63
+ export type PosHardwareSkuId = 'stripe-reader-s710' | 'stripe-reader-s700' | 'stripe-reader-t600' | 'stripe-reader-m2' | 'bbpos-wisepos-e' | 'stripe-reader-s700-dock' | 'stripe-reader-hub' | 'stripe-reader-s700-case' | 'stripe-reader-s700-cable' | 'stripe-reader-charger' | 'stripe-reader-m2-dock' | 'stripe-reader-m2-mount' | 'bbpos-wisepos-e-dock' | 'bbpos-wisepos-e-power-cable';
53
64
  export interface PosHardwareSku {
54
65
  id: PosHardwareSkuId;
55
66
  kind: 'reader' | 'accessory';
@@ -70,6 +81,15 @@ export declare function posHardwareSku(id: string): PosHardwareSku | null;
70
81
  export type PosHardwareShippingMethod = 'standard' | 'express' | 'priority';
71
82
  export declare const POS_HARDWARE_SHIPPING_LABELS: Record<PosHardwareShippingMethod, string>;
72
83
  export declare function isPosHardwareShippingMethod(value: unknown): value is PosHardwareShippingMethod;
84
+ /**
85
+ * How an order reached the buyer: one of the shop's shipping speeds, or
86
+ * `in_person` — handed over at the platform's own register (AGL-4038), with
87
+ * no parcel, address or carrier. Never offered at checkout.
88
+ */
89
+ export type PosHardwareOrderShippingMethod = PosHardwareShippingMethod | 'in_person';
90
+ export declare const POS_HARDWARE_IN_PERSON_SHIPPING_LABEL = "Handed over in person";
91
+ /** The label of any order's method, the in-person one included. */
92
+ export declare function posHardwareShippingLabel(method: PosHardwareOrderShippingMethod | null | undefined): string;
73
93
  /** The shop's configuration, once every figure it needs is present and sane. */
74
94
  export interface PosHardwareConfig {
75
95
  /** Stripe's price for each configured item, in cents. */
@@ -94,6 +114,25 @@ export interface PosHardwareConfig {
94
114
  * failing the whole shop, so a typo in one price hides that one item.
95
115
  */
96
116
  export declare function parsePosHardwareConfig(env: Record<string, string | undefined>): PosHardwareConfig | null;
117
+ /** The platform's own store, once the in-person sale is turned on and named. */
118
+ export interface PosHardwareInPersonConfig {
119
+ sellerHostId: string;
120
+ sellerOrgId: string;
121
+ }
122
+ /**
123
+ * The in-person sale's configuration from the environment, or `null` while
124
+ * it is off: not turned on, or the store or its workspace not named, or
125
+ * named with something that cannot be an id. It needs nothing of the online
126
+ * shop's: the store's own products carry the prices.
127
+ */
128
+ export declare function parsePosHardwareInPersonConfig(env: Record<string, string | undefined>): PosHardwareInPersonConfig | null;
129
+ export declare function isPosHardwareSkuId(value: unknown): value is PosHardwareSkuId;
130
+ /**
131
+ * A reader's serial number as staff scanned or typed it, in the one form
132
+ * every comparison uses: upper case, letters, digits and dashes only, at
133
+ * most 64 characters. Empty when nothing usable was given.
134
+ */
135
+ export declare function normalizePosHardwareSerial(value: unknown): string;
97
136
  /**
98
137
  * What the merchant pays for one item: Stripe's price plus the markup,
99
138
  * rounded half up to the cent, in integer math throughout.
@@ -176,10 +215,162 @@ export interface PosHardwareTracking {
176
215
  number: string;
177
216
  url: string | null;
178
217
  }
218
+ /**
219
+ * Why an order was canceled and refunded: by staff on the Hardware orders
220
+ * page, or because the workspace that bought it was deleted or the account
221
+ * that placed it was closed before it shipped (AGL-4038 closure).
222
+ */
223
+ export type PosHardwareCancelReason = 'staff' | 'workspace-closed' | 'account-closed';
224
+ /**
225
+ * One entry of the tax Stripe computed on a hardware checkout, as the
226
+ * storefront's tax rows store it (`StorefrontTaxLine`): the amount, the base
227
+ * it was applied to (`taxable_amount`, null when Stripe did not state one)
228
+ * and the rate, for the working papers of the platform's own return.
229
+ */
230
+ export interface PosHardwareTaxLine {
231
+ amountCents: number;
232
+ taxabilityReason: string | null;
233
+ taxRateId: string | null;
234
+ taxableAmountCents: number | null;
235
+ jurisdiction: string | null;
236
+ rateState: string | null;
237
+ percentage: number | null;
238
+ }
239
+ /**
240
+ * Where an order was sold (AGL-4038): the Hardware card's checkout, or the
241
+ * platform's own register, in person. Absent on every order sold before the
242
+ * in-person sale existed, which were all online; read it through
243
+ * {@link posHardwareOrderSource}.
244
+ */
245
+ export type PosHardwareOrderSource = 'online' | 'in_person';
246
+ export declare function posHardwareOrderSource(order: {
247
+ source?: unknown;
248
+ } | null | undefined): PosHardwareOrderSource;
249
+ /**
250
+ * The register sale an in-person order came from: the platform's own store,
251
+ * the register order and its number, and how it was rung.
252
+ */
253
+ export interface PosHardwareRegisterSale {
254
+ hostId: string;
255
+ orgId: string;
256
+ orderId: string;
257
+ /** The register order's number, as its receipt shows it. */
258
+ number: number | null;
259
+ registerId: string | null;
260
+ /** A customer built it at the self-service kiosk. */
261
+ kiosk: boolean;
262
+ /** It was rung while the register was offline, and synced later. */
263
+ offline: boolean;
264
+ /**
265
+ * The Checkout Session of the register's payment link, when the sale was
266
+ * paid by one: the storefront's tax record of the sale is filed under it.
267
+ */
268
+ paymentLinkSessionId: string | null;
269
+ }
270
+ /**
271
+ * Where an in-person sale's money went, for the books to reconcile it
272
+ * against: the selling store's own takings — cash in its drawer, cards into
273
+ * its connected Stripe account, exactly as every sale on its register. The
274
+ * hardware order records it because the platform's online sales land in the
275
+ * platform's own account instead, and the two must never be summed as one.
276
+ */
277
+ export interface PosHardwarePaidTo {
278
+ account: 'seller_store';
279
+ hostId: string;
280
+ orgId: string;
281
+ /** The register sale's tenders, as its payments name them (`cash`, `card_present`, …). */
282
+ tenders: string[];
283
+ /** The store's connected Stripe account, when its owner has one. */
284
+ stripeAccountId: string | null;
285
+ }
286
+ /**
287
+ * Who an in-person order belongs to (AGL-4038). `attached` once it is in the
288
+ * buyer's workspace; `pending` while staff have still to say whose it is —
289
+ * a kiosk or offline sale, a buyer with no account yet (`email`, invited to
290
+ * sign up), or one with an account and no workspace yet (`uid`). A pending
291
+ * order is kept in the selling workspace's own `hardwareOrders`, on its "To
292
+ * attach" list, and moves to the buyer's workspace when it is attached.
293
+ */
294
+ export interface PosHardwareAttachment {
295
+ state: 'attached' | 'pending';
296
+ /** The buyer's address: the account's, or the one typed for a buyer with no account. */
297
+ email: string | null;
298
+ uid: string | null;
299
+ /** The buyer's workspace, once there is one. */
300
+ orgId: string | null;
301
+ /** The store the buyer chose for the reader, when they chose one at the sale. */
302
+ hostId: string | null;
303
+ /** The register user who attached it; null for the buyer's own sign-up. */
304
+ attachedBy: string | null;
305
+ attachedAtMs: number | null;
306
+ /** When the sign-up invitation went to `email`, for a buyer with no account. */
307
+ invitedAtMs?: number | null;
308
+ /**
309
+ * The buyer's name, for the platform's reseller records (AGL-4038): the
310
+ * account's name, or the one typed at the sale. An online order keeps it
311
+ * in `shipping.name` instead. Taken off with the buyer's account.
312
+ */
313
+ name?: string | null;
314
+ /**
315
+ * The buyer's business address, for the same records: typed at the sale,
316
+ * or the address of the store the readers are set up on. Never the tax
317
+ * region, which stays the selling store's. Taken off with the account.
318
+ */
319
+ address?: PosHardwareAddress | null;
320
+ }
321
+ /**
322
+ * One reader of an in-person order, by its serial number when staff scanned
323
+ * it at the sale (AGL-4038). The order moves to Set up when every reader on
324
+ * it is registered to the buyer's store.
325
+ */
326
+ export interface PosHardwareUnit {
327
+ sku: PosHardwareSkuId;
328
+ /** Normalized ({@link normalizePosHardwareSerial}); null when none was taken. */
329
+ serialNumber: string | null;
330
+ /** The Stripe Terminal reader it was registered as, and on which store. */
331
+ readerId: string | null;
332
+ hostId: string | null;
333
+ registeredAtMs: number | null;
334
+ }
335
+ /**
336
+ * One refund of an in-person order (AGL-4038), once by its key: a return at
337
+ * the selling store's register (`register:{returnId}`), or a refund from the
338
+ * staff Hardware orders page (`staff:{n}`), both paid back from the selling
339
+ * store's own takings the way the sale was paid.
340
+ */
341
+ export interface PosHardwareRefund {
342
+ key: string;
343
+ via: 'register' | 'staff';
344
+ cents: number;
345
+ /** Hardware items it took back; 0 when the refund named none. */
346
+ quantity: number;
347
+ atMs: number;
348
+ stripeRefundId: string | null;
349
+ }
350
+ /**
351
+ * The buyer's request to return an in-person order, from their own
352
+ * purchase history (AGL-4038). Staff refund it (`refunded`) or decline it.
353
+ * Returns follow Stripe's hardware terms.
354
+ */
355
+ export interface PosHardwareReturnRequest {
356
+ state: 'requested' | 'declined' | 'refunded';
357
+ /** The buyer's words; taken off with the buyer when their account is erased. */
358
+ reason: string | null;
359
+ requestedBy: string | null;
360
+ requestedAtMs: number;
361
+ decidedBy: string | null;
362
+ decidedAtMs: number | null;
363
+ /** What staff told the buyer when declining. */
364
+ note: string | null;
365
+ }
366
+ export declare const POS_HARDWARE_RETURN_REASON_MAX = 500;
179
367
  /** `orgs/{orgId}/hardwareOrders/{orderId}`, written only by the server. */
180
368
  export interface PosHardwareOrder {
181
369
  orgId: string;
182
- /** The site whose POS settings the order was placed from. */
370
+ /**
371
+ * The site whose POS settings the order was placed from; for an in-person
372
+ * order, the buyer's store once known, else the selling store.
373
+ */
183
374
  hostId: string;
184
375
  /** The member who started the checkout; `null` once their account is erased. */
185
376
  createdBy: string | null;
@@ -188,7 +379,7 @@ export interface PosHardwareOrder {
188
379
  lines: PosHardwareLine[];
189
380
  subtotalCents: number;
190
381
  shipping: {
191
- method: PosHardwareShippingMethod;
382
+ method: PosHardwareOrderShippingMethod;
192
383
  label: string;
193
384
  cents: number;
194
385
  name: string | null;
@@ -201,9 +392,20 @@ export interface PosHardwareOrder {
201
392
  taxRegion?: PosHardwareTaxRegion | null;
202
393
  };
203
394
  taxCents: number;
395
+ /**
396
+ * The register sale's discounts that fell on this order's lines, for an
397
+ * in-person order (AGL-4038): `totalCents` is the lines less this, plus
398
+ * the tax. Absent, and so nothing, on every online order.
399
+ */
400
+ discountCents?: number;
204
401
  totalCents: number;
205
402
  currency: string;
206
- stripeCheckoutSessionId: string;
403
+ /** Whether Stripe Tax computed the tax on the checkout. Absent on orders before it was recorded. */
404
+ automaticTax?: boolean;
405
+ /** Stripe's tax breakdown for the checkout, when Stripe Tax computed it. */
406
+ taxLines?: PosHardwareTaxLine[];
407
+ /** The Hardware card's checkout; null for an in-person sale, which had none. */
408
+ stripeCheckoutSessionId: string | null;
207
409
  stripePaymentIntentId: string | null;
208
410
  /** Stripe's hardware order id, recorded by staff (phase 2 sets it itself). */
209
411
  stripeHardwareOrderId: string | null;
@@ -222,8 +424,41 @@ export interface PosHardwareOrder {
222
424
  refundId?: string | null;
223
425
  /** The cents Stripe reported refunding. */
224
426
  refundedCents?: number;
427
+ /** Why it was canceled, when it was. */
428
+ cancelReason?: PosHardwareCancelReason;
225
429
  /** When the buyer's account was erased and their details taken off the order. */
226
430
  buyerErasedAtMs?: number;
431
+ /** Where it was sold; absent reads as online ({@link posHardwareOrderSource}). */
432
+ source?: PosHardwareOrderSource;
433
+ /** The register sale an in-person order came from. */
434
+ posSale?: PosHardwareRegisterSale;
435
+ /** Where an in-person sale's money went. */
436
+ paidTo?: PosHardwarePaidTo;
437
+ /** Whose an in-person order is, or that staff have still to say. */
438
+ attachment?: PosHardwareAttachment;
439
+ /**
440
+ * How the buyer of an in-person order agreed to the terms of sale
441
+ * (AGL-4038): copied from the register sale, or the receipt-and-sign
442
+ * notice when they did not accept electronically.
443
+ */
444
+ termsAcceptance?: PosHardwareTermsAcceptance;
445
+ /** Each reader of an in-person order, with its serial when one was taken. */
446
+ units?: PosHardwareUnit[];
447
+ /** The units' serial numbers, for finding the order when a reader is registered. */
448
+ serialNumbers?: string[];
449
+ /** An in-person order's refunds, each once by its key. */
450
+ refunds?: PosHardwareRefund[];
451
+ /** The buyer's request to return it, and what staff decided. */
452
+ returnRequest?: PosHardwareReturnRequest;
453
+ /**
454
+ * The emails that are sent once (AGL-4038), by key: `canceled`, or
455
+ * `refunded:{refund key}`. Claimed before the send, so the staff page and a
456
+ * closure never both send one.
457
+ */
458
+ buyerEmails?: Record<string, {
459
+ state: 'sending' | 'sent' | 'skipped' | 'failed';
460
+ atMs: number;
461
+ }>;
227
462
  }
228
463
  /** The timestamp field each status stamps when it is reached. */
229
464
  export declare const POS_HARDWARE_STATUS_STAMP: Record<PosHardwareOrderStatus, keyof PosHardwareOrder>;
@@ -233,20 +468,50 @@ export declare const POS_HARDWARE_ANCHOR = "pos-hardware";
233
468
  export declare const POS_HARDWARE_ORDERS_COLLECTION = "hardwareOrders";
234
469
  /** The top-level collection of retained hardware sale records. */
235
470
  export declare const POS_HARDWARE_SALES_COLLECTION = "posHardwareSales";
236
- /** `posHardwareSales/{orderId}`: an order with every personal detail left out. */
471
+ /**
472
+ * A street address as the sale record keeps it: every key present, so a
473
+ * later write of a different address replaces each one.
474
+ */
475
+ export interface PosHardwareSaleAddress {
476
+ line1: string;
477
+ line2: string | null;
478
+ city: string;
479
+ state: string | null;
480
+ postalCode: string | null;
481
+ country: string;
482
+ }
483
+ /**
484
+ * Who bought it, for the reseller's records (AGL-4038): the buyer's name and
485
+ * address and nothing else of theirs. An online order's are the shipping
486
+ * name and address; an in-person order's are on its attachment.
487
+ */
488
+ export interface PosHardwareSaleBuyer {
489
+ name: string | null;
490
+ address: PosHardwareSaleAddress | null;
491
+ }
492
+ /**
493
+ * `posHardwareSales/{orderId}`: an order with every personal detail left out
494
+ * but the buyer's name and address.
495
+ */
237
496
  export interface PosHardwareSaleRecord {
238
497
  orderId: string;
239
498
  /** The workspace that bought it, by id; the record outlives the workspace. */
240
499
  orgId: string;
241
500
  lines: Array<Pick<PosHardwareLine, 'sku' | 'name' | 'quantity' | 'unitCents' | 'lineCents'>>;
242
501
  subtotalCents: number;
243
- shippingMethod: PosHardwareShippingMethod;
502
+ shippingMethod: PosHardwareOrderShippingMethod;
244
503
  shippingCents: number;
245
504
  taxCents: number;
505
+ /** The register discount on an in-person order's lines; 0 for every online one. */
506
+ discountCents: number;
246
507
  totalCents: number;
247
508
  currency: string;
248
509
  /** The sales tax sourcing input: country, state and postal code, never the street. */
249
510
  shipTo: PosHardwareTaxRegion | null;
511
+ /** Whether Stripe Tax computed the tax; null on orders before it was recorded. */
512
+ automaticTax: boolean | null;
513
+ /** Stripe's tax breakdown: the base each rate was applied to, for the return. */
514
+ taxLines: PosHardwareTaxLine[];
250
515
  stripeCheckoutSessionId: string | null;
251
516
  stripePaymentIntentId: string | null;
252
517
  stripeHardwareOrderId: string | null;
@@ -263,15 +528,88 @@ export interface PosHardwareSaleRecord {
263
528
  registeredAtMs: number | null;
264
529
  canceledAtMs: number | null;
265
530
  refundedAtMs: number | null;
531
+ /** Where it was sold; `online` for every order before the in-person sale. */
532
+ source: PosHardwareOrderSource;
533
+ /** The register sale an in-person order came from: the selling store and its order. */
534
+ posHostId: string | null;
535
+ posOrderId: string | null;
536
+ /**
537
+ * Where the money went: `platform` for the Hardware card's checkout, on
538
+ * the platform's own Stripe account; `seller_store` for an in-person sale,
539
+ * the selling store's own takings ({@link PosHardwarePaidTo}).
540
+ */
541
+ paidTo: {
542
+ account: 'platform';
543
+ } | PosHardwarePaidTo;
544
+ /**
545
+ * The `storefrontTaxCollected` row the register sale ALSO filed, when it
546
+ * was paid by a payment link. That row is the whole register sale; the
547
+ * storefront section leaves this order's part of it out, so the sale is on
548
+ * the return once, in the hardware section.
549
+ */
550
+ storefrontTaxRowId: string | null;
551
+ /**
552
+ * The buyer's name and address, for the reseller's records; null when the
553
+ * order names none (a sale not attached to anyone yet). Absent from a write
554
+ * whose order no longer has them because the buyer's account was erased,
555
+ * so the stored ones stay ({@link posHardwareSaleSetOptions}).
556
+ */
557
+ buyer?: PosHardwareSaleBuyer | null;
558
+ /**
559
+ * When the record is deleted: {@link POS_HARDWARE_SALE_RETENTION_YEARS}
560
+ * after the sale, by the Firestore TTL policy on `posHardwareSales.expiresAt`.
561
+ * Null when the record states no sale date, which keeps it rather than
562
+ * guessing a date to delete it by.
563
+ */
564
+ expiresAt: Date | null;
266
565
  }
566
+ /**
567
+ * How long the platform keeps a hardware sale record (AGL-4038): seven years
568
+ * from the sale, then the record is deleted. Longer than the four years Texas
569
+ * requires for sales tax records, a margin for an audit of an older period.
570
+ */
571
+ export declare const POS_HARDWARE_SALE_RETENTION_YEARS = 7;
572
+ /**
573
+ * When a sale record expires: the same calendar instant, seven years after
574
+ * the sale was paid (the order's creation where no payment time is stated).
575
+ * A sale on 29 February expires on 1 March, a day late rather than early.
576
+ * Null when there is no sale time, so the record is kept, never reaped at
577
+ * the epoch.
578
+ */
579
+ export declare function posHardwareSaleExpiry(order: Pick<PosHardwareOrder, 'paidAtMs' | 'createdAtMs'>): Date | null;
267
580
  /** The tax region of an order: its address cut down, or what an erasure left. */
268
581
  export declare function posHardwareTaxRegion(order: Pick<PosHardwareOrder, 'shipping'>): PosHardwareTaxRegion | null;
582
+ /**
583
+ * A buyer's business address as an in-person order keeps it (AGL-4038):
584
+ * trimmed and cut to length, or null when it lacks a street, city, postal
585
+ * code or two-letter country.
586
+ */
587
+ export declare function posHardwareBuyerAddress(value: unknown): PosHardwareAddress | null;
588
+ /**
589
+ * The buyer's name and address as the order holds them now (AGL-4038): the
590
+ * shipping name and address of an online order, the attachment's of an
591
+ * in-person one. `undefined` when the order has none BECAUSE its buyer's
592
+ * account was erased, which tells the write to keep what the record has;
593
+ * null when it simply names no one yet.
594
+ */
595
+ export declare function posHardwareSaleBuyer(order: Pick<PosHardwareOrder, 'shipping' | 'attachment' | 'source' | 'buyerErasedAtMs'>): PosHardwareSaleBuyer | null | undefined;
269
596
  /**
270
597
  * The retained sale record of an order, as it stands. Every field is picked
271
598
  * by name, so a field added to the order later reaches the record only when
272
599
  * someone decides it should.
273
600
  */
274
601
  export declare function posHardwareSaleRecord(orderId: string, order: PosHardwareOrder): PosHardwareSaleRecord;
602
+ /**
603
+ * How every write of a sale record is made (AGL-4038): `set` with exactly
604
+ * the record's own fields as `mergeFields`, so each one is replaced whole —
605
+ * a map included, never merged key by key — and a field the record leaves
606
+ * out is left as stored. The record leaves out only `buyer`, and only once
607
+ * the buyer's account was erased ({@link posHardwareSaleBuyer}), so the
608
+ * buyer's name and address outlive the erasure and every write after it.
609
+ */
610
+ export declare function posHardwareSaleSetOptions(order: PosHardwareOrder): {
611
+ mergeFields: string[];
612
+ };
275
613
  /**
276
614
  * What an account erasure does to an order the person placed (AGL-4038): the
277
615
  * workspace keeps the order and every amount on it; the buyer comes off it —
@@ -280,8 +618,12 @@ export declare function posHardwareSaleRecord(orderId: string, order: PosHardwar
280
618
  * The country, state and postal code stay, because sales tax is sourced by
281
619
  * them. Deterministic but for the stamp, and an order already erased no
282
620
  * longer answers to the person's uid, so a second run finds nothing.
621
+ *
622
+ * The buyer's NAME and ADDRESS stay on the platform's sale record, not on
623
+ * the order: `buyerErasedAtMs` is what tells the record's next write to keep
624
+ * them ({@link posHardwareSaleBuyer}, {@link posHardwareSaleSetOptions}).
283
625
  */
284
- export declare function posHardwareBuyerErasedPatch(order: Pick<PosHardwareOrder, 'shipping'>, now: number): Record<string, unknown>;
626
+ export declare function posHardwareBuyerErasedPatch(order: Pick<PosHardwareOrder, 'shipping' | 'attachment' | 'returnRequest'>, now: number): Record<string, unknown>;
285
627
  /** An order id: `hw_` and twenty hex characters. */
286
628
  export declare const POS_HARDWARE_ORDER_ID: RegExp;
287
629
  /** Dollars and cents for the card and the emails. */