@aglyn/plugins-commerce 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +10 -0
- package/package.json +57 -0
- package/src/index.d.ts +38 -0
- package/src/index.js +38 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/account.d.ts +31 -0
- package/src/lib/components/account.js +645 -0
- package/src/lib/components/account.js.map +1 -0
- package/src/lib/components/cart.d.ts +38 -0
- package/src/lib/components/cart.js +851 -0
- package/src/lib/components/cart.js.map +1 -0
- package/src/lib/components/commerce-console-page.d.ts +32 -0
- package/src/lib/components/commerce-console-page.js +296 -0
- package/src/lib/components/commerce-console-page.js.map +1 -0
- package/src/lib/components/commerce-console-sections.d.ts +34 -0
- package/src/lib/components/commerce-console-sections.js +62 -0
- package/src/lib/components/commerce-console-sections.js.map +1 -0
- package/src/lib/components/console/catalog-organization-card.component.d.ts +14 -0
- package/src/lib/components/console/catalog-organization-card.component.js +1087 -0
- package/src/lib/components/console/catalog-organization-card.component.js.map +1 -0
- package/src/lib/components/console/commerce-analytics-card.component.d.ts +27 -0
- package/src/lib/components/console/commerce-analytics-card.component.js +310 -0
- package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -0
- package/src/lib/components/console/commerce-glance-card.component.d.ts +20 -0
- package/src/lib/components/console/commerce-glance-card.component.js +340 -0
- package/src/lib/components/console/commerce-glance-card.component.js.map +1 -0
- package/src/lib/components/console/commerce-stat-tile.component.d.ts +37 -0
- package/src/lib/components/console/commerce-stat-tile.component.js +72 -0
- package/src/lib/components/console/commerce-stat-tile.component.js.map +1 -0
- package/src/lib/components/console/discounts-card.component.d.ts +14 -0
- package/src/lib/components/console/discounts-card.component.js +443 -0
- package/src/lib/components/console/discounts-card.component.js.map +1 -0
- package/src/lib/components/console/entitlement-gate.component.d.ts +76 -0
- package/src/lib/components/console/entitlement-gate.component.js +115 -0
- package/src/lib/components/console/entitlement-gate.component.js.map +1 -0
- package/src/lib/components/console/gift-cards-card.component.d.ts +29 -0
- package/src/lib/components/console/gift-cards-card.component.js +379 -0
- package/src/lib/components/console/gift-cards-card.component.js.map +1 -0
- package/src/lib/components/console/host-coupons-card.component.d.ts +14 -0
- package/src/lib/components/console/host-coupons-card.component.js +252 -0
- package/src/lib/components/console/host-coupons-card.component.js.map +1 -0
- package/src/lib/components/console/host-orders-card.component.d.ts +13 -0
- package/src/lib/components/console/host-orders-card.component.js +861 -0
- package/src/lib/components/console/host-orders-card.component.js.map +1 -0
- package/src/lib/components/console/locations-card.component.d.ts +14 -0
- package/src/lib/components/console/locations-card.component.js +256 -0
- package/src/lib/components/console/locations-card.component.js.map +1 -0
- package/src/lib/components/console/member-posts-card.component.d.ts +8 -0
- package/src/lib/components/console/member-posts-card.component.js +283 -0
- package/src/lib/components/console/member-posts-card.component.js.map +1 -0
- package/src/lib/components/console/newest-site-users-card.component.d.ts +36 -0
- package/src/lib/components/console/newest-site-users-card.component.js +126 -0
- package/src/lib/components/console/newest-site-users-card.component.js.map +1 -0
- package/src/lib/components/console/order-detail-dialog.component.d.ts +28 -0
- package/src/lib/components/console/order-detail-dialog.component.js +976 -0
- package/src/lib/components/console/order-detail-dialog.component.js.map +1 -0
- package/src/lib/components/console/paid-media.d.ts +127 -0
- package/src/lib/components/console/paid-media.js +397 -0
- package/src/lib/components/console/paid-media.js.map +1 -0
- package/src/lib/components/console/payments-settings-card.component.d.ts +13 -0
- package/src/lib/components/console/payments-settings-card.component.js +295 -0
- package/src/lib/components/console/payments-settings-card.component.js.map +1 -0
- package/src/lib/components/console/pos-page.component.d.ts +13 -0
- package/src/lib/components/console/pos-page.component.js +916 -0
- package/src/lib/components/console/pos-page.component.js.map +1 -0
- package/src/lib/components/console/product-editor-dialog.component.d.ts +32 -0
- package/src/lib/components/console/product-editor-dialog.component.js +1374 -0
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -0
- package/src/lib/components/console/products-hub-card.component.d.ts +16 -0
- package/src/lib/components/console/products-hub-card.component.js +1280 -0
- package/src/lib/components/console/products-hub-card.component.js.map +1 -0
- package/src/lib/components/console/products-hub-zone.component.d.ts +50 -0
- package/src/lib/components/console/products-hub-zone.component.js +200 -0
- package/src/lib/components/console/products-hub-zone.component.js.map +1 -0
- package/src/lib/components/console/recovery-queue-card.component.d.ts +39 -0
- package/src/lib/components/console/recovery-queue-card.component.js +262 -0
- package/src/lib/components/console/recovery-queue-card.component.js.map +1 -0
- package/src/lib/components/console/registers-card.component.d.ts +21 -0
- package/src/lib/components/console/registers-card.component.js +296 -0
- package/src/lib/components/console/registers-card.component.js.map +1 -0
- package/src/lib/components/console/reservations-card.component.d.ts +14 -0
- package/src/lib/components/console/reservations-card.component.js +650 -0
- package/src/lib/components/console/reservations-card.component.js.map +1 -0
- package/src/lib/components/console/reviews-moderation-card.component.d.ts +8 -0
- package/src/lib/components/console/reviews-moderation-card.component.js +235 -0
- package/src/lib/components/console/reviews-moderation-card.component.js.map +1 -0
- package/src/lib/components/console/shipping-settings-card.component.d.ts +38 -0
- package/src/lib/components/console/shipping-settings-card.component.js +560 -0
- package/src/lib/components/console/shipping-settings-card.component.js.map +1 -0
- package/src/lib/components/console/stock-movements-card.component.d.ts +31 -0
- package/src/lib/components/console/stock-movements-card.component.js +333 -0
- package/src/lib/components/console/stock-movements-card.component.js.map +1 -0
- package/src/lib/components/console/store-settings-card.component.d.ts +14 -0
- package/src/lib/components/console/store-settings-card.component.js +300 -0
- package/src/lib/components/console/store-settings-card.component.js.map +1 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.d.ts +73 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js +408 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -0
- package/src/lib/components/console/suppliers-card.component.d.ts +8 -0
- package/src/lib/components/console/suppliers-card.component.js +328 -0
- package/src/lib/components/console/suppliers-card.component.js.map +1 -0
- package/src/lib/components/console/tax-settings-card.component.d.ts +14 -0
- package/src/lib/components/console/tax-settings-card.component.js +473 -0
- package/src/lib/components/console/tax-settings-card.component.js.map +1 -0
- package/src/lib/components/gate.d.ts +39 -0
- package/src/lib/components/gate.js +202 -0
- package/src/lib/components/gate.js.map +1 -0
- package/src/lib/components/gated-video.d.ts +40 -0
- package/src/lib/components/gated-video.js +366 -0
- package/src/lib/components/gated-video.js.map +1 -0
- package/src/lib/components/member-feed.d.ts +32 -0
- package/src/lib/components/member-feed.js +198 -0
- package/src/lib/components/member-feed.js.map +1 -0
- package/src/lib/components/member-recovery.d.ts +35 -0
- package/src/lib/components/member-recovery.js +313 -0
- package/src/lib/components/member-recovery.js.map +1 -0
- package/src/lib/components/member-signin.d.ts +35 -0
- package/src/lib/components/member-signin.js +257 -0
- package/src/lib/components/member-signin.js.map +1 -0
- package/src/lib/components/member-signup.d.ts +34 -0
- package/src/lib/components/member-signup.js +287 -0
- package/src/lib/components/member-signup.js.map +1 -0
- package/src/lib/components/newsletter-signup.d.ts +39 -0
- package/src/lib/components/newsletter-signup.js +229 -0
- package/src/lib/components/newsletter-signup.js.map +1 -0
- package/src/lib/components/product-detail.d.ts +38 -0
- package/src/lib/components/product-detail.js +1022 -0
- package/src/lib/components/product-detail.js.map +1 -0
- package/src/lib/components/product-grid.d.ts +67 -0
- package/src/lib/components/product-grid.js +909 -0
- package/src/lib/components/product-grid.js.map +1 -0
- package/src/lib/components/product-reviews.d.ts +32 -0
- package/src/lib/components/product-reviews.js +349 -0
- package/src/lib/components/product-reviews.js.map +1 -0
- package/src/lib/components/related-products.d.ts +33 -0
- package/src/lib/components/related-products.js +232 -0
- package/src/lib/components/related-products.js.map +1 -0
- package/src/lib/components/reservation-widget.d.ts +33 -0
- package/src/lib/components/reservation-widget.js +418 -0
- package/src/lib/components/reservation-widget.js.map +1 -0
- package/src/lib/components/storefront-payment-element-fallback.d.ts +18 -0
- package/src/lib/components/storefront-payment-element-fallback.js +51 -0
- package/src/lib/components/storefront-payment-element-fallback.js.map +1 -0
- package/src/lib/components/storefront-payment-element.d.ts +78 -0
- package/src/lib/components/storefront-payment-element.js +156 -0
- package/src/lib/components/storefront-payment-element.js.map +1 -0
- package/src/lib/components/wishlist.d.ts +46 -0
- package/src/lib/components/wishlist.js +304 -0
- package/src/lib/components/wishlist.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +18 -0
- package/src/lib/constants/bundle-common.js +18 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/product-filters.d.ts +35 -0
- package/src/lib/constants/product-filters.js +109 -0
- package/src/lib/constants/product-filters.js.map +1 -0
- package/src/lib/model/commerce-cart.d.ts +52 -0
- package/src/lib/model/commerce-cart.js +102 -0
- package/src/lib/model/commerce-cart.js.map +1 -0
- package/src/lib/model/commerce-connect-transfer.d.ts +243 -0
- package/src/lib/model/commerce-connect-transfer.js +231 -0
- package/src/lib/model/commerce-connect-transfer.js.map +1 -0
- package/src/lib/model/commerce-discounts.d.ts +164 -0
- package/src/lib/model/commerce-discounts.js +231 -0
- package/src/lib/model/commerce-discounts.js.map +1 -0
- package/src/lib/model/commerce-dispute.d.ts +124 -0
- package/src/lib/model/commerce-dispute.js +225 -0
- package/src/lib/model/commerce-dispute.js.map +1 -0
- package/src/lib/model/commerce-gift-cards.d.ts +107 -0
- package/src/lib/model/commerce-gift-cards.js +121 -0
- package/src/lib/model/commerce-gift-cards.js.map +1 -0
- package/src/lib/model/commerce-io.d.ts +36 -0
- package/src/lib/model/commerce-io.js +245 -0
- package/src/lib/model/commerce-io.js.map +1 -0
- package/src/lib/model/commerce-orders.d.ts +1040 -0
- package/src/lib/model/commerce-orders.js +1022 -0
- package/src/lib/model/commerce-orders.js.map +1 -0
- package/src/lib/model/commerce-promotions.d.ts +188 -0
- package/src/lib/model/commerce-promotions.js +199 -0
- package/src/lib/model/commerce-promotions.js.map +1 -0
- package/src/lib/model/commerce-reservations.d.ts +175 -0
- package/src/lib/model/commerce-reservations.js +157 -0
- package/src/lib/model/commerce-reservations.js.map +1 -0
- package/src/lib/model/commerce-shipping.d.ts +316 -0
- package/src/lib/model/commerce-shipping.js +484 -0
- package/src/lib/model/commerce-shipping.js.map +1 -0
- package/src/lib/model/commerce-stock-holds.d.ts +199 -0
- package/src/lib/model/commerce-stock-holds.js +190 -0
- package/src/lib/model/commerce-stock-holds.js.map +1 -0
- package/src/lib/model/commerce-subscription-status.d.ts +67 -0
- package/src/lib/model/commerce-subscription-status.js +76 -0
- package/src/lib/model/commerce-subscription-status.js.map +1 -0
- package/src/lib/model/commerce-tax-decision.d.ts +222 -0
- package/src/lib/model/commerce-tax-decision.js +165 -0
- package/src/lib/model/commerce-tax-decision.js.map +1 -0
- package/src/lib/model/commerce-tax.d.ts +176 -0
- package/src/lib/model/commerce-tax.js +92 -0
- package/src/lib/model/commerce-tax.js.map +1 -0
- package/src/lib/model/commerce.d.ts +551 -0
- package/src/lib/model/commerce.js +739 -0
- package/src/lib/model/commerce.js.map +1 -0
- package/src/lib/model/index.d.ts +40 -0
- package/src/lib/model/index.js +40 -0
- package/src/lib/model/index.js.map +1 -0
- package/src/lib/model/order-figures.d.ts +48 -0
- package/src/lib/model/order-figures.js +74 -0
- package/src/lib/model/order-figures.js.map +1 -0
- package/src/lib/model/plugin-permissions.d.ts +23 -0
- package/src/lib/model/plugin-permissions.js +34 -0
- package/src/lib/model/plugin-permissions.js.map +1 -0
- package/src/lib/model/purchase-analytics.d.ts +186 -0
- package/src/lib/model/purchase-analytics.js +216 -0
- package/src/lib/model/purchase-analytics.js.map +1 -0
- package/src/lib/plugin-config.d.ts +62 -0
- package/src/lib/plugin-config.js +78 -0
- package/src/lib/plugin-config.js.map +1 -0
- package/src/lib/plugin.d.ts +28 -0
- package/src/lib/plugin.js +147 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server/billing-webhook.d.ts +26 -0
- package/src/lib/server/billing-webhook.js +4011 -0
- package/src/lib/server/billing-webhook.js.map +1 -0
- package/src/lib/server/cancel-order.d.ts +87 -0
- package/src/lib/server/cancel-order.js +368 -0
- package/src/lib/server/cancel-order.js.map +1 -0
- package/src/lib/server/cart-checkout.d.ts +25 -0
- package/src/lib/server/cart-checkout.js +976 -0
- package/src/lib/server/cart-checkout.js.map +1 -0
- package/src/lib/server/cart-cookie.d.ts +32 -0
- package/src/lib/server/cart-cookie.js +77 -0
- package/src/lib/server/cart-cookie.js.map +1 -0
- package/src/lib/server/cart.d.ts +34 -0
- package/src/lib/server/cart.js +181 -0
- package/src/lib/server/cart.js.map +1 -0
- package/src/lib/server/catalog.d.ts +127 -0
- package/src/lib/server/catalog.js +277 -0
- package/src/lib/server/catalog.js.map +1 -0
- package/src/lib/server/checkout.d.ts +36 -0
- package/src/lib/server/checkout.js +915 -0
- package/src/lib/server/checkout.js.map +1 -0
- package/src/lib/server/connect.d.ts +26 -0
- package/src/lib/server/connect.js +238 -0
- package/src/lib/server/connect.js.map +1 -0
- package/src/lib/server/contact-refund.d.ts +117 -0
- package/src/lib/server/contact-refund.js +196 -0
- package/src/lib/server/contact-refund.js.map +1 -0
- package/src/lib/server/download.d.ts +39 -0
- package/src/lib/server/download.js +206 -0
- package/src/lib/server/download.js.map +1 -0
- package/src/lib/server/draft-order.d.ts +26 -0
- package/src/lib/server/draft-order.js +706 -0
- package/src/lib/server/draft-order.js.map +1 -0
- package/src/lib/server/feed.d.ts +24 -0
- package/src/lib/server/feed.js +59 -0
- package/src/lib/server/feed.js.map +1 -0
- package/src/lib/server/fulfill-order.d.ts +97 -0
- package/src/lib/server/fulfill-order.js +235 -0
- package/src/lib/server/fulfill-order.js.map +1 -0
- package/src/lib/server/gate.d.ts +36 -0
- package/src/lib/server/gate.js +112 -0
- package/src/lib/server/gate.js.map +1 -0
- package/src/lib/server/gift-cards.d.ts +42 -0
- package/src/lib/server/gift-cards.js +219 -0
- package/src/lib/server/gift-cards.js.map +1 -0
- package/src/lib/server/low-stock.d.ts +49 -0
- package/src/lib/server/low-stock.js +60 -0
- package/src/lib/server/low-stock.js.map +1 -0
- package/src/lib/server/manual-tax-rate.d.ts +82 -0
- package/src/lib/server/manual-tax-rate.js +113 -0
- package/src/lib/server/manual-tax-rate.js.map +1 -0
- package/src/lib/server/member-feed.d.ts +24 -0
- package/src/lib/server/member-feed.js +72 -0
- package/src/lib/server/member-feed.js.map +1 -0
- package/src/lib/server/member-name-search.d.ts +37 -0
- package/src/lib/server/member-name-search.js +42 -0
- package/src/lib/server/member-name-search.js.map +1 -0
- package/src/lib/server/member-post.d.ts +23 -0
- package/src/lib/server/member-post.js +166 -0
- package/src/lib/server/member-post.js.map +1 -0
- package/src/lib/server/membership-account.d.ts +37 -0
- package/src/lib/server/membership-account.js +148 -0
- package/src/lib/server/membership-account.js.map +1 -0
- package/src/lib/server/membership-admin-password.d.ts +33 -0
- package/src/lib/server/membership-admin-password.js +202 -0
- package/src/lib/server/membership-admin-password.js.map +1 -0
- package/src/lib/server/membership-content.d.ts +23 -0
- package/src/lib/server/membership-content.js +105 -0
- package/src/lib/server/membership-content.js.map +1 -0
- package/src/lib/server/membership-login.d.ts +19 -0
- package/src/lib/server/membership-login.js +137 -0
- package/src/lib/server/membership-login.js.map +1 -0
- package/src/lib/server/membership-logout.d.ts +19 -0
- package/src/lib/server/membership-logout.js +35 -0
- package/src/lib/server/membership-logout.js.map +1 -0
- package/src/lib/server/membership-recover.d.ts +60 -0
- package/src/lib/server/membership-recover.js +244 -0
- package/src/lib/server/membership-recover.js.map +1 -0
- package/src/lib/server/membership-register.d.ts +22 -0
- package/src/lib/server/membership-register.js +241 -0
- package/src/lib/server/membership-register.js.map +1 -0
- package/src/lib/server/membership-reset.d.ts +26 -0
- package/src/lib/server/membership-reset.js +88 -0
- package/src/lib/server/membership-reset.js.map +1 -0
- package/src/lib/server/membership-wishlist.d.ts +23 -0
- package/src/lib/server/membership-wishlist.js +89 -0
- package/src/lib/server/membership-wishlist.js.map +1 -0
- package/src/lib/server/membership.d.ts +96 -0
- package/src/lib/server/membership.js +222 -0
- package/src/lib/server/membership.js.map +1 -0
- package/src/lib/server/native-checkout.d.ts +170 -0
- package/src/lib/server/native-checkout.js +193 -0
- package/src/lib/server/native-checkout.js.map +1 -0
- package/src/lib/server/newsletter.d.ts +23 -0
- package/src/lib/server/newsletter.js +323 -0
- package/src/lib/server/newsletter.js.map +1 -0
- package/src/lib/server/notify-restock.d.ts +22 -0
- package/src/lib/server/notify-restock.js +84 -0
- package/src/lib/server/notify-restock.js.map +1 -0
- package/src/lib/server/order-analytics.d.ts +134 -0
- package/src/lib/server/order-analytics.js +263 -0
- package/src/lib/server/order-analytics.js.map +1 -0
- package/src/lib/server/order-figures.d.ts +33 -0
- package/src/lib/server/order-figures.js +220 -0
- package/src/lib/server/order-figures.js.map +1 -0
- package/src/lib/server/paid-media-delivery.d.ts +173 -0
- package/src/lib/server/paid-media-delivery.js +212 -0
- package/src/lib/server/paid-media-delivery.js.map +1 -0
- package/src/lib/server/pos-order.d.ts +54 -0
- package/src/lib/server/pos-order.js +1137 -0
- package/src/lib/server/pos-order.js.map +1 -0
- package/src/lib/server/process-abandoned.d.ts +54 -0
- package/src/lib/server/process-abandoned.js +222 -0
- package/src/lib/server/process-abandoned.js.map +1 -0
- package/src/lib/server/process-restock.d.ts +42 -0
- package/src/lib/server/process-restock.js +219 -0
- package/src/lib/server/process-restock.js.map +1 -0
- package/src/lib/server/product-card.d.ts +29 -0
- package/src/lib/server/product-card.js +54 -0
- package/src/lib/server/product-card.js.map +1 -0
- package/src/lib/server/product.d.ts +70 -0
- package/src/lib/server/product.js +105 -0
- package/src/lib/server/product.js.map +1 -0
- package/src/lib/server/promotion-hold.d.ts +144 -0
- package/src/lib/server/promotion-hold.js +174 -0
- package/src/lib/server/promotion-hold.js.map +1 -0
- package/src/lib/server/reconcile-stock.d.ts +106 -0
- package/src/lib/server/reconcile-stock.js +349 -0
- package/src/lib/server/reconcile-stock.js.map +1 -0
- package/src/lib/server/refund.d.ts +45 -0
- package/src/lib/server/refund.js +607 -0
- package/src/lib/server/refund.js.map +1 -0
- package/src/lib/server/related.d.ts +24 -0
- package/src/lib/server/related.js +104 -0
- package/src/lib/server/related.js.map +1 -0
- package/src/lib/server/reservation-availability.d.ts +23 -0
- package/src/lib/server/reservation-availability.js +111 -0
- package/src/lib/server/reservation-availability.js.map +1 -0
- package/src/lib/server/reserve-stock.d.ts +156 -0
- package/src/lib/server/reserve-stock.js +146 -0
- package/src/lib/server/reserve-stock.js.map +1 -0
- package/src/lib/server/reserve.d.ts +25 -0
- package/src/lib/server/reserve.js +426 -0
- package/src/lib/server/reserve.js.map +1 -0
- package/src/lib/server/restock-flag.d.ts +202 -0
- package/src/lib/server/restock-flag.js +449 -0
- package/src/lib/server/restock-flag.js.map +1 -0
- package/src/lib/server/reviews.d.ts +51 -0
- package/src/lib/server/reviews.js +132 -0
- package/src/lib/server/reviews.js.map +1 -0
- package/src/lib/server/site-page-enricher.d.ts +42 -0
- package/src/lib/server/site-page-enricher.js +149 -0
- package/src/lib/server/site-page-enricher.js.map +1 -0
- package/src/lib/server/site-page-resolver.d.ts +26 -0
- package/src/lib/server/site-page-resolver.js +223 -0
- package/src/lib/server/site-page-resolver.js.map +1 -0
- package/src/lib/server/stock-hold.d.ts +127 -0
- package/src/lib/server/stock-hold.js +258 -0
- package/src/lib/server/stock-hold.js.map +1 -0
- package/src/lib/server/storefront-tax-record.d.ts +22 -0
- package/src/lib/server/storefront-tax-record.js +218 -0
- package/src/lib/server/storefront-tax-record.js.map +1 -0
- package/src/lib/server/storefront-tax.d.ts +197 -0
- package/src/lib/server/storefront-tax.js +245 -0
- package/src/lib/server/storefront-tax.js.map +1 -0
- package/src/lib/server/stream.d.ts +25 -0
- package/src/lib/server/stream.js +191 -0
- package/src/lib/server/stream.js.map +1 -0
- package/src/lib/server/subscription-portal.d.ts +24 -0
- package/src/lib/server/subscription-portal.js +91 -0
- package/src/lib/server/subscription-portal.js.map +1 -0
- package/src/lib/server/supplier-outbox.d.ts +190 -0
- package/src/lib/server/supplier-outbox.js +342 -0
- package/src/lib/server/supplier-outbox.js.map +1 -0
- package/src/lib/server/supplier-update.d.ts +23 -0
- package/src/lib/server/supplier-update.js +289 -0
- package/src/lib/server/supplier-update.js.map +1 -0
- package/src/lib/server/tax-profile.d.ts +29 -0
- package/src/lib/server/tax-profile.js +40 -0
- package/src/lib/server/tax-profile.js.map +1 -0
- package/src/lib/server.d.ts +32 -0
- package/src/lib/server.js +311 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/site.d.ts +27 -0
- package/src/lib/site.js +134 -0
- package/src/lib/site.js.map +1 -0
- package/src/lib/utils/escape-html.d.ts +41 -0
- package/src/lib/utils/escape-html.js +41 -0
- package/src/lib/utils/escape-html.js.map +1 -0
- package/src/lib/utils/generate-preset-id.d.ts +19 -0
- package/src/lib/utils/generate-preset-id.js +25 -0
- package/src/lib/utils/generate-preset-id.js.map +1 -0
- package/src/lib/utils/member-continue.d.ts +45 -0
- package/src/lib/utils/member-continue.js +49 -0
- package/src/lib/utils/member-continue.js.map +1 -0
- package/src/lib/utils/use-storefront-purchase-event.d.ts +60 -0
- package/src/lib/utils/use-storefront-purchase-event.js +142 -0
- package/src/lib/utils/use-storefront-purchase-event.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/host-orders-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'use client'\n\nimport * as CommerceModel from '../../model'\nimport { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { ScrollTable } from '@aglyn/shared-ui-jsx/components/scroll-table.component'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n checkEntitlement,\n ORDERS_CUSTOMER_PARAM,\n ORDERS_ORDER_PARAM,\n pluginDocsHelp,\n} from '@aglyn/aglyn'\nimport {\n Alert,\n AlertTitle,\n Button,\n Chip,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n MenuItem,\n Stack,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n TextField,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { collection, doc, getDoc, limit, orderBy, query } from 'firebase/firestore'\nimport { useSearchParams } from 'next/navigation'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n ceilingedWindow,\n collectionCeiling,\n useFirestore,\n useOrgPlan,\n useUser,\n} from '@aglyn/tenant-feature-instance'\nimport { useFirestoreCollection } from '@aglyn/tenant-feature-instance'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\n\nimport CommerceStatTile from './commerce-stat-tile.component'\nimport OrderDetailDialog, {\n DISPUTE_COLOR,\n} from './order-detail-dialog.component'\n\n/**\n * How far back the table, its filters and its export reach.\n *\n * This window cannot be paged the way a plain list can. Five filters and the\n * CSV export all run over what was read, so a page of ten would quietly narrow\n * every one of them — a status filter would search a tenth of the orders and\n * report confidently on what it found. Bounding the read and saying where the\n * bound falls keeps the filters honest about their own scope.\n */\nconst ORDERS_WINDOW = 200\n\n/** A name map for the filter menu; it renders no product rows of its own. */\nconst PRODUCT_NAME_WINDOW = 100\n\nexport interface HostOrdersCardProps {\n hostId: string\n}\n\n/**\n * Orders console (AGL-287): filterable list over webhook-written order\n * docs with a detail dialog (timeline, fulfill, refund, cancel, notes,\n * packing slip) and draft orders that send the buyer a payment link.\n */\nexport function HostOrdersCard(props: HostOrdersCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n /**\n * The most recent orders, in the order the table shows them.\n *\n * `createdAtMs` is the field every order writer in the plugin stamps and the\n * one `reconcile-stock` already walks the collection by. Ordering on it is\n * what makes this window the RECENT orders: an unordered cap is answered in\n * document-id order, and orders are keyed by generated ids, so it returns a\n * pseudo-random sample that a client sort then dresses as newest-first.\n */\n const { data: orderDocs } = useFirestoreCollection<any>(\n () =>\n query(\n collection(firestore, 'hosts', hostId, 'orders'),\n orderBy('createdAtMs', 'desc'),\n limit(ORDERS_WINDOW + 1),\n ),\n [firestore, hostId],\n { idField: '$id' },\n )\n const { data: productDocs } = useFirestoreCollection<any>(\n () =>\n collectionCeiling(\n collection(firestore, 'hosts', hostId, 'products'),\n PRODUCT_NAME_WINDOW,\n ),\n [firestore, hostId],\n { idField: '$id' },\n )\n const orderWindow = useMemo(\n () => ceilingedWindow<any>(orderDocs ?? undefined, ORDERS_WINDOW),\n [orderDocs],\n )\n const productWindow = useMemo(\n () => ceilingedWindow<any>(productDocs ?? undefined, PRODUCT_NAME_WINDOW),\n [productDocs],\n )\n const productNames = useMemo(() => {\n const map: Record<string, string> = {}\n for (const product of productWindow.rows) {\n map[product.$id] = product.name ?? product.$id\n }\n return map\n }, [productWindow])\n\n /**\n * The money tiles are the `commerceAnalytics` surface (AGL-1938,\n * AGL-2056), and this is the third place they appear. Rendering them\n * ungated here would undo both of those passes and hand a Starter org\n * the Pro figures one tab away from the upgrade prompt that refuses\n * them. The TABLE below is not gated — a list of your own orders is not\n * a paid feature.\n */\n const { org, ready: orgReady } = useOrgPlan(hostId)\n const showStats =\n orgReady && checkEntitlement(org as never, 'commerceAnalytics')\n\n // The query returns the window already newest-first; re-sorting it here\n // would only restate the order it arrived in.\n const orders = orderWindow.rows\n\n // Filters + CSV export (AGL-96) over the loaded window.\n const [productFilter, setProductFilter] = useState('')\n const [dateFilter, setDateFilter] = useState('')\n const [statusFilter, setStatusFilter] = useState('')\n const [channelFilter, setChannelFilter] = useState('')\n /**\n * Disputes filter (AGL-1796), separate from Status on purpose: the two are\n * orthogonal. An OPEN dispute sits on an order that is still `paid`, and a\n * lost one sits on `refunded` beside every ordinary refund — so folding\n * either into the Status select would make that control lie about what it\n * selects.\n */\n const [disputeFilter, setDisputeFilter] = useState('')\n /*\n * Customer filter (AGL-2622): the buyer's address, matched as a substring\n * of `customerEmail` so a domain finds every buyer at a company. Seeded\n * from the URL, because the CRM's contact page links here with the\n * person's address to answer \"what has this customer ordered\" — the\n * orders count on the record is the number, and this list is the rows.\n */\n const searchParams = useSearchParams()\n const [customerFilter, setCustomerFilter] = useState(\n () => searchParams?.get(ORDERS_CUSTOMER_PARAM) ?? '',\n )\n const [selectedId, setSelectedId] = useState<string | null>(null)\n /*\n * An order named in the URL opens in its dialog on arrival (AGL-2622). A\n * contact's timeline names the order that made the person a customer,\n * and the address it links to is this list with `?order={id}`. The\n * window is the newest two hundred, and an order from last year is not\n * in it, so the document is read once by id and held beside the window\n * for the dialog; an order that IS in the window is found there first\n * and the read is skipped. Once per id — the ref keeps a re-render from\n * reopening a dialog the merchant has since closed — and the landing read\n * is judged against the ref rather than an effect cleanup, because the\n * `setSelectedId` above re-renders before the read lands and a cleanup\n * keyed on any dep would cancel the answer to the question just asked.\n */\n const seededOrderId = searchParams?.get(ORDERS_ORDER_PARAM) ?? null\n const [seededOrder, setSeededOrder] = useState<any | null>(null)\n const seededOpened = useRef<string | null>(null)\n useEffect(() => {\n if (!seededOrderId || seededOpened.current === seededOrderId) return\n if (orderDocs === undefined) return\n seededOpened.current = seededOrderId\n setSelectedId(seededOrderId)\n if (orderDocs.some((order: any) => order.$id === seededOrderId)) return\n void getDoc(doc(firestore, 'hosts', hostId, 'orders', seededOrderId))\n .then((snapshot) => {\n if (seededOpened.current !== snapshot.id || !snapshot.exists()) return\n setSeededOrder({ ...snapshot.data(), $id: snapshot.id })\n })\n .catch(() => undefined)\n }, [seededOrderId, orderDocs, firestore, hostId])\n const [draft, setDraft] = useState<{\n productId: string\n variantId: string\n quantity: string\n email: string\n /** Destination the merchant declared, once they have been asked. */\n shipTo?: string\n /**\n * Revealed only when the server refuses for want of a destination\n * (AGL-1792). A merchant whose rates are the same everywhere — or who\n * configured none — is never asked and never sees this field.\n */\n shipCountries?: string[]\n busy?: boolean\n } | null>(null)\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const visibleOrders = useMemo(() => {\n const now = Date.now() / 1000\n return orders.filter((order: any) => {\n const lifted = CommerceModel.liftLegacyOrder(order)\n // Line items first (AGL-1747): the flat `productId` is written only by\n // the two buy-now Stripe paths, so matching on it alone hid every cart,\n // POS and draft order behind the product filter.\n if (productFilter && !CommerceModel.orderContainsProduct(lifted, productFilter)) {\n return false\n }\n if (statusFilter && lifted.status !== statusFilter) return false\n if (\n customerFilter &&\n !String(order.customerEmail ?? '')\n .toLowerCase()\n .includes(customerFilter.trim().toLowerCase())\n ) {\n return false\n }\n if (channelFilter && (lifted.channel ?? 'online') !== channelFilter) {\n return false\n }\n if (\n disputeFilter === 'open' &&\n !CommerceModel.orderHasOpenDispute(lifted)\n ) {\n return false\n }\n // `lost` is the tone, not the raw status: a dispute that was WON also\n // closes with money untouched, and listing it under \"charged back\"\n // would tell a merchant they lost a case they won.\n if (\n disputeFilter === 'lost' &&\n CommerceModel.describeOrderDispute(lifted)?.tone !== 'lost'\n ) {\n return false\n }\n // The same field the query orders by. `createdAt` is not universal\n // across order writers, and a row missing it read as epoch zero — which\n // both date filters excluded outright.\n const created = (order.createdAtMs ?? 0) / 1000\n if (dateFilter === '7d' && now - created > 7 * 86400) return false\n if (dateFilter === '30d' && now - created > 30 * 86400) return false\n return true\n })\n }, [\n orders,\n productFilter,\n dateFilter,\n statusFilter,\n channelFilter,\n disputeFilter,\n customerFilter,\n ])\n\n /**\n * Raised over EVERY loaded order, not the visible ones (AGL-1796). A\n * merchant filtered to \"delivered\" still has a deadline running on a `paid`\n * order, and the evidence window is days long.\n */\n const openDisputes = useMemo(\n () =>\n CommerceModel.summariseOpenDisputes(\n orders.map((order: any) => CommerceModel.liftLegacyOrder(order)),\n ),\n [orders],\n )\n /**\n * 30-day money summary with the prior 30 days behind it (AGL-2136). Over\n * the LOADED window, like every other figure on this card — the query is\n * `limit(200)`, so a store past 200 orders in 60 days is summarising a\n * slice. That is the same bound the analytics card has always had, and\n * making this one silently different would be worse than sharing it.\n */\n const summary = useMemo(\n () => CommerceModel.summarizeOrderWindow(orders, { nowMs: Date.now() }),\n [orders],\n )\n\n const handleExportCsv = useCallback(() => {\n // The rows themselves are built by the pure model helper (AGL-1747) so the\n // column-by-column arithmetic is unit-testable without a Firestore mock.\n const csv = CommerceModel.buildOrdersCsv(visibleOrders, productNames)\n const url = URL.createObjectURL(new Blob([csv], { type: 'text/csv' }))\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = 'orders.csv'\n anchor.click()\n URL.revokeObjectURL(url)\n }, [visibleOrders, productNames])\n\n /**\n * Idempotency key for ONE draft attempt (AGL-1697).\n *\n * Minted lazily on the first create click, NOT per call — two clicks (or a\n * click retried after a lost response) must present ONE key so the server\n * replays the original payment link instead of minting a second order.\n * Retired whenever a content field changes: an edited draft is a different\n * order, and replaying the old one against it would hand the merchant a\n * link priced for fields they no longer see. Answering the shipping-country\n * ask also retires it, which is safe — that refusal is served before the\n * server takes the claim, so the first key was never spent.\n */\n const draftAttemptKey = useRef('')\n useEffect(() => {\n draftAttemptKey.current = ''\n }, [\n draft?.productId,\n draft?.variantId,\n draft?.quantity,\n draft?.email,\n draft?.shipTo,\n ])\n\n const handleDraftCreate = useCallback(async () => {\n if (!draft?.productId) return\n setDraft((prev) => (prev ? { ...prev, busy: true } : prev))\n try {\n if (!draftAttemptKey.current) {\n draftAttemptKey.current =\n globalThis.crypto?.randomUUID?.() ??\n `${Date.now()}-${Math.random().toString(36).slice(2)}`\n }\n const response = await authorizedFetch(\n user,\n '/api/commerce/draft-order',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n // Stable across a retry of THIS attempt (AGL-1697), so a\n // double-click cannot mint two live payment links.\n 'Idempotency-Key': draftAttemptKey.current,\n },\n body: JSON.stringify({\n hostId,\n productId: draft.productId,\n variantId: draft.variantId || undefined,\n quantity: Number(draft.quantity) || 1,\n email: draft.email || undefined,\n // A request, never an instruction: the server resolves the\n // rates for this country AND restricts the payment link's\n // collectable addresses to it, so declaring one cannot buy a\n // cheaper zone's rate than the address the buyer then enters\n // (AGL-1721).\n ...(draft.shipTo ? { shippingCountry: draft.shipTo } : {}),\n }),\n },\n )\n const payload = await response.json()\n if (!response.ok) {\n // The merchant's rates differ by destination, so the server will not\n // price this order until it knows one (AGL-1792). Reveal the field and\n // let them answer; a store whose rates are the same everywhere, or\n // which configured none, never sends this and never shows it.\n if (payload?.needsShippingCountry) {\n setDraft((prev) =>\n prev\n ? {\n ...prev,\n shipCountries: (\n payload.shippingCountries as string[] | undefined\n )?.length\n ? (payload.shippingCountries as string[])\n : [...CommerceModel.CHECKOUT_SHIPPING_COUNTRIES],\n }\n : prev,\n )\n }\n return void enqueueSnackbar(payload?.error ?? 'Draft order failed', {\n variant: 'error',\n allowDuplicate: true,\n })\n }\n await navigator.clipboard.writeText(payload.url).catch(() => undefined)\n enqueueSnackbar('Draft created — payment link copied', {\n variant: 'success',\n persist: false,\n })\n setDraft(null)\n } finally {\n setDraft((prev) => (prev ? { ...prev, busy: false } : prev))\n }\n }, [draft, user, hostId, enqueueSnackbar])\n\n const selectedOrder =\n (orderDocs ?? []).find((order: any) => order.$id === selectedId) ??\n (seededOrder && seededOrder.$id === selectedId ? seededOrder : null)\n\n /**\n * Shared by the two triggers (AGL-1805) so the empty state and the toolbar\n * cannot drift into opening the dialog with different starting fields.\n */\n const openDraft = useCallback(\n () => setDraft({ productId: '', variantId: '', quantity: '1', email: '' }),\n [],\n )\n\n /** What the draft dialog can actually offer. */\n const selectableProducts = useMemo(\n () => productWindow.rows.filter((product: any) => !product.deletedAt),\n [productWindow],\n )\n\n return (\n <CardDisplay\n header={'Orders'}\n help={pluginDocsHelp('commerce', {\n anchor: '#orders',\n excerpt:\n 'Every order with its channel, status and net total. A refunded ' +\n 'order shows what is left, with the gross beneath it.',\n })}\n contentGutterX\n contentGutterY\n >\n {orders.length === 0 ? (\n /*\n * An invitation, not a report (AGL-1805). The \"Draft order\" button\n * used to live in the other arm of this ternary, so the one state a\n * draft order exists for — no sales yet, invoice the customer you\n * already have — was the only state that could not reach it, and\n * every other route into the dialog needs an order to exist first.\n *\n * The filters stay behind deliberately: they belong to a list with\n * rows in it. Export CSV likewise — a header-only file is not\n * something a merchant on day one is looking for.\n */\n <Stack spacing={1} sx={{ alignItems: 'flex-start' }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {\n 'No orders yet. Storefront sales, POS sales and draft orders ' +\n 'all appear here as they come in.'\n }\n </Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {\n 'Selling to someone directly? Draft their order and send them ' +\n 'a payment link.'\n }\n </Typography>\n <Button\n size=\"small\"\n variant=\"contained\"\n color=\"primary\"\n onClick={openDraft}\n >\n {'Draft order'}\n </Button>\n </Stack>\n ) : (\n <Stack spacing={1}>\n {showStats ? (\n <Stack\n direction=\"row\"\n spacing={3}\n sx={{ flexWrap: 'wrap', rowGap: 1 }}\n >\n <CommerceStatTile\n label=\"Revenue · 30d\"\n value={`$${(summary.revenueCents / 100).toFixed(2)}`}\n deltaPct={summary.revenueDeltaPct}\n deltaCaption=\"vs the previous 30 days\"\n />\n <CommerceStatTile\n label=\"Orders · 30d\"\n value={String(summary.orders)}\n deltaPct={summary.ordersDeltaPct}\n deltaCaption=\"vs the previous 30 days\"\n />\n <CommerceStatTile\n label=\"Avg order value\"\n value={`$${(summary.aovCents / 100).toFixed(2)}`}\n deltaPct={summary.aovDeltaPct}\n deltaCaption=\"vs the previous 30 days\"\n />\n </Stack>\n ) : null}\n {openDisputes.count > 0 ? (\n <Alert\n severity={openDisputes.overdue ? 'error' : 'warning'}\n action={\n disputeFilter === 'open' ? undefined : (\n <Button\n size=\"small\"\n color=\"inherit\"\n onClick={() => setDisputeFilter('open')}\n >\n {'Show them'}\n </Button>\n )\n }\n >\n <AlertTitle>\n {openDisputes.count === 1\n ? 'A shopper has disputed a charge with their bank'\n : `${openDisputes.count} charges are disputed with the shopper’s bank`}\n </AlertTitle>\n {openDisputes.soonestDaysLeft === undefined\n ? 'Answer in the Stripe dashboard while the case is open — an unanswered dispute is decided for the shopper.'\n : openDisputes.soonestDaysLeft < 0\n ? 'The evidence deadline has passed on at least one of these. Stripe decides an unanswered dispute for the shopper.'\n : `Evidence is due to Stripe in ${openDisputes.soonestDaysLeft} day${\n openDisputes.soonestDaysLeft === 1 ? '' : 's'\n } on the tightest of these. An unanswered dispute is decided for the shopper.`}\n </Alert>\n ) : null}\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <TextField\n select\n size=\"small\"\n label=\"Product\"\n value={productFilter}\n onChange={(event) => setProductFilter(event.target.value)}\n sx={{ minWidth: 160 }}\n >\n <MenuItem value=\"\">{'All products'}</MenuItem>\n {productWindow.rows.map((product: any) => (\n <MenuItem key={product.$id} value={product.$id}>\n {product.name ?? product.$id}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n select\n size=\"small\"\n label=\"Period\"\n value={dateFilter}\n onChange={(event) => setDateFilter(event.target.value)}\n sx={{ minWidth: 130 }}\n >\n <MenuItem value=\"\">{'All time'}</MenuItem>\n <MenuItem value=\"7d\">{'Last 7 days'}</MenuItem>\n <MenuItem value=\"30d\">{'Last 30 days'}</MenuItem>\n </TextField>\n <TextField\n select\n size=\"small\"\n label=\"Status\"\n value={statusFilter}\n onChange={(event) => setStatusFilter(event.target.value)}\n sx={{ minWidth: 130 }}\n >\n <MenuItem value=\"\">{'All statuses'}</MenuItem>\n {(\n Object.keys(\n CommerceModel.ORDER_STATUS_LABELS,\n ) as (keyof typeof CommerceModel.ORDER_STATUS_LABELS)[]\n ).map((status) => (\n <MenuItem key={status} value={status}>\n {CommerceModel.ORDER_STATUS_LABELS[status]}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n select\n size=\"small\"\n label=\"Channel\"\n value={channelFilter}\n onChange={(event) => setChannelFilter(event.target.value)}\n sx={{ minWidth: 120 }}\n >\n <MenuItem value=\"\">{'All channels'}</MenuItem>\n {(\n Object.keys(\n CommerceModel.ORDER_CHANNEL_LABELS,\n ) as (keyof typeof CommerceModel.ORDER_CHANNEL_LABELS)[]\n ).map((channel) => (\n <MenuItem key={channel} value={channel}>\n {CommerceModel.ORDER_CHANNEL_LABELS[channel]}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n size=\"small\"\n label=\"Customer\"\n placeholder=\"Email\"\n value={customerFilter}\n onChange={(event) => setCustomerFilter(event.target.value)}\n sx={{ minWidth: 180 }}\n />\n <TextField\n select\n size=\"small\"\n label=\"Disputes\"\n value={disputeFilter}\n onChange={(event) => setDisputeFilter(event.target.value)}\n sx={{ minWidth: 140 }}\n >\n <MenuItem value=\"\">{'All orders'}</MenuItem>\n <MenuItem value=\"open\">{'Open dispute'}</MenuItem>\n <MenuItem value=\"lost\">{'Charged back'}</MenuItem>\n </TextField>\n <Button size=\"small\" onClick={handleExportCsv}>\n {'Export CSV'}\n </Button>\n <Button\n size=\"small\"\n variant=\"contained\"\n color=\"primary\"\n onClick={openDraft}\n >\n {'Draft order'}\n </Button>\n </Stack>\n <ScrollTable size=\"small\" aria-label=\"Orders\">\n <TableHead>\n <TableRow>\n {/*\n The six columns `/product/commerce` advertises, in the\n order the mockup shows them. They were previously one\n `Typography` reading `#1042 · Product · $88.00` plus a\n caption of `email · date` — every fact present, none of\n them scannable, and Channel not present at all.\n */}\n <TableCell>{'Order'}</TableCell>\n <TableCell>{'Customer'}</TableCell>\n <TableCell>{'Channel'}</TableCell>\n <TableCell align=\"right\">{'Total'}</TableCell>\n <TableCell>{'Status'}</TableCell>\n <TableCell>{'Date'}</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {visibleOrders.map((order: any) => {\n const lifted = CommerceModel.liftLegacyOrder(order)\n // A lost chargeback leaves `status: 'refunded'` (AGL-1787),\n // so the status pill on this row cannot tell the two apart\n // either — which is why the dispute chip sits beside it\n // rather than being folded into the status.\n const dispute = CommerceModel.describeOrderDispute(lifted)\n const createdAt = order.createdAt?.toDate?.()\n const itemName =\n lifted.lineItems?.[0]?.name ??\n productNames[order.productId] ??\n order.productId ??\n ''\n const extraItems = Math.max(\n 0,\n (lifted.lineItems?.length ?? 0) - 1,\n )\n return (\n <TableRow\n key={order.$id}\n hover\n onClick={() => setSelectedId(order.$id)}\n sx={{ cursor: 'pointer' }}\n >\n <TableCell>\n <Typography variant=\"body2\">\n {CommerceModel.formatOrderNumber(lifted, order.$id)}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {extraItems\n ? `${itemName} +${extraItems} more`\n : itemName}\n </Typography>\n </TableCell>\n <TableCell>\n <Typography variant=\"body2\" noWrap>\n {order.customerEmail || '—'}\n </Typography>\n </TableCell>\n <TableCell>\n <Typography variant=\"body2\">\n {CommerceModel.orderChannelLabel(lifted.channel)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography variant=\"body2\">\n {`$${(CommerceModel.orderNetCents(lifted) / 100).toFixed(2)}`}\n </Typography>\n {order.refundedCents ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`$${((lifted.totals?.totalCents ?? order.amountCents ?? 0) / 100).toFixed(2)} less refunds`}\n </Typography>\n ) : null}\n </TableCell>\n <TableCell>\n <Stack\n direction=\"row\"\n spacing={0.5}\n sx={{ alignItems: 'center' }}\n >\n <Chip\n label={\n CommerceModel.ORDER_STATUS_LABELS[lifted.status] ??\n lifted.status\n }\n size=\"small\"\n color={\n CommerceModel.ORDER_STATUS_COLOR[lifted.status] ??\n 'default'\n }\n variant=\"outlined\"\n />\n {dispute ? (\n <Tooltip title={dispute.detail}>\n <Chip\n label={dispute.label}\n size=\"small\"\n color={DISPUTE_COLOR[dispute.tone]}\n variant=\"filled\"\n />\n </Tooltip>\n ) : null}\n </Stack>\n {/*\n The deadline on the row itself, while the case is\n open — the one fact on this screen that expires.\n */}\n {dispute?.evidenceDaysLeft !== undefined ? (\n <Typography\n variant=\"caption\"\n component=\"div\"\n color={\n dispute.evidenceDaysLeft < 0\n ? 'error'\n : 'warning.main'\n }\n >\n {dispute.evidenceDaysLeft < 0\n ? 'Evidence deadline passed'\n : `Evidence due in ${dispute.evidenceDaysLeft} day${\n dispute.evidenceDaysLeft === 1 ? '' : 's'\n }`}\n </Typography>\n ) : null}\n </TableCell>\n <TableCell>\n <Typography variant=\"body2\" noWrap>\n {createdAt ? createdAt.toLocaleDateString() : '—'}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {createdAt ? createdAt.toLocaleTimeString() : ''}\n </Typography>\n </TableCell>\n </TableRow>\n )\n })}\n </TableBody>\n </ScrollTable>\n {orderWindow.truncated ? (\n /*\n * Where the filters and the export stop. Both run over what was\n * read, so a store past this window would otherwise see a status\n * filter return nothing and read it as having no such orders.\n */\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Showing the ${ORDERS_WINDOW} most recent orders. Filters and Export CSV cover these.`}\n </Typography>\n ) : null}\n </Stack>\n )}\n {selectedOrder ? (\n <OrderDetailDialog\n hostId={hostId}\n order={selectedOrder}\n onClose={() => setSelectedId(null)}\n />\n ) : null}\n <Dialog\n open={Boolean(draft)}\n onClose={() => setDraft(null)}\n maxWidth=\"xs\"\n fullWidth\n >\n <DialogTitle>{'Draft order'}</DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <TextField\n label=\"Product\"\n value={draft?.productId ?? ''}\n onChange={(event) =>\n setDraft((prev) =>\n prev\n ? { ...prev, productId: event.target.value, variantId: '' }\n : prev,\n )\n }\n size=\"small\"\n select\n sx={{ mt: 1 }}\n /*\n * The second dead end behind the first (AGL-1805): a store with\n * no orders may have no products either, and a draft order is\n * composed from one — so \"Create & copy link\" stays disabled. Say\n * why, rather than opening an empty menu onto nothing.\n */\n helperText={\n selectableProducts.length === 0\n ? 'Add a product to this store first — a draft order is built from one.'\n : undefined\n }\n >\n {selectableProducts.map((product: any) => (\n <MenuItem key={product.$id} value={product.$id}>\n {product.name ?? product.$id}\n </MenuItem>\n ))}\n </TextField>\n {(() => {\n const product = productWindow.rows.find(\n (item: any) => item.$id === draft?.productId,\n )\n const variants = product\n ? CommerceModel.liftLegacyProduct(product).variants\n : []\n return variants.length > 1 ? (\n <TextField\n label=\"Variant\"\n value={draft?.variantId ?? ''}\n onChange={(event) =>\n setDraft((prev) =>\n prev ? { ...prev, variantId: event.target.value } : prev,\n )\n }\n size=\"small\"\n select\n >\n {variants.map((variant) => (\n <MenuItem key={variant.id} value={variant.id}>\n {`${Object.values(variant.options ?? {}).join(' / ') || 'Default'} — $${variant.priceUsd}`}\n </MenuItem>\n ))}\n </TextField>\n ) : null\n })()}\n <TextField\n label=\"Quantity\"\n value={draft?.quantity ?? '1'}\n onChange={(event) =>\n setDraft((prev) =>\n prev\n ? {\n ...prev,\n quantity: event.target.value.replace(/[^0-9]/g, ''),\n }\n : prev,\n )\n }\n size=\"small\"\n slotProps={{ htmlInput: { inputMode: 'numeric' } }}\n />\n <TextField\n label=\"Buyer email (optional)\"\n value={draft?.email ?? ''}\n onChange={(event) =>\n setDraft((prev) =>\n prev ? { ...prev, email: event.target.value } : prev,\n )\n }\n size=\"small\"\n />\n {draft?.shipCountries?.length ? (\n <TextField\n label=\"Ships to\"\n value={draft?.shipTo ?? ''}\n onChange={(event) =>\n setDraft((prev) =>\n prev ? { ...prev, shipTo: event.target.value } : prev,\n )\n }\n size=\"small\"\n select\n helperText={\n 'This store’s shipping rates differ by destination, so the ' +\n 'payment link has to be priced for one.'\n }\n >\n {draft.shipCountries.map((code) => (\n <MenuItem key={code} value={code}>\n {CommerceModel.CHECKOUT_SHIPPING_COUNTRY_NAMES[code] ?? code}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setDraft(null)}>{'Cancel'}</Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={\n !draft?.productId ||\n draft?.busy ||\n // Once asked, the answer is required: retrying without one is\n // refused again, so the button would only look broken.\n Boolean(draft?.shipCountries?.length && !draft?.shipTo)\n }\n onClick={handleDraftCreate}\n >\n {'Create & copy link'}\n </Button>\n </DialogActions>\n </Dialog>\n </CardDisplay>\n )\n}\nHostOrdersCard.displayName = 'HostOrdersCard'\n\nexport default HostOrdersCard\n"],"names":["CommerceModel","CardDisplay","ScrollTable","useSnackbar","checkEntitlement","ORDERS_CUSTOMER_PARAM","ORDERS_ORDER_PARAM","pluginDocsHelp","Alert","AlertTitle","Button","Chip","Dialog","DialogActions","DialogContent","DialogTitle","MenuItem","Stack","TableBody","TableCell","TableHead","TableRow","TextField","Tooltip","Typography","collection","doc","getDoc","limit","orderBy","query","useSearchParams","useCallback","useEffect","useMemo","useRef","useState","ceilingedWindow","collectionCeiling","useFirestore","useOrgPlan","useUser","useFirestoreCollection","authorizedFetch","CommerceStatTile","OrderDetailDialog","DISPUTE_COLOR","ORDERS_WINDOW","PRODUCT_NAME_WINDOW","HostOrdersCard","props","draft","hostId","firestore","data","orderDocs","idField","productDocs","orderWindow","undefined","productWindow","productNames","map","product","rows","$id","name","org","ready","orgReady","showStats","orders","productFilter","setProductFilter","dateFilter","setDateFilter","statusFilter","setStatusFilter","channelFilter","setChannelFilter","disputeFilter","setDisputeFilter","searchParams","customerFilter","setCustomerFilter","get","selectedId","setSelectedId","seededOrderId","seededOrder","setSeededOrder","seededOpened","current","some","order","then","snapshot","id","exists","catch","setDraft","user","enqueueSnackbar","visibleOrders","now","Date","filter","lifted","liftLegacyOrder","orderContainsProduct","status","String","customerEmail","toLowerCase","includes","trim","channel","orderHasOpenDispute","describeOrderDispute","tone","created","createdAtMs","openDisputes","summariseOpenDisputes","summary","summarizeOrderWindow","nowMs","handleExportCsv","csv","buildOrdersCsv","url","URL","createObjectURL","Blob","type","anchor","document","createElement","href","download","click","revokeObjectURL","draftAttemptKey","productId","variantId","quantity","email","shipTo","handleDraftCreate","prev","busy","globalThis","crypto","randomUUID","Math","random","toString","slice","response","method","headers","body","JSON","stringify","Number","shippingCountry","payload","json","ok","needsShippingCountry","shipCountries","shippingCountries","length","CHECKOUT_SHIPPING_COUNTRIES","error","variant","allowDuplicate","navigator","clipboard","writeText","persist","selectedOrder","find","openDraft","selectableProducts","deletedAt","header","help","excerpt","contentGutterX","contentGutterY","spacing","sx","alignItems","color","size","onClick","direction","flexWrap","rowGap","label","value","revenueCents","toFixed","deltaPct","revenueDeltaPct","deltaCaption","ordersDeltaPct","aovCents","aovDeltaPct","count","severity","overdue","action","soonestDaysLeft","select","onChange","event","target","minWidth","Object","keys","ORDER_STATUS_LABELS","ORDER_CHANNEL_LABELS","placeholder","aria-label","align","dispute","createdAt","toDate","itemName","lineItems","extraItems","max","hover","cursor","formatOrderNumber","noWrap","orderChannelLabel","orderNetCents","refundedCents","totals","totalCents","amountCents","ORDER_STATUS_COLOR","title","detail","evidenceDaysLeft","component","toLocaleDateString","toLocaleTimeString","truncated","onClose","open","Boolean","maxWidth","fullWidth","display","flexDirection","gap","mt","helperText","item","variants","liftLegacyProduct","values","options","join","priceUsd","replace","slotProps","htmlInput","inputMode","code","CHECKOUT_SHIPPING_COUNTRY_NAMES","disabled","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,YAAYA,mBAAmB,uBAAa;AAC5C,SAASC,WAAW,QAAQ,uBAAsB;AAClD,SAASC,WAAW,QAAQ,yDAAwD;AACpF,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,kBAAkB,EAClBC,cAAc,QACT,eAAc;AACrB,SACEC,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,OAAO,EACPC,UAAU,QACL,gBAAe;AACtB,SAASC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,KA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
|
|
4
|
+
/**
|
|
5
|
+
* Inventory locations (AGL-286): named stock buckets under
|
|
6
|
+
* `hosts/{hostId}/locations`, capped by the plan's `inventoryLocations`
|
|
7
|
+
* quota (AGL-278). Variant stock splits per location in the products
|
|
8
|
+
* hub; POS registers sell from their location (AGL-312).
|
|
9
|
+
*/
|
|
10
|
+
export declare function LocationsCard(props: LocationsCardProps): import("react").JSX.Element;
|
|
11
|
+
export declare namespace LocationsCard {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export default LocationsCard;
|
|
@@ -0,0 +1,256 @@
|
|
|
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 Aglyn from "@aglyn/aglyn";
|
|
20
|
+
import { CardDisplay, useConfirmationContext } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import QuotaReadoutComponent from "@aglyn/shared-ui-jsx/components/quota-readout.component";
|
|
22
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
23
|
+
import { Button, Chip, Stack, TextField, Typography } from "@mui/material";
|
|
24
|
+
import { collection, deleteDoc, doc, getCountFromServer, limit, query, setDoc } from "firebase/firestore";
|
|
25
|
+
import { useCallback, useEffect, useState } from "react";
|
|
26
|
+
import { useFirestore } from "@aglyn/tenant-feature-instance";
|
|
27
|
+
import { useFirestoreCollection } from "@aglyn/tenant-feature-instance";
|
|
28
|
+
import { useHostResourceApi } from "@aglyn/tenant-feature-instance";
|
|
29
|
+
import { useOrgPlan } from "@aglyn/tenant-feature-instance";
|
|
30
|
+
import { pluginDocsHelp } from "@aglyn/aglyn";
|
|
31
|
+
/**
|
|
32
|
+
* Inventory locations (AGL-286): named stock buckets under
|
|
33
|
+
* `hosts/{hostId}/locations`, capped by the plan's `inventoryLocations`
|
|
34
|
+
* quota (AGL-278). Variant stock splits per location in the products
|
|
35
|
+
* hub; POS registers sell from their location (AGL-312).
|
|
36
|
+
*/ export function LocationsCard(props) {
|
|
37
|
+
const { hostId } = props;
|
|
38
|
+
const firestore = useFirestore();
|
|
39
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
40
|
+
const { confirm } = useConfirmationContext();
|
|
41
|
+
const createHostResource = useHostResourceApi();
|
|
42
|
+
const { org, ready: planReady } = useOrgPlan(hostId);
|
|
43
|
+
const { data: locationDocs } = useFirestoreCollection(()=>query(collection(firestore, 'hosts', hostId, 'locations'), limit(25)), [
|
|
44
|
+
firestore,
|
|
45
|
+
hostId
|
|
46
|
+
], {
|
|
47
|
+
idField: '$id'
|
|
48
|
+
});
|
|
49
|
+
const locations = [
|
|
50
|
+
...locationDocs != null ? locationDocs : []
|
|
51
|
+
].sort((a, b)=>{
|
|
52
|
+
var _a_name, _b_name;
|
|
53
|
+
return String((_a_name = a.name) != null ? _a_name : '').localeCompare(String((_b_name = b.name) != null ? _b_name : ''));
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* The location HEAD-COUNT is a server aggregate, not the length of the
|
|
57
|
+
* capped listener (AGL-1716, the AGL-1706 shape).
|
|
58
|
+
*
|
|
59
|
+
* The smallest margin of the eight, and real for exactly one plan: the
|
|
60
|
+
* listener is `limit(25)` and `inventoryLocations` runs 1 / 1 / 2 / 4 / 6 /
|
|
61
|
+
* 10 / 50, so only Agency's 50 sits above the window. An agency with more
|
|
62
|
+
* than 25 stock buckets read its cap as satisfiable, and
|
|
63
|
+
* `api/hosts/resources` — which counts the collection — refused the add.
|
|
64
|
+
*
|
|
65
|
+
* Re-read after an add AND a delete: locations are hard-deleted here, so
|
|
66
|
+
* unlike the soft-deleting cards a removal really does free a slot on both
|
|
67
|
+
* sides, and a one-shot that missed it would keep refusing.
|
|
68
|
+
*
|
|
69
|
+
* `locations.length === 0` below still decides the FIRST location's
|
|
70
|
+
* `isDefault` flag off the loaded rows, which is the right question for it
|
|
71
|
+
* — that one is about what this card can see, not about the site's total.
|
|
72
|
+
*/ const [locationCountEpoch, setLocationCountEpoch] = useState(0);
|
|
73
|
+
const [serverLocationCount, setServerLocationCount] = useState(null);
|
|
74
|
+
useEffect(()=>{
|
|
75
|
+
let active = true;
|
|
76
|
+
void getCountFromServer(collection(firestore, 'hosts', hostId, 'locations')).then((snapshot)=>{
|
|
77
|
+
if (active) setServerLocationCount(snapshot.data().count);
|
|
78
|
+
}).catch(()=>{
|
|
79
|
+
// Falls back to the loaded rows — a LOWER bound and the prior
|
|
80
|
+
// behaviour, never 0, which reads as "no locations used" on a site
|
|
81
|
+
// that is over its band.
|
|
82
|
+
});
|
|
83
|
+
return ()=>{
|
|
84
|
+
active = false;
|
|
85
|
+
};
|
|
86
|
+
}, [
|
|
87
|
+
firestore,
|
|
88
|
+
hostId,
|
|
89
|
+
locationCountEpoch
|
|
90
|
+
]);
|
|
91
|
+
const locationCount = serverLocationCount != null ? serverLocationCount : locations.length;
|
|
92
|
+
const quota = Aglyn.checkQuota(org, 'inventoryLocations', locationCount);
|
|
93
|
+
const [name, setName] = useState('');
|
|
94
|
+
const handleAdd = useCallback(async ()=>{
|
|
95
|
+
if (!name.trim()) return;
|
|
96
|
+
// Held until the org doc lands (AGL-1064): an absent org resolves to
|
|
97
|
+
// the free tier's `inventoryLocations: 1`, so a site that already has
|
|
98
|
+
// its default location would be refused with an upgrade prompt it does
|
|
99
|
+
// not need. The button is disabled too; this guards the race.
|
|
100
|
+
if (!planReady) return;
|
|
101
|
+
if (!quota.allowed) {
|
|
102
|
+
return void enqueueSnackbar(`Your plan includes ${quota.limit} locations — upgrade for more`, {
|
|
103
|
+
variant: 'info',
|
|
104
|
+
persist: false
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
// Creation rides the quota-enforcing resources API (AGL-473).
|
|
109
|
+
await createHostResource({
|
|
110
|
+
hostId,
|
|
111
|
+
resource: 'location',
|
|
112
|
+
data: _extends({
|
|
113
|
+
name: name.trim().slice(0, 80)
|
|
114
|
+
}, locations.length === 0 ? {
|
|
115
|
+
isDefault: true
|
|
116
|
+
} : {})
|
|
117
|
+
});
|
|
118
|
+
setName('');
|
|
119
|
+
setLocationCountEpoch((epoch)=>epoch + 1);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
var _ref;
|
|
122
|
+
enqueueSnackbar((_ref = error == null ? void 0 : error.message) != null ? _ref : 'Could not add location', {
|
|
123
|
+
variant: 'warning',
|
|
124
|
+
persist: false
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}, [
|
|
128
|
+
name,
|
|
129
|
+
planReady,
|
|
130
|
+
quota,
|
|
131
|
+
locations.length,
|
|
132
|
+
hostId,
|
|
133
|
+
createHostResource,
|
|
134
|
+
enqueueSnackbar
|
|
135
|
+
]);
|
|
136
|
+
const handleDelete = useCallback((location)=>async ()=>{
|
|
137
|
+
const confirmed = await confirm({
|
|
138
|
+
title: 'Remove this location?',
|
|
139
|
+
description: `Stock bucketed under "${location.name}" folds back into the ` + 'flat totals; adjust counts afterward if needed.',
|
|
140
|
+
confirmationText: 'Remove',
|
|
141
|
+
confirmationButtonProps: {
|
|
142
|
+
color: 'error'
|
|
143
|
+
}
|
|
144
|
+
}).then(()=>true).catch(()=>false);
|
|
145
|
+
if (!confirmed) return;
|
|
146
|
+
await deleteDoc(doc(firestore, 'hosts', hostId, 'locations', location.$id));
|
|
147
|
+
// A HARD delete, so the slot really is freed on both sides — the
|
|
148
|
+
// one-shot aggregate has to be told (AGL-1716).
|
|
149
|
+
setLocationCountEpoch((epoch)=>epoch + 1);
|
|
150
|
+
}, [
|
|
151
|
+
confirm,
|
|
152
|
+
firestore,
|
|
153
|
+
hostId
|
|
154
|
+
]);
|
|
155
|
+
const handleMakeDefault = useCallback((location)=>async ()=>{
|
|
156
|
+
for (const other of locations){
|
|
157
|
+
if (other.isDefault && other.$id !== location.$id) {
|
|
158
|
+
await setDoc(doc(firestore, 'hosts', hostId, 'locations', other.$id), {
|
|
159
|
+
isDefault: false
|
|
160
|
+
}, {
|
|
161
|
+
merge: true
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
await setDoc(doc(firestore, 'hosts', hostId, 'locations', location.$id), {
|
|
166
|
+
isDefault: true
|
|
167
|
+
}, {
|
|
168
|
+
merge: true
|
|
169
|
+
});
|
|
170
|
+
}, [
|
|
171
|
+
locations,
|
|
172
|
+
firestore,
|
|
173
|
+
hostId
|
|
174
|
+
]);
|
|
175
|
+
return /*#__PURE__*/ _jsx(CardDisplay, {
|
|
176
|
+
header: 'Inventory locations',
|
|
177
|
+
help: pluginDocsHelp('commerce', {
|
|
178
|
+
anchor: '#inventory'
|
|
179
|
+
}),
|
|
180
|
+
contentGutterX: true,
|
|
181
|
+
contentGutterY: true,
|
|
182
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
183
|
+
spacing: 1,
|
|
184
|
+
children: [
|
|
185
|
+
locations.length === 0 ? /*#__PURE__*/ _jsx(Typography, {
|
|
186
|
+
variant: "body2",
|
|
187
|
+
color: "text.secondary",
|
|
188
|
+
children: 'Track stock per warehouse or storefront. Without locations, ' + 'every variant has a single stock count.'
|
|
189
|
+
}) : locations.map((location)=>/*#__PURE__*/ _jsxs(Stack, {
|
|
190
|
+
direction: "row",
|
|
191
|
+
spacing: 1,
|
|
192
|
+
sx: {
|
|
193
|
+
alignItems: 'center'
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
197
|
+
variant: "body2",
|
|
198
|
+
sx: {
|
|
199
|
+
flex: 1
|
|
200
|
+
},
|
|
201
|
+
noWrap: true,
|
|
202
|
+
children: location.name
|
|
203
|
+
}),
|
|
204
|
+
location.isDefault ? /*#__PURE__*/ _jsx(Chip, {
|
|
205
|
+
label: "Default",
|
|
206
|
+
size: "small",
|
|
207
|
+
variant: "outlined"
|
|
208
|
+
}) : /*#__PURE__*/ _jsx(Button, {
|
|
209
|
+
size: "small",
|
|
210
|
+
onClick: handleMakeDefault(location),
|
|
211
|
+
children: 'Make default'
|
|
212
|
+
}),
|
|
213
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
214
|
+
size: "small",
|
|
215
|
+
color: "error",
|
|
216
|
+
onClick: handleDelete(location),
|
|
217
|
+
children: 'Remove'
|
|
218
|
+
})
|
|
219
|
+
]
|
|
220
|
+
}, location.$id)),
|
|
221
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
222
|
+
direction: "row",
|
|
223
|
+
spacing: 1,
|
|
224
|
+
children: [
|
|
225
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
226
|
+
label: "New location",
|
|
227
|
+
value: name,
|
|
228
|
+
onChange: (event)=>setName(event.target.value),
|
|
229
|
+
size: "small",
|
|
230
|
+
sx: {
|
|
231
|
+
flex: 1
|
|
232
|
+
},
|
|
233
|
+
placeholder: "Main warehouse"
|
|
234
|
+
}),
|
|
235
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
236
|
+
size: "small",
|
|
237
|
+
disabled: !name.trim() || !planReady,
|
|
238
|
+
onClick: handleAdd,
|
|
239
|
+
children: 'Add'
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
}),
|
|
243
|
+
/*#__PURE__*/ _jsx(QuotaReadoutComponent, {
|
|
244
|
+
ready: planReady,
|
|
245
|
+
used: locationCount,
|
|
246
|
+
limit: quota.limit,
|
|
247
|
+
noun: "location"
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
})
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
LocationsCard.displayName = 'LocationsCard';
|
|
254
|
+
export default LocationsCard;
|
|
255
|
+
|
|
256
|
+
//# sourceMappingURL=locations-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/locations-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'use client'\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport * as CommerceModel from '../../model'\nimport { CardDisplay, useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport QuotaReadoutComponent from '@aglyn/shared-ui-jsx/components/quota-readout.component'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { Button, Chip, Stack, TextField, Typography } from '@mui/material'\nimport {\n collection,\n deleteDoc,\n doc,\n getCountFromServer,\n limit,\n query,\n setDoc,\n} from 'firebase/firestore'\nimport { useCallback, useEffect, useState } from 'react'\nimport { useFirestore } from '@aglyn/tenant-feature-instance'\nimport { useFirestoreCollection } from '@aglyn/tenant-feature-instance'\nimport { useHostResourceApi } from '@aglyn/tenant-feature-instance'\nimport { useOrgPlan } from '@aglyn/tenant-feature-instance'\nimport { pluginDocsHelp } from '@aglyn/aglyn'\n\nexport interface LocationsCardProps {\n hostId: string\n}\n\n/**\n * Inventory locations (AGL-286): named stock buckets under\n * `hosts/{hostId}/locations`, capped by the plan's `inventoryLocations`\n * quota (AGL-278). Variant stock splits per location in the products\n * hub; POS registers sell from their location (AGL-312).\n */\nexport function LocationsCard(props: LocationsCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const { confirm } = useConfirmationContext()\n const createHostResource = useHostResourceApi()\n const { org, ready: planReady } = useOrgPlan(hostId)\n const { data: locationDocs } = useFirestoreCollection<any>(\n () => query(collection(firestore, 'hosts', hostId, 'locations'), limit(25)),\n [firestore, hostId],\n { idField: '$id' },\n )\n const locations = [...(locationDocs ?? [])].sort((a: any, b: any) =>\n String(a.name ?? '').localeCompare(String(b.name ?? '')),\n )\n /**\n * The location HEAD-COUNT is a server aggregate, not the length of the\n * capped listener (AGL-1716, the AGL-1706 shape).\n *\n * The smallest margin of the eight, and real for exactly one plan: the\n * listener is `limit(25)` and `inventoryLocations` runs 1 / 1 / 2 / 4 / 6 /\n * 10 / 50, so only Agency's 50 sits above the window. An agency with more\n * than 25 stock buckets read its cap as satisfiable, and\n * `api/hosts/resources` — which counts the collection — refused the add.\n *\n * Re-read after an add AND a delete: locations are hard-deleted here, so\n * unlike the soft-deleting cards a removal really does free a slot on both\n * sides, and a one-shot that missed it would keep refusing.\n *\n * `locations.length === 0` below still decides the FIRST location's\n * `isDefault` flag off the loaded rows, which is the right question for it\n * — that one is about what this card can see, not about the site's total.\n */\n const [locationCountEpoch, setLocationCountEpoch] = useState(0)\n const [serverLocationCount, setServerLocationCount] = useState<number | null>(\n null,\n )\n useEffect(() => {\n let active = true\n void getCountFromServer(collection(firestore, 'hosts', hostId, 'locations'))\n .then((snapshot) => {\n if (active) setServerLocationCount(snapshot.data().count)\n })\n .catch(() => {\n // Falls back to the loaded rows — a LOWER bound and the prior\n // behaviour, never 0, which reads as \"no locations used\" on a site\n // that is over its band.\n })\n return () => {\n active = false\n }\n }, [firestore, hostId, locationCountEpoch])\n const locationCount = serverLocationCount ?? locations.length\n const quota = Aglyn.checkQuota(org, 'inventoryLocations', locationCount)\n const [name, setName] = useState('')\n\n const handleAdd = useCallback(async () => {\n if (!name.trim()) return\n // Held until the org doc lands (AGL-1064): an absent org resolves to\n // the free tier's `inventoryLocations: 1`, so a site that already has\n // its default location would be refused with an upgrade prompt it does\n // not need. The button is disabled too; this guards the race.\n if (!planReady) return\n if (!quota.allowed) {\n return void enqueueSnackbar(\n `Your plan includes ${quota.limit} locations — upgrade for more`,\n { variant: 'info', persist: false },\n )\n }\n try {\n // Creation rides the quota-enforcing resources API (AGL-473).\n await createHostResource({\n hostId,\n resource: 'location',\n data: {\n name: name.trim().slice(0, 80),\n ...(locations.length === 0 ? { isDefault: true } : {}),\n } satisfies CommerceModel.InventoryLocation,\n })\n setName('')\n setLocationCountEpoch((epoch) => epoch + 1)\n } catch (error: any) {\n enqueueSnackbar(error?.message ?? 'Could not add location', {\n variant: 'warning',\n persist: false,\n })\n }\n }, [\n name,\n planReady,\n quota,\n locations.length,\n hostId,\n createHostResource,\n enqueueSnackbar,\n ])\n\n const handleDelete = useCallback(\n (location: any) => async () => {\n const confirmed = await confirm({\n title: 'Remove this location?',\n description:\n `Stock bucketed under \"${location.name}\" folds back into the ` +\n 'flat totals; adjust counts afterward if needed.',\n confirmationText: 'Remove',\n confirmationButtonProps: { color: 'error' },\n })\n .then(() => true)\n .catch(() => false)\n if (!confirmed) return\n await deleteDoc(doc(firestore, 'hosts', hostId, 'locations', location.$id))\n // A HARD delete, so the slot really is freed on both sides — the\n // one-shot aggregate has to be told (AGL-1716).\n setLocationCountEpoch((epoch) => epoch + 1)\n },\n [confirm, firestore, hostId],\n )\n\n const handleMakeDefault = useCallback(\n (location: any) => async () => {\n for (const other of locations) {\n if (other.isDefault && other.$id !== location.$id) {\n await setDoc(\n doc(firestore, 'hosts', hostId, 'locations', other.$id),\n { isDefault: false },\n { merge: true },\n )\n }\n }\n await setDoc(\n doc(firestore, 'hosts', hostId, 'locations', location.$id),\n { isDefault: true },\n { merge: true },\n )\n },\n [locations, firestore, hostId],\n )\n\n return (\n <CardDisplay\n header={'Inventory locations'}\n help={pluginDocsHelp('commerce', { anchor: '#inventory' })}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={1}>\n {locations.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Track stock per warehouse or storefront. Without locations, ' +\n 'every variant has a single stock count.'}\n </Typography>\n ) : (\n locations.map((location: any) => (\n <Stack\n key={location.$id}\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center' }}\n >\n <Typography variant=\"body2\" sx={{ flex: 1 }} noWrap>\n {location.name}\n </Typography>\n {location.isDefault ? (\n <Chip label=\"Default\" size=\"small\" variant=\"outlined\" />\n ) : (\n <Button size=\"small\" onClick={handleMakeDefault(location)}>\n {'Make default'}\n </Button>\n )}\n <Button size=\"small\" color=\"error\" onClick={handleDelete(location)}>\n {'Remove'}\n </Button>\n </Stack>\n ))\n )}\n <Stack direction=\"row\" spacing={1}>\n <TextField\n label=\"New location\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n size=\"small\"\n sx={{ flex: 1 }}\n placeholder=\"Main warehouse\"\n />\n <Button\n size=\"small\"\n disabled={!name.trim() || !planReady}\n onClick={handleAdd}\n >\n {'Add'}\n </Button>\n </Stack>\n {/* The site's locations, not this card's rows (AGL-1716) — the\n readout and the gate must agree, and the gate now counts.\n The wording moved to the shared component in AGL-2113 so the five\n sibling cards that were missing it render the identical string\n rather than five near-misses; the output here is unchanged. */}\n <QuotaReadoutComponent\n ready={planReady}\n used={locationCount}\n limit={quota.limit}\n noun=\"location\"\n />\n </Stack>\n </CardDisplay>\n )\n}\nLocationsCard.displayName = 'LocationsCard'\n\nexport default LocationsCard\n"],"names":["Aglyn","CardDisplay","useConfirmationContext","QuotaReadoutComponent","useSnackbar","Button","Chip","Stack","TextField","Typography","collection","deleteDoc","doc","getCountFromServer","limit","query","setDoc","useCallback","useEffect","useState","useFirestore","useFirestoreCollection","useHostResourceApi","useOrgPlan","pluginDocsHelp","LocationsCard","props","hostId","firestore","enqueueSnackbar","confirm","createHostResource","org","ready","planReady","data","locationDocs","idField","locations","sort","a","b","String","name","localeCompare","locationCountEpoch","setLocationCountEpoch","serverLocationCount","setServerLocationCount","active","then","snapshot","count","catch","locationCount","length","quota","checkQuota","setName","handleAdd","trim","allowed","variant","persist","resource","slice","isDefault","epoch","error","message","handleDelete","location","confirmed","title","description","confirmationText","confirmationButtonProps","color","$id","handleMakeDefault","other","merge","header","help","anchor","contentGutterX","contentGutterY","spacing","map","direction","sx","alignItems","flex","noWrap","label","size","onClick","value","onChange","event","target","placeholder","disabled","used","noun","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,YAAYA,WAAW,eAAc;AAErC,SAASC,WAAW,EAAEC,sBAAsB,QAAQ,uBAAsB;AAC1E,OAAOC,2BAA2B,0DAAyD;AAC3F,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAe;AAC1E,SACEC,UAAU,EACVC,SAAS,EACTC,GAAG,EACHC,kBAAkB,EAClBC,KAAK,EACLC,KAAK,EACLC,MAAM,QACD,qBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AACxD,SAASC,YAAY,QAAQ,iCAAgC;AAC7D,SAASC,sBAAsB,QAAQ,iCAAgC;AACvE,SAASC,kBAAkB,QAAQ,iCAAgC;AACnE,SAASC,UAAU,QAAQ,iCAAgC;AAC3D,SAASC,cAAc,QAAQ,eAAc;AAM7C;;;;;CAKC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,MAAME,YAAYR;IAClB,MAAM,EAAES,eAAe,EAAE,GAAGzB;IAC5B,MAAM,EAAE0B,OAAO,EAAE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AK;4BAC/CF,MAAK;4BACLL,IAAI;gCAAEE,MAAM;4BAAE;4BACdS,aAAY;;sCAEd,KAAChG;4BACC0F,MAAK;4BACLO,UAAU,CAAC3D,KAAKiB,IAAI,MAAM,CAAC1B;4BAC3B8D,SAASrC;sCAER;;;;8BAQL,KAACxD;oBACC8B,OAAOC;oBACPqE,MAAMjD;oBACNxC,OAAO0C,MAAM1C,KAAK;oBAClB0F,MAAK;;;;;AAKf;AACA/E,cAAcgF,WAAW,GAAG;AAE5B,eAAehF,cAAa"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface MemberPostsCardProps {
|
|
2
|
+
hostId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function MemberPostsCard(props: MemberPostsCardProps): import("react").JSX.Element;
|
|
5
|
+
export declare namespace MemberPostsCard {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export default MemberPostsCard;
|