@aglyn/plugins-commerce 1.0.0-beta.285 → 1.0.0-beta.288
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/order-webhooks-card.component.js +1 -1
- package/src/lib/components/console/order-webhooks-card.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 +15 -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 +74 -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/model/workspace-site-permissions.d.ts +26 -0
- package/src/lib/model/workspace-site-permissions.js +81 -0
- package/src/lib/model/workspace-site-permissions.js.map +1 -0
- 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 +48 -0
- package/src/lib/server/commerce-site-keys.js +61 -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/order-webhooks.js +8 -8
- package/src/lib/server/order-webhooks.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 +28 -9
- package/src/lib/server/pos-ops-gate.js +50 -19
- 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-refund-authority.d.ts +3 -1
- package/src/lib/server/pos-refund-authority.js +3 -2
- package/src/lib/server/pos-refund-authority.js.map +1 -1
- package/src/lib/server/pos-return.d.ts +10 -0
- package/src/lib/server/pos-return.js +29 -7
- 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 +29 -24
- 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 +55 -42
- 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
|
@@ -30,7 +30,33 @@ export interface ProductCheckIn {
|
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
/** People one item admits, 1–{@link CHECK_IN_MAX_HEADCOUNT}; absent is 1. */
|
|
32
32
|
headcount?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Ask the buyer which day they will use it (a day pass bought ahead), as an
|
|
35
|
+
* optional date at checkout. Without an answer the item is due on the day
|
|
36
|
+
* it was bought, as every check-in item always has been. Absent is off.
|
|
37
|
+
*/
|
|
38
|
+
askUseDate?: boolean;
|
|
33
39
|
}
|
|
40
|
+
/** The furthest ahead a buyer may choose a use day: about two years. */
|
|
41
|
+
export declare const CHECK_IN_USE_DAY_MAX_AHEAD_DAYS = 730;
|
|
42
|
+
/** Whether a value is a real calendar day written `YYYY-MM-DD`. */
|
|
43
|
+
export declare function isCheckInDayKey(value: unknown): value is string;
|
|
44
|
+
/** The day key `days` after (or before, when negative) another. */
|
|
45
|
+
export declare function addCheckInDays(dayKey: string, days: number): string;
|
|
46
|
+
/**
|
|
47
|
+
* A day as the window and the cart read it: "Sat, Nov 1". It lives here, not
|
|
48
|
+
* beside the rain checks, because the storefront cart prints a line's use day,
|
|
49
|
+
* and reaching `commerce-check-in.ts` from the cart pulls the check-in window,
|
|
50
|
+
* the POS helpers and the receipt into the plugin's eager bytes
|
|
51
|
+
* (`check:plugin-budgets`).
|
|
52
|
+
*/
|
|
53
|
+
export declare function checkInDayLabel(dayKey: string | null | undefined): string;
|
|
54
|
+
/**
|
|
55
|
+
* Why a chosen use day cannot be sold, or null: a day that is not a date, a
|
|
56
|
+
* day before `todayKey` (today on the store's calendar), or one further
|
|
57
|
+
* ahead than {@link CHECK_IN_USE_DAY_MAX_AHEAD_DAYS}.
|
|
58
|
+
*/
|
|
59
|
+
export declare function checkInUseDayProblem(value: unknown, todayKey: string): string | null;
|
|
34
60
|
/** A stored check-in setting made safe, or `undefined` when it says nothing. */
|
|
35
61
|
export declare function normalizeProductCheckIn(value: unknown): ProductCheckIn | undefined;
|
|
36
62
|
/** Why a check-in setting cannot be saved, or `null`. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
1
2
|
/**
|
|
2
3
|
* @license
|
|
3
4
|
* Copyright 2026 Aglyn LLC
|
|
@@ -18,6 +19,61 @@
|
|
|
18
19
|
* check-in and how many people one item admits. It has no imports, so the
|
|
19
20
|
* native contracts and the console read the same shape and rules.
|
|
20
21
|
*/ /** The most people one item admits. */ export const CHECK_IN_MAX_HEADCOUNT = 50;
|
|
22
|
+
/*==========================================
|
|
23
|
+
* THE USE DAY (pass dates, AGL-4043)
|
|
24
|
+
*
|
|
25
|
+
* The day an item is for is a day key, `YYYY-MM-DD` on the store's own
|
|
26
|
+
* calendar (its time zone): the same key a check-in's `dayKey`, the day
|
|
27
|
+
* totals' `from`/`to` and the check-in day picker use. An order line
|
|
28
|
+
* carries the buyer's answer as `useDayKey`; a line without one is due on
|
|
29
|
+
* the day the order was placed.
|
|
30
|
+
*=========================================*/ /** The furthest ahead a buyer may choose a use day: about two years. */ export const CHECK_IN_USE_DAY_MAX_AHEAD_DAYS = 730;
|
|
31
|
+
const DAY_KEY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
32
|
+
/** UTC midnight of a real `YYYY-MM-DD` calendar day, or null. */ function dayKeyMs(value) {
|
|
33
|
+
const match = typeof value === 'string' ? DAY_KEY.exec(value) : null;
|
|
34
|
+
if (!match) return null;
|
|
35
|
+
const year = Number(match[1]);
|
|
36
|
+
const month = Number(match[2]);
|
|
37
|
+
const day = Number(match[3]);
|
|
38
|
+
const ms = Date.UTC(year, month - 1, day);
|
|
39
|
+
const check = new Date(ms);
|
|
40
|
+
return check.getUTCFullYear() === year && check.getUTCMonth() === month - 1 && check.getUTCDate() === day ? ms : null;
|
|
41
|
+
}
|
|
42
|
+
/** Whether a value is a real calendar day written `YYYY-MM-DD`. */ export function isCheckInDayKey(value) {
|
|
43
|
+
return dayKeyMs(value) !== null;
|
|
44
|
+
}
|
|
45
|
+
/** The day key `days` after (or before, when negative) another. */ export function addCheckInDays(dayKey, days) {
|
|
46
|
+
const ms = dayKeyMs(dayKey);
|
|
47
|
+
if (ms === null) return dayKey;
|
|
48
|
+
return new Date(ms + Math.round(days) * 86400000).toISOString().slice(0, 10);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A day as the window and the cart read it: "Sat, Nov 1". It lives here, not
|
|
52
|
+
* beside the rain checks, because the storefront cart prints a line's use day,
|
|
53
|
+
* and reaching `commerce-check-in.ts` from the cart pulls the check-in window,
|
|
54
|
+
* the POS helpers and the receipt into the plugin's eager bytes
|
|
55
|
+
* (`check:plugin-budgets`).
|
|
56
|
+
*/ export function checkInDayLabel(dayKey) {
|
|
57
|
+
if (!isCheckInDayKey(dayKey)) return '';
|
|
58
|
+
return new Intl.DateTimeFormat('en-US', {
|
|
59
|
+
weekday: 'short',
|
|
60
|
+
month: 'short',
|
|
61
|
+
day: 'numeric',
|
|
62
|
+
timeZone: 'UTC'
|
|
63
|
+
}).format(new Date(`${dayKey}T00:00:00Z`));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Why a chosen use day cannot be sold, or null: a day that is not a date, a
|
|
67
|
+
* day before `todayKey` (today on the store's calendar), or one further
|
|
68
|
+
* ahead than {@link CHECK_IN_USE_DAY_MAX_AHEAD_DAYS}.
|
|
69
|
+
*/ export function checkInUseDayProblem(value, todayKey) {
|
|
70
|
+
if (!isCheckInDayKey(value)) return 'Choose the day as a date.';
|
|
71
|
+
if (value < todayKey) return 'That day has passed. Choose today or a later day.';
|
|
72
|
+
if (value > addCheckInDays(todayKey, CHECK_IN_USE_DAY_MAX_AHEAD_DAYS)) {
|
|
73
|
+
return 'Choose a day within the next two years.';
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
21
77
|
function headcountOf(value) {
|
|
22
78
|
const count = Math.round(Number(value));
|
|
23
79
|
return Number.isFinite(count) && count >= 1 ? Math.min(count, CHECK_IN_MAX_HEADCOUNT) : 1;
|
|
@@ -26,10 +82,12 @@ function headcountOf(value) {
|
|
|
26
82
|
if (!value || typeof value !== 'object') return undefined;
|
|
27
83
|
const raw = value;
|
|
28
84
|
if (typeof raw['enabled'] !== 'boolean') return undefined;
|
|
29
|
-
return raw['enabled'] ? {
|
|
85
|
+
return raw['enabled'] ? _extends({
|
|
30
86
|
enabled: true,
|
|
31
87
|
headcount: headcountOf(raw['headcount'])
|
|
32
|
-
}
|
|
88
|
+
}, raw['askUseDate'] === true ? {
|
|
89
|
+
askUseDate: true
|
|
90
|
+
} : {}) : {
|
|
33
91
|
enabled: false
|
|
34
92
|
};
|
|
35
93
|
}
|
|
@@ -38,6 +96,10 @@ function headcountOf(value) {
|
|
|
38
96
|
if (typeof value !== 'object' || typeof value.enabled !== 'boolean') {
|
|
39
97
|
return 'Check-in must be on or off';
|
|
40
98
|
}
|
|
99
|
+
const askUseDate = value.askUseDate;
|
|
100
|
+
if (askUseDate !== undefined && typeof askUseDate !== 'boolean') {
|
|
101
|
+
return 'Asking for a use date must be on or off';
|
|
102
|
+
}
|
|
41
103
|
const headcount = value.headcount;
|
|
42
104
|
if (headcount === undefined) return null;
|
|
43
105
|
if (!Number.isInteger(headcount) || headcount < 1 || headcount > CHECK_IN_MAX_HEADCOUNT) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-check-in-product.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 product and variant check-in setting (AGL-4043): whether an item needs\n * check-in and how many people one item admits. It has no imports, so the\n * native contracts and the console read the same shape and rules.\n */\n\n/** The most people one item admits. */\nexport const CHECK_IN_MAX_HEADCOUNT = 50\n\n/**\n * Whether a product (or one variant) needs check-in (AGL-4043), and how\n * many people one item admits. On a product it is the default for every\n * variant; on a variant it overrides the product's.\n */\nexport interface ProductCheckIn {\n enabled: boolean\n /** People one item admits, 1–{@link CHECK_IN_MAX_HEADCOUNT}; absent is 1. */\n headcount?: number\n}\n\nfunction headcountOf(value: unknown): number {\n const count = Math.round(Number(value))\n return Number.isFinite(count) && count >= 1 ? Math.min(count, CHECK_IN_MAX_HEADCOUNT) : 1\n}\n\n/** A stored check-in setting made safe, or `undefined` when it says nothing. */\nexport function normalizeProductCheckIn(value: unknown): ProductCheckIn | undefined {\n if (!value || typeof value !== 'object') return undefined\n const raw = value as Record<string, unknown>\n if (typeof raw['enabled'] !== 'boolean') return undefined\n return raw['enabled']\n ? {
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-check-in-product.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 product and variant check-in setting (AGL-4043): whether an item needs\n * check-in and how many people one item admits. It has no imports, so the\n * native contracts and the console read the same shape and rules.\n */\n\n/** The most people one item admits. */\nexport const CHECK_IN_MAX_HEADCOUNT = 50\n\n/**\n * Whether a product (or one variant) needs check-in (AGL-4043), and how\n * many people one item admits. On a product it is the default for every\n * variant; on a variant it overrides the product's.\n */\nexport interface ProductCheckIn {\n enabled: boolean\n /** People one item admits, 1–{@link CHECK_IN_MAX_HEADCOUNT}; absent is 1. */\n headcount?: number\n /**\n * Ask the buyer which day they will use it (a day pass bought ahead), as an\n * optional date at checkout. Without an answer the item is due on the day\n * it was bought, as every check-in item always has been. Absent is off.\n */\n askUseDate?: boolean\n}\n\n/*==========================================\n * THE USE DAY (pass dates, AGL-4043)\n *\n * The day an item is for is a day key, `YYYY-MM-DD` on the store's own\n * calendar (its time zone): the same key a check-in's `dayKey`, the day\n * totals' `from`/`to` and the check-in day picker use. An order line\n * carries the buyer's answer as `useDayKey`; a line without one is due on\n * the day the order was placed.\n *=========================================*/\n\n/** The furthest ahead a buyer may choose a use day: about two years. */\nexport const CHECK_IN_USE_DAY_MAX_AHEAD_DAYS = 730\n\nconst DAY_KEY = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/** UTC midnight of a real `YYYY-MM-DD` calendar day, or null. */\nfunction dayKeyMs(value: unknown): number | null {\n const match = typeof value === 'string' ? DAY_KEY.exec(value) : null\n if (!match) return null\n const year = Number(match[1])\n const month = Number(match[2])\n const day = Number(match[3])\n const ms = Date.UTC(year, month - 1, day)\n const check = new Date(ms)\n return check.getUTCFullYear() === year && check.getUTCMonth() === month - 1 && check.getUTCDate() === day\n ? ms\n : null\n}\n\n/** Whether a value is a real calendar day written `YYYY-MM-DD`. */\nexport function isCheckInDayKey(value: unknown): value is string {\n return dayKeyMs(value) !== null\n}\n\n/** The day key `days` after (or before, when negative) another. */\nexport function addCheckInDays(dayKey: string, days: number): string {\n const ms = dayKeyMs(dayKey)\n if (ms === null) return dayKey\n return new Date(ms + Math.round(days) * 86_400_000).toISOString().slice(0, 10)\n}\n\n/**\n * A day as the window and the cart read it: \"Sat, Nov 1\". It lives here, not\n * beside the rain checks, because the storefront cart prints a line's use day,\n * and reaching `commerce-check-in.ts` from the cart pulls the check-in window,\n * the POS helpers and the receipt into the plugin's eager bytes\n * (`check:plugin-budgets`).\n */\nexport function checkInDayLabel(dayKey: string | null | undefined): string {\n if (!isCheckInDayKey(dayKey)) return ''\n return new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone: 'UTC',\n }).format(new Date(`${dayKey}T00:00:00Z`))\n}\n\n/**\n * Why a chosen use day cannot be sold, or null: a day that is not a date, a\n * day before `todayKey` (today on the store's calendar), or one further\n * ahead than {@link CHECK_IN_USE_DAY_MAX_AHEAD_DAYS}.\n */\nexport function checkInUseDayProblem(value: unknown, todayKey: string): string | null {\n if (!isCheckInDayKey(value)) return 'Choose the day as a date.'\n if (value < todayKey) return 'That day has passed. Choose today or a later day.'\n if (value > addCheckInDays(todayKey, CHECK_IN_USE_DAY_MAX_AHEAD_DAYS)) {\n return 'Choose a day within the next two years.'\n }\n return null\n}\n\nfunction headcountOf(value: unknown): number {\n const count = Math.round(Number(value))\n return Number.isFinite(count) && count >= 1 ? Math.min(count, CHECK_IN_MAX_HEADCOUNT) : 1\n}\n\n/** A stored check-in setting made safe, or `undefined` when it says nothing. */\nexport function normalizeProductCheckIn(value: unknown): ProductCheckIn | undefined {\n if (!value || typeof value !== 'object') return undefined\n const raw = value as Record<string, unknown>\n if (typeof raw['enabled'] !== 'boolean') return undefined\n return raw['enabled']\n ? {\n enabled: true,\n headcount: headcountOf(raw['headcount']),\n ...(raw['askUseDate'] === true ? { askUseDate: true } : {}),\n }\n : { enabled: false }\n}\n\n/** Why a check-in setting cannot be saved, or `null`. */\nexport function productCheckInProblem(value: unknown): string | null {\n if (value === undefined || value === null) return null\n if (typeof value !== 'object' || typeof (value as ProductCheckIn).enabled !== 'boolean') {\n return 'Check-in must be on or off'\n }\n const askUseDate = (value as ProductCheckIn).askUseDate\n if (askUseDate !== undefined && typeof askUseDate !== 'boolean') {\n return 'Asking for a use date must be on or off'\n }\n const headcount = (value as ProductCheckIn).headcount\n if (headcount === undefined) return null\n if (!Number.isInteger(headcount) || headcount < 1 || headcount > CHECK_IN_MAX_HEADCOUNT) {\n return `People per item must be a whole number from 1 to ${CHECK_IN_MAX_HEADCOUNT}`\n }\n return null\n}\n"],"names":["CHECK_IN_MAX_HEADCOUNT","CHECK_IN_USE_DAY_MAX_AHEAD_DAYS","DAY_KEY","dayKeyMs","value","match","exec","year","Number","month","day","ms","Date","UTC","check","getUTCFullYear","getUTCMonth","getUTCDate","isCheckInDayKey","addCheckInDays","dayKey","days","Math","round","toISOString","slice","checkInDayLabel","Intl","DateTimeFormat","weekday","timeZone","format","checkInUseDayProblem","todayKey","headcountOf","count","isFinite","min","normalizeProductCheckIn","undefined","raw","enabled","headcount","askUseDate","productCheckInProblem","isInteger"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;CAIC,GAED,qCAAqC,GACrC,OAAO,MAAMA,yBAAyB,GAAE;AAmBxC;;;;;;;;2CAQ2C,GAE3C,sEAAsE,GACtE,OAAO,MAAMC,kCAAkC,IAAG;AAElD,MAAMC,UAAU;AAEhB,+DAA+D,GAC/D,SAASC,SAASC,KAAc;IAC9B,MAAMC,QAAQ,OAAOD,UAAU,WAAWF,QAAQI,IAAI,CAACF,SAAS;IAChE,IAAI,CAACC,OAAO,OAAO;IACnB,MAAME,OAAOC,OAAOH,KAAK,CAAC,EAAE;IAC5B,MAAMI,QAAQD,OAAOH,KAAK,CAAC,EAAE;IAC7B,MAAMK,MAAMF,OAAOH,KAAK,CAAC,EAAE;IAC3B,MAAMM,KAAKC,KAAKC,GAAG,CAACN,MAAME,QAAQ,GAAGC;IACrC,MAAMI,QAAQ,IAAIF,KAAKD;IACvB,OAAOG,MAAMC,cAAc,OAAOR,QAAQO,MAAME,WAAW,OAAOP,QAAQ,KAAKK,MAAMG,UAAU,OAAOP,MAClGC,KACA;AACN;AAEA,iEAAiE,GACjE,OAAO,SAASO,gBAAgBd,KAAc;IAC5C,OAAOD,SAASC,WAAW;AAC7B;AAEA,iEAAiE,GACjE,OAAO,SAASe,eAAeC,MAAc,EAAEC,IAAY;IACzD,MAAMV,KAAKR,SAASiB;IACpB,IAAIT,OAAO,MAAM,OAAOS;IACxB,OAAO,IAAIR,KAAKD,KAAKW,KAAKC,KAAK,CAACF,QAAQ,UAAYG,WAAW,GAAGC,KAAK,CAAC,GAAG;AAC7E;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,gBAAgBN,MAAiC;IAC/D,IAAI,CAACF,gBAAgBE,SAAS,OAAO;IACrC,OAAO,IAAIO,KAAKC,cAAc,CAAC,SAAS;QACtCC,SAAS;QACTpB,OAAO;QACPC,KAAK;QACLoB,UAAU;IACZ,GAAGC,MAAM,CAAC,IAAInB,KAAK,GAAGQ,OAAO,UAAU,CAAC;AAC1C;AAEA;;;;CAIC,GACD,OAAO,SAASY,qBAAqB5B,KAAc,EAAE6B,QAAgB;IACnE,IAAI,CAACf,gBAAgBd,QAAQ,OAAO;IACpC,IAAIA,QAAQ6B,UAAU,OAAO;IAC7B,IAAI7B,QAAQe,eAAec,UAAUhC,kCAAkC;QACrE,OAAO;IACT;IACA,OAAO;AACT;AAEA,SAASiC,YAAY9B,KAAc;IACjC,MAAM+B,QAAQb,KAAKC,KAAK,CAACf,OAAOJ;IAChC,OAAOI,OAAO4B,QAAQ,CAACD,UAAUA,SAAS,IAAIb,KAAKe,GAAG,CAACF,OAAOnC,0BAA0B;AAC1F;AAEA,8EAA8E,GAC9E,OAAO,SAASsC,wBAAwBlC,KAAc;IACpD,IAAI,CAACA,SAAS,OAAOA,UAAU,UAAU,OAAOmC;IAChD,MAAMC,MAAMpC;IACZ,IAAI,OAAOoC,GAAG,CAAC,UAAU,KAAK,WAAW,OAAOD;IAChD,OAAOC,GAAG,CAAC,UAAU,GACjB;QACEC,SAAS;QACTC,WAAWR,YAAYM,GAAG,CAAC,YAAY;OACnCA,GAAG,CAAC,aAAa,KAAK,OAAO;QAAEG,YAAY;IAAK,IAAI,CAAC,KAE3D;QAAEF,SAAS;IAAM;AACvB;AAEA,uDAAuD,GACvD,OAAO,SAASG,sBAAsBxC,KAAc;IAClD,IAAIA,UAAUmC,aAAanC,UAAU,MAAM,OAAO;IAClD,IAAI,OAAOA,UAAU,YAAY,OAAO,AAACA,MAAyBqC,OAAO,KAAK,WAAW;QACvF,OAAO;IACT;IACA,MAAME,aAAa,AAACvC,MAAyBuC,UAAU;IACvD,IAAIA,eAAeJ,aAAa,OAAOI,eAAe,WAAW;QAC/D,OAAO;IACT;IACA,MAAMD,YAAY,AAACtC,MAAyBsC,SAAS;IACrD,IAAIA,cAAcH,WAAW,OAAO;IACpC,IAAI,CAAC/B,OAAOqC,SAAS,CAACH,cAAcA,YAAY,KAAKA,YAAY1C,wBAAwB;QACvF,OAAO,CAAC,iDAAiD,EAAEA,wBAAwB;IACrF;IACA,OAAO;AACT"}
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
import type { OrderChannel } from './commerce-orders';
|
|
18
|
+
export declare const POS_CHECK_IN_ROUTE = "/api/commerce/pos-check-in";
|
|
19
|
+
/** The most check-ins one tap records. */
|
|
20
|
+
export declare const CHECK_IN_BATCH_MAX = 50;
|
|
21
|
+
/** A wristband's number or color, at most this many characters. */
|
|
22
|
+
export declare const CHECK_IN_WRISTBAND_MAX = 24;
|
|
23
|
+
/** Colors offered as quick picks for a wristband. Any word is accepted. */
|
|
24
|
+
export declare const CHECK_IN_WRISTBAND_COLORS: readonly string[];
|
|
25
|
+
export type CheckInStatus = 'expected' | 'checked_in';
|
|
26
|
+
export interface CheckInWristband {
|
|
27
|
+
number: string | null;
|
|
28
|
+
color: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A rain check on one person's pass: who gave it, when, and the day it was
|
|
32
|
+
* due before. `open` waits to be claimed on any later day; `date` moved it
|
|
33
|
+
* to `toDayKey`.
|
|
34
|
+
*/
|
|
35
|
+
export interface CheckInRainCheck {
|
|
36
|
+
kind: 'open' | 'date';
|
|
37
|
+
/** The day the pass was due on before this rain check. */
|
|
38
|
+
fromDayKey: string;
|
|
39
|
+
/** The day it was moved to; null while open. */
|
|
40
|
+
toDayKey: string | null;
|
|
41
|
+
/** The day an open rain check was used, once it is checked in. */
|
|
42
|
+
claimedDayKey: string | null;
|
|
43
|
+
byUid: string;
|
|
44
|
+
byName: string | null;
|
|
45
|
+
atMs: number;
|
|
46
|
+
}
|
|
47
|
+
/** `hosts/{hostId}/checkIns/{id}`: one person due on one day. Server-written only. */
|
|
48
|
+
export interface HostCheckIn {
|
|
49
|
+
source: 'order' | 'reservation';
|
|
50
|
+
orderId: string | null;
|
|
51
|
+
/** The order's number as the console shows it (`#1042`), or null for a stay. */
|
|
52
|
+
orderLabel: string | null;
|
|
53
|
+
/** Where the order was sold, or `reservation`. */
|
|
54
|
+
channel: OrderChannel | 'reservation';
|
|
55
|
+
reservationId: string | null;
|
|
56
|
+
lineIndex: number | null;
|
|
57
|
+
/** This person's place among the line's or stay's check-ins, from 0. */
|
|
58
|
+
unitIndex: number;
|
|
59
|
+
/** How many check-ins the line or stay makes that day. */
|
|
60
|
+
unitCount: number;
|
|
61
|
+
productId: string | null;
|
|
62
|
+
variantId: string | null;
|
|
63
|
+
itemName: string;
|
|
64
|
+
variantLabel: string | null;
|
|
65
|
+
/** The day, `YYYY-MM-DD` in the site's time zone. */
|
|
66
|
+
dayKey: string;
|
|
67
|
+
/** Who the check-in is for, as one key: the address, else the contact, else the name, else the order. */
|
|
68
|
+
customerKey: string;
|
|
69
|
+
customerName: string | null;
|
|
70
|
+
customerEmail: string | null;
|
|
71
|
+
customerEmailLower: string | null;
|
|
72
|
+
customerPhone: string | null;
|
|
73
|
+
/** The contact the register attached to the sale, when it was one. */
|
|
74
|
+
contactId: string | null;
|
|
75
|
+
/** The name's, the address's, the phone's and the order number's search prefixes. */
|
|
76
|
+
searchTokens: string[];
|
|
77
|
+
status: CheckInStatus;
|
|
78
|
+
checkedInAtMs: number | null;
|
|
79
|
+
checkedInBy: string | null;
|
|
80
|
+
checkedInByName: string | null;
|
|
81
|
+
wristband: CheckInWristband | null;
|
|
82
|
+
/** The attempt that checked this person in, so a retried tap is not "already checked in". */
|
|
83
|
+
checkInAttempt: string | null;
|
|
84
|
+
/** The last undo, kept so a reversed check-in still says who reversed it. */
|
|
85
|
+
undoneAtMs: number | null;
|
|
86
|
+
undoneBy: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* A rain check on this pass, or null. Absent on a check-in written before
|
|
89
|
+
* rain checks existed, which reads as null.
|
|
90
|
+
*/
|
|
91
|
+
rainCheck?: CheckInRainCheck | null;
|
|
92
|
+
/**
|
|
93
|
+
* True while an open rain check waits to be used: what a later day's
|
|
94
|
+
* search and customer lookup ask (`rainCheckOpen == true`, `dayKey <` the
|
|
95
|
+
* day). Absent reads as false.
|
|
96
|
+
*/
|
|
97
|
+
rainCheckOpen?: boolean;
|
|
98
|
+
/** The last rain check taken back: when and by whom. */
|
|
99
|
+
rainCheckUndoneAtMs?: number | null;
|
|
100
|
+
rainCheckUndoneBy?: string | null;
|
|
101
|
+
createdAtMs: number;
|
|
102
|
+
updatedAtMs: number;
|
|
103
|
+
}
|
|
104
|
+
/** One check-in as the routes answer it. */
|
|
105
|
+
export type CheckInRow = HostCheckIn & {
|
|
106
|
+
id: string;
|
|
107
|
+
};
|
|
108
|
+
/** A customer with something due on a day, as the search lists them. */
|
|
109
|
+
export interface CheckInCustomer {
|
|
110
|
+
customerKey: string;
|
|
111
|
+
name: string | null;
|
|
112
|
+
email: string | null;
|
|
113
|
+
phone: string | null;
|
|
114
|
+
contactId: string | null;
|
|
115
|
+
/** Every check-in the customer has on the day. */
|
|
116
|
+
unitsDue: number;
|
|
117
|
+
unitsCheckedIn: number;
|
|
118
|
+
/** What the check-ins are for, item names once each. */
|
|
119
|
+
items: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface CheckInDayTotals {
|
|
122
|
+
/** Everyone due on the day, less the open rain checks waiting on it. */
|
|
123
|
+
expected: number;
|
|
124
|
+
checkedIn: number;
|
|
125
|
+
/** Passes on the day with an open rain check: not expected until used. */
|
|
126
|
+
rainChecks: number;
|
|
127
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 CHECK-IN RECORD (AGL-4043): what `/api/commerce/pos-check-in` stores
|
|
18
|
+
* and answers, in a module with no runtime imports so the native register
|
|
19
|
+
* reads the same shapes (`tools/scripts/native-contracts.json`). The rules
|
|
20
|
+
* over them live in `commerce-check-in.ts`, which re-exports all of this.
|
|
21
|
+
*=========================================*/ export const POS_CHECK_IN_ROUTE = '/api/commerce/pos-check-in';
|
|
22
|
+
/** The most check-ins one tap records. */ export const CHECK_IN_BATCH_MAX = 50;
|
|
23
|
+
/** A wristband's number or color, at most this many characters. */ export const CHECK_IN_WRISTBAND_MAX = 24;
|
|
24
|
+
/** Colors offered as quick picks for a wristband. Any word is accepted. */ export const CHECK_IN_WRISTBAND_COLORS = [
|
|
25
|
+
'Red',
|
|
26
|
+
'Orange',
|
|
27
|
+
'Yellow',
|
|
28
|
+
'Green',
|
|
29
|
+
'Blue',
|
|
30
|
+
'Purple',
|
|
31
|
+
'Pink',
|
|
32
|
+
'White',
|
|
33
|
+
'Black'
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=commerce-check-in-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-check-in-record.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 type { OrderChannel } from './commerce-orders'\n\n/*==========================================\n * THE CHECK-IN RECORD (AGL-4043): what `/api/commerce/pos-check-in` stores\n * and answers, in a module with no runtime imports so the native register\n * reads the same shapes (`tools/scripts/native-contracts.json`). The rules\n * over them live in `commerce-check-in.ts`, which re-exports all of this.\n *=========================================*/\n\nexport const POS_CHECK_IN_ROUTE = '/api/commerce/pos-check-in'\n\n/** The most check-ins one tap records. */\nexport const CHECK_IN_BATCH_MAX = 50\n\n/** A wristband's number or color, at most this many characters. */\nexport const CHECK_IN_WRISTBAND_MAX = 24\n\n/** Colors offered as quick picks for a wristband. Any word is accepted. */\nexport const CHECK_IN_WRISTBAND_COLORS: readonly string[] = [\n 'Red',\n 'Orange',\n 'Yellow',\n 'Green',\n 'Blue',\n 'Purple',\n 'Pink',\n 'White',\n 'Black',\n]\n\nexport type CheckInStatus = 'expected' | 'checked_in'\n\nexport interface CheckInWristband {\n number: string | null\n color: string | null\n}\n\n/**\n * A rain check on one person's pass: who gave it, when, and the day it was\n * due before. `open` waits to be claimed on any later day; `date` moved it\n * to `toDayKey`.\n */\nexport interface CheckInRainCheck {\n kind: 'open' | 'date'\n /** The day the pass was due on before this rain check. */\n fromDayKey: string\n /** The day it was moved to; null while open. */\n toDayKey: string | null\n /** The day an open rain check was used, once it is checked in. */\n claimedDayKey: string | null\n byUid: string\n byName: string | null\n atMs: number\n}\n\n/** `hosts/{hostId}/checkIns/{id}`: one person due on one day. Server-written only. */\nexport interface HostCheckIn {\n source: 'order' | 'reservation'\n orderId: string | null\n /** The order's number as the console shows it (`#1042`), or null for a stay. */\n orderLabel: string | null\n /** Where the order was sold, or `reservation`. */\n channel: OrderChannel | 'reservation'\n reservationId: string | null\n lineIndex: number | null\n /** This person's place among the line's or stay's check-ins, from 0. */\n unitIndex: number\n /** How many check-ins the line or stay makes that day. */\n unitCount: number\n productId: string | null\n variantId: string | null\n itemName: string\n variantLabel: string | null\n /** The day, `YYYY-MM-DD` in the site's time zone. */\n dayKey: string\n /** Who the check-in is for, as one key: the address, else the contact, else the name, else the order. */\n customerKey: string\n customerName: string | null\n customerEmail: string | null\n customerEmailLower: string | null\n customerPhone: string | null\n /** The contact the register attached to the sale, when it was one. */\n contactId: string | null\n /** The name's, the address's, the phone's and the order number's search prefixes. */\n searchTokens: string[]\n status: CheckInStatus\n checkedInAtMs: number | null\n checkedInBy: string | null\n checkedInByName: string | null\n wristband: CheckInWristband | null\n /** The attempt that checked this person in, so a retried tap is not \"already checked in\". */\n checkInAttempt: string | null\n /** The last undo, kept so a reversed check-in still says who reversed it. */\n undoneAtMs: number | null\n undoneBy: string | null\n /**\n * A rain check on this pass, or null. Absent on a check-in written before\n * rain checks existed, which reads as null.\n */\n rainCheck?: CheckInRainCheck | null\n /**\n * True while an open rain check waits to be used: what a later day's\n * search and customer lookup ask (`rainCheckOpen == true`, `dayKey <` the\n * day). Absent reads as false.\n */\n rainCheckOpen?: boolean\n /** The last rain check taken back: when and by whom. */\n rainCheckUndoneAtMs?: number | null\n rainCheckUndoneBy?: string | null\n createdAtMs: number\n updatedAtMs: number\n}\n\n/** One check-in as the routes answer it. */\nexport type CheckInRow = HostCheckIn & { id: string }\n\n/** A customer with something due on a day, as the search lists them. */\nexport interface CheckInCustomer {\n customerKey: string\n name: string | null\n email: string | null\n phone: string | null\n contactId: string | null\n /** Every check-in the customer has on the day. */\n unitsDue: number\n unitsCheckedIn: number\n /** What the check-ins are for, item names once each. */\n items: string[]\n}\n\nexport interface CheckInDayTotals {\n /** Everyone due on the day, less the open rain checks waiting on it. */\n expected: number\n checkedIn: number\n /** Passes on the day with an open rain check: not expected until used. */\n rainChecks: number\n}\n"],"names":["POS_CHECK_IN_ROUTE","CHECK_IN_BATCH_MAX","CHECK_IN_WRISTBAND_MAX","CHECK_IN_WRISTBAND_COLORS"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;2CAK2C,GAE3C,OAAO,MAAMA,qBAAqB,6BAA4B;AAE9D,wCAAwC,GACxC,OAAO,MAAMC,qBAAqB,GAAE;AAEpC,iEAAiE,GACjE,OAAO,MAAMC,yBAAyB,GAAE;AAExC,yEAAyE,GACzE,OAAO,MAAMC,4BAA+C;IAC1D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ProductVariant } from './commerce';
|
|
2
|
-
import { type HostOrder
|
|
3
|
-
import type
|
|
4
|
-
export {
|
|
5
|
-
|
|
2
|
+
import { type HostOrder } from './commerce-orders';
|
|
3
|
+
import { type HostReservation } from './commerce-reservations';
|
|
4
|
+
export { CHECK_IN_BATCH_MAX, CHECK_IN_WRISTBAND_COLORS, CHECK_IN_WRISTBAND_MAX, POS_CHECK_IN_ROUTE, type CheckInCustomer, type CheckInDayTotals, type CheckInRainCheck, type CheckInRow, type CheckInStatus, type CheckInWristband, type HostCheckIn, } from './commerce-check-in-record';
|
|
5
|
+
import { type CheckInCustomer, type CheckInDayTotals, type CheckInRow, type CheckInStatus, type CheckInWristband, type HostCheckIn } from './commerce-check-in-record';
|
|
6
|
+
export { addCheckInDays, checkInDayLabel, CHECK_IN_MAX_HEADCOUNT, CHECK_IN_USE_DAY_MAX_AHEAD_DAYS, checkInUseDayProblem, isCheckInDayKey, normalizeProductCheckIn, productCheckInProblem, type ProductCheckIn, } from './commerce-check-in-product';
|
|
6
7
|
/** The most check-ins one order line makes, whatever its quantity. */
|
|
7
8
|
export declare const CHECK_IN_MAX_UNITS_PER_LINE = 200;
|
|
8
9
|
/** The most check-ins, orders or stays one day reads. */
|
|
@@ -11,81 +12,10 @@ export declare const CHECK_IN_DAY_CEILING = 3000;
|
|
|
11
12
|
export declare const CHECK_IN_SEARCH_ROWS = 100;
|
|
12
13
|
/** The most customers one search answers. */
|
|
13
14
|
export declare const CHECK_IN_SEARCH_CUSTOMERS = 20;
|
|
14
|
-
/** The most check-ins one tap records. */
|
|
15
|
-
export declare const CHECK_IN_BATCH_MAX = 50;
|
|
16
|
-
/** A wristband's number or color, at most this many characters. */
|
|
17
|
-
export declare const CHECK_IN_WRISTBAND_MAX = 24;
|
|
18
|
-
/** Colors offered as quick picks for a wristband. Any word is accepted. */
|
|
19
|
-
export declare const CHECK_IN_WRISTBAND_COLORS: readonly ["Red", "Orange", "Yellow", "Green", "Blue", "Purple", "Pink", "White", "Black"];
|
|
20
15
|
/** The order statuses whose check-in lines are due. */
|
|
21
16
|
export declare const CHECK_IN_ORDER_STATUSES: readonly ["paid", "partially_fulfilled", "fulfilled", "delivered"];
|
|
22
17
|
/** The stay statuses whose days are due. */
|
|
23
18
|
export declare const CHECK_IN_RESERVATION_STATUSES: readonly ["confirmed", "checked_in"];
|
|
24
|
-
export type CheckInStatus = 'expected' | 'checked_in';
|
|
25
|
-
export interface CheckInWristband {
|
|
26
|
-
number: string | null;
|
|
27
|
-
color: string | null;
|
|
28
|
-
}
|
|
29
|
-
/** `hosts/{hostId}/checkIns/{id}`: one person due on one day. Server-written only. */
|
|
30
|
-
export interface HostCheckIn {
|
|
31
|
-
source: 'order' | 'reservation';
|
|
32
|
-
orderId: string | null;
|
|
33
|
-
/** The order's number as the console shows it (`#1042`), or null for a stay. */
|
|
34
|
-
orderLabel: string | null;
|
|
35
|
-
/** Where the order was sold, or `reservation`. */
|
|
36
|
-
channel: OrderChannel | 'reservation';
|
|
37
|
-
reservationId: string | null;
|
|
38
|
-
lineIndex: number | null;
|
|
39
|
-
/** This person's place among the line's or stay's check-ins, from 0. */
|
|
40
|
-
unitIndex: number;
|
|
41
|
-
/** How many check-ins the line or stay makes that day. */
|
|
42
|
-
unitCount: number;
|
|
43
|
-
productId: string | null;
|
|
44
|
-
variantId: string | null;
|
|
45
|
-
itemName: string;
|
|
46
|
-
variantLabel: string | null;
|
|
47
|
-
/** The day, `YYYY-MM-DD` in the site's time zone. */
|
|
48
|
-
dayKey: string;
|
|
49
|
-
/** Who the check-in is for, as one key: the address, else the contact, else the name, else the order. */
|
|
50
|
-
customerKey: string;
|
|
51
|
-
customerName: string | null;
|
|
52
|
-
customerEmail: string | null;
|
|
53
|
-
customerEmailLower: string | null;
|
|
54
|
-
customerPhone: string | null;
|
|
55
|
-
/** The contact the register attached to the sale, when it was one. */
|
|
56
|
-
contactId: string | null;
|
|
57
|
-
/** The name's, the address's, the phone's and the order number's search prefixes. */
|
|
58
|
-
searchTokens: string[];
|
|
59
|
-
status: CheckInStatus;
|
|
60
|
-
checkedInAtMs: number | null;
|
|
61
|
-
checkedInBy: string | null;
|
|
62
|
-
checkedInByName: string | null;
|
|
63
|
-
wristband: CheckInWristband | null;
|
|
64
|
-
/** The attempt that checked this person in, so a retried tap is not "already checked in". */
|
|
65
|
-
checkInAttempt: string | null;
|
|
66
|
-
/** The last undo, kept so a reversed check-in still says who reversed it. */
|
|
67
|
-
undoneAtMs: number | null;
|
|
68
|
-
undoneBy: string | null;
|
|
69
|
-
createdAtMs: number;
|
|
70
|
-
updatedAtMs: number;
|
|
71
|
-
}
|
|
72
|
-
/** One check-in as the routes answer it. */
|
|
73
|
-
export type CheckInRow = HostCheckIn & {
|
|
74
|
-
id: string;
|
|
75
|
-
};
|
|
76
|
-
/** A customer with something due on a day, as the search lists them. */
|
|
77
|
-
export interface CheckInCustomer {
|
|
78
|
-
customerKey: string;
|
|
79
|
-
name: string | null;
|
|
80
|
-
email: string | null;
|
|
81
|
-
phone: string | null;
|
|
82
|
-
contactId: string | null;
|
|
83
|
-
/** Every check-in the customer has on the day. */
|
|
84
|
-
unitsDue: number;
|
|
85
|
-
unitsCheckedIn: number;
|
|
86
|
-
/** What the check-ins are for, item names once each. */
|
|
87
|
-
items: string[];
|
|
88
|
-
}
|
|
89
19
|
/**
|
|
90
20
|
* Whether one variant of a product needs check-in, and for how many people
|
|
91
21
|
* per item: the variant's own setting, else the product's; `null` when not.
|
|
@@ -97,7 +27,10 @@ export declare function productCheckInFor(product: {
|
|
|
97
27
|
}>;
|
|
98
28
|
} | null | undefined, variantId: string | null | undefined): {
|
|
99
29
|
headcount: number;
|
|
30
|
+
askUseDate: boolean;
|
|
100
31
|
} | null;
|
|
32
|
+
/** Whether a product's variant asks the buyer which day they will use it. */
|
|
33
|
+
export declare function productAsksUseDate(product: Parameters<typeof productCheckInFor>[0], variantId: string | null | undefined): boolean;
|
|
101
34
|
/** Whether any variant of a product needs check-in. */
|
|
102
35
|
export declare function productNeedsCheckIn(product: Parameters<typeof productCheckInFor>[0]): boolean;
|
|
103
36
|
/** The digits of a phone number, without a leading US/Canada 1 when it has eleven. */
|
|
@@ -127,29 +60,86 @@ export declare function orderCheckInId(orderId: string, lineIndex: number, unitI
|
|
|
127
60
|
export declare function reservationCheckInId(reservationId: string, dayKey: string, unitIndex?: number): string;
|
|
128
61
|
/** A due check-in before the server stamps its times and status. */
|
|
129
62
|
export type DueCheckIn = Omit<HostCheckIn, 'status' | 'checkedInAtMs' | 'checkedInBy' | 'checkedInByName' | 'wristband' | 'checkInAttempt' | 'undoneAtMs' | 'undoneBy' | 'createdAtMs' | 'updatedAtMs'>;
|
|
130
|
-
/**
|
|
131
|
-
|
|
63
|
+
/**
|
|
64
|
+
* The fields a due check-in copies from its source, which a later read may
|
|
65
|
+
* refresh: the customer's, and how many check-ins its line or stay makes that
|
|
66
|
+
* day (a stay checked in per guest changes it when its guests or the store's
|
|
67
|
+
* control change).
|
|
68
|
+
*/
|
|
69
|
+
export declare const CHECK_IN_CUSTOMER_FIELDS: readonly ["unitCount", "customerKey", "customerName", "customerEmail", "customerEmailLower", "customerPhone", "contactId", "searchTokens"];
|
|
132
70
|
/** Whether an order's lines are due at all. */
|
|
133
71
|
export declare function orderIsDueForCheckIn(order: Pick<HostOrder, 'status'> | null | undefined): boolean;
|
|
134
72
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* the
|
|
73
|
+
* Every check-in an order makes, keyed by document id, each on its own day:
|
|
74
|
+
* the day the buyer chose for its line (`useDayKey`), else `purchaseDayKey`,
|
|
75
|
+
* the day the order was placed on the site's calendar. A caller working one
|
|
76
|
+
* day keeps the entries whose `dayKey` is that day; the rest are still owed,
|
|
77
|
+
* on theirs. `products` holds the products its lines name, as stored now:
|
|
78
|
+
* the setting is read at the window, so turning it on covers passes already
|
|
79
|
+
* sold today.
|
|
138
80
|
*/
|
|
139
81
|
export declare function dueCheckInsForOrder(input: {
|
|
140
82
|
orderId: string;
|
|
141
83
|
order: Partial<HostOrder>;
|
|
142
84
|
products: ReadonlyMap<string, Parameters<typeof productCheckInFor>[0]>;
|
|
143
|
-
|
|
85
|
+
purchaseDayKey: string;
|
|
144
86
|
}): Map<string, DueCheckIn>;
|
|
145
87
|
/** UTC midnight of a `YYYY-MM-DD` day, as a stay's days are stored. */
|
|
146
88
|
export declare function checkInDayMs(dayKey: string): number | null;
|
|
147
|
-
/**
|
|
89
|
+
/** Where the store's stay check-in control lives (AGL-4043): `hosts/{hostId}/settings/checkIn.stays`. */
|
|
90
|
+
export declare const STAY_CHECK_IN_SETTINGS_DOC = "checkIn";
|
|
91
|
+
/** One stay's stored check-in on one day, as far as how many it needs goes. */
|
|
92
|
+
export interface StayCheckInSlot {
|
|
93
|
+
id: string;
|
|
94
|
+
status: CheckInStatus;
|
|
95
|
+
unitIndex: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Which check-ins one stay keeps on one day when it needs `unitCount` of
|
|
99
|
+
* them (AGL-4043): when staff change a stay's guests, or the store switches
|
|
100
|
+
* between one check-in per stay and one per guest.
|
|
101
|
+
*
|
|
102
|
+
* A guest already checked in is never dropped, whatever their place: staff
|
|
103
|
+
* check a family in in any order, so the third guest may be in while the
|
|
104
|
+
* first is still on the way. The waiting ones fill what is left, lowest place
|
|
105
|
+
* first, and the rest are dropped; new places are the lowest free ones.
|
|
106
|
+
* `checkedIn` above `unitCount` is a count that cannot be honored without
|
|
107
|
+
* taking back a check-in: the guests route refuses it, and a reconcile keeps
|
|
108
|
+
* every checked-in guest and drops every waiting one.
|
|
109
|
+
*/
|
|
110
|
+
export declare function stayCheckInPlan(input: {
|
|
111
|
+
unitCount: number;
|
|
112
|
+
existing: ReadonlyArray<StayCheckInSlot>;
|
|
113
|
+
}): {
|
|
114
|
+
/** Every place the stay is due under that day: the checked-in, the waiting kept, the new. */
|
|
115
|
+
unitIndexes: number[];
|
|
116
|
+
/** New places to write. */
|
|
117
|
+
create: number[];
|
|
118
|
+
/** Waiting check-ins it no longer needs. */
|
|
119
|
+
drop: string[];
|
|
120
|
+
/** How many of its guests are checked in that day. */
|
|
121
|
+
checkedIn: number;
|
|
122
|
+
};
|
|
123
|
+
/** Stored check-ins of stays grouped by stay, as {@link stayCheckInPlan} reads them. */
|
|
124
|
+
export declare function storedStayCheckIns(docs: ReadonlyArray<{
|
|
125
|
+
id: string;
|
|
126
|
+
get(field: string): unknown;
|
|
127
|
+
}>): Map<string, StayCheckInSlot[]>;
|
|
128
|
+
/**
|
|
129
|
+
* The check-ins a stay makes on a day it covers; empty on any other day. One
|
|
130
|
+
* per stay, or with `perGuest` one per guest (`guests`, at least one), each
|
|
131
|
+
* with its own wristband: the resource's setting under the store's control
|
|
132
|
+
* (`stayChecksInPerGuest`). Given the stay's check-ins already stored that
|
|
133
|
+
* day (`existing`), its places follow {@link stayCheckInPlan}, so a guest
|
|
134
|
+
* checked in is kept and a waiting one beyond the count is not due.
|
|
135
|
+
*/
|
|
148
136
|
export declare function dueCheckInsForReservation(input: {
|
|
149
137
|
reservationId: string;
|
|
150
138
|
reservation: Partial<HostReservation>;
|
|
151
139
|
resourceName: string | null;
|
|
152
140
|
dayKey: string;
|
|
141
|
+
perGuest?: boolean;
|
|
142
|
+
existing?: ReadonlyArray<StayCheckInSlot>;
|
|
153
143
|
}): Map<string, DueCheckIn>;
|
|
154
144
|
/** A due check-in as first written. */
|
|
155
145
|
export declare function newCheckInDocument(due: DueCheckIn, nowMs: number): HostCheckIn;
|
|
@@ -172,11 +162,25 @@ export declare function describeWristband(wristband: CheckInWristband | null | u
|
|
|
172
162
|
export declare function checkInCustomers(rows: ReadonlyArray<CheckInRow>): CheckInCustomer[];
|
|
173
163
|
/** A day's check-ins in the order the window reads them: by name, then item, then unit. */
|
|
174
164
|
export declare function sortCheckInRows<T extends Pick<CheckInRow, 'customerName' | 'customerEmail' | 'itemName' | 'unitIndex' | 'id'>>(rows: ReadonlyArray<T>): T[];
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
165
|
+
/** Whether a check-in waits on an open rain check (not yet used). */
|
|
166
|
+
export declare function checkInRainCheckIsOpen(row: Pick<HostCheckIn, 'status' | 'rainCheckOpen'>): boolean;
|
|
167
|
+
export declare function checkInDayTotals(rows: ReadonlyArray<Pick<CheckInRow, 'status' | 'rainCheckOpen'>>): CheckInDayTotals;
|
|
168
|
+
/**
|
|
169
|
+
* Why a pass cannot be rain-checked as asked, or null. Only a pass bought as
|
|
170
|
+
* an order line (a stay's dates change on the Reservations card), only while
|
|
171
|
+
* nobody has used it, and a dated one only to a day after the one it is on
|
|
172
|
+
* that has not passed (`todayKey` on the store's calendar).
|
|
173
|
+
*/
|
|
174
|
+
export declare function rainCheckProblem(row: Pick<HostCheckIn, 'source' | 'status' | 'dayKey'>, ask: {
|
|
175
|
+
kind: 'open' | 'date';
|
|
176
|
+
dayKey?: string | null;
|
|
177
|
+
}, todayKey: string): string | null;
|
|
178
|
+
/** What the window says about a pass's rain check: "Rain check from Sat, Oct 25". */
|
|
179
|
+
export declare function rainCheckLabel(row: Pick<HostCheckIn, 'rainCheck' | 'rainCheckOpen' | 'status'>): string;
|
|
180
|
+
/** The check-in's status in words: "Checked in", "Expected" or "Rain check". */
|
|
181
|
+
export declare function checkInStatusLabel(row: Pick<HostCheckIn, 'status' | 'rainCheckOpen'>): string;
|
|
182
|
+
/** The day after `dayKey`: the first day an open rain check is good on. */
|
|
183
|
+
export declare function checkInNextDay(dayKey: string): string;
|
|
180
184
|
/** A time on the site's clock: "9:14 AM". */
|
|
181
185
|
export declare function checkInTimeLabel(ms: number | null | undefined, timeZone: string): string;
|
|
182
186
|
/** "Already checked in at 9:14 AM by Sam". */
|