@aglyn/plugins-commerce 1.0.0-beta.230 → 1.0.0-beta.232
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/package.json +13 -13
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/lib/barcode/barcode-decode.d.ts +71 -0
- package/src/lib/barcode/barcode-decode.js +498 -0
- package/src/lib/barcode/barcode-decode.js.map +1 -0
- package/src/lib/barcode/barcode-encode.d.ts +44 -0
- package/src/lib/barcode/barcode-encode.js +138 -0
- package/src/lib/barcode/barcode-encode.js.map +1 -0
- package/src/lib/barcode/barcode-scanner.component.d.ts +23 -0
- package/src/lib/barcode/barcode-scanner.component.js +260 -0
- package/src/lib/barcode/barcode-scanner.component.js.map +1 -0
- package/src/lib/barcode/scan-button.component.d.ts +10 -0
- package/src/lib/barcode/scan-button.component.js +62 -0
- package/src/lib/barcode/scan-button.component.js.map +1 -0
- package/src/lib/barcode/scanner-wedge.d.ts +35 -0
- package/src/lib/barcode/scanner-wedge.js +108 -0
- package/src/lib/barcode/scanner-wedge.js.map +1 -0
- package/src/lib/components/account.js +10 -1
- package/src/lib/components/account.js.map +1 -1
- package/src/lib/components/cart-extras.d.ts +45 -0
- package/src/lib/components/cart-extras.js +127 -0
- package/src/lib/components/cart-extras.js.map +1 -0
- package/src/lib/components/cart.js +82 -15
- package/src/lib/components/cart.js.map +1 -1
- package/src/lib/components/checkout-return-notice.d.ts +26 -0
- package/src/lib/components/checkout-return-notice.js +48 -0
- package/src/lib/components/checkout-return-notice.js.map +1 -0
- package/src/lib/components/commerce-console-page.js +124 -0
- package/src/lib/components/commerce-console-page.js.map +1 -1
- package/src/lib/components/commerce-console-sections.d.ts +1 -1
- package/src/lib/components/commerce-console-sections.js +4 -0
- package/src/lib/components/commerce-console-sections.js.map +1 -1
- package/src/lib/components/console/bulk-fulfill.d.ts +44 -0
- package/src/lib/components/console/bulk-fulfill.js +84 -0
- package/src/lib/components/console/bulk-fulfill.js.map +1 -0
- package/src/lib/components/console/catalog-organization-card.component.js +1 -0
- package/src/lib/components/console/catalog-organization-card.component.js.map +1 -1
- package/src/lib/components/console/customer-notifications-card.component.d.ts +19 -0
- package/src/lib/components/console/customer-notifications-card.component.js +149 -0
- package/src/lib/components/console/customer-notifications-card.component.js.map +1 -0
- package/src/lib/components/console/host-orders-card.component.js +88 -6
- package/src/lib/components/console/host-orders-card.component.js.map +1 -1
- package/src/lib/components/console/locations-card.component.js +164 -57
- package/src/lib/components/console/locations-card.component.js.map +1 -1
- package/src/lib/components/console/order-detail-dialog.component.js +209 -61
- package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
- package/src/lib/components/console/order-fulfillment-panel.component.d.ts +48 -0
- package/src/lib/components/console/order-fulfillment-panel.component.js +542 -0
- package/src/lib/components/console/order-fulfillment-panel.component.js.map +1 -0
- package/src/lib/components/console/order-invoice.component.d.ts +33 -0
- package/src/lib/components/console/order-invoice.component.js +81 -0
- package/src/lib/components/console/order-invoice.component.js.map +1 -0
- package/src/lib/components/console/order-receipt-resend.component.d.ts +21 -0
- package/src/lib/components/console/order-receipt-resend.component.js +203 -0
- package/src/lib/components/console/order-receipt-resend.component.js.map +1 -0
- package/src/lib/components/console/order-returns.component.d.ts +36 -0
- package/src/lib/components/console/order-returns.component.js +142 -0
- package/src/lib/components/console/order-returns.component.js.map +1 -0
- package/src/lib/components/console/order-shipping-actions.component.d.ts +54 -0
- package/src/lib/components/console/order-shipping-actions.component.js +149 -0
- package/src/lib/components/console/order-shipping-actions.component.js.map +1 -0
- package/src/lib/components/console/order-webhooks-card.component.d.ts +50 -0
- package/src/lib/components/console/order-webhooks-card.component.js +623 -0
- package/src/lib/components/console/order-webhooks-card.component.js.map +1 -0
- package/src/lib/components/console/order-zones.d.ts +155 -0
- package/src/lib/components/console/order-zones.js +40 -0
- package/src/lib/components/console/order-zones.js.map +1 -0
- package/src/lib/components/console/payment-methods-card.component.d.ts +67 -0
- package/src/lib/components/console/payment-methods-card.component.js +395 -0
- package/src/lib/components/console/payment-methods-card.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-api.d.ts +124 -0
- package/src/lib/components/console/pos/pos-api.js +101 -0
- package/src/lib/components/console/pos/pos-api.js.map +1 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +36 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.js +160 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.d.ts +39 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.js +352 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-product-grid.component.d.ts +47 -0
- package/src/lib/components/console/pos/pos-product-grid.component.js +272 -0
- package/src/lib/components/console/pos/pos-product-grid.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.d.ts +27 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.js +282 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.d.ts +53 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js +445 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.d.ts +31 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.js +640 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/use-pos-display.d.ts +43 -0
- package/src/lib/components/console/pos/use-pos-display.js +161 -0
- package/src/lib/components/console/pos/use-pos-display.js.map +1 -0
- package/src/lib/components/console/pos-devices-card.component.d.ts +14 -0
- package/src/lib/components/console/pos-devices-card.component.js +546 -0
- package/src/lib/components/console/pos-devices-card.component.js.map +1 -0
- package/src/lib/components/console/pos-display/brand-screen.d.ts +33 -0
- package/src/lib/components/console/pos-display/brand-screen.js +85 -0
- package/src/lib/components/console/pos-display/brand-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/cart-screen.d.ts +29 -0
- package/src/lib/components/console/pos-display/cart-screen.js +166 -0
- package/src/lib/components/console/pos-display/cart-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/pairing-screen.d.ts +24 -0
- package/src/lib/components/console/pos-display/pairing-screen.js +127 -0
- package/src/lib/components/console/pos-display/pairing-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/pos-display-api.d.ts +90 -0
- package/src/lib/components/console/pos-display/pos-display-api.js +140 -0
- package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -0
- package/src/lib/components/console/pos-display/receipt-screen.d.ts +35 -0
- package/src/lib/components/console/pos-display/receipt-screen.js +200 -0
- package/src/lib/components/console/pos-display/receipt-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/tip-screen.d.ts +36 -0
- package/src/lib/components/console/pos-display/tip-screen.js +211 -0
- package/src/lib/components/console/pos-display/tip-screen.js.map +1 -0
- package/src/lib/components/console/pos-display-page.component.d.ts +16 -0
- package/src/lib/components/console/pos-display-page.component.js +407 -0
- package/src/lib/components/console/pos-display-page.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.d.ts +40 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js +289 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.d.ts +34 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.js +61 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +38 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +129 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.d.ts +37 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.js +60 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.d.ts +48 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.js +220 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.d.ts +63 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js +186 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-receipt.d.ts +39 -0
- package/src/lib/components/console/pos-ops/pos-receipt.js +182 -0
- package/src/lib/components/console/pos-ops/pos-receipt.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.d.ts +40 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.js +465 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.d.ts +29 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js +253 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +34 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +494 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.d.ts +37 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.js +102 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.d.ts +30 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js +277 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/register-ops.d.ts +28 -0
- package/src/lib/components/console/pos-ops/register-ops.js +28 -0
- package/src/lib/components/console/pos-ops/register-ops.js.map +1 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.d.ts +46 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.js +128 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.js.map +1 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.d.ts +36 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js +64 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js.map +1 -0
- package/src/lib/components/console/pos-page.component.d.ts +13 -5
- package/src/lib/components/console/pos-page.component.js +756 -654
- package/src/lib/components/console/pos-page.component.js.map +1 -1
- package/src/lib/components/console/pos-zones.d.ts +23 -0
- package/src/lib/components/console/pos-zones.js +31 -0
- package/src/lib/components/console/pos-zones.js.map +1 -0
- package/src/lib/components/console/product-editor-dialog.component.js +61 -71
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
- package/src/lib/components/console/product-labels-dialog.component.d.ts +13 -0
- package/src/lib/components/console/product-labels-dialog.component.js +197 -0
- package/src/lib/components/console/product-labels-dialog.component.js.map +1 -0
- package/src/lib/components/console/product-register-fields.component.d.ts +19 -0
- package/src/lib/components/console/product-register-fields.component.js +241 -0
- package/src/lib/components/console/product-register-fields.component.js.map +1 -0
- package/src/lib/components/console/product-zones.d.ts +44 -0
- package/src/lib/components/console/product-zones.js.map +1 -1
- package/src/lib/components/console/products-hub-card.component.js +23 -20
- package/src/lib/components/console/products-hub-card.component.js.map +1 -1
- package/src/lib/components/console/register-hardware-card.component.d.ts +33 -0
- package/src/lib/components/console/register-hardware-card.component.js +826 -0
- package/src/lib/components/console/register-hardware-card.component.js.map +1 -0
- package/src/lib/components/console/registers-card.component.js +24 -5
- package/src/lib/components/console/registers-card.component.js.map +1 -1
- package/src/lib/components/console/return-actions.d.ts +38 -0
- package/src/lib/components/console/return-actions.js +76 -0
- package/src/lib/components/console/return-actions.js.map +1 -0
- package/src/lib/components/console/return-detail-dialog.component.d.ts +34 -0
- package/src/lib/components/console/return-detail-dialog.component.js +718 -0
- package/src/lib/components/console/return-detail-dialog.component.js.map +1 -0
- package/src/lib/components/console/return-settings-card.component.d.ts +34 -0
- package/src/lib/components/console/return-settings-card.component.js +195 -0
- package/src/lib/components/console/return-settings-card.component.js.map +1 -0
- package/src/lib/components/console/return-zones.d.ts +87 -0
- package/src/lib/components/console/return-zones.js +31 -0
- package/src/lib/components/console/return-zones.js.map +1 -0
- package/src/lib/components/console/returns-card.component.d.ts +45 -0
- package/src/lib/components/console/returns-card.component.js +159 -0
- package/src/lib/components/console/returns-card.component.js.map +1 -0
- package/src/lib/components/console/shipping-settings-card.component.js +161 -5
- package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
- package/src/lib/components/console/shippingeasy-card.component.d.ts +59 -0
- package/src/lib/components/console/shippingeasy-card.component.js +378 -0
- package/src/lib/components/console/shippingeasy-card.component.js.map +1 -0
- package/src/lib/components/console/shipstation-card.component.d.ts +35 -0
- package/src/lib/components/console/shipstation-card.component.js +345 -0
- package/src/lib/components/console/shipstation-card.component.js.map +1 -0
- package/src/lib/components/console/start-return-dialog.component.d.ts +40 -0
- package/src/lib/components/console/start-return-dialog.component.js +243 -0
- package/src/lib/components/console/start-return-dialog.component.js.map +1 -0
- package/src/lib/components/console/stock-movements-card.component.js +2 -1
- package/src/lib/components/console/stock-movements-card.component.js.map +1 -1
- package/src/lib/components/console/store-settings-card.component.js +2 -66
- package/src/lib/components/console/store-settings-card.component.js.map +1 -1
- package/src/lib/components/console/store-zones.d.ts +42 -0
- package/src/lib/components/console/store-zones.js +39 -0
- package/src/lib/components/console/store-zones.js.map +1 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js +1 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -1
- package/src/lib/components/order-status.d.ts +36 -0
- package/src/lib/components/order-status.js +502 -0
- package/src/lib/components/order-status.js.map +1 -0
- package/src/lib/components/product-detail.js +41 -2
- package/src/lib/components/product-detail.js.map +1 -1
- package/src/lib/components/return-request.d.ts +32 -0
- package/src/lib/components/return-request.js +576 -0
- package/src/lib/components/return-request.js.map +1 -0
- package/src/lib/components/storefront-payment-appearance.d.ts +32 -0
- package/src/lib/components/storefront-payment-appearance.js +114 -0
- package/src/lib/components/storefront-payment-appearance.js.map +1 -0
- package/src/lib/components/storefront-payment-element.d.ts +57 -1
- package/src/lib/components/storefront-payment-element.js +332 -33
- package/src/lib/components/storefront-payment-element.js.map +1 -1
- package/src/lib/constants/order-status.d.ts +22 -0
- package/src/lib/constants/order-status.js +22 -0
- package/src/lib/constants/order-status.js.map +1 -0
- package/src/lib/constants/return-request.d.ts +27 -0
- package/src/lib/constants/return-request.js +32 -0
- package/src/lib/constants/return-request.js.map +1 -0
- package/src/lib/constants/stock-movement-query.js +2 -1
- package/src/lib/constants/stock-movement-query.js.map +1 -1
- package/src/lib/declarations.console-server.js +9 -0
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/declarations.server.d.ts +2 -1
- package/src/lib/declarations.server.js +68 -1
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/buyer-notifications.d.ts +59 -0
- package/src/lib/model/buyer-notifications.js +97 -0
- package/src/lib/model/buyer-notifications.js.map +1 -0
- package/src/lib/model/commerce-orders.d.ts +171 -2
- package/src/lib/model/commerce-orders.js +26 -16
- package/src/lib/model/commerce-orders.js.map +1 -1
- package/src/lib/model/commerce-payment-methods.d.ts +146 -0
- package/src/lib/model/commerce-payment-methods.js +247 -0
- package/src/lib/model/commerce-payment-methods.js.map +1 -0
- package/src/lib/model/commerce-pos-ops.d.ts +437 -0
- package/src/lib/model/commerce-pos-ops.js +721 -0
- package/src/lib/model/commerce-pos-ops.js.map +1 -0
- package/src/lib/model/commerce-pos.d.ts +263 -0
- package/src/lib/model/commerce-pos.js +375 -0
- package/src/lib/model/commerce-pos.js.map +1 -0
- package/src/lib/model/commerce-printers.d.ts +211 -0
- package/src/lib/model/commerce-printers.js +181 -0
- package/src/lib/model/commerce-printers.js.map +1 -0
- package/src/lib/model/commerce-receipt.d.ts +97 -0
- package/src/lib/model/commerce-receipt.js +180 -0
- package/src/lib/model/commerce-receipt.js.map +1 -0
- package/src/lib/model/commerce-returns.d.ts +207 -0
- package/src/lib/model/commerce-returns.js +300 -0
- package/src/lib/model/commerce-returns.js.map +1 -0
- package/src/lib/model/commerce-shipping.d.ts +44 -1
- package/src/lib/model/commerce-shipping.js +53 -9
- package/src/lib/model/commerce-shipping.js.map +1 -1
- package/src/lib/model/commerce-tax-engine.d.ts +90 -0
- package/src/lib/model/commerce-tax-engine.js +129 -0
- package/src/lib/model/commerce-tax-engine.js.map +1 -0
- package/src/lib/model/commerce.d.ts +91 -2
- package/src/lib/model/commerce.js +89 -1
- package/src/lib/model/commerce.js.map +1 -1
- package/src/lib/model/index.d.ts +16 -0
- package/src/lib/model/index.js +16 -0
- package/src/lib/model/index.js.map +1 -1
- package/src/lib/model/order-events.d.ts +154 -0
- package/src/lib/model/order-events.js +153 -0
- package/src/lib/model/order-events.js.map +1 -0
- package/src/lib/model/order-fulfillment.d.ts +117 -0
- package/src/lib/model/order-fulfillment.js +217 -0
- package/src/lib/model/order-fulfillment.js.map +1 -0
- package/src/lib/model/order-history.d.ts +58 -0
- package/src/lib/model/order-history.js +22 -0
- package/src/lib/model/order-history.js.map +1 -0
- package/src/lib/model/order-list-fields.d.ts +9 -1
- package/src/lib/model/order-list-fields.js +7 -1
- package/src/lib/model/order-list-fields.js.map +1 -1
- package/src/lib/model/order-shipping-export.d.ts +91 -0
- package/src/lib/model/order-shipping-export.js +192 -0
- package/src/lib/model/order-shipping-export.js.map +1 -0
- package/src/lib/model/order-status-view.d.ts +103 -0
- package/src/lib/model/order-status-view.js +156 -0
- package/src/lib/model/order-status-view.js.map +1 -0
- package/src/lib/model/order-webhooks.d.ts +142 -0
- package/src/lib/model/order-webhooks.js +91 -0
- package/src/lib/model/order-webhooks.js.map +1 -0
- package/src/lib/model/product-channel.d.ts +56 -0
- package/src/lib/model/product-channel.js +86 -0
- package/src/lib/model/product-channel.js.map +1 -0
- package/src/lib/model/product-modifiers.d.ts +80 -0
- package/src/lib/model/product-modifiers.js +140 -0
- package/src/lib/model/product-modifiers.js.map +1 -0
- package/src/lib/model/product-write.d.ts +186 -0
- package/src/lib/model/product-write.js +116 -0
- package/src/lib/model/product-write.js.map +1 -0
- package/src/lib/model/shippingeasy.d.ts +94 -0
- package/src/lib/model/shippingeasy.js +267 -0
- package/src/lib/model/shippingeasy.js.map +1 -0
- package/src/lib/model/shipstation.d.ts +125 -0
- package/src/lib/model/shipstation.js +399 -0
- package/src/lib/model/shipstation.js.map +1 -0
- package/src/lib/model/smart-collection-reads.d.ts +32 -0
- package/src/lib/model/smart-collection-reads.js +63 -0
- package/src/lib/model/smart-collection-reads.js.map +1 -0
- package/src/lib/model/tracking-url.d.ts +74 -0
- package/src/lib/model/tracking-url.js +159 -0
- package/src/lib/model/tracking-url.js.map +1 -0
- package/src/lib/plugin-config.d.ts +13 -0
- package/src/lib/plugin-config.js +77 -5
- package/src/lib/plugin-config.js.map +1 -1
- package/src/lib/plugin.js +26 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/pos-ops-config.d.ts +39 -0
- package/src/lib/pos-ops-config.js +88 -0
- package/src/lib/pos-ops-config.js.map +1 -0
- package/src/lib/printing/print-document.d.ts +106 -0
- package/src/lib/printing/print-document.js +464 -0
- package/src/lib/printing/print-document.js.map +1 -0
- package/src/lib/printing/product-labels.d.ts +58 -0
- package/src/lib/printing/product-labels.js +116 -0
- package/src/lib/printing/product-labels.js.map +1 -0
- package/src/lib/printing/render-epson.d.ts +57 -0
- package/src/lib/printing/render-epson.js +135 -0
- package/src/lib/printing/render-epson.js.map +1 -0
- package/src/lib/printing/render-star.d.ts +45 -0
- package/src/lib/printing/render-star.js +100 -0
- package/src/lib/printing/render-star.js.map +1 -0
- package/src/lib/printing/render-text.d.ts +25 -0
- package/src/lib/printing/render-text.js +53 -0
- package/src/lib/printing/render-text.js.map +1 -0
- package/src/lib/server/api-v1/openapi.js +27 -4
- package/src/lib/server/api-v1/openapi.js.map +1 -1
- package/src/lib/server/api-v1/order-view.d.ts +67 -0
- package/src/lib/server/api-v1/order-view.js +120 -0
- package/src/lib/server/api-v1/order-view.js.map +1 -0
- package/src/lib/server/api-v1/orders-and-products.js +58 -65
- package/src/lib/server/api-v1/orders-and-products.js.map +1 -1
- package/src/lib/server/billing-webhook.js +135 -28
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/cancel-order.js +29 -0
- package/src/lib/server/cancel-order.js.map +1 -1
- package/src/lib/server/carrier-rates-availability.d.ts +26 -0
- package/src/lib/server/carrier-rates-availability.js +76 -0
- package/src/lib/server/carrier-rates-availability.js.map +1 -0
- package/src/lib/server/carrier-shipping.d.ts +84 -0
- package/src/lib/server/carrier-shipping.js +135 -0
- package/src/lib/server/carrier-shipping.js.map +1 -0
- package/src/lib/server/cart-checkout.d.ts +2 -0
- package/src/lib/server/cart-checkout.js +226 -22
- package/src/lib/server/cart-checkout.js.map +1 -1
- package/src/lib/server/channel-order-updates.d.ts +50 -0
- package/src/lib/server/channel-order-updates.js +290 -0
- package/src/lib/server/channel-order-updates.js.map +1 -0
- package/src/lib/server/channel-orders.d.ts +85 -0
- package/src/lib/server/channel-orders.js +543 -0
- package/src/lib/server/channel-orders.js.map +1 -0
- package/src/lib/server/checkout-extras.d.ts +64 -0
- package/src/lib/server/checkout-extras.js +157 -0
- package/src/lib/server/checkout-extras.js.map +1 -0
- package/src/lib/server/{feed.d.ts → checkout-status.d.ts} +2 -7
- package/src/lib/server/checkout-status.js +111 -0
- package/src/lib/server/checkout-status.js.map +1 -0
- package/src/lib/server/checkout.js +86 -9
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/draft-order.js +34 -5
- package/src/lib/server/draft-order.js.map +1 -1
- package/src/lib/server/fulfill-order.d.ts +127 -10
- package/src/lib/server/fulfill-order.js +451 -49
- package/src/lib/server/fulfill-order.js.map +1 -1
- package/src/lib/server/legacy-feed.d.ts +28 -0
- package/src/lib/server/legacy-feed.js +52 -0
- package/src/lib/server/legacy-feed.js.map +1 -0
- package/src/lib/server/native-checkout.d.ts +34 -15
- package/src/lib/server/native-checkout.js +32 -17
- package/src/lib/server/native-checkout.js.map +1 -1
- package/src/lib/server/order-event-host-emit.d.ts +23 -0
- package/src/lib/server/order-event-host-emit.js +30 -0
- package/src/lib/server/order-event-host-emit.js.map +1 -0
- package/src/lib/server/order-event-triggers.d.ts +37 -0
- package/src/lib/server/order-event-triggers.js +119 -0
- package/src/lib/server/order-event-triggers.js.map +1 -0
- package/src/lib/server/order-events.d.ts +62 -0
- package/src/lib/server/order-events.js +109 -0
- package/src/lib/server/order-events.js.map +1 -0
- package/src/lib/server/order-history.d.ts +23 -0
- package/src/lib/server/order-history.js +65 -0
- package/src/lib/server/order-history.js.map +1 -0
- package/src/lib/server/order-notifications.d.ts +185 -0
- package/src/lib/server/order-notifications.js +567 -0
- package/src/lib/server/order-notifications.js.map +1 -0
- package/src/lib/server/order-receipt-send.d.ts +39 -0
- package/src/lib/server/order-receipt-send.js +151 -0
- package/src/lib/server/order-receipt-send.js.map +1 -0
- package/src/lib/server/order-status-token.d.ts +31 -0
- package/src/lib/server/order-status-token.js +75 -0
- package/src/lib/server/order-status-token.js.map +1 -0
- package/src/lib/server/order-status.d.ts +58 -0
- package/src/lib/server/order-status.js +141 -0
- package/src/lib/server/order-status.js.map +1 -0
- package/src/lib/server/order-webhooks.d.ts +108 -0
- package/src/lib/server/order-webhooks.js +622 -0
- package/src/lib/server/order-webhooks.js.map +1 -0
- package/src/lib/server/orders-shipping-prepare.d.ts +26 -0
- package/src/lib/server/orders-shipping-prepare.js +121 -0
- package/src/lib/server/orders-shipping-prepare.js.map +1 -0
- package/src/lib/server/payment-method-domains.d.ts +209 -0
- package/src/lib/server/payment-method-domains.js +444 -0
- package/src/lib/server/payment-method-domains.js.map +1 -0
- package/src/lib/server/payment-methods.d.ts +77 -0
- package/src/lib/server/payment-methods.js +284 -0
- package/src/lib/server/payment-methods.js.map +1 -0
- package/src/lib/server/pos-auth.d.ts +50 -0
- package/src/lib/server/pos-auth.js +121 -0
- package/src/lib/server/pos-auth.js.map +1 -0
- package/src/lib/server/pos-customer.d.ts +49 -0
- package/src/lib/server/pos-customer.js +257 -0
- package/src/lib/server/pos-customer.js.map +1 -0
- package/src/lib/server/pos-display.d.ts +57 -0
- package/src/lib/server/pos-display.js +419 -0
- package/src/lib/server/pos-display.js.map +1 -0
- package/src/lib/server/pos-fee-month.d.ts +34 -0
- package/src/lib/server/pos-fee-month.js +36 -0
- package/src/lib/server/pos-fee-month.js.map +1 -0
- package/src/lib/server/pos-ops-gate.d.ts +161 -0
- package/src/lib/server/pos-ops-gate.js +295 -0
- package/src/lib/server/pos-ops-gate.js.map +1 -0
- package/src/lib/server/pos-ops-routes.d.ts +22 -0
- package/src/lib/server/pos-ops-routes.js +36 -0
- package/src/lib/server/pos-ops-routes.js.map +1 -0
- package/src/lib/server/pos-order.d.ts +1 -18
- package/src/lib/server/pos-order.js +222 -42
- package/src/lib/server/pos-order.js.map +1 -1
- package/src/lib/server/pos-payment.d.ts +39 -0
- package/src/lib/server/pos-payment.js +922 -0
- package/src/lib/server/pos-payment.js.map +1 -0
- package/src/lib/server/pos-print.d.ts +82 -0
- package/src/lib/server/pos-print.js +193 -0
- package/src/lib/server/pos-print.js.map +1 -0
- package/src/lib/server/pos-readers.d.ts +27 -0
- package/src/lib/server/pos-readers.js +276 -0
- package/src/lib/server/pos-readers.js.map +1 -0
- package/src/lib/server/pos-refund-authority.d.ts +60 -0
- package/src/lib/server/pos-refund-authority.js +72 -0
- package/src/lib/server/pos-refund-authority.js.map +1 -0
- package/src/lib/server/pos-return.d.ts +58 -0
- package/src/lib/server/pos-return.js +891 -0
- package/src/lib/server/pos-return.js.map +1 -0
- package/src/lib/server/pos-sale-stamp.d.ts +66 -0
- package/src/lib/server/pos-sale-stamp.js +84 -0
- package/src/lib/server/pos-sale-stamp.js.map +1 -0
- package/src/lib/server/pos-sale.d.ts +170 -0
- package/src/lib/server/pos-sale.js +461 -0
- package/src/lib/server/pos-sale.js.map +1 -0
- package/src/lib/server/pos-shift.d.ts +45 -0
- package/src/lib/server/pos-shift.js +484 -0
- package/src/lib/server/pos-shift.js.map +1 -0
- package/src/lib/server/pos-staff-pin.d.ts +26 -0
- package/src/lib/server/pos-staff-pin.js +339 -0
- package/src/lib/server/pos-staff-pin.js.map +1 -0
- package/src/lib/server/pos-stripe.d.ts +91 -0
- package/src/lib/server/pos-stripe.js +129 -0
- package/src/lib/server/pos-stripe.js.map +1 -0
- package/src/lib/server/pos-terminal-connection-token.d.ts +48 -0
- package/src/lib/server/pos-terminal-connection-token.js +166 -0
- package/src/lib/server/pos-terminal-connection-token.js.map +1 -0
- package/src/lib/server/pos-terminal.d.ts +218 -0
- package/src/lib/server/pos-terminal.js +1014 -0
- package/src/lib/server/pos-terminal.js.map +1 -0
- package/src/lib/server/print-queue.d.ts +124 -0
- package/src/lib/server/print-queue.js +301 -0
- package/src/lib/server/print-queue.js.map +1 -0
- package/src/lib/server/printer-poll.d.ts +75 -0
- package/src/lib/server/printer-poll.js +325 -0
- package/src/lib/server/printer-poll.js.map +1 -0
- package/src/lib/server/printer-secret.d.ts +39 -0
- package/src/lib/server/printer-secret.js +56 -0
- package/src/lib/server/printer-secret.js.map +1 -0
- package/src/lib/server/printers.d.ts +114 -0
- package/src/lib/server/printers.js +546 -0
- package/src/lib/server/printers.js.map +1 -0
- package/src/lib/server/product-catalog.d.ts +42 -0
- package/src/lib/server/product-catalog.js +309 -0
- package/src/lib/server/product-catalog.js.map +1 -0
- package/src/lib/server/product-drafts.d.ts +5 -1
- package/src/lib/server/product-drafts.js +3 -3
- package/src/lib/server/product-drafts.js.map +1 -1
- package/src/lib/server/product-writer.d.ts +19 -0
- package/src/lib/server/product-writer.js +261 -0
- package/src/lib/server/product-writer.js.map +1 -0
- package/src/lib/server/products-write.d.ts +61 -0
- package/src/lib/server/products-write.js +375 -0
- package/src/lib/server/products-write.js.map +1 -0
- package/src/lib/server/refund.js +110 -45
- package/src/lib/server/refund.js.map +1 -1
- package/src/lib/server/reserve.js +2 -0
- package/src/lib/server/reserve.js.map +1 -1
- package/src/lib/server/return-status-action.d.ts +37 -0
- package/src/lib/server/return-status-action.js +57 -0
- package/src/lib/server/return-status-action.js.map +1 -0
- package/src/lib/server/returns.d.ts +119 -0
- package/src/lib/server/returns.js +938 -0
- package/src/lib/server/returns.js.map +1 -0
- package/src/lib/server/shipment-records.d.ts +36 -0
- package/src/lib/server/shipment-records.js +289 -0
- package/src/lib/server/shipment-records.js.map +1 -0
- package/src/lib/server/shipping-connector-gates.d.ts +40 -0
- package/src/lib/server/shipping-connector-gates.js +97 -0
- package/src/lib/server/shipping-connector-gates.js.map +1 -0
- package/src/lib/server/shipping-connectors.d.ts +29 -0
- package/src/lib/server/shipping-connectors.js +236 -0
- package/src/lib/server/shipping-connectors.js.map +1 -0
- package/src/lib/server/shippingeasy.d.ts +238 -0
- package/src/lib/server/shippingeasy.js +787 -0
- package/src/lib/server/shippingeasy.js.map +1 -0
- package/src/lib/server/shipstation.d.ts +129 -0
- package/src/lib/server/shipstation.js +483 -0
- package/src/lib/server/shipstation.js.map +1 -0
- package/src/lib/server/site-page-resolver.d.ts +5 -0
- package/src/lib/server/site-page-resolver.js +156 -1
- package/src/lib/server/site-page-resolver.js.map +1 -1
- package/src/lib/server/stock-levels.d.ts +21 -0
- package/src/lib/server/stock-levels.js +263 -0
- package/src/lib/server/stock-levels.js.map +1 -0
- package/src/lib/server/stripe-refund.d.ts +47 -0
- package/src/lib/server/stripe-refund.js +87 -0
- package/src/lib/server/stripe-refund.js.map +1 -0
- package/src/lib/server/supplier-update.js +46 -5
- package/src/lib/server/supplier-update.js.map +1 -1
- package/src/lib/server/tax-engine-quote.d.ts +47 -0
- package/src/lib/server/tax-engine-quote.js +105 -0
- package/src/lib/server/tax-engine-quote.js.map +1 -0
- package/src/lib/server.js +143 -2
- package/src/lib/server.js.map +1 -1
- package/src/lib/site.js +12 -0
- package/src/lib/site.js.map +1 -1
- package/src/lib/subprocessors.d.ts +26 -0
- package/src/lib/subprocessors.js +50 -0
- package/src/lib/subprocessors.js.map +1 -0
- package/src/lib/tenant-emails.js +461 -3
- package/src/lib/tenant-emails.js.map +1 -1
- package/src/lib/testing/fake-firestore.d.ts +45 -0
- package/src/lib/testing/fake-firestore.js +189 -0
- package/src/lib/testing/fake-firestore.js.map +1 -0
- package/src/lib/testing/memory-firestore.d.ts +136 -0
- package/src/lib/testing/memory-firestore.js +282 -0
- package/src/lib/testing/memory-firestore.js.map +1 -0
- package/src/lib/testing/pos-ops-harness.d.ts +50 -0
- package/src/lib/testing/pos-ops-harness.js +184 -0
- package/src/lib/testing/pos-ops-harness.js.map +1 -0
- package/src/lib/testing/pos-ops-memory-firestore.d.ts +55 -0
- package/src/lib/testing/pos-ops-memory-firestore.js +376 -0
- package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -0
- package/src/lib/transfer/products.server.d.ts +5 -0
- package/src/lib/transfer/products.server.js +2 -2
- package/src/lib/transfer/products.server.js.map +1 -1
- package/src/lib/transfer/records-transfer.d.ts +11 -1
- package/src/lib/transfer/records-transfer.js +127 -5
- package/src/lib/transfer/records-transfer.js.map +1 -1
- package/src/lib/transfer/records.server.d.ts +9 -2
- package/src/lib/transfer/records.server.js +58 -7
- package/src/lib/transfer/records.server.js.map +1 -1
- package/src/lib/transfer/register-transfer-resources.js +40 -1
- package/src/lib/transfer/register-transfer-resources.js.map +1 -1
- package/src/lib/transfer/register-transfer-ui.js +4 -1
- package/src/lib/transfer/register-transfer-ui.js.map +1 -1
- package/src/lib/transfer/shipping-presets.d.ts +23 -0
- package/src/lib/transfer/shipping-presets.js +156 -0
- package/src/lib/transfer/shipping-presets.js.map +1 -0
- package/src/lib/transfer/tracking-transfer.d.ts +101 -0
- package/src/lib/transfer/tracking-transfer.js +546 -0
- package/src/lib/transfer/tracking-transfer.js.map +1 -0
- package/src/lib/transfer/tracking.server.d.ts +37 -0
- package/src/lib/transfer/tracking.server.js +393 -0
- package/src/lib/transfer/tracking.server.js.map +1 -0
- package/src/lib/transfer/transfer-keys.d.ts +2 -1
- package/src/lib/transfer/transfer-keys.js +6 -2
- package/src/lib/transfer/transfer-keys.js.map +1 -1
- package/src/lib/utils/code128.d.ts +37 -0
- package/src/lib/utils/code128.js +199 -0
- package/src/lib/utils/code128.js.map +1 -0
- package/src/lib/utils/order-invoice.d.ts +55 -0
- package/src/lib/utils/order-invoice.js +127 -0
- package/src/lib/utils/order-invoice.js.map +1 -0
- package/src/lib/utils/use-checkout-return-notice.d.ts +34 -0
- package/src/lib/utils/use-checkout-return-notice.js +78 -0
- package/src/lib/utils/use-checkout-return-notice.js.map +1 -0
- package/src/lib/server/feed.js +0 -69
- package/src/lib/server/feed.js.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { useFirestore } from "@aglyn/tenant-feature-instance";
|
|
19
|
+
import { Button } from "@mui/material";
|
|
20
|
+
import { doc, getDoc } from "firebase/firestore";
|
|
21
|
+
import { useCallback, useState } from "react";
|
|
22
|
+
import { buildOrderInvoiceHtml } from "../../utils/order-invoice.js";
|
|
23
|
+
/**
|
|
24
|
+
* "Invoice" (AGL-3611), beside "Packing slip" in the order dialog: the order
|
|
25
|
+
* as a printable bill, which the print dialog also saves as a PDF. The store's
|
|
26
|
+
* name, currency and footer are read when it is clicked, not while the dialog
|
|
27
|
+
* is open, so the dialog listens to nothing more.
|
|
28
|
+
*/ export function OrderInvoiceButton(props) {
|
|
29
|
+
const { hostId, orderId, order } = props;
|
|
30
|
+
const firestore = useFirestore();
|
|
31
|
+
const [busy, setBusy] = useState(false);
|
|
32
|
+
const handleInvoice = useCallback(async ()=>{
|
|
33
|
+
// Opened before the reads, inside the click, so a popup blocker sees the
|
|
34
|
+
// user's gesture.
|
|
35
|
+
const win = window.open('', '_blank', 'width=720,height=900');
|
|
36
|
+
if (!win) return;
|
|
37
|
+
setBusy(true);
|
|
38
|
+
try {
|
|
39
|
+
var _ref, _ref1, _ref2, _ref3, _hostData_businessName, _storeData_currency, _storeData_receiptFooter, _storeData_termsUrl;
|
|
40
|
+
const [host, store] = await Promise.all([
|
|
41
|
+
getDoc(doc(firestore, 'hosts', hostId)).catch(()=>null),
|
|
42
|
+
getDoc(doc(firestore, 'hosts', hostId, 'settings', 'store')).catch(()=>null)
|
|
43
|
+
]);
|
|
44
|
+
const hostData = (_ref = host == null ? void 0 : host.data()) != null ? _ref : {};
|
|
45
|
+
const storeData = (_ref1 = store == null ? void 0 : store.data()) != null ? _ref1 : {};
|
|
46
|
+
const html = buildOrderInvoiceHtml({
|
|
47
|
+
order,
|
|
48
|
+
orderId,
|
|
49
|
+
store: {
|
|
50
|
+
name: String((_ref2 = (_ref3 = (_hostData_businessName = hostData['businessName']) != null ? _hostData_businessName : hostData['displayName']) != null ? _ref3 : hostData['name']) != null ? _ref2 : ''),
|
|
51
|
+
currency: String((_storeData_currency = storeData['currency']) != null ? _storeData_currency : 'USD'),
|
|
52
|
+
footer: (_storeData_receiptFooter = storeData['receiptFooter']) != null ? _storeData_receiptFooter : null,
|
|
53
|
+
termsUrl: (_storeData_termsUrl = storeData['termsUrl']) != null ? _storeData_termsUrl : null
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
// Every value in `html` is escaped by the builder (AGL-2283).
|
|
57
|
+
win.document.write(html);
|
|
58
|
+
win.document.close();
|
|
59
|
+
// Print from the opener, not an injected script: the popup inherits
|
|
60
|
+
// the console's CSP (AGL-523).
|
|
61
|
+
win.focus();
|
|
62
|
+
win.print();
|
|
63
|
+
} finally{
|
|
64
|
+
setBusy(false);
|
|
65
|
+
}
|
|
66
|
+
}, [
|
|
67
|
+
firestore,
|
|
68
|
+
hostId,
|
|
69
|
+
orderId,
|
|
70
|
+
order
|
|
71
|
+
]);
|
|
72
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
73
|
+
disabled: busy,
|
|
74
|
+
onClick: handleInvoice,
|
|
75
|
+
children: 'Invoice'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
OrderInvoiceButton.displayName = 'OrderInvoiceButton';
|
|
79
|
+
export default OrderInvoiceButton;
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=order-invoice.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/order-invoice.component.tsx"],"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'use client'\n\nimport { useFirestore } from '@aglyn/tenant-feature-instance'\nimport { Button } from '@mui/material'\nimport { doc, getDoc } from 'firebase/firestore'\nimport { useCallback, useState } from 'react'\nimport type * as CommerceModel from '../../model'\nimport { buildOrderInvoiceHtml } from '../../utils/order-invoice'\n\nexport interface OrderInvoiceButtonProps {\n hostId: string\n orderId: string\n order: CommerceModel.HostOrder\n}\n\n/**\n * \"Invoice\" (AGL-3611), beside \"Packing slip\" in the order dialog: the order\n * as a printable bill, which the print dialog also saves as a PDF. The store's\n * name, currency and footer are read when it is clicked, not while the dialog\n * is open, so the dialog listens to nothing more.\n */\nexport function OrderInvoiceButton(props: OrderInvoiceButtonProps) {\n const { hostId, orderId, order } = props\n const firestore = useFirestore()\n const [busy, setBusy] = useState(false)\n\n const handleInvoice = useCallback(async () => {\n // Opened before the reads, inside the click, so a popup blocker sees the\n // user's gesture.\n const win = window.open('', '_blank', 'width=720,height=900')\n if (!win) return\n setBusy(true)\n try {\n const [host, store] = await Promise.all([\n getDoc(doc(firestore, 'hosts', hostId)).catch(() => null),\n getDoc(doc(firestore, 'hosts', hostId, 'settings', 'store')).catch(() => null),\n ])\n const hostData = (host?.data() ?? {}) as Record<string, unknown>\n const storeData = (store?.data() ?? {}) as Record<string, unknown>\n const html = buildOrderInvoiceHtml({\n order,\n orderId,\n store: {\n name: String(hostData['businessName'] ?? hostData['displayName'] ?? hostData['name'] ?? ''),\n currency: String(storeData['currency'] ?? 'USD'),\n footer: (storeData['receiptFooter'] as string | undefined) ?? null,\n termsUrl: (storeData['termsUrl'] as string | undefined) ?? null,\n },\n })\n // Every value in `html` is escaped by the builder (AGL-2283).\n win.document.write(html)\n win.document.close()\n // Print from the opener, not an injected script: the popup inherits\n // the console's CSP (AGL-523).\n win.focus()\n win.print()\n } finally {\n setBusy(false)\n }\n }, [firestore, hostId, orderId, order])\n\n return (\n <Button disabled={busy} onClick={handleInvoice}>\n {'Invoice'}\n </Button>\n )\n}\nOrderInvoiceButton.displayName = 'OrderInvoiceButton'\n\nexport default OrderInvoiceButton\n"],"names":["useFirestore","Button","doc","getDoc","useCallback","useState","buildOrderInvoiceHtml","OrderInvoiceButton","props","hostId","orderId","order","firestore","busy","setBusy","handleInvoice","win","window","open","hostData","storeData","host","store","Promise","all","catch","data","html","name","String","currency","footer","termsUrl","document","write","close","focus","print","disabled","onClick","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,SAASA,YAAY,QAAQ,iCAAgC;AAC7D,SAASC,MAAM,QAAQ,gBAAe;AACtC,SAASC,GAAG,EAAEC,MAAM,QAAQ,qBAAoB;AAChD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAE7C,SAASC,qBAAqB,QAAQ,+BAA2B;AAQjE;;;;;CAKC,GACD,OAAO,SAASC,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGH;IACnC,MAAMI,YAAYZ;IAClB,MAAM,CAACa,MAAMC,QAAQ,GAAGT,SAAS;IAEjC,MAAMU,gBAAgBX,YAAY;QAChC,yEAAyE;QACzE,kBAAkB;QAClB,MAAMY,MAAMC,OAAOC,IAAI,CAAC,IAAI,UAAU;QACtC,IAAI,CAACF,KAAK;QACVF,QAAQ;QACR,IAAI;6BAWeK,OAAAA,OAAAA,wBACIC,qBACRA,0BACEA;YAbf,MAAM,CAACC,MAAMC,MAAM,GAAG,MAAMC,QAAQC,GAAG,CAAC;gBACtCrB,OAAOD,IAAIU,WAAW,SAASH,SAASgB,KAAK,CAAC,IAAM;gBACpDtB,OAAOD,IAAIU,WAAW,SAASH,QAAQ,YAAY,UAAUgB,KAAK,CAAC,IAAM;aAC1E;YACD,MAAMN,mBAAYE,wBAAAA,KAAMK,IAAI,qBAAM,CAAC;YACnC,MAAMN,qBAAaE,yBAAAA,MAAOI,IAAI,sBAAM,CAAC;YACrC,MAAMC,OAAOrB,sBAAsB;gBACjCK;gBACAD;gBACAY,OAAO;oBACLM,MAAMC,QAAOV,SAAAA,SAAAA,yBAAAA,QAAQ,CAAC,eAAe,YAAxBA,yBAA4BA,QAAQ,CAAC,cAAc,YAAnDA,QAAuDA,QAAQ,CAAC,OAAO,YAAvEA,QAA2E;oBACxFW,UAAUD,QAAOT,sBAAAA,SAAS,CAAC,WAAW,YAArBA,sBAAyB;oBAC1CW,MAAM,GAAGX,2BAAAA,SAAS,CAAC,gBAAgB,YAA1BA,2BAAqD;oBAC9DY,QAAQ,GAAGZ,sBAAAA,SAAS,CAAC,WAAW,YAArBA,sBAAgD;gBAC7D;YACF;YACA,8DAA8D;YAC9DJ,IAAIiB,QAAQ,CAACC,KAAK,CAACP;YACnBX,IAAIiB,QAAQ,CAACE,KAAK;YAClB,oEAAoE;YACpE,+BAA+B;YAC/BnB,IAAIoB,KAAK;YACTpB,IAAIqB,KAAK;QACX,SAAU;YACRvB,QAAQ;QACV;IACF,GAAG;QAACF;QAAWH;QAAQC;QAASC;KAAM;IAEtC,qBACE,KAACV;QAAOqC,UAAUzB;QAAM0B,SAASxB;kBAC9B;;AAGP;AACAR,mBAAmBiC,WAAW,GAAG;AAEjC,eAAejC,mBAAkB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as CommerceModel from '../../model';
|
|
2
|
+
export interface OrderReceiptResendProps {
|
|
3
|
+
hostId: string;
|
|
4
|
+
orderId: string;
|
|
5
|
+
order: Pick<CommerceModel.HostOrder, 'customerEmail' | 'customerPhone' | 'status'>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* "Resend receipt" (AGL-3610), for the order dialog's actions: the receipt
|
|
9
|
+
* again, to the buyer's address or one the merchant types — by text too, but
|
|
10
|
+
* only when the platform can send texts. The route answers which channels
|
|
11
|
+
* exist (`GET /api/commerce/order-receipt-send`) when the dialog opens, so
|
|
12
|
+
* "Text" is never offered on an install with no SMS provider.
|
|
13
|
+
*
|
|
14
|
+
* Kept out of `order-detail-dialog` on purpose: the dialog is shared by
|
|
15
|
+
* several lanes, and this is one line there.
|
|
16
|
+
*/
|
|
17
|
+
export declare function OrderReceiptResend(props: OrderReceiptResendProps): import("react").JSX.Element;
|
|
18
|
+
export declare namespace OrderReceiptResend {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export default OrderReceiptResend;
|
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
19
|
+
import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
|
|
20
|
+
import { useUser } from "@aglyn/tenant-feature-instance";
|
|
21
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, Radio, RadioGroup, TextField, Typography } from "@mui/material";
|
|
22
|
+
import { useCallback, useState } from "react";
|
|
23
|
+
/**
|
|
24
|
+
* "Resend receipt" (AGL-3610), for the order dialog's actions: the receipt
|
|
25
|
+
* again, to the buyer's address or one the merchant types — by text too, but
|
|
26
|
+
* only when the platform can send texts. The route answers which channels
|
|
27
|
+
* exist (`GET /api/commerce/order-receipt-send`) when the dialog opens, so
|
|
28
|
+
* "Text" is never offered on an install with no SMS provider.
|
|
29
|
+
*
|
|
30
|
+
* Kept out of `order-detail-dialog` on purpose: the dialog is shared by
|
|
31
|
+
* several lanes, and this is one line there.
|
|
32
|
+
*/ export function OrderReceiptResend(props) {
|
|
33
|
+
const { hostId, orderId, order } = props;
|
|
34
|
+
const { data: user } = useUser();
|
|
35
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
36
|
+
const [open, setOpen] = useState(false);
|
|
37
|
+
const [channels, setChannels] = useState(null);
|
|
38
|
+
const [channel, setChannel] = useState('email');
|
|
39
|
+
const [to, setTo] = useState('');
|
|
40
|
+
const [busy, setBusy] = useState(false);
|
|
41
|
+
const recipientFor = useCallback((next)=>{
|
|
42
|
+
var _ref;
|
|
43
|
+
return String((_ref = next === 'sms' ? order.customerPhone : order.customerEmail) != null ? _ref : '');
|
|
44
|
+
}, [
|
|
45
|
+
order.customerEmail,
|
|
46
|
+
order.customerPhone
|
|
47
|
+
]);
|
|
48
|
+
const handleOpen = useCallback(async ()=>{
|
|
49
|
+
setOpen(true);
|
|
50
|
+
setChannel('email');
|
|
51
|
+
setTo(recipientFor('email'));
|
|
52
|
+
setChannels(null);
|
|
53
|
+
try {
|
|
54
|
+
const response = await authorizedFetch(user, `/api/commerce/order-receipt-send?hostId=${encodeURIComponent(hostId)}`);
|
|
55
|
+
const payload = await response.json().catch(()=>({}));
|
|
56
|
+
setChannels(response.ok ? {
|
|
57
|
+
email: payload.email === true,
|
|
58
|
+
sms: payload.sms === true
|
|
59
|
+
} : {
|
|
60
|
+
email: true,
|
|
61
|
+
sms: false
|
|
62
|
+
});
|
|
63
|
+
} catch (unused) {
|
|
64
|
+
setChannels({
|
|
65
|
+
email: true,
|
|
66
|
+
sms: false
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [
|
|
70
|
+
hostId,
|
|
71
|
+
recipientFor,
|
|
72
|
+
user
|
|
73
|
+
]);
|
|
74
|
+
const handleSend = useCallback(async ()=>{
|
|
75
|
+
setBusy(true);
|
|
76
|
+
try {
|
|
77
|
+
const response = await authorizedFetch(user, '/api/commerce/order-receipt-send', {
|
|
78
|
+
method: 'POST',
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': 'application/json'
|
|
81
|
+
},
|
|
82
|
+
body: JSON.stringify({
|
|
83
|
+
hostId,
|
|
84
|
+
orderId,
|
|
85
|
+
channel,
|
|
86
|
+
to: to.trim()
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
const payload = await response.json().catch(()=>({}));
|
|
90
|
+
if (!response.ok) {
|
|
91
|
+
var _payload_error;
|
|
92
|
+
enqueueSnackbar((_payload_error = payload.error) != null ? _payload_error : 'The receipt could not be sent.', {
|
|
93
|
+
variant: 'error'
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
enqueueSnackbar(channel === 'sms' ? 'Receipt texted' : 'Receipt sent', {
|
|
98
|
+
variant: 'success',
|
|
99
|
+
persist: false
|
|
100
|
+
});
|
|
101
|
+
setOpen(false);
|
|
102
|
+
} catch (unused) {
|
|
103
|
+
enqueueSnackbar('The request did not complete, so it is not known whether the ' + 'receipt went. Check the order timeline before sending again.', {
|
|
104
|
+
variant: 'error'
|
|
105
|
+
});
|
|
106
|
+
} finally{
|
|
107
|
+
setBusy(false);
|
|
108
|
+
}
|
|
109
|
+
}, [
|
|
110
|
+
channel,
|
|
111
|
+
enqueueSnackbar,
|
|
112
|
+
hostId,
|
|
113
|
+
orderId,
|
|
114
|
+
to,
|
|
115
|
+
user
|
|
116
|
+
]);
|
|
117
|
+
if (order.status === 'pending') return null;
|
|
118
|
+
const emailOff = channels !== null && !channels.email && channel === 'email';
|
|
119
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
120
|
+
children: [
|
|
121
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
122
|
+
onClick: handleOpen,
|
|
123
|
+
children: 'Resend receipt'
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ _jsxs(Dialog, {
|
|
126
|
+
open: open,
|
|
127
|
+
onClose: ()=>setOpen(false),
|
|
128
|
+
maxWidth: "xs",
|
|
129
|
+
fullWidth: true,
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
132
|
+
children: 'Resend receipt'
|
|
133
|
+
}),
|
|
134
|
+
/*#__PURE__*/ _jsxs(DialogContent, {
|
|
135
|
+
sx: {
|
|
136
|
+
display: 'flex',
|
|
137
|
+
flexDirection: 'column',
|
|
138
|
+
gap: 1.5
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
(channels == null ? void 0 : channels.sms) ? /*#__PURE__*/ _jsxs(RadioGroup, {
|
|
142
|
+
row: true,
|
|
143
|
+
value: channel,
|
|
144
|
+
onChange: (event)=>{
|
|
145
|
+
const next = event.target.value;
|
|
146
|
+
setChannel(next);
|
|
147
|
+
setTo(recipientFor(next));
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
151
|
+
value: "email",
|
|
152
|
+
control: /*#__PURE__*/ _jsx(Radio, {
|
|
153
|
+
size: "small"
|
|
154
|
+
}),
|
|
155
|
+
label: "Email"
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
158
|
+
value: "sms",
|
|
159
|
+
control: /*#__PURE__*/ _jsx(Radio, {
|
|
160
|
+
size: "small"
|
|
161
|
+
}),
|
|
162
|
+
label: "Text"
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
}) : null,
|
|
166
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
167
|
+
autoFocus: true,
|
|
168
|
+
size: "small",
|
|
169
|
+
label: channel === 'sms' ? 'Phone number' : 'Email address',
|
|
170
|
+
type: channel === 'sms' ? 'tel' : 'email',
|
|
171
|
+
value: to,
|
|
172
|
+
onChange: (event)=>setTo(event.target.value)
|
|
173
|
+
}),
|
|
174
|
+
emailOff ? /*#__PURE__*/ _jsx(Typography, {
|
|
175
|
+
variant: "body2",
|
|
176
|
+
color: "text.secondary",
|
|
177
|
+
children: 'Email is not set up on this platform, so receipts cannot be sent.'
|
|
178
|
+
}) : null
|
|
179
|
+
]
|
|
180
|
+
}),
|
|
181
|
+
/*#__PURE__*/ _jsxs(DialogActions, {
|
|
182
|
+
children: [
|
|
183
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
184
|
+
onClick: ()=>setOpen(false),
|
|
185
|
+
children: 'Cancel'
|
|
186
|
+
}),
|
|
187
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
188
|
+
variant: "contained",
|
|
189
|
+
disabled: busy || !to.trim() || channels === null || emailOff,
|
|
190
|
+
onClick: handleSend,
|
|
191
|
+
children: 'Send'
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
OrderReceiptResend.displayName = 'OrderReceiptResend';
|
|
201
|
+
export default OrderReceiptResend;
|
|
202
|
+
|
|
203
|
+
//# sourceMappingURL=order-receipt-resend.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/order-receipt-resend.component.tsx"],"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'use client'\n\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n FormControlLabel,\n Radio,\n RadioGroup,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useState } from 'react'\nimport type * as CommerceModel from '../../model'\n\nexport interface OrderReceiptResendProps {\n hostId: string\n orderId: string\n order: Pick<CommerceModel.HostOrder, 'customerEmail' | 'customerPhone' | 'status'>\n}\n\ntype Channel = 'email' | 'sms'\n\n/**\n * \"Resend receipt\" (AGL-3610), for the order dialog's actions: the receipt\n * again, to the buyer's address or one the merchant types — by text too, but\n * only when the platform can send texts. The route answers which channels\n * exist (`GET /api/commerce/order-receipt-send`) when the dialog opens, so\n * \"Text\" is never offered on an install with no SMS provider.\n *\n * Kept out of `order-detail-dialog` on purpose: the dialog is shared by\n * several lanes, and this is one line there.\n */\nexport function OrderReceiptResend(props: OrderReceiptResendProps) {\n const { hostId, orderId, order } = props\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const [open, setOpen] = useState(false)\n const [channels, setChannels] = useState<{ email: boolean; sms: boolean } | null>(null)\n const [channel, setChannel] = useState<Channel>('email')\n const [to, setTo] = useState('')\n const [busy, setBusy] = useState(false)\n\n const recipientFor = useCallback(\n (next: Channel) =>\n String((next === 'sms' ? order.customerPhone : order.customerEmail) ?? ''),\n [order.customerEmail, order.customerPhone],\n )\n\n const handleOpen = useCallback(async () => {\n setOpen(true)\n setChannel('email')\n setTo(recipientFor('email'))\n setChannels(null)\n try {\n const response = await authorizedFetch(\n user,\n `/api/commerce/order-receipt-send?hostId=${encodeURIComponent(hostId)}`,\n )\n const payload: any = await response.json().catch(() => ({}))\n setChannels(\n response.ok\n ? { email: payload.email === true, sms: payload.sms === true }\n : { email: true, sms: false },\n )\n } catch {\n setChannels({ email: true, sms: false })\n }\n }, [hostId, recipientFor, user])\n\n const handleSend = useCallback(async () => {\n setBusy(true)\n try {\n const response = await authorizedFetch(\n user,\n '/api/commerce/order-receipt-send',\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ hostId, orderId, channel, to: to.trim() }),\n },\n )\n const payload: any = await response.json().catch(() => ({}))\n if (!response.ok) {\n enqueueSnackbar(payload.error ?? 'The receipt could not be sent.', {\n variant: 'error',\n })\n return\n }\n enqueueSnackbar(channel === 'sms' ? 'Receipt texted' : 'Receipt sent', {\n variant: 'success',\n persist: false,\n })\n setOpen(false)\n } catch {\n enqueueSnackbar(\n 'The request did not complete, so it is not known whether the ' +\n 'receipt went. Check the order timeline before sending again.',\n { variant: 'error' },\n )\n } finally {\n setBusy(false)\n }\n }, [channel, enqueueSnackbar, hostId, orderId, to, user])\n\n if (order.status === 'pending') return null\n const emailOff = channels !== null && !channels.email && channel === 'email'\n\n return (\n <>\n <Button onClick={handleOpen}>{'Resend receipt'}</Button>\n <Dialog open={open} onClose={() => setOpen(false)} maxWidth=\"xs\" fullWidth>\n <DialogTitle>{'Resend receipt'}</DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>\n {channels?.sms ? (\n <RadioGroup\n row\n value={channel}\n onChange={(event) => {\n const next = event.target.value as Channel\n setChannel(next)\n setTo(recipientFor(next))\n }}\n >\n <FormControlLabel value=\"email\" control={<Radio size=\"small\" />} label=\"Email\" />\n <FormControlLabel value=\"sms\" control={<Radio size=\"small\" />} label=\"Text\" />\n </RadioGroup>\n ) : null}\n <TextField\n autoFocus\n size=\"small\"\n label={channel === 'sms' ? 'Phone number' : 'Email address'}\n type={channel === 'sms' ? 'tel' : 'email'}\n value={to}\n onChange={(event) => setTo(event.target.value)}\n />\n {emailOff ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Email is not set up on this platform, so receipts cannot be sent.'}\n </Typography>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpen(false)}>{'Cancel'}</Button>\n <Button\n variant=\"contained\"\n disabled={busy || !to.trim() || channels === null || emailOff}\n onClick={handleSend}\n >\n {'Send'}\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\nOrderReceiptResend.displayName = 'OrderReceiptResend'\n\nexport default OrderReceiptResend\n"],"names":["useSnackbar","authorizedFetch","useUser","Button","Dialog","DialogActions","DialogContent","DialogTitle","FormControlLabel","Radio","RadioGroup","TextField","Typography","useCallback","useState","OrderReceiptResend","props","hostId","orderId","order","data","user","enqueueSnackbar","open","setOpen","channels","setChannels","channel","setChannel","to","setTo","busy","setBusy","recipientFor","next","String","customerPhone","customerEmail","handleOpen","response","encodeURIComponent","payload","json","catch","ok","email","sms","handleSend","method","headers","body","JSON","stringify","trim","error","variant","persist","status","emailOff","onClick","onClose","maxWidth","fullWidth","sx","display","flexDirection","gap","row","value","onChange","event","target","control","size","label","autoFocus","type","color","disabled","displayName"],"mappings":"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"}
|
|
@@ -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
|
+
import * as CommerceModel from '../../model';
|
|
18
|
+
export interface OrderReturnsProps {
|
|
19
|
+
hostId: string;
|
|
20
|
+
orderId: string;
|
|
21
|
+
order: CommerceModel.HostOrder;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The order dialog's returns (AGL-3611): the returns on this order, each
|
|
25
|
+
* opening its return dialog, and "Start return" while the order can take one.
|
|
26
|
+
* Kept out of `order-detail-dialog` on purpose: the dialog is shared by
|
|
27
|
+
* several lanes, and this is one line there.
|
|
28
|
+
*
|
|
29
|
+
* `orderId ==` alone, on the automatic single-field index. An order holds a
|
|
30
|
+
* handful of returns at most, so the read is the whole answer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function OrderReturns(props: OrderReturnsProps): import("react").JSX.Element;
|
|
33
|
+
export declare namespace OrderReturns {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export default OrderReturns;
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import * as CommerceModel from "../../model/index.js";
|
|
19
|
+
import { Button, Chip, Divider, Link, Stack, Typography } from "@mui/material";
|
|
20
|
+
import { collection, query, where } from "firebase/firestore";
|
|
21
|
+
import { useMemo, useState } from "react";
|
|
22
|
+
import { useFirestore, useFirestoreCollection } from "@aglyn/tenant-feature-instance";
|
|
23
|
+
import ReturnDetailDialog from "./return-detail-dialog.component.js";
|
|
24
|
+
import StartReturnDialog from "./start-return-dialog.component.js";
|
|
25
|
+
/** Order statuses a return may be started against — the route's own list. */ const STARTABLE_STATUSES = [
|
|
26
|
+
'paid',
|
|
27
|
+
'partially_fulfilled',
|
|
28
|
+
'fulfilled',
|
|
29
|
+
'delivered'
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* The order dialog's returns (AGL-3611): the returns on this order, each
|
|
33
|
+
* opening its return dialog, and "Start return" while the order can take one.
|
|
34
|
+
* Kept out of `order-detail-dialog` on purpose: the dialog is shared by
|
|
35
|
+
* several lanes, and this is one line there.
|
|
36
|
+
*
|
|
37
|
+
* `orderId ==` alone, on the automatic single-field index. An order holds a
|
|
38
|
+
* handful of returns at most, so the read is the whole answer.
|
|
39
|
+
*/ export function OrderReturns(props) {
|
|
40
|
+
const { hostId, orderId, order } = props;
|
|
41
|
+
const firestore = useFirestore();
|
|
42
|
+
const { data: returnDocs } = useFirestoreCollection(()=>query(collection(firestore, 'hosts', hostId, 'returns'), where('orderId', '==', orderId)), [
|
|
43
|
+
firestore,
|
|
44
|
+
hostId,
|
|
45
|
+
orderId
|
|
46
|
+
], {
|
|
47
|
+
idField: '$id'
|
|
48
|
+
});
|
|
49
|
+
const returns = useMemo(()=>[
|
|
50
|
+
...returnDocs != null ? returnDocs : []
|
|
51
|
+
].sort((a, b)=>{
|
|
52
|
+
var _b_createdAtMs, _a_createdAtMs;
|
|
53
|
+
return ((_b_createdAtMs = b.createdAtMs) != null ? _b_createdAtMs : 0) - ((_a_createdAtMs = a.createdAtMs) != null ? _a_createdAtMs : 0);
|
|
54
|
+
}), [
|
|
55
|
+
returnDocs
|
|
56
|
+
]);
|
|
57
|
+
const [starting, setStarting] = useState(false);
|
|
58
|
+
const [openId, setOpenId] = useState(null);
|
|
59
|
+
const startable = STARTABLE_STATUSES.includes(order.status);
|
|
60
|
+
if (!startable && returns.length === 0) return null;
|
|
61
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx(Divider, {}),
|
|
64
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
65
|
+
direction: "row",
|
|
66
|
+
spacing: 1,
|
|
67
|
+
sx: {
|
|
68
|
+
alignItems: 'center'
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
72
|
+
variant: "subtitle2",
|
|
73
|
+
sx: {
|
|
74
|
+
flex: 1
|
|
75
|
+
},
|
|
76
|
+
children: 'Returns'
|
|
77
|
+
}),
|
|
78
|
+
startable ? /*#__PURE__*/ _jsx(Button, {
|
|
79
|
+
size: "small",
|
|
80
|
+
onClick: ()=>setStarting(true),
|
|
81
|
+
children: 'Start return'
|
|
82
|
+
}) : null
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
returns.length === 0 ? /*#__PURE__*/ _jsx(Typography, {
|
|
86
|
+
variant: "caption",
|
|
87
|
+
color: "text.secondary",
|
|
88
|
+
children: 'No returns on this order.'
|
|
89
|
+
}) : returns.map((entry)=>{
|
|
90
|
+
var _entry_lines, _CommerceModel_RETURN_STATUS_LABELS_entry_status, _CommerceModel_RETURN_STATUS_COLOR_entry_status;
|
|
91
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
92
|
+
direction: "row",
|
|
93
|
+
spacing: 1,
|
|
94
|
+
sx: {
|
|
95
|
+
alignItems: 'center'
|
|
96
|
+
},
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ _jsx(Link, {
|
|
99
|
+
component: "button",
|
|
100
|
+
variant: "body2",
|
|
101
|
+
onClick: ()=>setOpenId(entry.$id),
|
|
102
|
+
sx: {
|
|
103
|
+
flex: 1,
|
|
104
|
+
textAlign: 'left'
|
|
105
|
+
},
|
|
106
|
+
children: CommerceModel.describeReturnLines(order, (_entry_lines = entry.lines) != null ? _entry_lines : [])
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
109
|
+
variant: "caption",
|
|
110
|
+
color: "text.secondary",
|
|
111
|
+
children: new Date(entry.createdAtMs).toLocaleDateString()
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ _jsx(Chip, {
|
|
114
|
+
label: (_CommerceModel_RETURN_STATUS_LABELS_entry_status = CommerceModel.RETURN_STATUS_LABELS[entry.status]) != null ? _CommerceModel_RETURN_STATUS_LABELS_entry_status : entry.status,
|
|
115
|
+
size: "small",
|
|
116
|
+
color: (_CommerceModel_RETURN_STATUS_COLOR_entry_status = CommerceModel.RETURN_STATUS_COLOR[entry.status]) != null ? _CommerceModel_RETURN_STATUS_COLOR_entry_status : 'default',
|
|
117
|
+
variant: "outlined"
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
}, entry.$id);
|
|
121
|
+
}),
|
|
122
|
+
starting ? /*#__PURE__*/ _jsx(StartReturnDialog, {
|
|
123
|
+
hostId: hostId,
|
|
124
|
+
orderId: orderId,
|
|
125
|
+
order: order,
|
|
126
|
+
existing: returns,
|
|
127
|
+
open: true,
|
|
128
|
+
onClose: ()=>setStarting(false),
|
|
129
|
+
onCreated: setOpenId
|
|
130
|
+
}) : null,
|
|
131
|
+
openId ? /*#__PURE__*/ _jsx(ReturnDetailDialog, {
|
|
132
|
+
hostId: hostId,
|
|
133
|
+
returnId: openId,
|
|
134
|
+
onClose: ()=>setOpenId(null)
|
|
135
|
+
}) : null
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
OrderReturns.displayName = 'OrderReturns';
|
|
140
|
+
export default OrderReturns;
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=order-returns.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/order-returns.component.tsx"],"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'use client'\n\nimport * as CommerceModel from '../../model'\nimport { Button, Chip, Divider, Link, Stack, Typography } from '@mui/material'\nimport { collection, query, where } from 'firebase/firestore'\nimport { useMemo, useState } from 'react'\nimport { useFirestore, useFirestoreCollection } from '@aglyn/tenant-feature-instance'\nimport ReturnDetailDialog from './return-detail-dialog.component'\nimport StartReturnDialog from './start-return-dialog.component'\n\nexport interface OrderReturnsProps {\n hostId: string\n orderId: string\n order: CommerceModel.HostOrder\n}\n\n/** Order statuses a return may be started against — the route's own list. */\nconst STARTABLE_STATUSES = ['paid', 'partially_fulfilled', 'fulfilled', 'delivered']\n\n/**\n * The order dialog's returns (AGL-3611): the returns on this order, each\n * opening its return dialog, and \"Start return\" while the order can take one.\n * Kept out of `order-detail-dialog` on purpose: the dialog is shared by\n * several lanes, and this is one line there.\n *\n * `orderId ==` alone, on the automatic single-field index. An order holds a\n * handful of returns at most, so the read is the whole answer.\n */\nexport function OrderReturns(props: OrderReturnsProps) {\n const { hostId, orderId, order } = props\n const firestore = useFirestore()\n const { data: returnDocs } = useFirestoreCollection<CommerceModel.HostReturn & { $id: string }>(\n () => query(collection(firestore, 'hosts', hostId, 'returns'), where('orderId', '==', orderId)),\n [firestore, hostId, orderId],\n { idField: '$id' },\n )\n const returns = useMemo(\n () => [...(returnDocs ?? [])].sort((a, b) => (b.createdAtMs ?? 0) - (a.createdAtMs ?? 0)),\n [returnDocs],\n )\n const [starting, setStarting] = useState(false)\n const [openId, setOpenId] = useState<string | null>(null)\n const startable = STARTABLE_STATUSES.includes(order.status)\n\n if (!startable && returns.length === 0) return null\n return (\n <>\n <Divider />\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Typography variant=\"subtitle2\" sx={{ flex: 1 }}>\n {'Returns'}\n </Typography>\n {startable ? (\n <Button size=\"small\" onClick={() => setStarting(true)}>\n {'Start return'}\n </Button>\n ) : null}\n </Stack>\n {returns.length === 0 ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'No returns on this order.'}\n </Typography>\n ) : (\n returns.map((entry) => (\n <Stack key={entry.$id} direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Link\n component=\"button\"\n variant=\"body2\"\n onClick={() => setOpenId(entry.$id)}\n sx={{ flex: 1, textAlign: 'left' }}\n >\n {CommerceModel.describeReturnLines(order, entry.lines ?? [])}\n </Link>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {new Date(entry.createdAtMs).toLocaleDateString()}\n </Typography>\n <Chip\n label={CommerceModel.RETURN_STATUS_LABELS[entry.status] ?? entry.status}\n size=\"small\"\n color={CommerceModel.RETURN_STATUS_COLOR[entry.status] ?? 'default'}\n variant=\"outlined\"\n />\n </Stack>\n ))\n )}\n {starting ? (\n <StartReturnDialog\n hostId={hostId}\n orderId={orderId}\n order={order}\n existing={returns}\n open\n onClose={() => setStarting(false)}\n onCreated={setOpenId}\n />\n ) : null}\n {openId ? (\n <ReturnDetailDialog hostId={hostId} returnId={openId} onClose={() => setOpenId(null)} />\n ) : null}\n </>\n )\n}\nOrderReturns.displayName = 'OrderReturns'\n\nexport default OrderReturns\n"],"names":["CommerceModel","Button","Chip","Divider","Link","Stack","Typography","collection","query","where","useMemo","useState","useFirestore","useFirestoreCollection","ReturnDetailDialog","StartReturnDialog","STARTABLE_STATUSES","OrderReturns","props","hostId","orderId","order","firestore","data","returnDocs","idField","returns","sort","a","b","createdAtMs","starting","setStarting","openId","setOpenId","startable","includes","status","length","direction","spacing","sx","alignItems","variant","flex","size","onClick","color","map","entry","component","$id","textAlign","describeReturnLines","lines","Date","toLocaleDateString","label","RETURN_STATUS_LABELS","RETURN_STATUS_COLOR","existing","open","onClose","onCreated","returnId","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* The orders still to ship, as the export dialog's filter: orders that ship
|
|
19
|
+
* at all (`requiresShipping`, AGL-3613) that are paid or part-shipped —
|
|
20
|
+
* one indexed query, `(requiresShipping, status, createdAtMs)`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ORDERS_TO_SHIP_FILTER: {
|
|
23
|
+
readonly label: "orders still to ship";
|
|
24
|
+
readonly value: {
|
|
25
|
+
readonly filters: readonly [{
|
|
26
|
+
readonly path: "requiresShipping";
|
|
27
|
+
readonly op: "==";
|
|
28
|
+
readonly value: true;
|
|
29
|
+
}, {
|
|
30
|
+
readonly path: "status";
|
|
31
|
+
readonly op: "in";
|
|
32
|
+
readonly value: readonly ["paid", "partially_fulfilled"];
|
|
33
|
+
}];
|
|
34
|
+
readonly orderBy: {
|
|
35
|
+
readonly path: "createdAtMs";
|
|
36
|
+
readonly direction: "desc";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export interface OrderShippingActionsProps {
|
|
41
|
+
hostId: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The orders card's shipping actions, for its header (AGL-3613): Export for
|
|
45
|
+
* shipping — the orders still to ship, laid out for Pirate Ship, Shippo,
|
|
46
|
+
* EasyPost or any tool — and Import tracking, which records each parcel in a
|
|
47
|
+
* label tool's file as a shipment. Each shows only when the transfer
|
|
48
|
+
* launcher's `can` admits the person; off the console shell, nothing.
|
|
49
|
+
*/
|
|
50
|
+
export declare function OrderShippingActions(props: OrderShippingActionsProps): import("react").JSX.Element;
|
|
51
|
+
export declare namespace OrderShippingActions {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
export default OrderShippingActions;
|