@aglyn/plugins-commerce 1.0.0-beta.284 → 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.
- package/README.md +1 -1
- package/package.json +13 -13
- package/src/lib/components/cart.js +25 -12
- package/src/lib/components/cart.js.map +1 -1
- package/src/lib/components/commerce-console-page.js +70 -13
- package/src/lib/components/commerce-console-page.js.map +1 -1
- package/src/lib/components/console/order-detail-dialog.component.js +2 -1
- package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
- package/src/lib/components/console/payment-methods-card.component.js +1 -1
- package/src/lib/components/console/payment-methods-card.component.js.map +1 -1
- package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +5 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.js +18 -12
- package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -1
- package/src/lib/components/console/pos/pos-hardware-api.d.ts +76 -5
- package/src/lib/components/console/pos/pos-hardware-api.js +53 -11
- package/src/lib/components/console/pos/pos-hardware-api.js.map +1 -1
- package/src/lib/components/console/pos/pos-hardware-buyer.component.d.ts +18 -0
- package/src/lib/components/console/pos/pos-hardware-buyer.component.js +629 -0
- package/src/lib/components/console/pos/pos-hardware-buyer.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-hardware-sale-api.d.ts +162 -0
- package/src/lib/components/console/pos/pos-hardware-sale-api.js +122 -0
- package/src/lib/components/console/pos/pos-hardware-sale-api.js.map +1 -0
- package/src/lib/components/console/pos/pos-hardware-sale-terms.component.d.ts +39 -0
- package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js +251 -0
- package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js.map +1 -0
- package/src/lib/components/console/pos/use-pos-display.js +50 -0
- package/src/lib/components/console/pos/use-pos-display.js.map +1 -1
- package/src/lib/components/console/pos-cellular-control.component.d.ts +41 -0
- package/src/lib/components/console/pos-cellular-control.component.js +211 -0
- package/src/lib/components/console/pos-cellular-control.component.js.map +1 -0
- package/src/lib/components/console/pos-devices-card.component.d.ts +9 -1
- package/src/lib/components/console/pos-devices-card.component.js +47 -15
- package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
- package/src/lib/components/console/pos-display/pos-display-api.d.ts +6 -0
- package/src/lib/components/console/pos-display/pos-display-api.js +8 -1
- package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -1
- package/src/lib/components/console/pos-display-page.component.d.ts +13 -0
- package/src/lib/components/console/pos-display-page.component.js +44 -2
- package/src/lib/components/console/pos-display-page.component.js.map +1 -1
- package/src/lib/components/console/pos-hardware-card.component.d.ts +12 -4
- package/src/lib/components/console/pos-hardware-card.component.js +157 -36
- package/src/lib/components/console/pos-hardware-card.component.js.map +1 -1
- package/src/lib/components/console/pos-hardware-orders-staff-page.component.js +360 -80
- package/src/lib/components/console/pos-hardware-orders-staff-page.component.js.map +1 -1
- package/src/lib/components/console/pos-hardware-terms-page.component.d.ts +34 -0
- package/src/lib/components/console/pos-hardware-terms-page.component.js +257 -0
- package/src/lib/components/console/pos-hardware-terms-page.component.js.map +1 -0
- package/src/lib/components/console/pos-hardware-terms-sign-page.component.d.ts +27 -0
- package/src/lib/components/console/pos-hardware-terms-sign-page.component.js +104 -0
- package/src/lib/components/console/pos-hardware-terms-sign-page.component.js.map +1 -0
- package/src/lib/components/console/pos-hardware-waiting-card.component.d.ts +24 -0
- package/src/lib/components/console/pos-hardware-waiting-card.component.js +205 -0
- package/src/lib/components/console/pos-hardware-waiting-card.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js +297 -201
- package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js.map +1 -1
- package/src/lib/components/console/pos-ops/pos-check-ins-card.component.d.ts +3 -0
- package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js +260 -92
- package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js.map +1 -1
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +9 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +15 -6
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -1
- package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.d.ts +25 -0
- package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js +136 -0
- package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +6 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +48 -31
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -1
- package/src/lib/components/console/pos-page.component.d.ts +1 -1
- package/src/lib/components/console/pos-page.component.js +63 -12
- package/src/lib/components/console/pos-page.component.js.map +1 -1
- package/src/lib/components/console/pos-reader-splash-setting.component.js +1 -1
- package/src/lib/components/console/pos-reader-splash-setting.component.js.map +1 -1
- package/src/lib/components/console/product-check-in-fields.component.d.ts +4 -2
- package/src/lib/components/console/product-check-in-fields.component.js +60 -14
- package/src/lib/components/console/product-check-in-fields.component.js.map +1 -1
- package/src/lib/components/console/product-editor-dialog.component.js +44 -1
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
- package/src/lib/components/console/product-hardware-sku-field.component.d.ts +19 -0
- package/src/lib/components/console/product-hardware-sku-field.component.js +92 -0
- package/src/lib/components/console/product-hardware-sku-field.component.js.map +1 -0
- package/src/lib/components/console/product-kiosk-offer-field.component.d.ts +22 -0
- package/src/lib/components/console/product-kiosk-offer-field.component.js +94 -0
- package/src/lib/components/console/product-kiosk-offer-field.component.js.map +1 -0
- package/src/lib/components/console/product-register-fields.component.d.ts +4 -0
- package/src/lib/components/console/product-register-fields.component.js +31 -2
- package/src/lib/components/console/product-register-fields.component.js.map +1 -1
- package/src/lib/components/console/products-hub-card.component.js +11 -2
- package/src/lib/components/console/products-hub-card.component.js.map +1 -1
- package/src/lib/components/console/register-hardware-card.component.d.ts +11 -0
- package/src/lib/components/console/register-hardware-card.component.js +56 -27
- package/src/lib/components/console/register-hardware-card.component.js.map +1 -1
- package/src/lib/components/console/reservation-guests-dialog.component.d.ts +28 -0
- package/src/lib/components/console/reservation-guests-dialog.component.js +189 -0
- package/src/lib/components/console/reservation-guests-dialog.component.js.map +1 -0
- package/src/lib/components/console/reservations-card.component.d.ts +9 -0
- package/src/lib/components/console/reservations-card.component.js +158 -23
- package/src/lib/components/console/reservations-card.component.js.map +1 -1
- package/src/lib/components/console/shippingeasy-card.component.js +1 -1
- package/src/lib/components/console/shippingeasy-card.component.js.map +1 -1
- package/src/lib/components/console/shipstation-card.component.d.ts +1 -1
- package/src/lib/components/console/shipstation-card.component.js +3 -3
- package/src/lib/components/console/shipstation-card.component.js.map +1 -1
- package/src/lib/components/product-detail.d.ts +4 -0
- package/src/lib/components/product-detail.js +40 -5
- package/src/lib/components/product-detail.js.map +1 -1
- package/src/lib/components/product-reviews.js +28 -11
- package/src/lib/components/product-reviews.js.map +1 -1
- package/src/lib/components/reservation-widget.js +28 -5
- package/src/lib/components/reservation-widget.js.map +1 -1
- package/src/lib/components/use-day-picker.d.ts +25 -0
- package/src/lib/components/use-day-picker.js +57 -0
- package/src/lib/components/use-day-picker.js.map +1 -0
- package/src/lib/constants/operator-alerts.d.ts +55 -0
- package/src/lib/constants/operator-alerts.js +156 -1
- package/src/lib/constants/operator-alerts.js.map +1 -1
- package/src/lib/declarations.console-server.js +54 -1
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/declarations.d.ts +4 -2
- package/src/lib/declarations.js +11 -4
- package/src/lib/declarations.js.map +1 -1
- package/src/lib/declarations.server.js +9 -0
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/commerce-cart.d.ts +9 -1
- package/src/lib/model/commerce-cart.js +4 -3
- package/src/lib/model/commerce-cart.js.map +1 -1
- package/src/lib/model/commerce-check-in-product.d.ts +26 -0
- package/src/lib/model/commerce-check-in-product.js +64 -2
- package/src/lib/model/commerce-check-in-product.js.map +1 -1
- package/src/lib/model/commerce-check-in-record.d.ts +127 -0
- package/src/lib/model/commerce-check-in-record.js +36 -0
- package/src/lib/model/commerce-check-in-record.js.map +1 -0
- package/src/lib/model/commerce-check-in.d.ts +91 -87
- package/src/lib/model/commerce-check-in.js +186 -62
- package/src/lib/model/commerce-check-in.js.map +1 -1
- package/src/lib/model/commerce-kiosk-offer.d.ts +31 -0
- package/src/lib/model/commerce-kiosk-offer.js +35 -0
- package/src/lib/model/commerce-kiosk-offer.js.map +1 -0
- package/src/lib/model/commerce-orders.d.ts +76 -0
- package/src/lib/model/commerce-orders.js +6 -0
- package/src/lib/model/commerce-orders.js.map +1 -1
- package/src/lib/model/commerce-pos-day-report.d.ts +54 -1
- package/src/lib/model/commerce-pos-day-report.js +39 -2
- package/src/lib/model/commerce-pos-day-report.js.map +1 -1
- package/src/lib/model/commerce-pos-offline.d.ts +1 -1
- package/src/lib/model/commerce-pos-offline.js +6 -1
- package/src/lib/model/commerce-pos-offline.js.map +1 -1
- package/src/lib/model/commerce-pos-ops.js +3 -2
- package/src/lib/model/commerce-pos-ops.js.map +1 -1
- package/src/lib/model/commerce-pos.d.ts +36 -3
- package/src/lib/model/commerce-pos.js +14 -6
- package/src/lib/model/commerce-pos.js.map +1 -1
- package/src/lib/model/commerce-receipt.js +3 -2
- package/src/lib/model/commerce-receipt.js.map +1 -1
- package/src/lib/model/commerce-reservations.d.ts +69 -4
- package/src/lib/model/commerce-reservations.js +57 -5
- package/src/lib/model/commerce-reservations.js.map +1 -1
- package/src/lib/model/commerce.d.ts +66 -0
- package/src/lib/model/commerce.js +15 -0
- package/src/lib/model/commerce.js.map +1 -1
- package/src/lib/model/order-list-fields.d.ts +11 -0
- package/src/lib/model/order-list-fields.js +17 -1
- package/src/lib/model/order-list-fields.js.map +1 -1
- package/src/lib/model/own-store-tax-summary.d.ts +152 -0
- package/src/lib/model/own-store-tax-summary.js +288 -0
- package/src/lib/model/own-store-tax-summary.js.map +1 -0
- package/src/lib/model/plugin-permissions.d.ts +67 -0
- package/src/lib/model/plugin-permissions.js +224 -7
- package/src/lib/model/plugin-permissions.js.map +1 -1
- package/src/lib/model/pos-cellular.d.ts +223 -0
- package/src/lib/model/pos-cellular.js +293 -0
- package/src/lib/model/pos-cellular.js.map +1 -0
- package/src/lib/model/pos-hardware-in-person.d.ts +98 -0
- package/src/lib/model/pos-hardware-in-person.js +224 -0
- package/src/lib/model/pos-hardware-in-person.js.map +1 -0
- package/src/lib/model/pos-hardware-tax-summary.d.ts +166 -0
- package/src/lib/model/pos-hardware-tax-summary.js +225 -0
- package/src/lib/model/pos-hardware-tax-summary.js.map +1 -0
- package/src/lib/model/pos-hardware-terms.d.ts +74 -0
- package/src/lib/model/pos-hardware-terms.js +115 -0
- package/src/lib/model/pos-hardware-terms.js.map +1 -0
- package/src/lib/model/pos-hardware.d.ts +349 -7
- package/src/lib/model/pos-hardware.js +291 -20
- package/src/lib/model/pos-hardware.js.map +1 -1
- package/src/lib/model/product-write.d.ts +10 -0
- package/src/lib/model/product-write.js +4 -2
- package/src/lib/model/product-write.js.map +1 -1
- package/src/lib/plugin.js +16 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/server/billing-webhook.js +25 -1
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/cancel-order.js +7 -5
- package/src/lib/server/cancel-order.js.map +1 -1
- package/src/lib/server/cart-checkout.js +20 -8
- package/src/lib/server/cart-checkout.js.map +1 -1
- package/src/lib/server/cart.js +29 -0
- package/src/lib/server/cart.js.map +1 -1
- package/src/lib/server/checkout.js +42 -13
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/collection-membership.d.ts +4 -0
- package/src/lib/server/collection-membership.js +5 -10
- package/src/lib/server/collection-membership.js.map +1 -1
- package/src/lib/server/commerce-site-keys.d.ts +29 -0
- package/src/lib/server/commerce-site-keys.js +40 -0
- package/src/lib/server/commerce-site-keys.js.map +1 -0
- package/src/lib/server/draft-order.js +8 -5
- package/src/lib/server/draft-order.js.map +1 -1
- package/src/lib/server/fulfill-order.js +7 -5
- package/src/lib/server/fulfill-order.js.map +1 -1
- package/src/lib/server/gift-cards.js +8 -5
- package/src/lib/server/gift-cards.js.map +1 -1
- package/src/lib/server/local-fulfillment-status.js +9 -6
- package/src/lib/server/local-fulfillment-status.js.map +1 -1
- package/src/lib/server/member-post.js +6 -5
- package/src/lib/server/member-post.js.map +1 -1
- package/src/lib/server/membership-admin-password.d.ts +4 -2
- package/src/lib/server/membership-admin-password.js +10 -8
- package/src/lib/server/membership-admin-password.js.map +1 -1
- package/src/lib/server/membership-admin-remove.d.ts +7 -5
- package/src/lib/server/membership-admin-remove.js +9 -9
- package/src/lib/server/membership-admin-remove.js.map +1 -1
- package/src/lib/server/order-notifications.js +5 -2
- package/src/lib/server/order-notifications.js.map +1 -1
- package/src/lib/server/order-print.js +7 -5
- package/src/lib/server/order-print.js.map +1 -1
- package/src/lib/server/order-receipt-send.js +8 -5
- package/src/lib/server/order-receipt-send.js.map +1 -1
- package/src/lib/server/orders-shipping-prepare.js +9 -6
- package/src/lib/server/orders-shipping-prepare.js.map +1 -1
- package/src/lib/server/own-store-tax-return-source.d.ts +47 -0
- package/src/lib/server/own-store-tax-return-source.js +312 -0
- package/src/lib/server/own-store-tax-return-source.js.map +1 -0
- package/src/lib/server/payment-methods.js +13 -9
- package/src/lib/server/payment-methods.js.map +1 -1
- package/src/lib/server/pos-auth.d.ts +37 -6
- package/src/lib/server/pos-auth.js +40 -15
- package/src/lib/server/pos-auth.js.map +1 -1
- package/src/lib/server/pos-cellular-billing.d.ts +81 -0
- package/src/lib/server/pos-cellular-billing.js +711 -0
- package/src/lib/server/pos-cellular-billing.js.map +1 -0
- package/src/lib/server/pos-cellular-notify.d.ts +47 -0
- package/src/lib/server/pos-cellular-notify.js +150 -0
- package/src/lib/server/pos-cellular-notify.js.map +1 -0
- package/src/lib/server/pos-cellular.d.ts +88 -0
- package/src/lib/server/pos-cellular.js +339 -0
- package/src/lib/server/pos-cellular.js.map +1 -0
- package/src/lib/server/pos-check-in.d.ts +5 -1
- package/src/lib/server/pos-check-in.js +296 -28
- package/src/lib/server/pos-check-in.js.map +1 -1
- package/src/lib/server/pos-day-report.js +29 -3
- package/src/lib/server/pos-day-report.js.map +1 -1
- package/src/lib/server/pos-display.d.ts +16 -0
- package/src/lib/server/pos-display.js +129 -2
- package/src/lib/server/pos-display.js.map +1 -1
- package/src/lib/server/pos-hardware-admin.d.ts +10 -1
- package/src/lib/server/pos-hardware-admin.js +250 -84
- package/src/lib/server/pos-hardware-admin.js.map +1 -1
- package/src/lib/server/pos-hardware-attach.d.ts +105 -0
- package/src/lib/server/pos-hardware-attach.js +443 -0
- package/src/lib/server/pos-hardware-attach.js.map +1 -0
- package/src/lib/server/pos-hardware-buyer-lookup.d.ts +58 -0
- package/src/lib/server/pos-hardware-buyer-lookup.js +180 -0
- package/src/lib/server/pos-hardware-buyer-lookup.js.map +1 -0
- package/src/lib/server/pos-hardware-buyer-record.d.ts +29 -0
- package/src/lib/server/pos-hardware-buyer-record.js +86 -0
- package/src/lib/server/pos-hardware-buyer-record.js.map +1 -0
- package/src/lib/server/pos-hardware-cancel.d.ts +58 -0
- package/src/lib/server/pos-hardware-cancel.js +147 -0
- package/src/lib/server/pos-hardware-cancel.js.map +1 -0
- package/src/lib/server/pos-hardware-closure-notices.d.ts +27 -0
- package/src/lib/server/pos-hardware-closure-notices.js +85 -0
- package/src/lib/server/pos-hardware-closure-notices.js.map +1 -0
- package/src/lib/server/pos-hardware-closure.d.ts +60 -0
- package/src/lib/server/pos-hardware-closure.js +153 -0
- package/src/lib/server/pos-hardware-closure.js.map +1 -0
- package/src/lib/server/pos-hardware-in-person.d.ts +61 -0
- package/src/lib/server/pos-hardware-in-person.js +236 -0
- package/src/lib/server/pos-hardware-in-person.js.map +1 -0
- package/src/lib/server/pos-hardware-notify.d.ts +40 -2
- package/src/lib/server/pos-hardware-notify.js +195 -14
- package/src/lib/server/pos-hardware-notify.js.map +1 -1
- package/src/lib/server/pos-hardware-readers.d.ts +115 -0
- package/src/lib/server/pos-hardware-readers.js +430 -0
- package/src/lib/server/pos-hardware-readers.js.map +1 -0
- package/src/lib/server/pos-hardware-returns.d.ts +116 -0
- package/src/lib/server/pos-hardware-returns.js +502 -0
- package/src/lib/server/pos-hardware-returns.js.map +1 -0
- package/src/lib/server/pos-hardware-sale-fields.d.ts +28 -0
- package/src/lib/server/pos-hardware-sale-fields.js +44 -0
- package/src/lib/server/pos-hardware-sale-fields.js.map +1 -0
- package/src/lib/server/pos-hardware-sale.d.ts +54 -0
- package/src/lib/server/pos-hardware-sale.js +369 -0
- package/src/lib/server/pos-hardware-sale.js.map +1 -0
- package/src/lib/server/pos-hardware-tax-return-source.d.ts +99 -0
- package/src/lib/server/pos-hardware-tax-return-source.js +462 -0
- package/src/lib/server/pos-hardware-tax-return-source.js.map +1 -0
- package/src/lib/server/pos-hardware-terms.d.ts +64 -0
- package/src/lib/server/pos-hardware-terms.js +154 -0
- package/src/lib/server/pos-hardware-terms.js.map +1 -0
- package/src/lib/server/pos-hardware-user-eraser.d.ts +3 -0
- package/src/lib/server/pos-hardware-user-eraser.js +31 -7
- package/src/lib/server/pos-hardware-user-eraser.js.map +1 -1
- package/src/lib/server/pos-hardware-webhook.d.ts +5 -0
- package/src/lib/server/pos-hardware-webhook.js +51 -6
- package/src/lib/server/pos-hardware-webhook.js.map +1 -1
- package/src/lib/server/pos-hardware.d.ts +74 -1
- package/src/lib/server/pos-hardware.js +175 -10
- package/src/lib/server/pos-hardware.js.map +1 -1
- package/src/lib/server/pos-kiosk.d.ts +2 -0
- package/src/lib/server/pos-kiosk.js +17 -12
- package/src/lib/server/pos-kiosk.js.map +1 -1
- package/src/lib/server/pos-offline-card-order.d.ts +64 -0
- package/src/lib/server/pos-offline-card-order.js +102 -0
- package/src/lib/server/pos-offline-card-order.js.map +1 -0
- package/src/lib/server/pos-offline-card-reconcile.d.ts +67 -1
- package/src/lib/server/pos-offline-card-reconcile.js +215 -18
- package/src/lib/server/pos-offline-card-reconcile.js.map +1 -1
- package/src/lib/server/pos-offline-sync.d.ts +39 -0
- package/src/lib/server/pos-offline-sync.js +190 -55
- package/src/lib/server/pos-offline-sync.js.map +1 -1
- package/src/lib/server/pos-ops-gate.d.ts +15 -4
- package/src/lib/server/pos-ops-gate.js +42 -9
- package/src/lib/server/pos-ops-gate.js.map +1 -1
- package/src/lib/server/pos-ops-routes.js +24 -0
- package/src/lib/server/pos-ops-routes.js.map +1 -1
- package/src/lib/server/pos-order-refund-ids.d.ts +28 -0
- package/src/lib/server/pos-order-refund-ids.js +31 -0
- package/src/lib/server/pos-order-refund-ids.js.map +1 -0
- package/src/lib/server/pos-order.js +52 -49
- package/src/lib/server/pos-order.js.map +1 -1
- package/src/lib/server/pos-payment.js +1 -1
- package/src/lib/server/pos-payment.js.map +1 -1
- package/src/lib/server/pos-reader-splash-admin.js +30 -32
- package/src/lib/server/pos-reader-splash-admin.js.map +1 -1
- package/src/lib/server/pos-reader-splash-images-route.d.ts +17 -0
- package/src/lib/server/pos-reader-splash-images-route.js +113 -0
- package/src/lib/server/pos-reader-splash-images-route.js.map +1 -0
- package/src/lib/server/pos-reader-splash-images.d.ts +51 -0
- package/src/lib/server/pos-reader-splash-images.js +123 -0
- package/src/lib/server/pos-reader-splash-images.js.map +1 -0
- package/src/lib/server/pos-reader-splash.d.ts +68 -1
- package/src/lib/server/pos-reader-splash.js +182 -11
- package/src/lib/server/pos-reader-splash.js.map +1 -1
- package/src/lib/server/pos-readers.d.ts +29 -0
- package/src/lib/server/pos-readers.js +134 -35
- package/src/lib/server/pos-readers.js.map +1 -1
- package/src/lib/server/pos-return.d.ts +10 -0
- package/src/lib/server/pos-return.js +26 -1
- package/src/lib/server/pos-return.js.map +1 -1
- package/src/lib/server/pos-sale.js +6 -1
- package/src/lib/server/pos-sale.js.map +1 -1
- package/src/lib/server/pos-shift.js +11 -0
- package/src/lib/server/pos-shift.js.map +1 -1
- package/src/lib/server/pos-staff-pin.js +25 -20
- package/src/lib/server/pos-staff-pin.js.map +1 -1
- package/src/lib/server/pos-terminal.d.ts +14 -4
- package/src/lib/server/pos-terminal.js +34 -38
- package/src/lib/server/pos-terminal.js.map +1 -1
- package/src/lib/server/printers.d.ts +7 -3
- package/src/lib/server/printers.js +18 -12
- package/src/lib/server/printers.js.map +1 -1
- package/src/lib/server/product-drafts.d.ts +11 -1
- package/src/lib/server/product-drafts.js +12 -8
- package/src/lib/server/product-drafts.js.map +1 -1
- package/src/lib/server/product.d.ts +15 -1
- package/src/lib/server/product.js +16 -3
- package/src/lib/server/product.js.map +1 -1
- package/src/lib/server/products-write.d.ts +26 -2
- package/src/lib/server/products-write.js +19 -7
- package/src/lib/server/products-write.js.map +1 -1
- package/src/lib/server/refund.js +34 -11
- package/src/lib/server/refund.js.map +1 -1
- package/src/lib/server/reservation-availability-query.d.ts +8 -0
- package/src/lib/server/reservation-availability-query.js +11 -1
- package/src/lib/server/reservation-availability-query.js.map +1 -1
- package/src/lib/server/reservation-availability.d.ts +1 -1
- package/src/lib/server/reservation-availability.js +7 -2
- package/src/lib/server/reservation-availability.js.map +1 -1
- package/src/lib/server/reservation-guests.d.ts +32 -0
- package/src/lib/server/reservation-guests.js +285 -0
- package/src/lib/server/reservation-guests.js.map +1 -0
- package/src/lib/server/reservation-walk-in.d.ts +11 -1
- package/src/lib/server/reservation-walk-in.js +56 -12
- package/src/lib/server/reservation-walk-in.js.map +1 -1
- package/src/lib/server/reserve.js +18 -5
- package/src/lib/server/reserve.js.map +1 -1
- package/src/lib/server/returns.js +9 -6
- package/src/lib/server/returns.js.map +1 -1
- package/src/lib/server/reviews.d.ts +22 -2
- package/src/lib/server/reviews.js +88 -20
- package/src/lib/server/reviews.js.map +1 -1
- package/src/lib/server/shipping-connectors.js +10 -11
- package/src/lib/server/shipping-connectors.js.map +1 -1
- package/src/lib/server/site-page-resolver.js +20 -3
- package/src/lib/server/site-page-resolver.js.map +1 -1
- package/src/lib/server/store-day.d.ts +33 -0
- package/src/lib/server/store-day.js +46 -0
- package/src/lib/server/store-day.js.map +1 -0
- package/src/lib/server/store-setup-ai-writer.d.ts +2 -1
- package/src/lib/server/store-setup-ai-writer.js +5 -6
- package/src/lib/server/store-setup-ai-writer.js.map +1 -1
- package/src/lib/server/storefront-tax.d.ts +13 -0
- package/src/lib/server/storefront-tax.js +8 -1
- package/src/lib/server/storefront-tax.js.map +1 -1
- package/src/lib/server/tax-return-source.d.ts +32 -3
- package/src/lib/server/tax-return-source.js +99 -20
- package/src/lib/server/tax-return-source.js.map +1 -1
- package/src/lib/server.js +100 -2
- package/src/lib/server.js.map +1 -1
- package/src/lib/testing/fake-firestore.js +58 -16
- package/src/lib/testing/fake-firestore.js.map +1 -1
- package/src/lib/testing/pos-ops-memory-firestore.js +18 -4
- package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -1
- package/src/lib/testing/site-register-permissions.d.ts +29 -0
- package/src/lib/testing/site-register-permissions.js +38 -0
- package/src/lib/testing/site-register-permissions.js.map +1 -0
- package/src/lib/transfer/tracking.server.js +8 -5
- package/src/lib/transfer/tracking.server.js.map +1 -1
- package/src/lib/utils/add-to-cart.d.ts +2 -0
- package/src/lib/utils/add-to-cart.js +6 -3
- package/src/lib/utils/add-to-cart.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/pos-hardware-tax-summary.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * THE PLATFORM'S OWN HARDWARE SALES, SUMMED FOR ONE FILING PERIOD (AGL-4038).\n *\n * The platform is the seller of record for every card reader order, so these\n * are its OWN sales, not facilitated ones, and they belong on its sales tax\n * return. They are recorded in `posHardwareSales` — apart from the invoices\n * the return sums (`platformRevenue`, written only for a paid invoice, which a\n * hardware checkout never makes) and apart from the storefront's tax rows\n * (`storefrontTaxCollected`, whose recorder does not take a hardware session)\n * — so nothing here is already in another figure on the return. The return\n * folds them into its filing figures as the operator's own sales\n * (`server/pos-hardware-tax-return-source.ts`), each sale once.\n *\n * THE RULES, each pinned by `pos-hardware-tax-summary.spec.ts`:\n *\n * - **A sale is in the period it was PAID**, by `paidAtMs`, half-open: the\n * first instant of the period is in, the first instant of the next is not.\n * Its status today does not move it: an order paid in the period and\n * canceled later is still a sale of the period it was paid in.\n * - **Total sales** are receipts excluding the tax itself: the total less\n * the tax (the items and the shipping).\n * - **Taxable sales** are the base Stripe Tax applied its rate to, read from\n * the order's stored breakdown and never inferred. One order's lines are\n * one base taxed at several levels (state, county, city), each line\n * stating the same base, so the order's base is the LARGEST stated, never\n * their sum. An order taxed with no stated base adds nothing and is counted\n * out loud.\n * - **A refund is in the period it was MADE**, by the stamp of the status\n * that refunded it (`refundedAtMs`, or `canceledAtMs` for a cancel), and\n * is stated beside the sales, never netted from them — the platform's own\n * rule for its invoices. Hardware refunds are whole, so the refunded tax is\n * the order's own tax; a partial one is split in the order's own ratio.\n * - **A canceled order with no refund recorded** stays a sale and is counted\n * out loud: the record says canceled and nobody recorded the money coming\n * back.\n * - **Test-mode orders are not sales.** An order made with Stripe's test keys\n * is left out of every figure and counted, never dropped silently.\n * - **Where it shipped decides the jurisdiction**: a shipped sale is sourced\n * to its destination. No ship-to region is `unknown`, counted out loud.\n *\n * Integer cents throughout. Pure and total: no Firestore, no clock.\n */\n\nimport {\n accumulateTaxWorkingPapers,\n emptyTaxJurisdiction,\n taxJurisdictionKey,\n type TaxLineInput,\n type TaxReturnJurisdiction,\n} from '@aglyn/aglyn/app-utils/tax-jurisdiction-figures'\n\n/** A `posHardwareSales/{orderId}` record as the return reads it. */\nexport interface PosHardwareTaxRowInput {\n orderId: string\n totalCents?: unknown\n taxCents?: unknown\n currency?: unknown\n shipTo?: { country?: unknown; state?: unknown; postalCode?: unknown } | null\n automaticTax?: unknown\n taxLines?: TaxLineInput[] | null\n status?: unknown\n livemode?: unknown\n paidAtMs?: unknown\n refundedCents?: unknown\n refundedAtMs?: unknown\n canceledAtMs?: unknown\n /** `in_person` for a reader sold at a store's register (AGL-4038), else sold online. */\n source?: unknown\n /** The store whose register sold it, for an in-person sale. */\n posHostId?: unknown\n}\n\n/** One ship-to jurisdiction: the sales paid in the period and the refunds made in it. */\nexport interface PosHardwareTaxJurisdiction extends TaxReturnJurisdiction {\n /** Sales with no tax computed: sold without Stripe Tax. */\n untaxedOrders: number\n refundedOrders: number\n /** Refunded receipts excluding tax. */\n refundedSalesCents: number\n refundedTaxCents: number\n}\n\nexport interface PosHardwareTaxSummary {\n periodStart: string\n periodEnd: string\n /** Live sales paid in the period, in every jurisdiction. */\n orders: number\n totalSalesCents: number\n taxableSalesCents: number\n taxCollectedCents: number\n byJurisdiction: Record<string, PosHardwareTaxJurisdiction>\n refunds: {\n orders: number\n /** Everything refunded, tax included. */\n refundedCents: number\n refundedSalesCents: number\n refundedTaxCents: number\n }\n excluded: {\n /** Test-mode orders paid in the period: in no figure. */\n testModeOrders: number\n }\n attention: {\n untaxedOrders: number\n ordersMissingTaxableBase: number\n ordersMissingShipTo: number\n canceledWithoutRefund: number\n }\n}\n\nconst cents = (value: unknown): number => {\n const parsed = Number(value ?? 0)\n return Number.isFinite(parsed) ? Math.round(parsed) : 0\n}\n\nconst stamp = (value: unknown): number | null =>\n typeof value === 'number' && Number.isFinite(value) ? value : null\n\nfunction emptyJurisdiction(): PosHardwareTaxJurisdiction {\n return {\n ...emptyTaxJurisdiction(),\n untaxedOrders: 0,\n refundedOrders: 0,\n refundedSalesCents: 0,\n refundedTaxCents: 0,\n }\n}\n\n/**\n * The base Stripe stated for one order, or null when no line states one: the\n * largest of the stated bases, because each jurisdiction level restates the\n * same base (see the module note).\n */\nexport function posHardwareTaxableBase(lines: readonly (TaxLineInput | undefined)[] | null | undefined): number | null {\n let base: number | null = null\n for (const line of lines ?? []) {\n const stated = line?.taxableAmountCents\n if (stated === null || stated === undefined || !Number.isFinite(Number(stated))) continue\n const rounded = Math.round(Number(stated))\n base = base === null ? rounded : Math.max(base, rounded)\n }\n return base\n}\n\n/** When the order's refund was made: the stamp of the status that made it. */\nexport function posHardwareRefundStamp(row: PosHardwareTaxRowInput): number | null {\n if (row.status === 'refunded') return stamp(row.refundedAtMs) ?? stamp(row.canceledAtMs)\n if (row.status === 'canceled') return stamp(row.canceledAtMs) ?? stamp(row.refundedAtMs)\n return stamp(row.refundedAtMs) ?? stamp(row.canceledAtMs)\n}\n\n/** How a row counts in the period: as a sale, as a refund, as both, or not at all. */\nexport function posHardwareRowInPeriod(\n row: PosHardwareTaxRowInput,\n period: { start: Date; end: Date },\n): { sale: boolean; refund: boolean } {\n const startMs = period.start.getTime()\n const endMs = period.end.getTime()\n const within = (at: number | null) => at !== null && at >= startMs && at < endMs\n return {\n sale: within(stamp(row.paidAtMs)),\n refund: cents(row.refundedCents) > 0 && within(posHardwareRefundStamp(row)),\n }\n}\n\n/** The period's figures from the records read for it. See the module note. */\nexport function posHardwareTaxSummary(\n rows: readonly PosHardwareTaxRowInput[],\n period: { start: Date; end: Date },\n): PosHardwareTaxSummary {\n const summary: PosHardwareTaxSummary = {\n periodStart: period.start.toISOString(),\n periodEnd: period.end.toISOString(),\n orders: 0,\n totalSalesCents: 0,\n taxableSalesCents: 0,\n taxCollectedCents: 0,\n byJurisdiction: {},\n refunds: { orders: 0, refundedCents: 0, refundedSalesCents: 0, refundedTaxCents: 0 },\n excluded: { testModeOrders: 0 },\n attention: {\n untaxedOrders: 0,\n ordersMissingTaxableBase: 0,\n ordersMissingShipTo: 0,\n canceledWithoutRefund: 0,\n },\n }\n\n // The reader merges three queries, so an order can arrive twice.\n const seen = new Set<string>()\n for (const row of rows ?? []) {\n if (!row?.orderId || seen.has(row.orderId)) continue\n seen.add(row.orderId)\n const placed = posHardwareRowInPeriod(row, period)\n if (!placed.sale && !placed.refund) continue\n if (row.livemode !== true) {\n if (placed.sale) summary.excluded.testModeOrders += 1\n continue\n }\n\n const total = cents(row.totalCents)\n const tax = cents(row.taxCents)\n const jurisdiction = taxJurisdictionKey(row.shipTo)\n const bucket = (summary.byJurisdiction[jurisdiction] ??= emptyJurisdiction())\n\n if (placed.sale) {\n const lines = Array.isArray(row.taxLines) ? row.taxLines : []\n const base = posHardwareTaxableBase(lines)\n const sales = total - tax\n summary.orders += 1\n summary.totalSalesCents += sales\n summary.taxableSalesCents += base ?? 0\n summary.taxCollectedCents += tax\n bucket.transactionCount += 1\n bucket.totalSalesCents += sales\n bucket.taxableSalesCents += base ?? 0\n bucket.taxCollectedCents += tax\n accumulateTaxWorkingPapers(bucket, lines)\n if (tax === 0 && row.automaticTax !== true) {\n bucket.untaxedOrders += 1\n summary.attention.untaxedOrders += 1\n }\n if (tax > 0 && base === null) summary.attention.ordersMissingTaxableBase += 1\n if (jurisdiction === 'unknown') summary.attention.ordersMissingShipTo += 1\n if ((row.status === 'canceled' || row.status === 'refunded') && cents(row.refundedCents) <= 0) {\n summary.attention.canceledWithoutRefund += 1\n }\n }\n\n if (placed.refund) {\n const refunded = cents(row.refundedCents)\n // Whole refunds give back the order's own tax; a partial one is split\n // in the order's own ratio, and a row with no total states no ratio.\n const refundedTax =\n refunded >= total ? tax : total > 0 && tax > 0 ? Math.round((refunded * tax) / total) : 0\n const refundedSales = refunded - refundedTax\n summary.refunds.orders += 1\n summary.refunds.refundedCents += refunded\n summary.refunds.refundedSalesCents += refundedSales\n summary.refunds.refundedTaxCents += refundedTax\n bucket.refundedOrders += 1\n bucket.refundedSalesCents += refundedSales\n bucket.refundedTaxCents += refundedTax\n }\n }\n return summary\n}\n\n/*==========================================\n * AN IN-PERSON SALE IS ON THE RETURN ONCE (AGL-4038).\n *\n * A card reader the platform sells at its own store's register is the\n * platform's own hardware sale, and the hardware section counts it from its\n * `posHardwareSales` record. A register sale paid by a payment link ALSO\n * files a storefront tax row for the whole register sale, under the link's\n * Checkout Session id — which the record names as `storefrontTaxRowId`. So\n * the storefront section takes the hardware's part out of that row: what is\n * left is the rest of the register sale, and a sale of hardware alone leaves\n * nothing. A sale paid in cash, on a reader or offline files no storefront\n * row, and the hardware section is its only line.\n *\n * Only a record the hardware section counts is taken out — a live one — so\n * a test sale is not removed from one section without being in the other.\n * The row is matched by its id, not by period, so a sale and its row that\n * fall either side of a period's edge still meet.\n *=========================================*/\n\n/** The part of a storefront row an in-person hardware record accounts for. */\nexport interface PosHardwareStorefrontPart {\n storefrontTaxRowId: string\n /** The hardware's share of the register sale, tax included. */\n totalCents: number\n taxCents: number\n}\n\n/** The parts the hardware section counts, from its records. */\nexport function posHardwareStorefrontParts(\n records: ReadonlyArray<{\n source?: unknown\n storefrontTaxRowId?: unknown\n totalCents?: unknown\n taxCents?: unknown\n livemode?: unknown\n }>,\n): PosHardwareStorefrontPart[] {\n return records.flatMap((record) =>\n record.source === 'in_person' &&\n record.livemode === true &&\n typeof record.storefrontTaxRowId === 'string' &&\n record.storefrontTaxRowId\n ? [{ storefrontTaxRowId: record.storefrontTaxRowId, totalCents: cents(record.totalCents), taxCents: cents(record.taxCents) }]\n : [],\n )\n}\n\n/**\n * The storefront rows with each in-person hardware part taken out: a row's\n * receipts and tax less the hardware's, and a row left with nothing dropped.\n * A row's stated tax lines are kept as they are: a register sale's row is a\n * manual-rate row, which states none.\n */\nexport function storefrontRowsWithoutInPersonHardware<\n Row extends { id: string; grossCents?: unknown; taxCents?: unknown },\n>(rows: readonly Row[], parts: readonly PosHardwareStorefrontPart[]): Row[] {\n const byRow = new Map<string, { totalCents: number; taxCents: number }>()\n for (const part of parts) {\n const held = byRow.get(part.storefrontTaxRowId) ?? { totalCents: 0, taxCents: 0 }\n byRow.set(part.storefrontTaxRowId, {\n totalCents: held.totalCents + part.totalCents,\n taxCents: held.taxCents + part.taxCents,\n })\n }\n return rows.flatMap((row) => {\n const part = byRow.get(row.id)\n if (!part) return [row]\n const gross = cents(row.grossCents) - part.totalCents\n if (gross <= 0) return []\n return [{ ...row, grossCents: gross, taxCents: Math.max(0, cents(row.taxCents) - part.taxCents) }]\n })\n}\n"],"names":["accumulateTaxWorkingPapers","emptyTaxJurisdiction","taxJurisdictionKey","cents","value","parsed","Number","isFinite","Math","round","stamp","emptyJurisdiction","untaxedOrders","refundedOrders","refundedSalesCents","refundedTaxCents","posHardwareTaxableBase","lines","base","line","stated","taxableAmountCents","undefined","rounded","max","posHardwareRefundStamp","row","status","refundedAtMs","canceledAtMs","posHardwareRowInPeriod","period","startMs","start","getTime","endMs","end","within","at","sale","paidAtMs","refund","refundedCents","posHardwareTaxSummary","rows","summary","periodStart","toISOString","periodEnd","orders","totalSalesCents","taxableSalesCents","taxCollectedCents","byJurisdiction","refunds","excluded","testModeOrders","attention","ordersMissingTaxableBase","ordersMissingShipTo","canceledWithoutRefund","seen","Set","jurisdiction","orderId","has","add","placed","livemode","total","totalCents","tax","taxCents","shipTo","bucket","Array","isArray","taxLines","sales","transactionCount","automaticTax","refunded","refundedTax","refundedSales","posHardwareStorefrontParts","records","flatMap","record","source","storefrontTaxRowId","storefrontRowsWithoutInPersonHardware","parts","byRow","Map","part","held","get","set","id","gross","grossCents"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GAED,SACEA,0BAA0B,EAC1BC,oBAAoB,EACpBC,kBAAkB,QAGb,kDAAiD;AA6DxD,MAAMC,QAAQ,CAACC;IACb,MAAMC,SAASC,OAAOF,gBAAAA,QAAS;IAC/B,OAAOE,OAAOC,QAAQ,CAACF,UAAUG,KAAKC,KAAK,CAACJ,UAAU;AACxD;AAEA,MAAMK,QAAQ,CAACN,QACb,OAAOA,UAAU,YAAYE,OAAOC,QAAQ,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AU,IAAIN,KAAKxB,UAAU;QACrD,IAAI6B,SAAS,GAAG,OAAO,EAAE;QACzB,OAAO;YAAC,aAAKzE;gBAAK0E,YAAYD;gBAAO3B,UAAUhE,KAAKgB,GAAG,CAAC,GAAGrB,MAAMuB,IAAI8C,QAAQ,IAAIsB,KAAKtB,QAAQ;;SAAI;IACpG;AACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/** The published Terms version the summary and every acceptance name. */
|
|
18
|
+
export declare const POS_HARDWARE_TERMS_VERSION = "v20";
|
|
19
|
+
/** The sections of the Terms that are the terms of sale for hardware. */
|
|
20
|
+
export declare const POS_HARDWARE_TERMS_SECTIONS = "4.26\u20134.32";
|
|
21
|
+
/** The published Terms, where the full text is. */
|
|
22
|
+
export declare function posHardwareTermsUrl(): string;
|
|
23
|
+
/** The Terms' address as a receipt or a sign prints it: `example.com/legal/terms`. */
|
|
24
|
+
export declare function posHardwareTermsAddress(): string;
|
|
25
|
+
/**
|
|
26
|
+
* What the buyer reads before accepting: Sections 4.26–4.32 in short, in the
|
|
27
|
+
* published text's own order and terms, with the link to the whole. Never
|
|
28
|
+
* instead of it: the acceptance is of the Terms, which this summarizes.
|
|
29
|
+
*/
|
|
30
|
+
export declare const POS_HARDWARE_TERMS_SUMMARY: readonly string[];
|
|
31
|
+
/** How a buyer agreed to the terms of sale. */
|
|
32
|
+
export type PosHardwareTermsMethod = 'tablet' | 'display' | 'notice';
|
|
33
|
+
/** `hardwareTermsAcceptance` on a register sale, and `termsAcceptance` on the hardware order. */
|
|
34
|
+
export interface PosHardwareTermsAcceptance {
|
|
35
|
+
version: string;
|
|
36
|
+
sections: string;
|
|
37
|
+
method: PosHardwareTermsMethod;
|
|
38
|
+
atMs: number;
|
|
39
|
+
/** The register user who handed the tablet over or put the terms on the display; null for a notice. */
|
|
40
|
+
staffUid: string | null;
|
|
41
|
+
/** The address and browser of the device the buyer accepted on; null for a notice. */
|
|
42
|
+
ip: string | null;
|
|
43
|
+
userAgent: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** An acceptance as stored, or null for anything that is not one. */
|
|
46
|
+
export declare function posHardwareTermsAcceptanceOf(raw: unknown): PosHardwareTermsAcceptance | null;
|
|
47
|
+
/** A fresh acceptance of the current terms of sale. */
|
|
48
|
+
export declare function posHardwareTermsAcceptance(input: {
|
|
49
|
+
method: PosHardwareTermsMethod;
|
|
50
|
+
atMs: number;
|
|
51
|
+
staffUid?: string | null;
|
|
52
|
+
ip?: string | null;
|
|
53
|
+
userAgent?: string | null;
|
|
54
|
+
}): PosHardwareTermsAcceptance;
|
|
55
|
+
/** Whether a register sale sells hardware: marked when rung, or recorded since. */
|
|
56
|
+
export declare function isPosHardwareRegisterSale(order: {
|
|
57
|
+
hardwareSalePending?: unknown;
|
|
58
|
+
hardwareOrderId?: unknown;
|
|
59
|
+
} | null | undefined): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The line every receipt of a register sale of hardware prints (Section
|
|
62
|
+
* 4.28's fallback, printed whether or not the buyer also accepted
|
|
63
|
+
* electronically): which terms the sale is made under, and that paying is
|
|
64
|
+
* agreeing to them. Null on every other sale.
|
|
65
|
+
*/
|
|
66
|
+
export declare function posHardwareReceiptNotice(order: {
|
|
67
|
+
hardwareSalePending?: unknown;
|
|
68
|
+
hardwareOrderId?: unknown;
|
|
69
|
+
} | null | undefined): string | null;
|
|
70
|
+
/** A receipt footer with the terms notice after it, for a sale of hardware. */
|
|
71
|
+
export declare function withPosHardwareReceiptNotice(footer: string | null | undefined, order: {
|
|
72
|
+
hardwareSalePending?: unknown;
|
|
73
|
+
hardwareOrderId?: unknown;
|
|
74
|
+
} | null | undefined): string;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { LEGAL_ORIGIN } from "@aglyn/aglyn/app-utils/published-legal-pages";
|
|
17
|
+
/*==========================================
|
|
18
|
+
* THE TERMS OF SALE AT THE BOOTH (AGL-4038).
|
|
19
|
+
*
|
|
20
|
+
* The platform sells card readers in person under its published Terms,
|
|
21
|
+
* Sections 4.26 to 4.32. Section 4.28 says how a buyer agrees: before paying,
|
|
22
|
+
* they accept those terms electronically — on the register tablet handed to
|
|
23
|
+
* them, or on the register's customer display — and where that can't be done
|
|
24
|
+
* (no power, no connection), the receipt and a sign at the booth state that
|
|
25
|
+
* the sale is made under them, and paying is agreeing.
|
|
26
|
+
*
|
|
27
|
+
* So a register sale of hardware carries `hardwareTermsAcceptance`: which
|
|
28
|
+
* version of the Terms, when, how (`tablet`, `display`, or `notice` for the
|
|
29
|
+
* receipt-and-sign route), the register user who handed it over, and the
|
|
30
|
+
* device's address and browser, as a signature's audit does. The hardware
|
|
31
|
+
* order the sale becomes copies it (`termsAcceptance`).
|
|
32
|
+
*
|
|
33
|
+
* `POS_HARDWARE_TERMS_VERSION` is the Terms version whose Sections 4.26–4.32
|
|
34
|
+
* the summary below follows. It moves only when those sections change; a
|
|
35
|
+
* console spec holds it at or below the published version.
|
|
36
|
+
*=========================================*/ /** The published Terms version the summary and every acceptance name. */ export const POS_HARDWARE_TERMS_VERSION = 'v20';
|
|
37
|
+
/** The sections of the Terms that are the terms of sale for hardware. */ export const POS_HARDWARE_TERMS_SECTIONS = '4.26–4.32';
|
|
38
|
+
/** The published Terms, where the full text is. */ export function posHardwareTermsUrl() {
|
|
39
|
+
return `${LEGAL_ORIGIN}/legal/terms`;
|
|
40
|
+
}
|
|
41
|
+
/** The Terms' address as a receipt or a sign prints it: `example.com/legal/terms`. */ export function posHardwareTermsAddress() {
|
|
42
|
+
try {
|
|
43
|
+
return `${new URL(LEGAL_ORIGIN).host}/legal/terms`;
|
|
44
|
+
} catch (unused) {
|
|
45
|
+
return '/legal/terms';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What the buyer reads before accepting: Sections 4.26–4.32 in short, in the
|
|
50
|
+
* published text's own order and terms, with the link to the whole. Never
|
|
51
|
+
* instead of it: the acceptance is of the Terms, which this summarizes.
|
|
52
|
+
*/ export const POS_HARDWARE_TERMS_SUMMARY = [
|
|
53
|
+
'We are the seller of this hardware. It is for use in a business in the United States, not for personal, family or household use, and you may not resell it.',
|
|
54
|
+
'Ownership and the risk of loss pass to you when the hardware is handed to you. Sales tax is charged at the rate our register charges for this sale.',
|
|
55
|
+
'You may return it within 30 days of buying it, in its original packaging and condition with all its accessories. You pay the return shipping, and any restocking fee Stripe charges us for the return comes off the refund.',
|
|
56
|
+
'For one year we warrant it, other than cables and other accessories, against defects in materials and workmanship under normal use. Repair or replacement is the only remedy.',
|
|
57
|
+
'Its software is Stripe’s, under Stripe’s terms. It needs an internet connection you provide, and its price does not include any internet or cellular data service.',
|
|
58
|
+
'Apart from that warranty, the hardware is provided as is, and our liability for it is limited to the amount you paid for it.'
|
|
59
|
+
];
|
|
60
|
+
const METHODS = [
|
|
61
|
+
'tablet',
|
|
62
|
+
'display',
|
|
63
|
+
'notice'
|
|
64
|
+
];
|
|
65
|
+
/** An acceptance as stored, or null for anything that is not one. */ export function posHardwareTermsAcceptanceOf(raw) {
|
|
66
|
+
var _value_method, _text, _text1;
|
|
67
|
+
if (!raw || typeof raw !== 'object') return null;
|
|
68
|
+
const value = raw;
|
|
69
|
+
const method = String((_value_method = value['method']) != null ? _value_method : '');
|
|
70
|
+
const atMs = Number(value['atMs']);
|
|
71
|
+
if (!METHODS.includes(method) || !Number.isFinite(atMs) || atMs <= 0) return null;
|
|
72
|
+
const text = (field, max)=>typeof value[field] === 'string' && value[field] ? value[field].slice(0, max) : null;
|
|
73
|
+
return {
|
|
74
|
+
version: (_text = text('version', 20)) != null ? _text : POS_HARDWARE_TERMS_VERSION,
|
|
75
|
+
sections: (_text1 = text('sections', 40)) != null ? _text1 : POS_HARDWARE_TERMS_SECTIONS,
|
|
76
|
+
method,
|
|
77
|
+
atMs,
|
|
78
|
+
staffUid: text('staffUid', 128),
|
|
79
|
+
ip: text('ip', 100),
|
|
80
|
+
userAgent: text('userAgent', 400)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** A fresh acceptance of the current terms of sale. */ export function posHardwareTermsAcceptance(input) {
|
|
84
|
+
var _input_staffUid, _ref, _input_ip, _ref1, _input_userAgent;
|
|
85
|
+
var _this, _this1;
|
|
86
|
+
return {
|
|
87
|
+
version: POS_HARDWARE_TERMS_VERSION,
|
|
88
|
+
sections: POS_HARDWARE_TERMS_SECTIONS,
|
|
89
|
+
method: input.method,
|
|
90
|
+
atMs: input.atMs,
|
|
91
|
+
staffUid: input.method === 'notice' ? null : (_input_staffUid = input.staffUid) != null ? _input_staffUid : null,
|
|
92
|
+
ip: input.method === 'notice' ? null : (_ref = (_this = (_input_ip = input.ip) != null ? _input_ip : null) == null ? void 0 : _this.slice(0, 100)) != null ? _ref : null,
|
|
93
|
+
userAgent: input.method === 'notice' ? null : (_ref1 = (_this1 = (_input_userAgent = input.userAgent) != null ? _input_userAgent : null) == null ? void 0 : _this1.slice(0, 400)) != null ? _ref1 : null
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** Whether a register sale sells hardware: marked when rung, or recorded since. */ export function isPosHardwareRegisterSale(order) {
|
|
97
|
+
return (order == null ? void 0 : order.hardwareSalePending) === true || typeof (order == null ? void 0 : order.hardwareOrderId) === 'string' && Boolean(order.hardwareOrderId);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The line every receipt of a register sale of hardware prints (Section
|
|
101
|
+
* 4.28's fallback, printed whether or not the buyer also accepted
|
|
102
|
+
* electronically): which terms the sale is made under, and that paying is
|
|
103
|
+
* agreeing to them. Null on every other sale.
|
|
104
|
+
*/ export function posHardwareReceiptNotice(order) {
|
|
105
|
+
if (!isPosHardwareRegisterSale(order)) return null;
|
|
106
|
+
return `Card reader hardware on this receipt is sold under ${posHardwareTermsAddress()}, ` + `Sections ${POS_HARDWARE_TERMS_SECTIONS}. By paying for it you agree to those terms for this purchase.`;
|
|
107
|
+
}
|
|
108
|
+
/** A receipt footer with the terms notice after it, for a sale of hardware. */ export function withPosHardwareReceiptNotice(footer, order) {
|
|
109
|
+
return [
|
|
110
|
+
String(footer != null ? footer : '').trim(),
|
|
111
|
+
posHardwareReceiptNotice(order)
|
|
112
|
+
].filter(Boolean).join('\n');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=pos-hardware-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/pos-hardware-terms.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LEGAL_ORIGIN } from '@aglyn/aglyn/app-utils/published-legal-pages'\n\n/*==========================================\n * THE TERMS OF SALE AT THE BOOTH (AGL-4038).\n *\n * The platform sells card readers in person under its published Terms,\n * Sections 4.26 to 4.32. Section 4.28 says how a buyer agrees: before paying,\n * they accept those terms electronically — on the register tablet handed to\n * them, or on the register's customer display — and where that can't be done\n * (no power, no connection), the receipt and a sign at the booth state that\n * the sale is made under them, and paying is agreeing.\n *\n * So a register sale of hardware carries `hardwareTermsAcceptance`: which\n * version of the Terms, when, how (`tablet`, `display`, or `notice` for the\n * receipt-and-sign route), the register user who handed it over, and the\n * device's address and browser, as a signature's audit does. The hardware\n * order the sale becomes copies it (`termsAcceptance`).\n *\n * `POS_HARDWARE_TERMS_VERSION` is the Terms version whose Sections 4.26–4.32\n * the summary below follows. It moves only when those sections change; a\n * console spec holds it at or below the published version.\n *=========================================*/\n\n/** The published Terms version the summary and every acceptance name. */\nexport const POS_HARDWARE_TERMS_VERSION = 'v20'\n\n/** The sections of the Terms that are the terms of sale for hardware. */\nexport const POS_HARDWARE_TERMS_SECTIONS = '4.26–4.32'\n\n/** The published Terms, where the full text is. */\nexport function posHardwareTermsUrl(): string {\n return `${LEGAL_ORIGIN}/legal/terms`\n}\n\n/** The Terms' address as a receipt or a sign prints it: `example.com/legal/terms`. */\nexport function posHardwareTermsAddress(): string {\n try {\n return `${new URL(LEGAL_ORIGIN).host}/legal/terms`\n } catch {\n return '/legal/terms'\n }\n}\n\n/**\n * What the buyer reads before accepting: Sections 4.26–4.32 in short, in the\n * published text's own order and terms, with the link to the whole. Never\n * instead of it: the acceptance is of the Terms, which this summarizes.\n */\nexport const POS_HARDWARE_TERMS_SUMMARY: readonly string[] = [\n 'We are the seller of this hardware. It is for use in a business in the United States, not for personal, family or household use, and you may not resell it.',\n 'Ownership and the risk of loss pass to you when the hardware is handed to you. Sales tax is charged at the rate our register charges for this sale.',\n 'You may return it within 30 days of buying it, in its original packaging and condition with all its accessories. You pay the return shipping, and any restocking fee Stripe charges us for the return comes off the refund.',\n 'For one year we warrant it, other than cables and other accessories, against defects in materials and workmanship under normal use. Repair or replacement is the only remedy.',\n 'Its software is Stripe’s, under Stripe’s terms. It needs an internet connection you provide, and its price does not include any internet or cellular data service.',\n 'Apart from that warranty, the hardware is provided as is, and our liability for it is limited to the amount you paid for it.',\n]\n\n/** How a buyer agreed to the terms of sale. */\nexport type PosHardwareTermsMethod = 'tablet' | 'display' | 'notice'\n\n/** `hardwareTermsAcceptance` on a register sale, and `termsAcceptance` on the hardware order. */\nexport interface PosHardwareTermsAcceptance {\n version: string\n sections: string\n method: PosHardwareTermsMethod\n atMs: number\n /** The register user who handed the tablet over or put the terms on the display; null for a notice. */\n staffUid: string | null\n /** The address and browser of the device the buyer accepted on; null for a notice. */\n ip: string | null\n userAgent: string | null\n}\n\nconst METHODS: readonly PosHardwareTermsMethod[] = ['tablet', 'display', 'notice']\n\n/** An acceptance as stored, or null for anything that is not one. */\nexport function posHardwareTermsAcceptanceOf(raw: unknown): PosHardwareTermsAcceptance | null {\n if (!raw || typeof raw !== 'object') return null\n const value = raw as Record<string, unknown>\n const method = String(value['method'] ?? '') as PosHardwareTermsMethod\n const atMs = Number(value['atMs'])\n if (!METHODS.includes(method) || !Number.isFinite(atMs) || atMs <= 0) return null\n const text = (field: string, max: number) =>\n typeof value[field] === 'string' && (value[field] as string) ? (value[field] as string).slice(0, max) : null\n return {\n version: text('version', 20) ?? POS_HARDWARE_TERMS_VERSION,\n sections: text('sections', 40) ?? POS_HARDWARE_TERMS_SECTIONS,\n method,\n atMs,\n staffUid: text('staffUid', 128),\n ip: text('ip', 100),\n userAgent: text('userAgent', 400),\n }\n}\n\n/** A fresh acceptance of the current terms of sale. */\nexport function posHardwareTermsAcceptance(input: {\n method: PosHardwareTermsMethod\n atMs: number\n staffUid?: string | null\n ip?: string | null\n userAgent?: string | null\n}): PosHardwareTermsAcceptance {\n return {\n version: POS_HARDWARE_TERMS_VERSION,\n sections: POS_HARDWARE_TERMS_SECTIONS,\n method: input.method,\n atMs: input.atMs,\n staffUid: input.method === 'notice' ? null : (input.staffUid ?? null),\n ip: input.method === 'notice' ? null : (input.ip ?? null)?.slice(0, 100) ?? null,\n userAgent: input.method === 'notice' ? null : (input.userAgent ?? null)?.slice(0, 400) ?? null,\n }\n}\n\n/** Whether a register sale sells hardware: marked when rung, or recorded since. */\nexport function isPosHardwareRegisterSale(order: { hardwareSalePending?: unknown; hardwareOrderId?: unknown } | null | undefined): boolean {\n return order?.hardwareSalePending === true || (typeof order?.hardwareOrderId === 'string' && Boolean(order.hardwareOrderId))\n}\n\n/**\n * The line every receipt of a register sale of hardware prints (Section\n * 4.28's fallback, printed whether or not the buyer also accepted\n * electronically): which terms the sale is made under, and that paying is\n * agreeing to them. Null on every other sale.\n */\nexport function posHardwareReceiptNotice(\n order: { hardwareSalePending?: unknown; hardwareOrderId?: unknown } | null | undefined,\n): string | null {\n if (!isPosHardwareRegisterSale(order)) return null\n return (\n `Card reader hardware on this receipt is sold under ${posHardwareTermsAddress()}, ` +\n `Sections ${POS_HARDWARE_TERMS_SECTIONS}. By paying for it you agree to those terms for this purchase.`\n )\n}\n\n/** A receipt footer with the terms notice after it, for a sale of hardware. */\nexport function withPosHardwareReceiptNotice(\n footer: string | null | undefined,\n order: { hardwareSalePending?: unknown; hardwareOrderId?: unknown } | null | undefined,\n): string {\n return [String(footer ?? '').trim(), posHardwareReceiptNotice(order)].filter(Boolean).join('\\n')\n}\n"],"names":["LEGAL_ORIGIN","POS_HARDWARE_TERMS_VERSION","POS_HARDWARE_TERMS_SECTIONS","posHardwareTermsUrl","posHardwareTermsAddress","URL","host","POS_HARDWARE_TERMS_SUMMARY","METHODS","posHardwareTermsAcceptanceOf","raw","value","text","method","String","atMs","Number","includes","isFinite","field","max","slice","version","sections","staffUid","ip","userAgent","posHardwareTermsAcceptance","input","isPosHardwareRegisterSale","order","hardwareSalePending","hardwareOrderId","Boolean","posHardwareReceiptNotice","withPosHardwareReceiptNotice","footer","trim","filter","join"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,YAAY,QAAQ,+CAA8C;AAE3E;;;;;;;;;;;;;;;;;;;2CAmB2C,GAE3C,uEAAuE,GACvE,OAAO,MAAMC,6BAA6B,MAAK;AAE/C,uEAAuE,GACvE,OAAO,MAAMC,8BAA8B,YAAW;AAEtD,iDAAiD,GACjD,OAAO,SAASC;IACd,OAAO,GAAGH,aAAa,YAAY,CAAC;AACtC;AAEA,oFAAoF,GACpF,OAAO,SAASI;IACd,IAAI;QACF,OAAO,GAAG,IAAIC,IAAIL,cAAcM,IAAI,CAAC,YAAY,CAAC;IACpD,EAAE,eAAM;QACN,OAAO;IACT;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAMC,6BAAgD;IAC3D;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAkBD,MAAMC,UAA6C;IAAC;IAAU;IAAW;CAAS;AAElF,mEAAmE,GACnE,OAAO,SAASC,6BAA6BC,GAAY;QAGjCC,eAMXC,OACCA;IATZ,IAAI,CAACF,OAAO,OAAOA,QAAQ,UAAU,OAAO;IAC5C,MAAMC,QAAQD;IACd,MAAMG,SAASC,QAAOH,gBAAAA,KAAK,CAAC,SAAS,YAAfA,gBAAmB;IACzC,MAAMI,OAAOC,OAAOL,KAAK,CAAC,OAAO;IACjC,IAAI,CAACH,QAAQS,QAAQ,CAACJ,WAAW,CAACG,OAAOE,QAAQ,CAACH,SAASA,QAAQ,GAAG,OAAO;IAC7E,MAAMH,OAAO,CAACO,O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