@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/return-detail-dialog.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 { useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n type ConsoleWidgetSlotRenderer,\n useConsoleWidgetSlot,\n} from '@aglyn/aglyn/app-utils/console-widget-slot-context'\nimport {\n Button,\n Checkbox,\n Chip,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n FormControlLabel,\n InputAdornment,\n Link,\n MenuItem,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { collection, doc, limit, query } from 'firebase/firestore'\nimport { memo, useCallback, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreCollection,\n useFirestoreDoc,\n useUser,\n} from '@aglyn/tenant-feature-instance'\nimport { formatMoney, postReturnAction } from './return-actions'\nimport {\n type ConsoleReturnLabelRequest,\n type ConsoleReturnZoneReturn,\n RETURN_DETAIL_ZONE,\n} from './return-zones'\n\nexport interface ReturnDetailDialogProps {\n hostId: string\n /** The return to show; `null` keeps the dialog closed. */\n returnId: string | null\n onClose: () => void\n}\n\n/** The locations a receive may restock to — the locations card's own window. */\nconst LOCATION_WINDOW = 25\n\n/** The panel open beneath the details, one at a time. */\ntype Panel = 'approve' | 'decline' | 'receive' | 'refund' | null\n\n/**\n * A zone hosted in the dialog, drawn again only when what it is handed\n * changes — the order dialog's reasoning: the shell's renderer is not\n * memoized, and the dialog redraws on every keystroke in its fields.\n */\nconst HostedZone = memo(function HostedZone(\n props: { renderer: ConsoleWidgetSlotRenderer; slot: string } & Record<string, unknown>,\n) {\n const { renderer: Renderer, ...zone } = props\n return <Renderer {...zone} />\n})\n\nconst centsFromInput = (value: string) => Math.round(Number(value) * 100)\n\n/**\n * One return (AGL-3611): what is coming back and why, the notes on both\n * sides, the label and the restock, its timeline, and the actions its state\n * allows (`canTransitionReturn`). Every action is the returns route — the\n * return is never written from here — and the dialog reads the return live,\n * so what the route wrote is what it shows next.\n */\nexport function ReturnDetailDialog(props: ReturnDetailDialogProps) {\n const { hostId, returnId, onClose } = props\n const firestore = useFirestore()\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const { confirm } = useConfirmationContext()\n const WidgetSlot = useConsoleWidgetSlot()\n\n const { data: entry } = useFirestoreDoc<CommerceModel.HostReturn>(\n () => (returnId ? doc(firestore, 'hosts', hostId, 'returns', returnId) : null),\n [firestore, hostId, returnId],\n )\n const orderId = entry?.orderId ?? null\n const { data: rawOrder } = useFirestoreDoc<CommerceModel.HostOrder>(\n () => (orderId ? doc(firestore, 'hosts', hostId, 'orders', orderId) : null),\n [firestore, hostId, orderId],\n )\n const { data: store } = useFirestoreDoc<Record<string, any>>(\n () => (returnId ? doc(firestore, 'hosts', hostId, 'settings', 'store') : null),\n [firestore, hostId, returnId],\n )\n const [panel, setPanel] = useState<Panel>(null)\n // The locations are read only to set up a receive, or to name the one a\n // receive restocked to.\n const readLocations = panel === 'receive' || Boolean(entry?.restock?.locationId)\n const { data: locationDocs } = useFirestoreCollection<any>(\n () =>\n readLocations\n ? query(collection(firestore, 'hosts', hostId, 'locations'), limit(LOCATION_WINDOW))\n : null,\n [firestore, hostId, readLocations],\n { idField: '$id' },\n )\n const locations = useMemo(\n () =>\n [...(locationDocs ?? [])].sort((a: any, b: any) =>\n String(a.name ?? '').localeCompare(String(b.name ?? '')),\n ),\n [locationDocs],\n )\n\n const order = useMemo(\n () => (rawOrder ? CommerceModel.liftLegacyOrder(rawOrder as never) : null),\n [rawOrder],\n )\n const currency = String(store?.currency ?? 'USD').toUpperCase()\n const [busy, setBusy] = useState(false)\n const [buyerNote, setBuyerNote] = useState('')\n const [notify, setNotify] = useState(true)\n const [restock, setRestock] = useState<Record<number, string>>({})\n const [locationId, setLocationId] = useState('')\n const [amount, setAmount] = useState('')\n const [merchantNote, setMerchantNote] = useState<string | null>(null)\n\n const lineName = useCallback(\n (lineItemId: number) => {\n const line = order?.lineItems?.[lineItemId]\n if (!line) return `Line ${lineItemId + 1}`\n return line.variantLabel ? `${line.name} — ${line.variantLabel}` : line.name\n },\n [order],\n )\n\n const suggestedRefundCents = useMemo(\n () => (order && entry ? CommerceModel.returnRefundCents(order, entry.lines ?? []) : 0),\n [order, entry],\n )\n\n const run = useCallback(\n async (body: Record<string, unknown>, done: string) => {\n if (!returnId) return false\n setBusy(true)\n try {\n const outcome = await postReturnAction(user, { hostId, returnId, ...body })\n if (!outcome.ok) {\n enqueueSnackbar(outcome.message, {\n variant: outcome.refused ? 'warning' : 'error',\n allowDuplicate: true,\n })\n return false\n }\n enqueueSnackbar(outcome.payload['already'] ? 'Nothing to change — already done' : done, {\n variant: 'success',\n persist: false,\n })\n setPanel(null)\n return true\n } finally {\n setBusy(false)\n }\n },\n [returnId, user, hostId, enqueueSnackbar],\n )\n\n const openPanel = useCallback(\n (next: Panel) => {\n setPanel(next)\n setBuyerNote('')\n setNotify(true)\n if (next === 'receive' && entry) {\n setRestock(\n Object.fromEntries(entry.lines.map((line) => [line.lineItemId, String(line.quantity)])),\n )\n setLocationId('')\n }\n if (next === 'refund') setAmount((suggestedRefundCents / 100).toFixed(2))\n },\n [entry, suggestedRefundCents],\n )\n\n const handleDecision = useCallback(\n (action: 'approve' | 'decline') =>\n run(\n {\n action,\n ...(buyerNote.trim() ? { merchantNote: buyerNote.trim() } : {}),\n notify,\n },\n action === 'approve' ? 'Return approved' : 'Return declined',\n ),\n [run, buyerNote, notify],\n )\n\n const defaultLocationId =\n locations.find((location: any) => location.isDefault)?.$id ?? locations[0]?.$id ?? ''\n const handleReceive = useCallback(() => {\n if (!entry) return\n const chosen = locationId || defaultLocationId\n return run(\n {\n action: 'receive',\n restock: entry.lines.map((line) => ({\n lineItemId: line.lineItemId,\n quantity: Math.max(0, Math.floor(Number(restock[line.lineItemId] ?? 0) || 0)),\n })),\n ...(chosen ? { locationId: chosen } : {}),\n },\n 'Return received',\n )\n }, [entry, restock, locationId, defaultLocationId, run])\n\n const refundCents = centsFromInput(amount)\n const refundValid = Number.isInteger(refundCents) && refundCents > 0\n const handleRefund = useCallback(async () => {\n if (!refundValid) return\n const confirmed = await confirm({\n title: 'Refund this return?',\n description:\n `Refunds ${formatMoney(refundCents, currency)} to the buyer through Stripe, ` +\n 'through the order’s own refund. The buyer is emailed.',\n confirmationText: 'Refund',\n confirmationButtonProps: { color: 'error' },\n })\n .then(() => true)\n .catch(() => false)\n if (!confirmed) return\n await run({ action: 'refund', amountCents: refundCents }, 'Refund issued')\n }, [confirm, refundValid, refundCents, currency, run])\n\n const noteDraft = merchantNote ?? entry?.merchantNote ?? ''\n const handleSaveNote = useCallback(async () => {\n const saved = await run({ action: 'note', merchantNote: noteDraft.trim() }, 'Note saved')\n if (saved) setMerchantNote(null)\n }, [run, noteDraft])\n\n const attachReturnLabel = useCallback(\n async (label: ConsoleReturnLabelRequest) => {\n if (!returnId) throw new Error('No return is open')\n const outcome = await postReturnAction(user, {\n hostId,\n returnId,\n action: 'attach-label',\n label: {\n carrier: label.carrier,\n trackingNumber: label.trackingNumber,\n labelUrl: label.labelUrl,\n ...(label.trackingUrl ? { trackingUrl: label.trackingUrl } : {}),\n },\n })\n if (!outcome.ok) throw new Error(outcome.message)\n },\n [user, hostId, returnId],\n )\n\n const zoneReturn = useMemo((): ConsoleReturnZoneReturn | null => {\n if (!entry || !returnId) return null\n const address = order?.shippingAddress\n return {\n id: returnId,\n status: entry.status,\n orderId: entry.orderId,\n orderNumber: entry.orderNumber,\n customerName: entry.customerName ?? null,\n customerEmail: entry.customerEmail ?? null,\n lines: (entry.lines ?? []).map((line) => ({\n lineItemId: line.lineItemId,\n name: order?.lineItems?.[line.lineItemId]?.name ?? `Line ${line.lineItemId + 1}`,\n variantLabel: order?.lineItems?.[line.lineItemId]?.variantLabel ?? null,\n quantity: line.quantity,\n reason: line.reason,\n })),\n fromAddress: address\n ? {\n name: address.name ?? null,\n line1: address.line1 ?? null,\n line2: address.line2 ?? null,\n city: address.city ?? null,\n state: address.state ?? null,\n postalCode: address.postalCode ?? null,\n country: address.country ?? null,\n phone: address.phone ?? null,\n }\n : null,\n returnLabel: entry.returnLabel\n ? {\n carrier: entry.returnLabel.carrier,\n trackingNumber: entry.returnLabel.trackingNumber,\n labelUrl: entry.returnLabel.labelUrl,\n trackingUrl: entry.returnLabel.trackingUrl ?? null,\n attachedAtMs: entry.returnLabel.attachedAtMs,\n }\n : null,\n }\n }, [entry, order, returnId])\n\n if (!returnId) return null\n const status = entry?.status\n const can = (to: CommerceModel.ReturnStatus) =>\n Boolean(status) && CommerceModel.canTransitionReturn(status as CommerceModel.ReturnStatus, to)\n const restockLocationName = entry?.restock?.locationId\n ? (locations.find((location: any) => location.$id === entry.restock?.locationId)?.name ??\n null)\n : null\n\n return (\n <Dialog open onClose={onClose} maxWidth=\"sm\" fullWidth>\n <DialogTitle>\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <span>{entry ? `Return for order ${entry.orderNumber}` : 'Return'}</span>\n {status ? (\n <Chip\n label={CommerceModel.RETURN_STATUS_LABELS[status] ?? status}\n size=\"small\"\n color={CommerceModel.RETURN_STATUS_COLOR[status] ?? 'default'}\n variant=\"outlined\"\n />\n ) : null}\n </Stack>\n </DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>\n {!entry ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Loading the return…'}\n </Typography>\n ) : (\n <>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {[entry.customerName, entry.customerEmail].filter(Boolean).join(' · ') ||\n 'Guest buyer'}\n {entry.requestedBy === 'merchant' ? ' · Opened by the store' : ''}\n </Typography>\n {(entry.lines ?? []).map((line) => (\n <Stack\n key={line.lineItemId}\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center' }}\n >\n <Typography variant=\"body2\" sx={{ flex: 1 }}>\n {`${line.quantity}× ${lineName(line.lineItemId)}`}\n </Typography>\n <Chip\n label={CommerceModel.RETURN_REASON_LABELS[line.reason] ?? line.reason}\n size=\"small\"\n variant=\"outlined\"\n />\n </Stack>\n ))}\n {entry.customerNote ? (\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Customer note'}</Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {entry.customerNote}\n </Typography>\n </Stack>\n ) : null}\n {entry.returnLabel ? (\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Return label'}</Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`${entry.returnLabel.carrier} · ${entry.returnLabel.trackingNumber}`}\n </Typography>\n <Stack direction=\"row\" spacing={2}>\n <Link href={entry.returnLabel.labelUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n {'Print label'}\n </Link>\n {entry.returnLabel.trackingUrl ? (\n <Link\n href={entry.returnLabel.trackingUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {'Track parcel'}\n </Link>\n ) : null}\n </Stack>\n </Stack>\n ) : null}\n {entry.restock ? (\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Restocked'}</Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {entry.restock.lines.length\n ? entry.restock.lines\n .map((line) => `${line.quantity}× ${lineName(line.lineItemId)}`)\n .join(', ')\n : 'Nothing went back on the shelf'}\n {restockLocationName ? ` at ${restockLocationName}` : ''}\n {` · ${new Date(entry.restock.atMs).toLocaleDateString()}`}\n </Typography>\n </Stack>\n ) : null}\n {entry.refundedAtMs ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`Refunded ${formatMoney(entry.refundCents ?? 0, currency)} on ${new Date(\n entry.refundedAtMs,\n ).toLocaleDateString()}`}\n </Typography>\n ) : null}\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'flex-start' }}>\n <TextField\n label=\"Merchant note\"\n value={noteDraft}\n onChange={(event) => setMerchantNote(event.target.value)}\n size=\"small\"\n multiline\n sx={{ flex: 1 }}\n slotProps={{ htmlInput: { maxLength: CommerceModel.RETURN_NOTE_MAX } }}\n />\n <Button\n size=\"small\"\n disabled={busy || merchantNote === null}\n onClick={handleSaveNote}\n >\n {'Save note'}\n </Button>\n </Stack>\n\n {panel === 'approve' || panel === 'decline' ? (\n <Stack spacing={1}>\n <Divider />\n <TextField\n label=\"Note to the customer (optional)\"\n value={buyerNote}\n onChange={(event) => setBuyerNote(event.target.value)}\n size=\"small\"\n multiline\n minRows={2}\n slotProps={{ htmlInput: { maxLength: CommerceModel.RETURN_NOTE_MAX } }}\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={notify}\n onChange={(event) => setNotify(event.target.checked)}\n />\n }\n label=\"Notify customer\"\n />\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"contained\"\n color={panel === 'decline' ? 'error' : 'primary'}\n disabled={busy}\n onClick={() => handleDecision(panel)}\n >\n {panel === 'approve' ? 'Approve return' : 'Decline return'}\n </Button>\n <Button disabled={busy} onClick={() => setPanel(null)}>\n {'Back'}\n </Button>\n </Stack>\n </Stack>\n ) : null}\n\n {panel === 'receive' ? (\n <Stack spacing={1}>\n <Divider />\n <Typography variant=\"subtitle2\">{'Put back on the shelf'}</Typography>\n {entry.lines.map((line) => (\n <Stack\n key={line.lineItemId}\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center' }}\n >\n <Typography variant=\"body2\" sx={{ flex: 1 }}>\n {lineName(line.lineItemId)}\n </Typography>\n <TextField\n label={`Restock (of ${line.quantity})`}\n type=\"number\"\n size=\"small\"\n value={restock[line.lineItemId] ?? ''}\n onChange={(event) =>\n setRestock((prior) => ({ ...prior, [line.lineItemId]: event.target.value }))\n }\n slotProps={{ htmlInput: { min: 0, max: line.quantity, step: 1 } }}\n sx={{ width: 150 }}\n />\n </Stack>\n ))}\n {locations.length > 0 ? (\n <TextField\n label=\"Location\"\n select\n size=\"small\"\n value={locationId || defaultLocationId}\n onChange={(event) => setLocationId(event.target.value)}\n sx={{ maxWidth: 280 }}\n >\n {locations.map((location: any) => (\n <MenuItem key={location.$id} value={location.$id}>\n {location.name ?? location.$id}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n <Stack direction=\"row\" spacing={1}>\n <Button variant=\"contained\" color=\"primary\" disabled={busy} onClick={handleReceive}>\n {'Confirm received'}\n </Button>\n <Button disabled={busy} onClick={() => setPanel(null)}>\n {'Back'}\n </Button>\n </Stack>\n </Stack>\n ) : null}\n\n {panel === 'refund' ? (\n <Stack spacing={1}>\n <Divider />\n <TextField\n label=\"Refund amount\"\n type=\"number\"\n size=\"small\"\n value={amount}\n onChange={(event) => setAmount(event.target.value)}\n error={!refundValid}\n helperText={\n `Suggested ${formatMoney(suggestedRefundCents, currency)} — what the returned ` +\n 'items were paid, shipping and tax left out. Change it to refund more or less.'\n }\n slotProps={{\n htmlInput: { min: 0, step: 0.01 },\n input: {\n startAdornment: <InputAdornment position=\"start\">{currency}</InputAdornment>,\n },\n }}\n sx={{ maxWidth: 360 }}\n />\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"contained\"\n color=\"error\"\n disabled={busy || !refundValid}\n onClick={handleRefund}\n >\n {'Refund'}\n </Button>\n <Button disabled={busy} onClick={() => setPanel(null)}>\n {'Back'}\n </Button>\n </Stack>\n </Stack>\n ) : null}\n\n {/*\n The return zone (AGL-3611): a shipping plugin's widget buys the\n buyer a label and attaches it through `attachReturnLabel`, this\n dialog's own route.\n */}\n {WidgetSlot && zoneReturn ? (\n <HostedZone\n renderer={WidgetSlot}\n slot={RETURN_DETAIL_ZONE.id}\n hostId={hostId}\n orgId={undefined}\n return={zoneReturn}\n attachReturnLabel={attachReturnLabel}\n />\n ) : null}\n\n <Divider />\n <Typography variant=\"subtitle2\">{'Timeline'}</Typography>\n {(entry.timeline ?? [])\n .slice()\n .reverse()\n .map((event, index) => (\n <Typography key={index} variant=\"caption\" color=\"text.secondary\">\n {`${new Date(event.atMs).toLocaleString()} — ${event.event}` +\n (event.detail ? `: ${event.detail}` : '')}\n </Typography>\n ))}\n </>\n )}\n </DialogContent>\n <DialogActions>\n {can('closed') ? (\n <Button\n disabled={busy}\n onClick={() => run({ action: 'close' }, 'Return closed')}\n >\n {'Close return'}\n </Button>\n ) : null}\n {can('declined') && panel === null ? (\n <Button color=\"error\" disabled={busy} onClick={() => openPanel('decline')}>\n {'Decline'}\n </Button>\n ) : null}\n {can('refunded') && panel === null ? (\n <Button color=\"error\" disabled={busy || !order} onClick={() => openPanel('refund')}>\n {'Refund…'}\n </Button>\n ) : null}\n {can('received') && panel === null ? (\n <Button disabled={busy} onClick={() => openPanel('receive')}>\n {'Mark received…'}\n </Button>\n ) : null}\n {can('approved') && panel === null ? (\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={busy}\n onClick={() => openPanel('approve')}\n >\n {'Approve'}\n </Button>\n ) : null}\n <Button onClick={onClose}>{'Done'}</Button>\n </DialogActions>\n </Dialog>\n )\n}\nReturnDetailDialog.displayName = 'ReturnDetailDialog'\n\nexport default ReturnDetailDialog\n"],"names":["CommerceModel","useConfirmationContext","useSnackbar","useConsoleWidgetSlot","Button","Checkbox","Chip","Dialog","DialogActions","DialogContent","DialogTitle","Divider","FormControlLabel","InputAdornment","Link","MenuItem","Stack","TextField","Typography","collection","doc","limit","query","memo","useCallback","useMemo","useState","useFirestore","useFirestoreCollection","useFirestoreDoc","useUser","formatMoney","postReturnAction","RETURN_DETAIL_ZONE","LOCATION_WINDOW","HostedZone","props","renderer","Renderer","zone","centsFromInput","value","Math","round","Number","ReturnDetailDialog","locations","merchantNote","entry","hostId","returnId","onClose","firestore","data","user","enqueueSnackbar","confirm","WidgetSlot","orderId","rawOrder","store","panel","setPanel","readLocations","Boolean","restock","locationId","locationDocs","idField","sort","a","b","String","name","localeCompare","order","liftLegacyOrder","currency","toUpperCase","busy","setBusy","buyerNote","setBuyerNote","notify","setNotify","setRestock","setLocationId","amount","setAmount","setMerchantNote","lineName","lineItemId","line","lineItems","variantLabel","suggestedRefundCents","returnRefundCents","lines","run","body","done","outcome","ok","message","variant","refused","allowDuplicate","payload","persist","openPanel","next","Object","fromEntries","map","quantity","toFixed","handleDecision","action","trim","defaultLocationId","find","location","isDefault","$id","handleReceive","chosen","max","floor","refundCents","refundValid","isInteger","handleRefund","confirmed","title","description","confirmationText","confirmationButtonProps","color","then","catch","amountCents","noteDraft","handleSaveNote","saved","attachReturnLabel","label","Error","carrier","trackingNumber","labelUrl","trackingUrl","zoneReturn","address","shippingAddress","id","status","orderNumber","customerName","customerEmail","reason","fromAddress","line1","line2","city","state","postalCode","country","phone","returnLabel","attachedAtMs","can","to","canTransitionReturn","restockLocationName","open","maxWidth","fullWidth","direction","spacing","sx","alignItems","span","RETURN_STATUS_LABELS","size","RETURN_STATUS_COLOR","display","flexDirection","gap","filter","join","requestedBy","flex","RETURN_REASON_LABELS","customerNote","href","target","rel","length","Date","atMs","toLocaleDateString","refundedAtMs","onChange","event","multiline","slotProps","htmlInput","maxLength","RETURN_NOTE_MAX","disabled","onClick","minRows","control","checked","type","prior","min","step","width","select","error","helperText","input","startAdornment","position","slot","orgId","undefined","return","timeline","slice","reverse","index","toLocaleString","detail","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;AAEA,YAAYA,mBAAmB,uBAAa;AAC5C,SAASC,sBAAsB,QAAQ,uBAAsB;AAC7D,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAEEC,oBAAoB,QACf,qDAAoD;AAC3D,SACEC,MAAM,EACNC,QAAQ,EACRC,IAAI,EACJC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,UAAU,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,qBAAoB;AAClE,SAASC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAC5D,SACEC,YAAY,EACZC,sBAAsB,EACtBC,eAAe,EACfC,OAAO,QACF,iCAAgC;AACvC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,sBAAkB;AAChE,SAGEC,kBAAkB,QACb,oBAAgB;AASvB,8EAA8E,GAC9E,MAAMC,kBAAkB;AAKxB;;;;CAIC,GACD,MAAMC,2BAAaZ,KAAK,SAASY,WAC/BC,KAAsF;IAEtF,MAAM,EAAEC,UAAUC,QAAQ,EAAW,GAAGF,OAATG,wCAASH;;;IACxC,qBAAO,KAACE,uBAAaC;AAC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UAAUlI;wBACVmI,SAAS,IAAMhH,IAAI;gCAAEmB,QAAQ;4BAAQ,GAAG;kCAEvC;yBAED;oBACHqD,IAAI,eAAe7G,UAAU,qBAC5B,KAACzD;wBAAOqI,OAAM;wBAAQwE,UAAUlI;wBAAMmI,SAAS,IAAMrG,UAAU;kCAC5D;yBAED;oBACH6D,IAAI,eAAe7G,UAAU,qBAC5B,KAACzD;wBAAOqI,OAAM;wBAAQwE,UAAUlI,QAAQ,CAACJ;wBAAOuI,SAAS,IAAMrG,UAAU;kCACtE;yBAED;oBACH6D,IAAI,eAAe7G,UAAU,qBAC5B,KAACzD;wBAAO6M,UAAUlI;wBAAMmI,SAAS,IAAMrG,UAAU;kCAC9C;yBAED;oBACH6D,IAAI,eAAe7G,UAAU,qBAC5B,KAACzD;wBACCoG,SAAQ;wBACRiC,OAAM;wBACNwE,UAAUlI;wBACVmI,SAAS,IAAMrG,UAAU;kCAExB;yBAED;kCACJ,KAACzG;wBAAO8M,SAAS/J;kCAAU;;;;;;AAInC;AACAN,mBAAmB8L,WAAW,GAAG;AAEjC,eAAe9L,mBAAkB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export interface ReturnSettingsCardProps {
|
|
18
|
+
hostId: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Return settings (AGL-3611) on `hosts/{hostId}/settings/store` `returns`:
|
|
22
|
+
* whether buyers may ask for a return online, for how many days after the
|
|
23
|
+
* order shipped, and which product types. The rules are the buyer's alone —
|
|
24
|
+
* a merchant may start a return on any order from the order dialog.
|
|
25
|
+
*
|
|
26
|
+
* Written as the store settings card writes the same document: guarded by a
|
|
27
|
+
* server-confirmed seed, merged so the other cards' fields stay, and with the
|
|
28
|
+
* site's cache drop, since the buyer's account page offers returns from it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ReturnSettingsCard(props: ReturnSettingsCardProps): import("react").JSX.Element;
|
|
31
|
+
export declare namespace ReturnSettingsCard {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export default ReturnSettingsCard;
|
|
@@ -0,0 +1,195 @@
|
|
|
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 { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import * as CommerceModel from "../../model/index.js";
|
|
20
|
+
import { CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
22
|
+
import { Button, Checkbox, FormControlLabel, FormGroup, FormLabel, Stack, Switch, TextField } from "@mui/material";
|
|
23
|
+
import { doc } from "firebase/firestore";
|
|
24
|
+
import { useCallback, useMemo, useState } from "react";
|
|
25
|
+
import { useFirestore, useFirestoreDoc, useUser, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
26
|
+
import { pluginDocsHelp } from "@aglyn/aglyn";
|
|
27
|
+
import { writeSiteWideChange } from "@aglyn/tenant-feature-instance/hooks/helpers/site-wide-change";
|
|
28
|
+
const PRODUCT_TYPE_LABELS = {
|
|
29
|
+
physical: 'Physical products',
|
|
30
|
+
digital: 'Digital products',
|
|
31
|
+
service: 'Services'
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Return settings (AGL-3611) on `hosts/{hostId}/settings/store` `returns`:
|
|
35
|
+
* whether buyers may ask for a return online, for how many days after the
|
|
36
|
+
* order shipped, and which product types. The rules are the buyer's alone —
|
|
37
|
+
* a merchant may start a return on any order from the order dialog.
|
|
38
|
+
*
|
|
39
|
+
* Written as the store settings card writes the same document: guarded by a
|
|
40
|
+
* server-confirmed seed, merged so the other cards' fields stay, and with the
|
|
41
|
+
* site's cache drop, since the buyer's account page offers returns from it.
|
|
42
|
+
*/ export function ReturnSettingsCard(props) {
|
|
43
|
+
const { hostId } = props;
|
|
44
|
+
const firestore = useFirestore();
|
|
45
|
+
const { data: user } = useUser();
|
|
46
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
47
|
+
const { data: store, status: storeStatus, fromCache: storeFromCache } = useFirestoreDoc(()=>doc(firestore, 'hosts', hostId, 'settings', 'store'), [
|
|
48
|
+
firestore,
|
|
49
|
+
hostId
|
|
50
|
+
]);
|
|
51
|
+
const [draft, setDraft] = useState(null);
|
|
52
|
+
const current = useMemo(()=>{
|
|
53
|
+
if (draft) return draft;
|
|
54
|
+
const saved = CommerceModel.readReturnSettings(store == null ? void 0 : store.returns);
|
|
55
|
+
return {
|
|
56
|
+
enabled: saved.enabled,
|
|
57
|
+
windowDays: String(saved.windowDays),
|
|
58
|
+
eligibleTypes: saved.eligibleTypes
|
|
59
|
+
};
|
|
60
|
+
}, [
|
|
61
|
+
draft,
|
|
62
|
+
store
|
|
63
|
+
]);
|
|
64
|
+
const update = (patch)=>setDraft(_extends({}, current, patch));
|
|
65
|
+
const days = Number(current.windowDays);
|
|
66
|
+
const daysValid = current.windowDays.trim() !== '' && Number.isInteger(days) && days >= 0 && days <= CommerceModel.RETURN_WINDOW_MAX_DAYS;
|
|
67
|
+
const toggleType = (type, on)=>update({
|
|
68
|
+
eligibleTypes: on ? [
|
|
69
|
+
...current.eligibleTypes.filter((entry)=>entry !== type),
|
|
70
|
+
type
|
|
71
|
+
] : current.eligibleTypes.filter((entry)=>entry !== type)
|
|
72
|
+
});
|
|
73
|
+
const handleSave = useCallback(async ()=>{
|
|
74
|
+
if (!daysValid) return;
|
|
75
|
+
const verdict = await writeGuardedBySeed({
|
|
76
|
+
subject: 'return settings',
|
|
77
|
+
unreadable: storeStatus === 'error',
|
|
78
|
+
fromCache: storeFromCache
|
|
79
|
+
}, async ()=>{
|
|
80
|
+
await writeSiteWideChange({
|
|
81
|
+
firestore,
|
|
82
|
+
user,
|
|
83
|
+
hostId,
|
|
84
|
+
write: (batch)=>batch.set(doc(firestore, 'hosts', hostId, 'settings', 'store'), {
|
|
85
|
+
returns: {
|
|
86
|
+
enabled: current.enabled,
|
|
87
|
+
windowDays: days,
|
|
88
|
+
eligibleTypes: [
|
|
89
|
+
'physical',
|
|
90
|
+
'digital',
|
|
91
|
+
'service'
|
|
92
|
+
].filter((type)=>current.eligibleTypes.includes(type))
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
merge: true
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
if (!verdict.ok) {
|
|
100
|
+
return void enqueueSnackbar(verdict.message, {
|
|
101
|
+
variant: 'warning',
|
|
102
|
+
persist: false
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
setDraft(null);
|
|
106
|
+
enqueueSnackbar('Return settings saved', {
|
|
107
|
+
variant: 'success',
|
|
108
|
+
persist: false
|
|
109
|
+
});
|
|
110
|
+
}, [
|
|
111
|
+
daysValid,
|
|
112
|
+
storeStatus,
|
|
113
|
+
storeFromCache,
|
|
114
|
+
firestore,
|
|
115
|
+
user,
|
|
116
|
+
hostId,
|
|
117
|
+
current,
|
|
118
|
+
days,
|
|
119
|
+
enqueueSnackbar
|
|
120
|
+
]);
|
|
121
|
+
return /*#__PURE__*/ _jsx(CardDisplay, {
|
|
122
|
+
header: 'Returns',
|
|
123
|
+
help: pluginDocsHelp('ordersAndReturns', {
|
|
124
|
+
anchor: '#buyer-requests'
|
|
125
|
+
}),
|
|
126
|
+
contentGutterX: true,
|
|
127
|
+
contentGutterY: true,
|
|
128
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
129
|
+
spacing: 1.5,
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
132
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
133
|
+
size: "small",
|
|
134
|
+
checked: current.enabled,
|
|
135
|
+
onChange: (event)=>update({
|
|
136
|
+
enabled: event.target.checked
|
|
137
|
+
})
|
|
138
|
+
}),
|
|
139
|
+
label: "Accept return requests online"
|
|
140
|
+
}),
|
|
141
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
142
|
+
label: "Return window in days",
|
|
143
|
+
type: "number",
|
|
144
|
+
value: current.windowDays,
|
|
145
|
+
onChange: (event)=>update({
|
|
146
|
+
windowDays: event.target.value
|
|
147
|
+
}),
|
|
148
|
+
size: "small",
|
|
149
|
+
error: !daysValid,
|
|
150
|
+
helperText: `Days after the order shipped (or was placed, when nothing ships), 0–${CommerceModel.RETURN_WINDOW_MAX_DAYS}`,
|
|
151
|
+
slotProps: {
|
|
152
|
+
htmlInput: {
|
|
153
|
+
min: 0,
|
|
154
|
+
max: CommerceModel.RETURN_WINDOW_MAX_DAYS,
|
|
155
|
+
step: 1
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
sx: {
|
|
159
|
+
maxWidth: 320
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ _jsxs(FormGroup, {
|
|
163
|
+
children: [
|
|
164
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
165
|
+
children: 'Returnable product types'
|
|
166
|
+
}),
|
|
167
|
+
Object.keys(PRODUCT_TYPE_LABELS).map((type)=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
168
|
+
control: /*#__PURE__*/ _jsx(Checkbox, {
|
|
169
|
+
size: "small",
|
|
170
|
+
checked: current.eligibleTypes.includes(type),
|
|
171
|
+
onChange: (event)=>toggleType(type, event.target.checked)
|
|
172
|
+
}),
|
|
173
|
+
label: PRODUCT_TYPE_LABELS[type]
|
|
174
|
+
}, type))
|
|
175
|
+
]
|
|
176
|
+
}),
|
|
177
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
178
|
+
variant: "contained",
|
|
179
|
+
color: "primary",
|
|
180
|
+
size: "small",
|
|
181
|
+
disabled: !draft || !daysValid,
|
|
182
|
+
onClick: handleSave,
|
|
183
|
+
sx: {
|
|
184
|
+
alignSelf: 'flex-start'
|
|
185
|
+
},
|
|
186
|
+
children: 'Save return settings'
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
ReturnSettingsCard.displayName = 'ReturnSettingsCard';
|
|
193
|
+
export default ReturnSettingsCard;
|
|
194
|
+
|
|
195
|
+
//# sourceMappingURL=return-settings-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/return-settings-card.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 { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Button,\n Checkbox,\n FormControlLabel,\n FormGroup,\n FormLabel,\n Stack,\n Switch,\n TextField,\n} from '@mui/material'\nimport { doc } from 'firebase/firestore'\nimport { useCallback, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreDoc,\n useUser,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport { pluginDocsHelp } from '@aglyn/aglyn'\nimport { writeSiteWideChange } from '@aglyn/tenant-feature-instance/hooks/helpers/site-wide-change'\nimport type { ProductType } from '../../model/commerce'\n\nexport interface ReturnSettingsCardProps {\n hostId: string\n}\n\nconst PRODUCT_TYPE_LABELS: Record<ProductType, string> = {\n physical: 'Physical products',\n digital: 'Digital products',\n service: 'Services',\n}\n\n/**\n * Return settings (AGL-3611) on `hosts/{hostId}/settings/store` `returns`:\n * whether buyers may ask for a return online, for how many days after the\n * order shipped, and which product types. The rules are the buyer's alone —\n * a merchant may start a return on any order from the order dialog.\n *\n * Written as the store settings card writes the same document: guarded by a\n * server-confirmed seed, merged so the other cards' fields stay, and with the\n * site's cache drop, since the buyer's account page offers returns from it.\n */\nexport function ReturnSettingsCard(props: ReturnSettingsCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const {\n data: store,\n status: storeStatus,\n fromCache: storeFromCache,\n } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId, 'settings', 'store'),\n [firestore, hostId],\n )\n const [draft, setDraft] = useState<{\n enabled: boolean\n windowDays: string\n eligibleTypes: ProductType[]\n } | null>(null)\n const current = useMemo(() => {\n if (draft) return draft\n const saved = CommerceModel.readReturnSettings(store?.returns)\n return {\n enabled: saved.enabled,\n windowDays: String(saved.windowDays),\n eligibleTypes: saved.eligibleTypes,\n }\n }, [draft, store])\n const update = (patch: Partial<typeof current>) => setDraft({ ...current, ...patch })\n\n const days = Number(current.windowDays)\n const daysValid =\n current.windowDays.trim() !== '' &&\n Number.isInteger(days) &&\n days >= 0 &&\n days <= CommerceModel.RETURN_WINDOW_MAX_DAYS\n\n const toggleType = (type: ProductType, on: boolean) =>\n update({\n eligibleTypes: on\n ? [...current.eligibleTypes.filter((entry) => entry !== type), type]\n : current.eligibleTypes.filter((entry) => entry !== type),\n })\n\n const handleSave = useCallback(async () => {\n if (!daysValid) return\n const verdict = await writeGuardedBySeed(\n {\n subject: 'return settings',\n unreadable: storeStatus === 'error',\n fromCache: storeFromCache,\n },\n async () => {\n await writeSiteWideChange({\n firestore,\n user,\n hostId,\n write: (batch) =>\n batch.set(\n doc(firestore, 'hosts', hostId, 'settings', 'store'),\n {\n returns: {\n enabled: current.enabled,\n windowDays: days,\n eligibleTypes: (['physical', 'digital', 'service'] as ProductType[]).filter(\n (type) => current.eligibleTypes.includes(type),\n ),\n },\n },\n { merge: true },\n ),\n })\n },\n )\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, { variant: 'warning', persist: false })\n }\n setDraft(null)\n enqueueSnackbar('Return settings saved', { variant: 'success', persist: false })\n }, [daysValid, storeStatus, storeFromCache, firestore, user, hostId, current, days, enqueueSnackbar])\n\n return (\n <CardDisplay\n header={'Returns'}\n help={pluginDocsHelp('ordersAndReturns', { anchor: '#buyer-requests' })}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={1.5}>\n <FormControlLabel\n control={\n <Switch\n size=\"small\"\n checked={current.enabled}\n onChange={(event) => update({ enabled: event.target.checked })}\n />\n }\n label=\"Accept return requests online\"\n />\n <TextField\n label=\"Return window in days\"\n type=\"number\"\n value={current.windowDays}\n onChange={(event) => update({ windowDays: event.target.value })}\n size=\"small\"\n error={!daysValid}\n helperText={`Days after the order shipped (or was placed, when nothing ships), 0–${CommerceModel.RETURN_WINDOW_MAX_DAYS}`}\n slotProps={{ htmlInput: { min: 0, max: CommerceModel.RETURN_WINDOW_MAX_DAYS, step: 1 } }}\n sx={{ maxWidth: 320 }}\n />\n <FormGroup>\n <FormLabel>{'Returnable product types'}</FormLabel>\n {(Object.keys(PRODUCT_TYPE_LABELS) as ProductType[]).map((type) => (\n <FormControlLabel\n key={type}\n control={\n <Checkbox\n size=\"small\"\n checked={current.eligibleTypes.includes(type)}\n onChange={(event) => toggleType(type, event.target.checked)}\n />\n }\n label={PRODUCT_TYPE_LABELS[type]}\n />\n ))}\n </FormGroup>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"small\"\n disabled={!draft || !daysValid}\n onClick={handleSave}\n sx={{ alignSelf: 'flex-start' }}\n >\n {'Save return settings'}\n </Button>\n </Stack>\n </CardDisplay>\n )\n}\nReturnSettingsCard.displayName = 'ReturnSettingsCard'\n\nexport default ReturnSettingsCard\n"],"names":["CommerceModel","CardDisplay","useSnackbar","Button","Checkbox","FormControlLabel","FormGroup","FormLabel","Stack","Switch","TextField","doc","useCallback","useMemo","useState","useFirestore","useFirestoreDoc","useUser","writeGuardedBySeed","pluginDocsHelp","writeSiteWideChange","PRODUCT_TYPE_LABELS","physical","digital","service","ReturnSettingsCard","props","hostId","firestore","data","user","enqueueSnackbar","store","status","storeStatus","fromCache","storeFromCache","draft","setDraft","current","saved","readReturnSettings","returns","enabled","windowDays","String","eligibleTypes","update","patch","days","Number","daysValid","trim","isInteger","RETURN_WINDOW_MAX_DAYS","toggleType","type","on","filter","entry","handleSave","verdict","subject","unreadable","write","batch","set","includes","merge","ok","message","variant","persist","header","help","anchor","contentGutterX","contentGutterY","spacing","control","size","checked","onChange","event","target","label","value","error","helperText","slotProps","htmlInput","min","max","step","sx","maxWidth","Object","keys","map","color","disabled","onClick","alignSelf","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;AAEA,YAAYA,mBAAmB,uBAAa;AAC5C,SAASC,WAAW,QAAQ,uBAAsB;AAClD,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,MAAM,EACNC,QAAQ,EACRC,gBAAgB,EAChBC,SAAS,EACTC,SAAS,EACTC,KAAK,EACLC,MAAM,EACNC,SAAS,QACJ,gBAAe;AACtB,SAASC,GAAG,QAAQ,qBAAoB;AACxC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AACtD,SACEC,YAAY,EACZC,eAAe,EACfC,OAAO,EACPC,kBAAkB,QACb,iCAAgC;AACvC,SAASC,cAAc,QAAQ,eAAc;AAC7C,SAASC,mBAAmB,QAAQ,gEAA+D;AAOnG,MAAMC,sBAAmD;IACvDC,UAAU;IACVC,SAAS;IACTC,SAAS;AACX;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASC,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,MAAME,YAAYb;IAClB,MAAM,EAAEc,MAAMC,IAAI,EAAE,GAAGb;IACvB,MAAM,EAAEc,eAAe,EAAE,GAAG7B;IAC5B,MAAM,EACJ2B,MAAMG,KAAK,EACXC,QAAQC,WAAW,EACnBC,WAAWC,cAAc,EAC1B,GAAGpB,gBACF,IAAML,IAAIiB,WAAW,SAASD,QAAQ,YAAY,UAClD;QAACC;QAAWD;KAAO;IAErB,MAAM,CAACU,OAAOC,SAAS,GAAGxB,SAIhB;IACV,MAAMyB,UAAU1B,QAAQ;QACtB,IAAIwB,OAAO,OAAOA;QAClB,MAAMG,QAAQxC,cAAcyC,kBAAkB,CAACT,yBAAAA,MAAOU,OAAO;QAC7D,OAAO;YACLC,SAASH,MAAMG,OAAO;YACtBC,YAAYC,OAAOL,MAAM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BACTkC,IAAI;wBAAEQ,WAAW;oBAAa;8BAE7B;;;;;AAKX;AACA7E,mBAAmB8E,WAAW,GAAG;AAEjC,eAAe9E,mBAAkB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { ConsoleOrderZoneAddress } from './order-zones';
|
|
18
|
+
/**
|
|
19
|
+
* The zone the return dialog hosts (AGL-3611): `returnDetail`, among the
|
|
20
|
+
* return's details, where a shipping plugin buys the buyer a return label.
|
|
21
|
+
*
|
|
22
|
+
* Declared here, by the plugin that hosts it, as the order zones are. A
|
|
23
|
+
* widget restates the props it reads rather than importing this package, and
|
|
24
|
+
* it never writes the return itself: the label it bought is attached through
|
|
25
|
+
* `attachReturnLabel`, which posts this plugin's own route (`attach-label`),
|
|
26
|
+
* with its role gate and its https check.
|
|
27
|
+
*/
|
|
28
|
+
/** One line coming back. `lineItemId` is the order line's index. */
|
|
29
|
+
export interface ConsoleReturnZoneLine {
|
|
30
|
+
lineItemId: number;
|
|
31
|
+
name: string;
|
|
32
|
+
variantLabel: string | null;
|
|
33
|
+
quantity: number;
|
|
34
|
+
/** A `ReturnReason` key, e.g. `damaged`. */
|
|
35
|
+
reason: string;
|
|
36
|
+
}
|
|
37
|
+
/** The label already on the return, when one was attached. */
|
|
38
|
+
export interface ConsoleReturnZoneLabel {
|
|
39
|
+
carrier: string;
|
|
40
|
+
trackingNumber: string;
|
|
41
|
+
labelUrl: string;
|
|
42
|
+
trackingUrl: string | null;
|
|
43
|
+
attachedAtMs: number;
|
|
44
|
+
}
|
|
45
|
+
/** The return a widget is handed. */
|
|
46
|
+
export interface ConsoleReturnZoneReturn {
|
|
47
|
+
id: string;
|
|
48
|
+
/** A `ReturnStatus`: `requested`, `approved`, `received`, … */
|
|
49
|
+
status: string;
|
|
50
|
+
orderId: string;
|
|
51
|
+
/** The order's human number, e.g. `#1042`. */
|
|
52
|
+
orderNumber: string;
|
|
53
|
+
customerName: string | null;
|
|
54
|
+
customerEmail: string | null;
|
|
55
|
+
lines: readonly ConsoleReturnZoneLine[];
|
|
56
|
+
/**
|
|
57
|
+
* Where the parcel comes FROM: the order's ship-to address, as the buyer
|
|
58
|
+
* gave it. `null` for an order that never shipped anywhere.
|
|
59
|
+
*/
|
|
60
|
+
fromAddress: ConsoleOrderZoneAddress | null;
|
|
61
|
+
returnLabel: ConsoleReturnZoneLabel | null;
|
|
62
|
+
}
|
|
63
|
+
/** A return label a widget asks the dialog to attach. */
|
|
64
|
+
export interface ConsoleReturnLabelRequest {
|
|
65
|
+
carrier: string;
|
|
66
|
+
trackingNumber: string;
|
|
67
|
+
/** The printable label, an https URL. */
|
|
68
|
+
labelUrl: string;
|
|
69
|
+
/** An explicit https tracking link; derived from the carrier when absent. */
|
|
70
|
+
trackingUrl?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What the `returnDetail` zone hands each widget. `attachReturnLabel`
|
|
74
|
+
* resolves once the route stored the label, and throws with a message a
|
|
75
|
+
* person can act on when it refuses: a finished return, a link that is not
|
|
76
|
+
* https.
|
|
77
|
+
*/
|
|
78
|
+
export interface ConsoleReturnDetailZoneProps {
|
|
79
|
+
hostId: string;
|
|
80
|
+
/** The org the page names; `undefined` where the host does not know it. */
|
|
81
|
+
orgId: string | undefined;
|
|
82
|
+
return: ConsoleReturnZoneReturn;
|
|
83
|
+
attachReturnLabel: (label: ConsoleReturnLabelRequest) => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export declare const RETURN_DETAIL_ZONE: import("@aglyn/aglyn/plugin-manager/plugin-zones").PluginZone<ConsoleReturnDetailZoneProps>;
|
|
86
|
+
/** Declares the return zone, from the console registrar. */
|
|
87
|
+
export declare function registerCommerceReturnZones(): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { definePluginZone, registerPluginZone } from "@aglyn/aglyn/plugin-manager/plugin-zones";
|
|
17
|
+
import { BUNDLE_ID } from "../../constants/bundle-common.js";
|
|
18
|
+
export const RETURN_DETAIL_ZONE = definePluginZone('returnDetail');
|
|
19
|
+
/** Declares the return zone, from the console registrar. */ export function registerCommerceReturnZones() {
|
|
20
|
+
registerPluginZone({
|
|
21
|
+
zone: RETURN_DETAIL_ZONE,
|
|
22
|
+
label: 'Return detail',
|
|
23
|
+
surface: 'console',
|
|
24
|
+
layout: 'bare',
|
|
25
|
+
description: 'In the return dialog, above its actions. A widget here reads the return — its lines, the buyer and the address the parcel comes from — and attaches a return label through `attachReturnLabel`, the dialog’s own route.'
|
|
26
|
+
}, {
|
|
27
|
+
pluginId: BUNDLE_ID
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=return-zones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/return-zones.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 {\n definePluginZone,\n registerPluginZone,\n} from '@aglyn/aglyn/plugin-manager/plugin-zones'\nimport { BUNDLE_ID } from '../../constants/bundle-common'\nimport type { ConsoleOrderZoneAddress } from './order-zones'\n\n/**\n * The zone the return dialog hosts (AGL-3611): `returnDetail`, among the\n * return's details, where a shipping plugin buys the buyer a return label.\n *\n * Declared here, by the plugin that hosts it, as the order zones are. A\n * widget restates the props it reads rather than importing this package, and\n * it never writes the return itself: the label it bought is attached through\n * `attachReturnLabel`, which posts this plugin's own route (`attach-label`),\n * with its role gate and its https check.\n */\n\n/** One line coming back. `lineItemId` is the order line's index. */\nexport interface ConsoleReturnZoneLine {\n lineItemId: number\n name: string\n variantLabel: string | null\n quantity: number\n /** A `ReturnReason` key, e.g. `damaged`. */\n reason: string\n}\n\n/** The label already on the return, when one was attached. */\nexport interface ConsoleReturnZoneLabel {\n carrier: string\n trackingNumber: string\n labelUrl: string\n trackingUrl: string | null\n attachedAtMs: number\n}\n\n/** The return a widget is handed. */\nexport interface ConsoleReturnZoneReturn {\n id: string\n /** A `ReturnStatus`: `requested`, `approved`, `received`, … */\n status: string\n orderId: string\n /** The order's human number, e.g. `#1042`. */\n orderNumber: string\n customerName: string | null\n customerEmail: string | null\n lines: readonly ConsoleReturnZoneLine[]\n /**\n * Where the parcel comes FROM: the order's ship-to address, as the buyer\n * gave it. `null` for an order that never shipped anywhere.\n */\n fromAddress: ConsoleOrderZoneAddress | null\n returnLabel: ConsoleReturnZoneLabel | null\n}\n\n/** A return label a widget asks the dialog to attach. */\nexport interface ConsoleReturnLabelRequest {\n carrier: string\n trackingNumber: string\n /** The printable label, an https URL. */\n labelUrl: string\n /** An explicit https tracking link; derived from the carrier when absent. */\n trackingUrl?: string\n}\n\n/**\n * What the `returnDetail` zone hands each widget. `attachReturnLabel`\n * resolves once the route stored the label, and throws with a message a\n * person can act on when it refuses: a finished return, a link that is not\n * https.\n */\nexport interface ConsoleReturnDetailZoneProps {\n hostId: string\n /** The org the page names; `undefined` where the host does not know it. */\n orgId: string | undefined\n return: ConsoleReturnZoneReturn\n attachReturnLabel: (label: ConsoleReturnLabelRequest) => Promise<void>\n}\n\nexport const RETURN_DETAIL_ZONE =\n definePluginZone<ConsoleReturnDetailZoneProps>('returnDetail')\n\n/** Declares the return zone, from the console registrar. */\nexport function registerCommerceReturnZones(): void {\n registerPluginZone(\n {\n zone: RETURN_DETAIL_ZONE,\n label: 'Return detail',\n surface: 'console',\n layout: 'bare',\n description:\n 'In the return dialog, above its actions. A widget here reads the return — its lines, the buyer and the address the parcel comes from — and attaches a return label through `attachReturnLabel`, the dialog’s own route.',\n },\n { pluginId: BUNDLE_ID },\n )\n}\n"],"names":["definePluginZone","registerPluginZone","BUNDLE_ID","RETURN_DETAIL_ZONE","registerCommerceReturnZones","zone","label","surface","layout","description","pluginId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,gBAAgB,EAChBC,kBAAkB,QACb,2CAA0C;AACjD,SAASC,SAAS,QAAQ,mCAA+B;AA4EzD,OAAO,MAAMC,qBACXH,iBAA+C,gBAAe;AAEhE,0DAA0D,GAC1D,OAAO,SAASI;IACdH,mBACE;QACEI,MAAMF;QACNG,OAAO;QACPC,SAAS;QACTC,QAAQ;QACRC,aACE;IACJ,GACA;QAAEC,UAAUR;IAAU;AAE1B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 ReturnsCardProps {
|
|
19
|
+
hostId: string;
|
|
20
|
+
}
|
|
21
|
+
/** The query key the Returns list opens one return's dialog by. */
|
|
22
|
+
export declare const RETURNS_RETURN_PARAM = "return";
|
|
23
|
+
/**
|
|
24
|
+
* What is coming back, as the row's summary: "2× Mug, 1× Tee" from the names
|
|
25
|
+
* a return keeps, or "3 items" for one opened before it kept them.
|
|
26
|
+
*/
|
|
27
|
+
export declare function itemsSummary(entry: Pick<CommerceModel.HostReturn, 'lines'>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Returns (RMA, AGL-3611): every return on the store, newest first.
|
|
30
|
+
*
|
|
31
|
+
* THE STATUS FILTER IS THE QUERY. `status == X` ordered by `createdAtMs`
|
|
32
|
+
* descending, served by the `returns(status ASC, createdAtMs DESC)`
|
|
33
|
+
* composite; "All" is the single-field order alone. The footer pages that
|
|
34
|
+
* query's answer, so page two of "Requested" is page two of the requests,
|
|
35
|
+
* never a page of the store narrowed afterwards.
|
|
36
|
+
*
|
|
37
|
+
* `?return={id}` opens that return's dialog on arrival — the address the
|
|
38
|
+
* merchant's "return requested" notification links to. The dialog reads the
|
|
39
|
+
* return by id, so one that is not on this page opens just the same.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ReturnsCard(props: ReturnsCardProps): import("react").JSX.Element;
|
|
42
|
+
export declare namespace ReturnsCard {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
45
|
+
export default ReturnsCard;
|