@aglyn/plugins-commerce 1.0.0-beta.231 → 1.0.0-beta.233
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/lib/components/cart-extras.d.ts +6 -0
- package/src/lib/components/cart-extras.js +4 -1
- package/src/lib/components/cart-extras.js.map +1 -1
- package/src/lib/components/cart-fulfillment.d.ts +117 -0
- package/src/lib/components/cart-fulfillment.js +367 -0
- package/src/lib/components/cart-fulfillment.js.map +1 -0
- package/src/lib/components/cart.js +52 -10
- package/src/lib/components/cart.js.map +1 -1
- package/src/lib/components/commerce-console-page.js +42 -1
- package/src/lib/components/commerce-console-page.js.map +1 -1
- 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/host-orders-card.component.js +42 -11
- package/src/lib/components/console/host-orders-card.component.js.map +1 -1
- package/src/lib/components/console/local-delivery-settings-card.component.d.ts +37 -0
- package/src/lib/components/console/local-delivery-settings-card.component.js +542 -0
- package/src/lib/components/console/local-delivery-settings-card.component.js.map +1 -0
- package/src/lib/components/console/locations-card.component.js +177 -3
- package/src/lib/components/console/locations-card.component.js.map +1 -1
- package/src/lib/components/console/order-detail-dialog.component.js +10 -0
- package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
- package/src/lib/components/console/order-local-fulfillment-panel.component.d.ts +44 -0
- package/src/lib/components/console/order-local-fulfillment-panel.component.js +265 -0
- package/src/lib/components/console/order-local-fulfillment-panel.component.js.map +1 -0
- package/src/lib/components/console/order-offline-notice.component.d.ts +12 -0
- package/src/lib/components/console/order-offline-notice.component.js +53 -0
- package/src/lib/components/console/order-offline-notice.component.js.map +1 -0
- package/src/lib/components/console/pickup-delivery-queue-card.component.d.ts +35 -0
- package/src/lib/components/console/pickup-delivery-queue-card.component.js +222 -0
- package/src/lib/components/console/pickup-delivery-queue-card.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-api.d.ts +24 -1
- package/src/lib/components/console/pos/pos-api.js +13 -0
- package/src/lib/components/console/pos/pos-api.js.map +1 -1
- package/src/lib/components/console/pos/pos-item-dialog.component.d.ts +12 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.js +10 -8
- package/src/lib/components/console/pos/pos-item-dialog.component.js.map +1 -1
- package/src/lib/components/console/pos/pos-kiosk-queue.component.d.ts +22 -0
- package/src/lib/components/console/pos/pos-kiosk-queue.component.js +168 -0
- package/src/lib/components/console/pos/pos-kiosk-queue.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.d.ts +18 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js +116 -1
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js.map +1 -1
- package/src/lib/components/console/pos/pos-tender-panel.component.d.ts +8 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.js +77 -18
- package/src/lib/components/console/pos/pos-tender-panel.component.js.map +1 -1
- package/src/lib/components/console/pos/use-pos-display.d.ts +5 -2
- package/src/lib/components/console/pos/use-pos-display.js +3 -2
- package/src/lib/components/console/pos/use-pos-display.js.map +1 -1
- package/src/lib/components/console/pos-devices-card.component.js +2 -2
- package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
- package/src/lib/components/console/pos-display/pairing-screen.d.ts +5 -2
- package/src/lib/components/console/pos-display/pairing-screen.js +7 -5
- package/src/lib/components/console/pos-display/pairing-screen.js.map +1 -1
- package/src/lib/components/console/pos-display/pos-display-api.d.ts +7 -1
- package/src/lib/components/console/pos-display/pos-display-api.js +7 -2
- package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -1
- package/src/lib/components/console/pos-kiosk/kiosk-checkout.d.ts +41 -0
- package/src/lib/components/console/pos-kiosk/kiosk-checkout.js +275 -0
- package/src/lib/components/console/pos-kiosk/kiosk-checkout.js.map +1 -0
- package/src/lib/components/console/pos-kiosk/kiosk-menu.d.ts +32 -0
- package/src/lib/components/console/pos-kiosk/kiosk-menu.js +344 -0
- package/src/lib/components/console/pos-kiosk/kiosk-menu.js.map +1 -0
- package/src/lib/components/console/pos-kiosk/kiosk-staff.d.ts +12 -0
- package/src/lib/components/console/pos-kiosk/kiosk-staff.js +257 -0
- package/src/lib/components/console/pos-kiosk/kiosk-staff.js.map +1 -0
- package/src/lib/components/console/pos-kiosk/pos-kiosk-api.d.ts +114 -0
- package/src/lib/components/console/pos-kiosk/pos-kiosk-api.js +189 -0
- package/src/lib/components/console/pos-kiosk/pos-kiosk-api.js.map +1 -0
- package/src/lib/components/console/pos-kiosk/use-kiosk-idle.d.ts +16 -0
- package/src/lib/components/console/pos-kiosk/use-kiosk-idle.js +80 -0
- package/src/lib/components/console/pos-kiosk/use-kiosk-idle.js.map +1 -0
- package/src/lib/components/console/pos-kiosk-page.component.d.ts +28 -0
- package/src/lib/components/console/pos-kiosk-page.component.js +791 -0
- package/src/lib/components/console/pos-kiosk-page.component.js.map +1 -0
- package/src/lib/components/console/pos-offline/pos-offline-api.d.ts +44 -0
- package/src/lib/components/console/pos-offline/pos-offline-api.js +69 -0
- package/src/lib/components/console/pos-offline/pos-offline-api.js.map +1 -0
- package/src/lib/components/console/pos-offline/pos-offline-banner.component.d.ts +7 -0
- package/src/lib/components/console/pos-offline/pos-offline-banner.component.js +135 -0
- package/src/lib/components/console/pos-offline/pos-offline-banner.component.js.map +1 -0
- package/src/lib/components/console/pos-offline/pos-offline-checkout.component.d.ts +32 -0
- package/src/lib/components/console/pos-offline/pos-offline-checkout.component.js +287 -0
- package/src/lib/components/console/pos-offline/pos-offline-checkout.component.js.map +1 -0
- package/src/lib/components/console/pos-offline/pos-offline-store.d.ts +63 -0
- package/src/lib/components/console/pos-offline/pos-offline-store.js +145 -0
- package/src/lib/components/console/pos-offline/pos-offline-store.js.map +1 -0
- package/src/lib/components/console/pos-offline/register-offline.d.ts +24 -0
- package/src/lib/components/console/pos-offline/register-offline.js +24 -0
- package/src/lib/components/console/pos-offline/register-offline.js.map +1 -0
- package/src/lib/components/console/pos-offline/use-pos-offline.d.ts +85 -0
- package/src/lib/components/console/pos-offline/use-pos-offline.js +542 -0
- package/src/lib/components/console/pos-offline/use-pos-offline.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js +72 -17
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js.map +1 -1
- package/src/lib/components/console/pos-page.component.js +228 -51
- 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 +10 -64
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
- package/src/lib/components/console/products-hub-card.component.js +46 -30
- package/src/lib/components/console/products-hub-card.component.js.map +1 -1
- package/src/lib/components/console/shipping-settings-card.component.js +1 -1
- package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
- package/src/lib/components/console/stock-movements-card.component.js +48 -16
- package/src/lib/components/console/stock-movements-card.component.js.map +1 -1
- package/src/lib/components/console/store-zones.d.ts +8 -1
- package/src/lib/components/console/store-zones.js +11 -1
- package/src/lib/components/console/store-zones.js.map +1 -1
- 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.js +66 -0
- package/src/lib/components/order-status.js.map +1 -1
- package/src/lib/components/product-detail.js +42 -15
- package/src/lib/components/product-detail.js.map +1 -1
- package/src/lib/constants/local-fulfillment-list-query.d.ts +48 -0
- package/src/lib/constants/local-fulfillment-list-query.js +84 -0
- package/src/lib/constants/local-fulfillment-list-query.js.map +1 -0
- package/src/lib/constants/orders-list-query.d.ts +7 -2
- package/src/lib/constants/orders-list-query.js +89 -8
- package/src/lib/constants/orders-list-query.js.map +1 -1
- package/src/lib/constants/pos-shift-list-query.d.ts +22 -0
- package/src/lib/constants/pos-shift-list-query.js +115 -0
- package/src/lib/constants/pos-shift-list-query.js.map +1 -0
- package/src/lib/constants/product-list-query.d.ts +6 -1
- package/src/lib/constants/product-list-query.js +77 -8
- package/src/lib/constants/product-list-query.js.map +1 -1
- package/src/lib/constants/stock-movement-query.d.ts +3 -2
- package/src/lib/constants/stock-movement-query.js +52 -8
- package/src/lib/constants/stock-movement-query.js.map +1 -1
- package/src/lib/declarations.server.js +21 -0
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/buyer-notifications.d.ts +5 -3
- package/src/lib/model/buyer-notifications.js +25 -4
- package/src/lib/model/buyer-notifications.js.map +1 -1
- package/src/lib/model/commerce-orders.d.ts +103 -1
- package/src/lib/model/commerce-orders.js +2 -1
- package/src/lib/model/commerce-orders.js.map +1 -1
- package/src/lib/model/commerce-pos-kiosk.d.ts +175 -0
- package/src/lib/model/commerce-pos-kiosk.js +147 -0
- package/src/lib/model/commerce-pos-kiosk.js.map +1 -0
- package/src/lib/model/commerce-pos-offline.d.ts +234 -0
- package/src/lib/model/commerce-pos-offline.js +301 -0
- package/src/lib/model/commerce-pos-offline.js.map +1 -0
- package/src/lib/model/commerce-pos-ops.d.ts +16 -6
- package/src/lib/model/commerce-pos-ops.js +12 -4
- package/src/lib/model/commerce-pos-ops.js.map +1 -1
- package/src/lib/model/commerce-pos.d.ts +13 -1
- package/src/lib/model/commerce-pos.js +5 -4
- package/src/lib/model/commerce-pos.js.map +1 -1
- package/src/lib/model/commerce-stock-holds.d.ts +24 -3
- package/src/lib/model/commerce-stock-holds.js +26 -8
- package/src/lib/model/commerce-stock-holds.js.map +1 -1
- package/src/lib/model/commerce.d.ts +7 -1
- package/src/lib/model/commerce.js.map +1 -1
- package/src/lib/model/index.d.ts +5 -0
- package/src/lib/model/index.js +5 -0
- package/src/lib/model/index.js.map +1 -1
- package/src/lib/model/local-fulfillment-settings.d.ts +178 -0
- package/src/lib/model/local-fulfillment-settings.js +361 -0
- package/src/lib/model/local-fulfillment-settings.js.map +1 -0
- package/src/lib/model/order-list-fields.d.ts +10 -1
- package/src/lib/model/order-list-fields.js +1 -0
- package/src/lib/model/order-list-fields.js.map +1 -1
- package/src/lib/model/order-local-fulfillment.d.ts +131 -0
- package/src/lib/model/order-local-fulfillment.js +125 -0
- package/src/lib/model/order-local-fulfillment.js.map +1 -0
- package/src/lib/model/order-shipping-export.js +4 -0
- package/src/lib/model/order-shipping-export.js.map +1 -1
- package/src/lib/model/order-status-view.d.ts +20 -1
- package/src/lib/model/order-status-view.js +60 -6
- package/src/lib/model/order-status-view.js.map +1 -1
- 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/plugin-config.js +6 -2
- package/src/lib/plugin-config.js.map +1 -1
- package/src/lib/plugin.js +11 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/pos-kiosk-config.d.ts +26 -0
- package/src/lib/pos-kiosk-config.js +59 -0
- package/src/lib/pos-kiosk-config.js.map +1 -0
- package/src/lib/server/api-v1/openapi.js +8 -0
- package/src/lib/server/api-v1/openapi.js.map +1 -1
- package/src/lib/server/api-v1/order-view.d.ts +19 -0
- package/src/lib/server/api-v1/order-view.js +35 -0
- package/src/lib/server/api-v1/order-view.js.map +1 -1
- package/src/lib/server/billing-webhook.js +238 -87
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/cart-checkout.d.ts +2 -0
- package/src/lib/server/cart-checkout.js +173 -13
- 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.js +18 -4
- package/src/lib/server/checkout-extras.js.map +1 -1
- package/src/lib/server/checkout.js +71 -14
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/local-fulfillment-status.d.ts +86 -0
- package/src/lib/server/local-fulfillment-status.js +379 -0
- package/src/lib/server/local-fulfillment-status.js.map +1 -0
- package/src/lib/server/local-fulfillment.d.ts +190 -0
- package/src/lib/server/local-fulfillment.js +580 -0
- package/src/lib/server/local-fulfillment.js.map +1 -0
- package/src/lib/server/membership-register.js +3 -1
- package/src/lib/server/membership-register.js.map +1 -1
- package/src/lib/server/order-notifications.js +61 -0
- package/src/lib/server/order-notifications.js.map +1 -1
- package/src/lib/server/pos-display.d.ts +27 -1
- package/src/lib/server/pos-display.js +50 -9
- package/src/lib/server/pos-display.js.map +1 -1
- package/src/lib/server/pos-kiosk-principal.d.ts +29 -0
- package/src/lib/server/pos-kiosk-principal.js +42 -0
- package/src/lib/server/pos-kiosk-principal.js.map +1 -0
- package/src/lib/server/pos-kiosk.d.ts +54 -0
- package/src/lib/server/pos-kiosk.js +972 -0
- package/src/lib/server/pos-kiosk.js.map +1 -0
- package/src/lib/server/pos-offline-sync.d.ts +85 -0
- package/src/lib/server/pos-offline-sync.js +765 -0
- package/src/lib/server/pos-offline-sync.js.map +1 -0
- package/src/lib/server/pos-order.js +22 -4
- package/src/lib/server/pos-order.js.map +1 -1
- package/src/lib/server/pos-payment.d.ts +6 -0
- package/src/lib/server/pos-payment.js +225 -6
- package/src/lib/server/pos-payment.js.map +1 -1
- package/src/lib/server/pos-print.js +5 -0
- package/src/lib/server/pos-print.js.map +1 -1
- package/src/lib/server/pos-return.js +27 -0
- package/src/lib/server/pos-return.js.map +1 -1
- package/src/lib/server/pos-sale.d.ts +6 -0
- package/src/lib/server/pos-sale.js +2 -0
- package/src/lib/server/pos-sale.js.map +1 -1
- package/src/lib/server/pos-shift.js +8 -1
- package/src/lib/server/pos-shift.js.map +1 -1
- package/src/lib/server/product-catalog.js +5 -1
- package/src/lib/server/product-catalog.js.map +1 -1
- 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 +3 -0
- package/src/lib/server/refund.js.map +1 -1
- package/src/lib/server/stock-hold.d.ts +9 -1
- package/src/lib/server/stock-hold.js +15 -7
- package/src/lib/server/stock-hold.js.map +1 -1
- package/src/lib/server.js +21 -0
- package/src/lib/server.js.map +1 -1
- package/src/lib/tenant-emails.js +161 -0
- package/src/lib/tenant-emails.js.map +1 -1
- package/src/lib/testing/memory-firestore.d.ts +16 -3
- package/src/lib/testing/memory-firestore.js +11 -3
- package/src/lib/testing/memory-firestore.js.map +1 -1
- 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/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/plugin.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 * as Aglyn from '@aglyn/aglyn'\nimport { mdiStorefrontOutline } from '@aglyn/shared-data-mdi'\nimport { lazy } from 'react'\nconst PosConsolePage = lazy(() => import('./components/console/pos-page.component'))\n/** The customer display (AGL-3608): loads only on the public page that shows it. */\nconst PosDisplayPage = lazy(() => import('./components/console/pos-display-page.component'))\nconst CommerceGlanceCard = lazy(\n () => import('./components/console/commerce-glance-card.component'),\n)\nconst NewestSiteUsersCard = lazy(\n () => import('./components/console/newest-site-users-card.component'),\n)\nconst SiteMemberPurchases = lazy(\n () => import('./components/console/site-member-purchases.component'),\n)\nimport { COMMERCE_CONSOLE_SECTIONS } from './components/commerce-console-sections'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { COMMERCE_PERMISSIONS } from './model/plugin-permissions'\nimport { registerCommerceRecordLists } from './model/commerce-record-lists'\nimport { registerCommerceRecordRoutes } from './model/commerce-record-routes'\nimport { registerCommerceZones } from './components/console/product-zones'\nimport { registerCommerceOrderZones } from './components/console/order-zones'\nimport { registerCommerceReturnZones } from './components/console/return-zones'\nimport { registerCommerceStoreZones } from './components/console/store-zones'\nimport { registerCommerceTransferUi } from './transfer/register-transfer-ui'\nimport { COMMERCE_SEARCH_SOURCES } from './model/commerce-search-sources'\nimport { COMMERCE_CONFIG_SCHEMA } from './plugin-config'\n\n/** Code-split: the Products console page only loads when opened. */\nconst CommerceConsolePage = lazy(() => import('./components/commerce-console-page'))\n\n/**\n * Console half (AGL-395): registers the Products nav item in the\n * ConsoleExtension registry so the commerce console surface is owned by the\n * plugin, like events and email. The page body still lives in the console\n * app (`/[hostId]/products`): its product editor depends on the app's media\n * browser, which transitively pulls in the org/session context, so a full\n * body relocation needs a plugin-consumable media-picker context first —\n * tracked as follow-up. The nav item omits a `Component`, so the shell's\n * nav renders the link and the existing named route serves the page.\n */\nexport function registerCommerceConsole(): void {\n // Where a product is read, for surfaces outside this plugin (AGL-3080).\n registerCommerceRecordRoutes()\n registerCommerceRecordLists()\n // The zones its product editor, products hub and CSV import dialog host,\n // with the props each hands a widget (AGL-2916, AGL-3080).\n registerCommerceZones()\n // …and the order dialog's two (AGL-3611), where a shipping plugin's widget\n // buys a label and records the shipment through the dialog's own route.\n registerCommerceOrderZones()\n // …and the return dialog's (AGL-3611), where a shipping plugin's widget\n // buys the buyer a return label and attaches it through this plugin's route.\n registerCommerceReturnZones()\n // The orders list's bulk actions and the store's Settings (AGL-3612).\n registerCommerceStoreZones()\n // Its import and export resources' names and the products wizard's own\n // step (AGL-3531); the server halves register from the console's server\n // declarations.\n registerCommerceTransferUi()\n // Plugin-declared permissions (AGL-435): tier defaults ride every\n // resolved role set; custom roles override key-by-key.\n Aglyn.registerPluginPermissions(COMMERCE_PERMISSIONS)\n // Register discount ceiling (AGL-2161) — the generic settings card renders\n // it from this schema, so there is no bespoke UI to keep in sync.\n Aglyn.registerPluginConfigSchema(COMMERCE_CONFIG_SCHEMA)\n Aglyn.registerConsoleExtension({\n pluginId: BUNDLE_ID,\n displayName: 'Commerce',\n searchSources: COMMERCE_SEARCH_SOURCES,\n // The screen a register turns toward its customer (AGL-3608), at\n // `/kiosk/commerce/pos-display`. No staff session: the device proves\n // itself with the display token it got by pairing, and\n // `server/pos-display.ts` refuses every read without one.\n publicPages: [\n { path: '/pos-display', title: 'Customer display', Component: PosDisplayPage },\n ],\n // Dashboard/analytics glance card (AGL-419): rendered through the\n // shell's 'commerceGlance' widget slot.\n widgets: [\n {\n slot: 'commerceGlance',\n widgetId: 'commerce-glance',\n title: 'Commerce',\n Component: CommerceGlanceCard,\n },\n // What a site user bought — lifetime total, orders and subscriptions —\n // in their drawer on the site's Users page: the orders and\n // subscriptions are this plugin's.\n {\n slot: Aglyn.CONSOLE_WIDGET_SLOTS.siteMember,\n widgetId: 'commerce-site-member-purchases',\n title: 'Purchases',\n Component: SiteMemberPurchases,\n },\n ],\n navItems: [\n {\n label: 'Products',\n href: '/products',\n icon: { path: mdiStorefrontOutline.path },\n // Sections as ROUTES (AGL-2501): `/products/orders` and friends are\n // real URLs the shell resolves and gates, so the page mounts the one\n // being read instead of subscribing all six.\n sections: COMMERCE_CONSOLE_SECTIONS,\n header: {\n title: 'Products',\n icon: { path: mdiStorefrontOutline.path },\n // The overview, not `catalog`: this surface is the whole commerce\n // console — Catalog, Orders, Promotions and Reservations.\n docsTopic: 'commerce',\n },\n Component: CommerceConsolePage,\n },\n {\n // POS register (AGL-312/419): relocated from the app's /pos route —\n // the generic [pluginSlug] shell now serves it at the same URL.\n label: 'POS',\n href: '/pos',\n /*\n * WHO may open the register, declared on THIS nav item rather than on\n * the extension.\n *\n * A key here narrows one surface; a key on the extension would gate\n * every surface it registers, and Products is the sibling — a catalog\n * anyone who works on the site may open. The register is the one that\n * takes money and lists checked-in guests by name, so the two\n * genuinely have different answers and only this one is narrowed.\n *\n * `managePos` rather than a dotted catalog key because it is the key\n * the sale itself is refused by: `server/pos-order.ts` resolves the\n * member's permission map and returns 403 unless `managePos` holds.\n * The shell answers this declaration out of that same resolved map, so\n * the console offers a register exactly to the people the route will\n * accept a sale from — the gate and its server twin cannot disagree,\n * because they are reading one value.\n *\n * `pos-order.ts` stays the enforcement point regardless. This decides\n * whether the surface is built at all, which is the part a check\n * inside the page cannot do: by the time the page can refuse itself it\n * has mounted and its product, register, location and reservation\n * listeners are already open.\n */\n permission: 'managePos',\n icon: { path: mdiStorefrontOutline.path },\n header: { title: 'Point of Sale', docsTopic: 'pos' },\n Component: PosConsolePage,\n },\n ],\n })\n /*\n * The USER ACCOUNTS half, registered under its own id.\n *\n * `accounts` is a switch rather than a bundle: the member blocks and every\n * `membership/*` handler ship inside this package, which is why the id\n * carries no loader manifest entry of its own. A second extension is how a\n * card about visitor accounts is gated on the switch that decides whether\n * the site serves them — `listConsoleWidgets` filters by the workspace's\n * effective plugin ids, and `accounts` is default-OFF per site.\n *\n * A separate call rather than more widgets on the commerce extension: the\n * registry is keyed by `pluginId` and that key IS the gate, so folding this\n * card in above would have kept the dashboard defect it fixes — `Newest\n * site users` on a site whose /signin returns 404.\n */\n Aglyn.registerConsoleExtension({\n pluginId: Aglyn.ACCOUNTS_PLUGIN_ID,\n displayName: 'User Accounts',\n widgets: [\n {\n slot: Aglyn.CONSOLE_WIDGET_SLOTS.hostDashboard,\n widgetId: 'accounts-newest-site-users',\n title: 'Newest site users',\n Component: NewestSiteUsersCard,\n },\n ],\n })\n}\n\nexport * from './site'\n"],"names":["Aglyn","mdiStorefrontOutline","lazy","PosConsolePage","PosDisplayPage","CommerceGlanceCard","NewestSiteUsersCard","SiteMemberPurchases","COMMERCE_CONSOLE_SECTIONS","BUNDLE_ID","COMMERCE_PERMISSIONS","registerCommerceRecordLists","registerCommerceRecordRoutes","registerCommerceZones","registerCommerceOrderZones","registerCommerceReturnZones","registerCommerceStoreZones","registerCommerceTransferUi","COMMERCE_SEARCH_SOURCES","COMMERCE_CONFIG_SCHEMA","CommerceConsolePage","registerCommerceConsole","registerPluginPermissions","registerPluginConfigSchema","registerConsoleExtension","pluginId","displayName","searchSources","publicPages","path","title","Component","widgets","slot","widgetId","CONSOLE_WIDGET_SLOTS","siteMember","navItems","label","href","icon","sections","header","docsTopic","permission","ACCOUNTS_PLUGIN_ID","hostDashboard"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,oBAAoB,QAAQ,yBAAwB;AAC7D,SAASC,IAAI,QAAQ,QAAO;AAC5B,MAAMC,iBAAiBD,KAAK,IAAM,MAAM,CAAC;AACzC,kFAAkF,GAClF,MAAME,iBAAiBF,KAAK,IAAM,MAAM,CAAC;AACzC,MAAMG,qBAAqBH,KACzB,IAAM,MAAM,CAAC;AAEf,MAAMI,sBAAsBJ,KAC1B,IAAM,MAAM,CAAC;AAEf,MAAMK,sBAAsBL,KAC1B,IAAM,MAAM,CAAC;AAEf,SAASM,yBAAyB,QAAQ,4CAAwC;AAClF,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,oBAAoB,QAAQ,gCAA4B;AACjE,SAASC,2BAA2B,QAAQ,mCAA+B;AAC3E,SAASC,4BAA4B,QAAQ,oCAAgC;AAC7E,SAASC,qBAAqB,QAAQ,wCAAoC;AAC1E,SAASC,0BAA0B,QAAQ,sCAAkC;AAC7E,SAASC,2BAA2B,QAAQ,uCAAmC;AAC/E,SAASC,0BAA0B,QAAQ,sCAAkC;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BAAqB4B,IAAI;oBAAC;oBACxC,kEAAkE;oBAClE,0DAA0D;oBAC1Dc,WAAW;gBACb;gBACAZ,WAAWX;YACb;YACA;gBACE,oEAAoE;gBACpE,gEAAgE;gBAChEkB,OAAO;gBACPC,MAAM;gBACN;;;;;;;;;;;;;;;;;;;;;;;SAuBC,GACDK,YAAY;gBACZJ,MAAM;oBAAEX,MAAM5B,qBAAqB4B,IAAI;gBAAC;gBACxCa,QAAQ;oBAAEZ,OAAO;oBAAiBa,WAAW;gBAAM;gBACnDZ,WAAW5B;YACb;SACD;IACH;IACA;;;;;;;;;;;;;;GAcC,GACDH,MAAMwB,wBAAwB,CAAC;QAC7BC,UAAUzB,MAAM6C,kBAAkB;QAClCnB,aAAa;QACbM,SAAS;YACP;gBACEC,MAAMjC,MAAMmC,oBAAoB,CAACW,aAAa;gBAC9CZ,UAAU;gBACVJ,OAAO;gBACPC,WAAWzB;YACb;SACD;IACH;AACF;AAEA,cAAc,YAAQ"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/plugin.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 * as Aglyn from '@aglyn/aglyn'\nimport { mdiStorefrontOutline } from '@aglyn/shared-data-mdi'\nimport { lazy } from 'react'\nconst PosConsolePage = lazy(() => import('./components/console/pos-page.component'))\n/** The customer display (AGL-3608): loads only on the public page that shows it. */\nconst PosDisplayPage = lazy(() => import('./components/console/pos-display-page.component'))\nconst PosKioskPage = lazy(() => import('./components/console/pos-kiosk-page.component'))\nconst CommerceGlanceCard = lazy(\n () => import('./components/console/commerce-glance-card.component'),\n)\nconst NewestSiteUsersCard = lazy(\n () => import('./components/console/newest-site-users-card.component'),\n)\nconst SiteMemberPurchases = lazy(\n () => import('./components/console/site-member-purchases.component'),\n)\nimport { COMMERCE_CONSOLE_SECTIONS } from './components/commerce-console-sections'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { COMMERCE_PERMISSIONS } from './model/plugin-permissions'\nimport { registerCommerceRecordLists } from './model/commerce-record-lists'\nimport { registerCommerceRecordRoutes } from './model/commerce-record-routes'\nimport { registerCommerceZones } from './components/console/product-zones'\nimport { registerCommerceOrderZones } from './components/console/order-zones'\nimport { registerCommerceReturnZones } from './components/console/return-zones'\nimport { registerCommerceStoreZones } from './components/console/store-zones'\nimport { registerCommercePosZones } from './components/console/pos-zones'\nimport { registerCommerceTransferUi } from './transfer/register-transfer-ui'\nimport { COMMERCE_SEARCH_SOURCES } from './model/commerce-search-sources'\nimport { COMMERCE_CONFIG_SCHEMA } from './plugin-config'\n\n/** Code-split: the Products console page only loads when opened. */\nconst CommerceConsolePage = lazy(() => import('./components/commerce-console-page'))\n\n/**\n * Console half (AGL-395): registers the Products nav item in the\n * ConsoleExtension registry so the commerce console surface is owned by the\n * plugin, like events and email. The page body still lives in the console\n * app (`/[hostId]/products`): its product editor depends on the app's media\n * browser, which transitively pulls in the org/session context, so a full\n * body relocation needs a plugin-consumable media-picker context first —\n * tracked as follow-up. The nav item omits a `Component`, so the shell's\n * nav renders the link and the existing named route serves the page.\n */\nexport function registerCommerceConsole(): void {\n // Where a product is read, for surfaces outside this plugin (AGL-3080).\n registerCommerceRecordRoutes()\n registerCommerceRecordLists()\n // The zones its product editor, products hub and CSV import dialog host,\n // with the props each hands a widget (AGL-2916, AGL-3080).\n registerCommerceZones()\n // …and the order dialog's two (AGL-3611), where a shipping plugin's widget\n // buys a label and records the shipment through the dialog's own route.\n registerCommerceOrderZones()\n // …and the return dialog's (AGL-3611), where a shipping plugin's widget\n // buys the buyer a return label and attaches it through this plugin's route.\n registerCommerceReturnZones()\n // The orders list's bulk actions and the store's Settings (AGL-3612).\n registerCommerceStoreZones()\n // The register's orders from other channels — a delivery app's (AGL-3644).\n registerCommercePosZones()\n // Its import and export resources' names and the products wizard's own\n // step (AGL-3531); the server halves register from the console's server\n // declarations.\n registerCommerceTransferUi()\n // Plugin-declared permissions (AGL-435): tier defaults ride every\n // resolved role set; custom roles override key-by-key.\n Aglyn.registerPluginPermissions(COMMERCE_PERMISSIONS)\n // Register discount ceiling (AGL-2161) — the generic settings card renders\n // it from this schema, so there is no bespoke UI to keep in sync.\n Aglyn.registerPluginConfigSchema(COMMERCE_CONFIG_SCHEMA)\n Aglyn.registerConsoleExtension({\n pluginId: BUNDLE_ID,\n displayName: 'Commerce',\n searchSources: COMMERCE_SEARCH_SOURCES,\n // The screen a register turns toward its customer (AGL-3608), at\n // `/kiosk/commerce/pos-display`. No staff session: the device proves\n // itself with the display token it got by pairing, and\n // `server/pos-display.ts` refuses every read without one.\n publicPages: [\n { path: '/pos-display', title: 'Customer display', Component: PosDisplayPage },\n // The self-service kiosk (AGL-3623), paired the same way with a kiosk\n // code; `server/pos-kiosk.ts` refuses every call without its token.\n { path: '/pos-kiosk', title: 'Self-service kiosk', Component: PosKioskPage },\n ],\n // Dashboard/analytics glance card (AGL-419): rendered through the\n // shell's 'commerceGlance' widget slot.\n widgets: [\n {\n slot: 'commerceGlance',\n widgetId: 'commerce-glance',\n title: 'Commerce',\n Component: CommerceGlanceCard,\n },\n // What a site user bought — lifetime total, orders and subscriptions —\n // in their drawer on the site's Users page: the orders and\n // subscriptions are this plugin's.\n {\n slot: Aglyn.CONSOLE_WIDGET_SLOTS.siteMember,\n widgetId: 'commerce-site-member-purchases',\n title: 'Purchases',\n Component: SiteMemberPurchases,\n },\n ],\n navItems: [\n {\n label: 'Products',\n href: '/products',\n icon: { path: mdiStorefrontOutline.path },\n // Sections as ROUTES (AGL-2501): `/products/orders` and friends are\n // real URLs the shell resolves and gates, so the page mounts the one\n // being read instead of subscribing all six.\n sections: COMMERCE_CONSOLE_SECTIONS,\n header: {\n title: 'Products',\n icon: { path: mdiStorefrontOutline.path },\n // The overview, not `catalog`: this surface is the whole commerce\n // console — Catalog, Orders, Promotions and Reservations.\n docsTopic: 'commerce',\n },\n Component: CommerceConsolePage,\n },\n {\n // POS register (AGL-312/419): relocated from the app's /pos route —\n // the generic [pluginSlug] shell now serves it at the same URL.\n label: 'POS',\n href: '/pos',\n /*\n * WHO may open the register, declared on THIS nav item rather than on\n * the extension.\n *\n * A key here narrows one surface; a key on the extension would gate\n * every surface it registers, and Products is the sibling — a catalog\n * anyone who works on the site may open. The register is the one that\n * takes money and lists checked-in guests by name, so the two\n * genuinely have different answers and only this one is narrowed.\n *\n * `managePos` rather than a dotted catalog key because it is the key\n * the sale itself is refused by: `server/pos-order.ts` resolves the\n * member's permission map and returns 403 unless `managePos` holds.\n * The shell answers this declaration out of that same resolved map, so\n * the console offers a register exactly to the people the route will\n * accept a sale from — the gate and its server twin cannot disagree,\n * because they are reading one value.\n *\n * `pos-order.ts` stays the enforcement point regardless. This decides\n * whether the surface is built at all, which is the part a check\n * inside the page cannot do: by the time the page can refuse itself it\n * has mounted and its product, register, location and reservation\n * listeners are already open.\n */\n permission: 'managePos',\n icon: { path: mdiStorefrontOutline.path },\n header: { title: 'Point of Sale', docsTopic: 'pos' },\n Component: PosConsolePage,\n },\n ],\n })\n /*\n * The USER ACCOUNTS half, registered under its own id.\n *\n * `accounts` is a switch rather than a bundle: the member blocks and every\n * `membership/*` handler ship inside this package, which is why the id\n * carries no loader manifest entry of its own. A second extension is how a\n * card about visitor accounts is gated on the switch that decides whether\n * the site serves them — `listConsoleWidgets` filters by the workspace's\n * effective plugin ids, and `accounts` is default-OFF per site.\n *\n * A separate call rather than more widgets on the commerce extension: the\n * registry is keyed by `pluginId` and that key IS the gate, so folding this\n * card in above would have kept the dashboard defect it fixes — `Newest\n * site users` on a site whose /signin returns 404.\n */\n Aglyn.registerConsoleExtension({\n pluginId: Aglyn.ACCOUNTS_PLUGIN_ID,\n displayName: 'User Accounts',\n widgets: [\n {\n slot: Aglyn.CONSOLE_WIDGET_SLOTS.hostDashboard,\n widgetId: 'accounts-newest-site-users',\n title: 'Newest site users',\n Component: NewestSiteUsersCard,\n },\n ],\n })\n}\n\nexport * from './site'\n"],"names":["Aglyn","mdiStorefrontOutline","lazy","PosConsolePage","PosDisplayPage","PosKioskPage","CommerceGlanceCard","NewestSiteUsersCard","SiteMemberPurchases","COMMERCE_CONSOLE_SECTIONS","BUNDLE_ID","COMMERCE_PERMISSIONS","registerCommerceRecordLists","registerCommerceRecordRoutes","registerCommerceZones","registerCommerceOrderZones","registerCommerceReturnZones","registerCommerceStoreZones","registerCommercePosZones","registerCommerceTransferUi","COMMERCE_SEARCH_SOURCES","COMMERCE_CONFIG_SCHEMA","CommerceConsolePage","registerCommerceConsole","registerPluginPermissions","registerPluginConfigSchema","registerConsoleExtension","pluginId","displayName","searchSources","publicPages","path","title","Component","widgets","slot","widgetId","CONSOLE_WIDGET_SLOTS","siteMember","navItems","label","href","icon","sections","header","docsTopic","permission","ACCOUNTS_PLUGIN_ID","hostDashboard"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,oBAAoB,QAAQ,yBAAwB;AAC7D,SAASC,IAAI,QAAQ,QAAO;AAC5B,MAAMC,iBAAiBD,KAAK,IAAM,MAAM,CAAC;AACzC,kFAAkF,GAClF,MAAME,iBAAiBF,KAAK,IAAM,MAAM,CAAC;AACzC,MAAMG,eAAeH,KAAK,IAAM,MAAM,CAAC;AACvC,MAAMI,qBAAqBJ,KACzB,IAAM,MAAM,CAAC;AAEf,MAAMK,sBAAsBL,KAC1B,IAAM,MAAM,CAAC;AAEf,MAAMM,sBAAsBN,KAC1B,IAAM,MAAM,CAAC;AAEf,SAASO,yBAAyB,QAAQ,4CAAwC;AAClF,SAASC,SAAS,QAAQ,+BAA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;gBACVJ,OAAO;gBACPC,WAAW3B;YACb;YACA,uEAAuE;YACvE,2DAA2D;YAC3D,mCAAmC;YACnC;gBACE6B,MAAMnC,MAAMqC,oBAAoB,CAACC,UAAU;gBAC3CF,UAAU;gBACVJ,OAAO;gBACPC,WAAWzB;YACb;SACD;QACD+B,UAAU;YACR;gBACEC,OAAO;gBACPC,MAAM;gBACNC,MAAM;oBAAEX,MAAM9B,qBAAqB8B,IAAI;gBAAC;gBACxC,oEAAoE;gBACpE,qEAAqE;gBACrE,6CAA6C;gBAC7CY,UAAUlC;gBACVmC,QAAQ;oBACNZ,OAAO;oBACPU,MAAM;wBAAEX,MAAM9B,qBAAqB8B,IAAI;oBAAC;oBACxC,kEAAkE;oBAClE,0DAA0D;oBAC1Dc,WAAW;gBACb;gBACAZ,WAAWX;YACb;YACA;gBACE,oEAAoE;gBACpE,gEAAgE;gBAChEkB,OAAO;gBACPC,MAAM;gBACN;;;;;;;;;;;;;;;;;;;;;;;SAuBC,GACDK,YAAY;gBACZJ,MAAM;oBAAEX,MAAM9B,qBAAqB8B,IAAI;gBAAC;gBACxCa,QAAQ;oBAAEZ,OAAO;oBAAiBa,WAAW;gBAAM;gBACnDZ,WAAW9B;YACb;SACD;IACH;IACA;;;;;;;;;;;;;;GAcC,GACDH,MAAM0B,wBAAwB,CAAC;QAC7BC,UAAU3B,MAAM+C,kBAAkB;QAClCnB,aAAa;QACbM,SAAS;YACP;gBACEC,MAAMnC,MAAMqC,oBAAoB,CAACW,aAAa;gBAC9CZ,UAAU;gBACVJ,OAAO;gBACPC,WAAW1B;YACb;SACD;IACH;AACF;AAEA,cAAc,YAAQ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { PluginConfigField } from '@aglyn/aglyn';
|
|
18
|
+
export declare const POS_KIOSK_CONFIG_FIELDS: PluginConfigField[];
|
|
19
|
+
export declare const POS_KIOSK_CONFIG_DEFAULTS: Record<string, unknown>;
|
|
20
|
+
export interface PosKioskSettings {
|
|
21
|
+
payAtCounter: boolean;
|
|
22
|
+
idleSeconds: number;
|
|
23
|
+
welcome: string;
|
|
24
|
+
}
|
|
25
|
+
/** Read defensively, for a config read with or without the schema. */
|
|
26
|
+
export declare function posKioskSettings(config: Record<string, unknown> | null | undefined): PosKioskSettings;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { POS_KIOSK_IDLE_SECONDS_DEFAULT, POS_KIOSK_IDLE_SECONDS_MAX, POS_KIOSK_IDLE_SECONDS_MIN, posKioskIdleSeconds } from "./model/commerce-pos-kiosk.js";
|
|
17
|
+
/*==========================================
|
|
18
|
+
* THE SELF-SERVICE KIOSK'S SETTINGS (AGL-3623). Pure data, spread into
|
|
19
|
+
* `COMMERCE_CONFIG_SCHEMA` beside the register's own, so the settings form,
|
|
20
|
+
* the kiosk route and the kiosk read one set of keys with one set of bounds.
|
|
21
|
+
* Tips and receipts are the register's settings: a kiosk asks for a tip
|
|
22
|
+
* exactly when the register does.
|
|
23
|
+
*=========================================*/ export const POS_KIOSK_CONFIG_FIELDS = [
|
|
24
|
+
{
|
|
25
|
+
key: 'posKioskPayAtCounter',
|
|
26
|
+
label: 'Kiosk: let customers pay at the counter',
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
description: 'Adds "Pay at counter" to the self-service kiosk. The order goes to the ' + 'register’s queue with its number, and a cashier takes payment there.'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'posKioskIdleSeconds',
|
|
32
|
+
label: 'Kiosk: start over after (seconds idle)',
|
|
33
|
+
type: 'number',
|
|
34
|
+
min: POS_KIOSK_IDLE_SECONDS_MIN,
|
|
35
|
+
max: POS_KIOSK_IDLE_SECONDS_MAX,
|
|
36
|
+
description: 'After this long without a touch the kiosk asks "Still there?", then ' + 'clears the cart and anything the customer typed.'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: 'posKioskWelcome',
|
|
40
|
+
label: 'Kiosk welcome',
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'The line the kiosk’s start screen shows under your store name. Leave blank for "Order here".'
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
export const POS_KIOSK_CONFIG_DEFAULTS = {
|
|
46
|
+
posKioskPayAtCounter: true,
|
|
47
|
+
posKioskIdleSeconds: POS_KIOSK_IDLE_SECONDS_DEFAULT,
|
|
48
|
+
posKioskWelcome: ''
|
|
49
|
+
};
|
|
50
|
+
/** Read defensively, for a config read with or without the schema. */ export function posKioskSettings(config) {
|
|
51
|
+
var _ref;
|
|
52
|
+
return {
|
|
53
|
+
payAtCounter: (config == null ? void 0 : config['posKioskPayAtCounter']) !== false,
|
|
54
|
+
idleSeconds: posKioskIdleSeconds(config == null ? void 0 : config['posKioskIdleSeconds']),
|
|
55
|
+
welcome: String((_ref = config == null ? void 0 : config['posKioskWelcome']) != null ? _ref : '').trim().slice(0, 120)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=pos-kiosk-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/pos-kiosk-config.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PluginConfigField } from '@aglyn/aglyn'\nimport {\n POS_KIOSK_IDLE_SECONDS_DEFAULT,\n POS_KIOSK_IDLE_SECONDS_MAX,\n POS_KIOSK_IDLE_SECONDS_MIN,\n posKioskIdleSeconds,\n} from './model/commerce-pos-kiosk'\n\n/*==========================================\n * THE SELF-SERVICE KIOSK'S SETTINGS (AGL-3623). Pure data, spread into\n * `COMMERCE_CONFIG_SCHEMA` beside the register's own, so the settings form,\n * the kiosk route and the kiosk read one set of keys with one set of bounds.\n * Tips and receipts are the register's settings: a kiosk asks for a tip\n * exactly when the register does.\n *=========================================*/\n\nexport const POS_KIOSK_CONFIG_FIELDS: PluginConfigField[] = [\n {\n key: 'posKioskPayAtCounter',\n label: 'Kiosk: let customers pay at the counter',\n type: 'boolean',\n description:\n 'Adds \"Pay at counter\" to the self-service kiosk. The order goes to the ' +\n 'register’s queue with its number, and a cashier takes payment there.',\n },\n {\n key: 'posKioskIdleSeconds',\n label: 'Kiosk: start over after (seconds idle)',\n type: 'number',\n min: POS_KIOSK_IDLE_SECONDS_MIN,\n max: POS_KIOSK_IDLE_SECONDS_MAX,\n description:\n 'After this long without a touch the kiosk asks \"Still there?\", then ' +\n 'clears the cart and anything the customer typed.',\n },\n {\n key: 'posKioskWelcome',\n label: 'Kiosk welcome',\n type: 'string',\n description: 'The line the kiosk’s start screen shows under your store name. Leave blank for \"Order here\".',\n },\n]\n\nexport const POS_KIOSK_CONFIG_DEFAULTS: Record<string, unknown> = {\n posKioskPayAtCounter: true,\n posKioskIdleSeconds: POS_KIOSK_IDLE_SECONDS_DEFAULT,\n posKioskWelcome: '',\n}\n\nexport interface PosKioskSettings {\n payAtCounter: boolean\n idleSeconds: number\n welcome: string\n}\n\n/** Read defensively, for a config read with or without the schema. */\nexport function posKioskSettings(config: Record<string, unknown> | null | undefined): PosKioskSettings {\n return {\n payAtCounter: config?.['posKioskPayAtCounter'] !== false,\n idleSeconds: posKioskIdleSeconds(config?.['posKioskIdleSeconds']),\n welcome: String(config?.['posKioskWelcome'] ?? '').trim().slice(0, 120),\n }\n}\n"],"names":["POS_KIOSK_IDLE_SECONDS_DEFAULT","POS_KIOSK_IDLE_SECONDS_MAX","POS_KIOSK_IDLE_SECONDS_MIN","posKioskIdleSeconds","POS_KIOSK_CONFIG_FIELDS","key","label","type","description","min","max","POS_KIOSK_CONFIG_DEFAULTS","posKioskPayAtCounter","posKioskWelcome","posKioskSettings","config","payAtCounter","idleSeconds","welcome","String","trim","slice"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SACEA,8BAA8B,EAC9BC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,mBAAmB,QACd,gCAA4B;AAEnC;;;;;;2CAM2C,GAE3C,OAAO,MAAMC,0BAA+C;IAC1D;QACEC,KAAK;QACLC,OAAO;QACPC,MAAM;QACNC,aACE,4EACA;IACJ;IACA;QACEH,KAAK;QACLC,OAAO;QACPC,MAAM;QACNE,KAAKP;QACLQ,KAAKT;QACLO,aACE,yEACA;IACJ;IACA;QACEH,KAAK;QACLC,OAAO;QACPC,MAAM;QACNC,aAAa;IACf;CACD,CAAA;AAED,OAAO,MAAMG,4BAAqD;IAChEC,sBAAsB;IACtBT,qBAAqBH;IACrBa,iBAAiB;AACnB,EAAC;AAQD,oEAAoE,GACpE,OAAO,SAASC,iBAAiBC,MAAkD;;IACjF,OAAO;QACLC,cAAcD,CAAAA,0BAAAA,MAAQ,CAAC,uBAAuB,MAAK;QACnDE,aAAad,oBAAoBY,0BAAAA,MAAQ,CAAC,sBAAsB;QAChEG,SAASC,eAAOJ,0BAAAA,MAAQ,CAAC,kBAAkB,mBAAI,IAAIK,IAAI,GAAGC,KAAK,CAAC,GAAG;IACrE;AACF"}
|
|
@@ -165,6 +165,14 @@ export const ORDERS_API_V1_DESCRIPTION = {
|
|
|
165
165
|
additionalProperties: true
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
|
+
credits: {
|
|
169
|
+
type: 'array',
|
|
170
|
+
description: 'Store credit another plugin kept that paid part of the sale, such as rewards: `[{ providerId, pluginId, reference, label, last4, amountCents, appliedAs }]`. `appliedAs` is `discount` for a checkout redemption and `tender` for a register payment. Empty when there were none.',
|
|
171
|
+
items: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
additionalProperties: true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
168
176
|
refundedCents: int('Amount refunded so far.'),
|
|
169
177
|
disputed: bool('Whether a chargeback is open.'),
|
|
170
178
|
taxMode: nullable(str('The tax regime: `stripe-automatic` (Stripe Tax, collected and remitted by the platform as marketplace facilitator), `manual` (your own rate) or `none`. `null` on an order from before it was recorded.')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/server/api-v1/openapi.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 type ApiV1ResourceDescription,\n booleanField as bool,\n integerField as int,\n nullableField as nullable,\n objectKindField as OBJECT_FIELD,\n openObjectField as objectOf,\n postalAddressField as ADDRESS,\n queryParam as q,\n RECORD_STAMPS as STAMPS,\n stringField as str,\n stringListField as strList,\n} from '@aglyn/tenant-data-admin/server/api-v1-description'\n\n/**\n * A site's products and orders as the customer API's OpenAPI document\n * describes them — what the console's builder turns into paths, tags and\n * schemas, and the MCP tools derive from. Transcribed unchanged from the\n * builder's own list when the resources moved here (AGL-3080);\n * `api-v1-openapi.spec.ts` holds the document to every endpoint the\n * documentation promises.\n */\nexport const PRODUCTS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Products',\n description: 'A site’s catalog. Read-only over the API.',\n schemaName: 'Product',\n required: ['id', 'object', 'name'],\n fields: {\n id: str('Product id.'),\n object: OBJECT_FIELD('product'),\n name: str('Product name.'),\n slug: str('URL slug.'),\n description: nullable(str('Description.')),\n type: str('Product type.'),\n status: str('Publication status.'),\n tags: strList('Free-form tags.'),\n categoryIds: strList('Categories this product belongs to.'),\n mediaUrls: strList('Image URLs.'),\n options: { type: 'array', description: 'Option definitions, e.g. size.', items: { type: 'object', additionalProperties: true } },\n variants: { type: 'array', description: 'Purchasable variants.', items: { type: 'object', additionalProperties: true } },\n inventory: nullable(int('Stock on hand, when tracked.')),\n subscription: nullable(objectOf('Subscription terms, when the product is one.')),\n ...STAMPS,\n },\n ops: [\n { path: '/v1/sites/{siteId}/products', method: 'get', operationId: 'listProducts', summary: 'List products', list: true, returns: 'Product', description: 'Rows deleted since they were written are dropped after the read, so pages can come back short.', pathParams: [{ name: 'siteId', description: 'Site id.' }] },\n { path: '/v1/sites/{siteId}/products/{productId}', method: 'get', operationId: 'getProduct', summary: 'Retrieve a product', returns: 'Product', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'productId', description: 'Product id.' }] },\n ],\n}\n\nexport const ORDERS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Orders',\n description: 'A site’s orders. Status moves are constrained.',\n schemaName: 'Order',\n required: ['id', 'object', 'number', 'status'],\n writable: ['status', 'carrier', 'trackingNumber', 'trackingUrl', 'lineItems', 'notify'],\n writeOnly: {\n status: { type: 'string', enum: ['fulfilled', 'delivered'], description: 'The status to move the order to.' },\n carrier: str('Free text, e.g. `UPS`. Trimmed to 40 characters. USPS, UPS, FedEx, DHL, Canada Post, Royal Mail and Australia Post get a tracking link.'),\n trackingNumber: str('Free text. Trimmed to 60 characters.'),\n trackingUrl: str('An https tracking link, for a carrier the link is not derived for.'),\n lineItems: {\n type: 'array',\n description:\n 'With `status: fulfilled`, the units this shipment covers: `[{ lineItemId, quantity }]`, where `lineItemId` is the line’s index. Omitted, the shipment covers everything still to ship. More than is left is `409 conflict` (`code: \"over_fulfilled\"`). Send an `Idempotency-Key` header so a retried partial shipment is recorded once.',\n items: { type: 'object', additionalProperties: true },\n },\n notify: bool('Whether the buyer is told about this shipment. Defaults to true.'),\n },\n writeRequired: ['status'],\n fields: {\n id: str('Order id.'),\n object: OBJECT_FIELD('order'),\n number: int('Human-facing order number.'),\n status: str('Order status.'),\n channel: str('`online` by default. Older orders carry no stored value, so `?channel=online` drops them after the read.'),\n currency: str('ISO 4217 code.'),\n customerEmail: nullable(str('Customer email.')),\n customerName: nullable(str('Customer name.')),\n lineItems: { type: 'array', description: 'What was bought.', items: { type: 'object', additionalProperties: true } },\n totals: objectOf('Money totals, in the smallest unit of `currency`. `extrasCents` is the optional lines the buyer added at checkout, inside `totalCents` and outside `itemsCents`.'),\n extras: { type: 'array', description: 'Optional lines the buyer added at checkout, such as package protection: `[{ id, pluginId, key, label, amountCents, quoteRef }]`. Empty when there were none.', items: { type: 'object', additionalProperties: true } },\n refundedCents: int('Amount refunded so far.'),\n disputed: bool('Whether a chargeback is open.'),\n taxMode: nullable(str('The tax regime: `stripe-automatic` (Stripe Tax, collected and remitted by the platform as marketplace facilitator), `manual` (your own rate) or `none`. `null` on an order from before it was recorded.')),\n taxEngine: nullable(objectOf('The tax service you connected, when one was asked for this sale’s tax: `provider` (`avalara` or `taxjar`), `providerLabel`, `status` (`quoted` when its tax was charged, `fallback` when it did not answer and your own rate was charged), `reason` (`timeout` or `error` on a fallback) and `sandbox`. `null` when no service was asked.')),\n shippingAddress: ADDRESS(),\n couponCode: nullable(str('Coupon applied.')),\n fulfillments: { type: 'array', description: 'Shipments and deliveries.', items: { type: 'object', additionalProperties: true } },\n created: STAMPS.created,\n },\n ops: [\n { path: '/v1/sites/{siteId}/orders', method: 'get', operationId: 'listOrders', summary: 'List orders', list: true, returns: 'Order', filters: [q('channel', '`online` is a default rather than a stored value, so filtering on it drops older orders after the read.'), q('status', 'Order status.')], pathParams: [{ name: 'siteId', description: 'Site id.' }] },\n { path: '/v1/sites/{siteId}/orders/{orderId}', method: 'get', operationId: 'getOrder', summary: 'Retrieve an order', returns: 'Order', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'orderId', description: 'Order id.' }] },\n { path: '/v1/sites/{siteId}/orders/{orderId}', method: 'patch', operationId: 'updateOrder', summary: 'Move an order’s status', accepts: 'OrderWrite', returns: 'Order', description: 'An illegal transition is `409 conflict` (`code: \"order_transition\"`), and the message names the status it is in.', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'orderId', description: 'Order id.' }] },\n ],\n}\n"],"names":["booleanField","bool","integerField","int","nullableField","nullable","objectKindField","OBJECT_FIELD","openObjectField","objectOf","postalAddressField","ADDRESS","queryParam","q","RECORD_STAMPS","STAMPS","stringField","str","stringListField","strList","PRODUCTS_API_V1_DESCRIPTION","tag","description","schemaName","required","fields","id","object","name","slug","type","status","tags","categoryIds","mediaUrls","options","items","additionalProperties","variants","inventory","subscription","ops","path","method","operationId","summary","list","returns","pathParams","ORDERS_API_V1_DESCRIPTION","writable","writeOnly","enum","carrier","trackingNumber","trackingUrl","lineItems","notify","writeRequired","number","channel","currency","customerEmail","customerName","totals","extras","refundedCents","disputed","taxMode","taxEngine","shippingAddress","couponCode","fulfillments","created","filters","accepts"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,gBAAgBC,IAAI,EACpBC,gBAAgBC,GAAG,EACnBC,iBAAiBC,QAAQ,EACzBC,mBAAmBC,YAAY,EAC/BC,mBAAmBC,QAAQ,EAC3BC,sBAAsBC,OAAO,EAC7BC,cAAcC,CAAC,EACfC,iBAAiBC,MAAM,EACvBC,eAAeC,GAAG,EAClBC,mBAAmBC,OAAO,QACrB,qDAAoD;AAE3D;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAAwD;IACnEC,KAAK;IACLC,aAAa;IACbC,YAAY;IACZC,UAAU;QAAC;QAAM;QAAU;KAAO;IAClCC,QAAQ;QACNC,IAAIT,IAAI;QACRU,QAAQpB,aAAa;QACrBqB,MAAMX,IAAI;QACVY,MAAMZ,IAAI;QACVK,aAAajB,SAASY,IAAI;QAC1Ba,MAAMb,IAAI;QACVc,QAAQd,IAAI;QACZe,MAAMb,QAAQ;QACdc,aAAad,QAAQ;QACrBe,WAAWf,QAAQ;QACnBgB,SAAS;YAAEL,MAAM;YAASR,aAAa;YAAkCc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAC/HC,UAAU;YAAER,MAAM;YAASR,aAAa;YAAyBc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QACvHE,WAAWlC,SAASF,IAAI;QACxBqC,cAAcnC,SAASI,SAAS;OAC7BM;IAEL0B,KAAK;QACH;YAAEC,MAAM;YAA+BC,Q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AUO,sBAAsB;YAAK;QAAE;QAC5P6B,eAAe/D,IAAI;QACnBgE,UAAUlE,KAAK;QACfmE,SAAS/D,SAASY,IAAI;QACtBoD,WAAWhE,SAASI,SAAS;QAC7B6D,iBAAiB3D;QACjB4D,YAAYlE,SAASY,IAAI;QACzBuD,cAAc;YAAE1C,MAAM;YAASR,aAAa;YAA6Bc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAC/HoC,SAAS1D,OAAO0D,OAAO;IACzB;IACAhC,KAAK;QACH;YAAEC,MAAM;YAA6BC,QAAQ;YAAOC,aAAa;YAAcC,SAAS;YAAeC,MAAM;YAAMC,SAAS;YAAS2B,SAAS;gBAAC7D,EAAE,WAAW;gBAA4GA,EAAE,UAAU;aAAiB;YAAEmC,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;aAAE;QAAC;QACjW;YAAEoB,MAAM;YAAuCC,QAAQ;YAAOC,aAAa;YAAYC,SAAS;YAAqBE,SAAS;YAASC,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;gBAAG;oBAAEM,MAAM;oBAAWN,aAAa;gBAAY;aAAE;QAAC;QAChP;YAAEoB,MAAM;YAAuCC,QAAQ;YAASC,aAAa;YAAeC,SAAS;YAA0B8B,SAAS;YAAc5B,SAAS;YAASzB,aAAa;YAAoH0B,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;gBAAG;oBAAEM,MAAM;oBAAWN,aAAa;gBAAY;aAAE;QAAC;KACnZ;AACH,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/server/api-v1/openapi.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 type ApiV1ResourceDescription,\n booleanField as bool,\n integerField as int,\n nullableField as nullable,\n objectKindField as OBJECT_FIELD,\n openObjectField as objectOf,\n postalAddressField as ADDRESS,\n queryParam as q,\n RECORD_STAMPS as STAMPS,\n stringField as str,\n stringListField as strList,\n} from '@aglyn/tenant-data-admin/server/api-v1-description'\n\n/**\n * A site's products and orders as the customer API's OpenAPI document\n * describes them — what the console's builder turns into paths, tags and\n * schemas, and the MCP tools derive from. Transcribed unchanged from the\n * builder's own list when the resources moved here (AGL-3080);\n * `api-v1-openapi.spec.ts` holds the document to every endpoint the\n * documentation promises.\n */\nexport const PRODUCTS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Products',\n description: 'A site’s catalog. Read-only over the API.',\n schemaName: 'Product',\n required: ['id', 'object', 'name'],\n fields: {\n id: str('Product id.'),\n object: OBJECT_FIELD('product'),\n name: str('Product name.'),\n slug: str('URL slug.'),\n description: nullable(str('Description.')),\n type: str('Product type.'),\n status: str('Publication status.'),\n tags: strList('Free-form tags.'),\n categoryIds: strList('Categories this product belongs to.'),\n mediaUrls: strList('Image URLs.'),\n options: { type: 'array', description: 'Option definitions, e.g. size.', items: { type: 'object', additionalProperties: true } },\n variants: { type: 'array', description: 'Purchasable variants.', items: { type: 'object', additionalProperties: true } },\n inventory: nullable(int('Stock on hand, when tracked.')),\n subscription: nullable(objectOf('Subscription terms, when the product is one.')),\n ...STAMPS,\n },\n ops: [\n { path: '/v1/sites/{siteId}/products', method: 'get', operationId: 'listProducts', summary: 'List products', list: true, returns: 'Product', description: 'Rows deleted since they were written are dropped after the read, so pages can come back short.', pathParams: [{ name: 'siteId', description: 'Site id.' }] },\n { path: '/v1/sites/{siteId}/products/{productId}', method: 'get', operationId: 'getProduct', summary: 'Retrieve a product', returns: 'Product', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'productId', description: 'Product id.' }] },\n ],\n}\n\nexport const ORDERS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Orders',\n description: 'A site’s orders. Status moves are constrained.',\n schemaName: 'Order',\n required: ['id', 'object', 'number', 'status'],\n writable: ['status', 'carrier', 'trackingNumber', 'trackingUrl', 'lineItems', 'notify'],\n writeOnly: {\n status: { type: 'string', enum: ['fulfilled', 'delivered'], description: 'The status to move the order to.' },\n carrier: str('Free text, e.g. `UPS`. Trimmed to 40 characters. USPS, UPS, FedEx, DHL, Canada Post, Royal Mail and Australia Post get a tracking link.'),\n trackingNumber: str('Free text. Trimmed to 60 characters.'),\n trackingUrl: str('An https tracking link, for a carrier the link is not derived for.'),\n lineItems: {\n type: 'array',\n description:\n 'With `status: fulfilled`, the units this shipment covers: `[{ lineItemId, quantity }]`, where `lineItemId` is the line’s index. Omitted, the shipment covers everything still to ship. More than is left is `409 conflict` (`code: \"over_fulfilled\"`). Send an `Idempotency-Key` header so a retried partial shipment is recorded once.',\n items: { type: 'object', additionalProperties: true },\n },\n notify: bool('Whether the buyer is told about this shipment. Defaults to true.'),\n },\n writeRequired: ['status'],\n fields: {\n id: str('Order id.'),\n object: OBJECT_FIELD('order'),\n number: int('Human-facing order number.'),\n status: str('Order status.'),\n channel: str('`online` by default. Older orders carry no stored value, so `?channel=online` drops them after the read.'),\n currency: str('ISO 4217 code.'),\n customerEmail: nullable(str('Customer email.')),\n customerName: nullable(str('Customer name.')),\n lineItems: { type: 'array', description: 'What was bought.', items: { type: 'object', additionalProperties: true } },\n totals: objectOf('Money totals, in the smallest unit of `currency`. `extrasCents` is the optional lines the buyer added at checkout, inside `totalCents` and outside `itemsCents`.'),\n extras: { type: 'array', description: 'Optional lines the buyer added at checkout, such as package protection: `[{ id, pluginId, key, label, amountCents, quoteRef }]`. Empty when there were none.', items: { type: 'object', additionalProperties: true } },\n credits: { type: 'array', description: 'Store credit another plugin kept that paid part of the sale, such as rewards: `[{ providerId, pluginId, reference, label, last4, amountCents, appliedAs }]`. `appliedAs` is `discount` for a checkout redemption and `tender` for a register payment. Empty when there were none.', items: { type: 'object', additionalProperties: true } },\n refundedCents: int('Amount refunded so far.'),\n disputed: bool('Whether a chargeback is open.'),\n taxMode: nullable(str('The tax regime: `stripe-automatic` (Stripe Tax, collected and remitted by the platform as marketplace facilitator), `manual` (your own rate) or `none`. `null` on an order from before it was recorded.')),\n taxEngine: nullable(objectOf('The tax service you connected, when one was asked for this sale’s tax: `provider` (`avalara` or `taxjar`), `providerLabel`, `status` (`quoted` when its tax was charged, `fallback` when it did not answer and your own rate was charged), `reason` (`timeout` or `error` on a fallback) and `sandbox`. `null` when no service was asked.')),\n shippingAddress: ADDRESS(),\n couponCode: nullable(str('Coupon applied.')),\n fulfillments: { type: 'array', description: 'Shipments and deliveries.', items: { type: 'object', additionalProperties: true } },\n created: STAMPS.created,\n },\n ops: [\n { path: '/v1/sites/{siteId}/orders', method: 'get', operationId: 'listOrders', summary: 'List orders', list: true, returns: 'Order', filters: [q('channel', '`online` is a default rather than a stored value, so filtering on it drops older orders after the read.'), q('status', 'Order status.')], pathParams: [{ name: 'siteId', description: 'Site id.' }] },\n { path: '/v1/sites/{siteId}/orders/{orderId}', method: 'get', operationId: 'getOrder', summary: 'Retrieve an order', returns: 'Order', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'orderId', description: 'Order id.' }] },\n { path: '/v1/sites/{siteId}/orders/{orderId}', method: 'patch', operationId: 'updateOrder', summary: 'Move an order’s status', accepts: 'OrderWrite', returns: 'Order', description: 'An illegal transition is `409 conflict` (`code: \"order_transition\"`), and the message names the status it is in.', pathParams: [{ name: 'siteId', description: 'Site id.' }, { name: 'orderId', description: 'Order id.' }] },\n ],\n}\n"],"names":["booleanField","bool","integerField","int","nullableField","nullable","objectKindField","OBJECT_FIELD","openObjectField","objectOf","postalAddressField","ADDRESS","queryParam","q","RECORD_STAMPS","STAMPS","stringField","str","stringListField","strList","PRODUCTS_API_V1_DESCRIPTION","tag","description","schemaName","required","fields","id","object","name","slug","type","status","tags","categoryIds","mediaUrls","options","items","additionalProperties","variants","inventory","subscription","ops","path","method","operationId","summary","list","returns","pathParams","ORDERS_API_V1_DESCRIPTION","writable","writeOnly","enum","carrier","trackingNumber","trackingUrl","lineItems","notify","writeRequired","number","channel","currency","customerEmail","customerName","totals","extras","credits","refundedCents","disputed","taxMode","taxEngine","shippingAddress","couponCode","fulfillments","created","filters","accepts"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,gBAAgBC,IAAI,EACpBC,gBAAgBC,GAAG,EACnBC,iBAAiBC,QAAQ,EACzBC,mBAAmBC,YAAY,EAC/BC,mBAAmBC,QAAQ,EAC3BC,sBAAsBC,OAAO,EAC7BC,cAAcC,CAAC,EACfC,iBAAiBC,MAAM,EACvBC,eAAeC,GAAG,EAClBC,mBAAmBC,OAAO,QACrB,qDAAoD;AAE3D;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAAwD;IACnEC,KAAK;IACLC,aAAa;IACbC,YAAY;IACZC,UAAU;QAAC;QAAM;QAAU;KAAO;IAClCC,QAAQ;QACNC,IAAIT,IAAI;QACRU,QAAQpB,aAAa;QACrBqB,MAAMX,IAAI;QACVY,MAAMZ,IAAI;QACVK,aAAajB,SAASY,IAAI;QAC1Ba,MAAMb,IAAI;QACVc,QAAQd,IAAI;QACZe,MAAMb,QAAQ;QACdc,aAAad,QAAQ;QACrBe,WAAWf,QAAQ;QACnBgB,SAAS;YAAEL,MAAM;YAASR,aAAa;YAAkCc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAC/HC,UAAU;YAAER,MAAM;YAASR,aAAa;YAAyBc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QACvHE,WAAWlC,SAASF,IAAI;QACxBqC,cAAcnC,SAASI,SAAS;OAC7BM;IAEL0B,KAAK;QAC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,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAC5P6B,SAAS;YAAEpC,MAAM;YAASR,aAAa;YAAqRc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAClX8B,eAAehE,IAAI;QACnBiE,UAAUnE,KAAK;QACfoE,SAAShE,SAASY,IAAI;QACtBqD,WAAWjE,SAASI,SAAS;QAC7B8D,iBAAiB5D;QACjB6D,YAAYnE,SAASY,IAAI;QACzBwD,cAAc;YAAE3C,MAAM;YAASR,aAAa;YAA6Bc,OAAO;gBAAEN,MAAM;gBAAUO,sBAAsB;YAAK;QAAE;QAC/HqC,SAAS3D,OAAO2D,OAAO;IACzB;IACAjC,KAAK;QACH;YAAEC,MAAM;YAA6BC,QAAQ;YAAOC,aAAa;YAAcC,SAAS;YAAeC,MAAM;YAAMC,SAAS;YAAS4B,SAAS;gBAAC9D,EAAE,WAAW;gBAA4GA,EAAE,UAAU;aAAiB;YAAEmC,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;aAAE;QAAC;QACjW;YAAEoB,MAAM;YAAuCC,QAAQ;YAAOC,aAAa;YAAYC,SAAS;YAAqBE,SAAS;YAASC,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;gBAAG;oBAAEM,MAAM;oBAAWN,aAAa;gBAAY;aAAE;QAAC;QAChP;YAAEoB,MAAM;YAAuCC,QAAQ;YAASC,aAAa;YAAeC,SAAS;YAA0B+B,SAAS;YAAc7B,SAAS;YAASzB,aAAa;YAAoH0B,YAAY;gBAAC;oBAAEpB,MAAM;oBAAUN,aAAa;gBAAW;gBAAG;oBAAEM,MAAM;oBAAWN,aAAa;gBAAY;aAAE;QAAC;KACnZ;AACH,EAAC"}
|
|
@@ -46,6 +46,15 @@ export declare function orderViewFromData(id: string, data: Record<string, any>)
|
|
|
46
46
|
amountCents: number;
|
|
47
47
|
quoteRef: string;
|
|
48
48
|
}[];
|
|
49
|
+
credits: {
|
|
50
|
+
providerId: string;
|
|
51
|
+
pluginId: string;
|
|
52
|
+
reference: string;
|
|
53
|
+
label: string;
|
|
54
|
+
last4: string;
|
|
55
|
+
amountCents: number;
|
|
56
|
+
appliedAs: "discount" | "tender";
|
|
57
|
+
}[];
|
|
49
58
|
refundedCents: number;
|
|
50
59
|
taxMode: string;
|
|
51
60
|
taxEngine: import("../../model/commerce-tax-engine").OrderTaxEngineStamp;
|
|
@@ -65,3 +74,13 @@ export declare function orderViewFromData(id: string, data: Record<string, any>)
|
|
|
65
74
|
}[];
|
|
66
75
|
created: unknown;
|
|
67
76
|
};
|
|
77
|
+
/** The plugin credits an order carries, online and at the register (AGL-3640). */
|
|
78
|
+
export declare function orderCreditsView(data: Record<string, any>): Array<{
|
|
79
|
+
providerId: string;
|
|
80
|
+
pluginId: string;
|
|
81
|
+
reference: string;
|
|
82
|
+
label: string;
|
|
83
|
+
last4: string;
|
|
84
|
+
amountCents: number;
|
|
85
|
+
appliedAs: 'discount' | 'tender';
|
|
86
|
+
}>;
|
|
@@ -64,6 +64,11 @@ import { orderTaxEngineView } from "../../model/commerce-tax-engine.js";
|
|
|
64
64
|
quoteRef: typeof entry.quoteRef === 'string' ? entry.quoteRef : null
|
|
65
65
|
};
|
|
66
66
|
}),
|
|
67
|
+
// Store credit another plugin kept that paid part of the sale (AGL-3640):
|
|
68
|
+
// a rewards redemption online comes off the goods (`discount`), one at
|
|
69
|
+
// the register is one of its payments (`tender`). The provider reads its
|
|
70
|
+
// own `reference` back off `order.paid` and `order.refunded`.
|
|
71
|
+
credits: orderCreditsView(data),
|
|
67
72
|
// Money already handed back, for any reason. A chargeback lands here too,
|
|
68
73
|
// so `refundedCents > 0` does not by itself mean the merchant chose it.
|
|
69
74
|
refundedCents: Number((_data_refundedCents = data.refundedCents) != null ? _data_refundedCents : 0),
|
|
@@ -116,5 +121,35 @@ import { orderTaxEngineView } from "../../model/commerce-tax-engine.js";
|
|
|
116
121
|
created: (_serialize1 = serialize(data.createdAt)) != null ? _serialize1 : null
|
|
117
122
|
};
|
|
118
123
|
}
|
|
124
|
+
/** The plugin credits an order carries, online and at the register (AGL-3640). */ export function orderCreditsView(data) {
|
|
125
|
+
const online = (Array.isArray(data.credits) ? data.credits : []).filter((entry)=>entry && typeof entry.providerId === 'string').map((entry)=>{
|
|
126
|
+
var _entry_pluginId, _entry_reference, _entry_label, _entry_last4;
|
|
127
|
+
return {
|
|
128
|
+
providerId: String(entry.providerId),
|
|
129
|
+
pluginId: String((_entry_pluginId = entry.pluginId) != null ? _entry_pluginId : String(entry.providerId).split('.')[0]),
|
|
130
|
+
reference: String((_entry_reference = entry.reference) != null ? _entry_reference : ''),
|
|
131
|
+
label: String((_entry_label = entry.label) != null ? _entry_label : ''),
|
|
132
|
+
last4: String((_entry_last4 = entry.last4) != null ? _entry_last4 : ''),
|
|
133
|
+
amountCents: Math.max(0, Math.trunc(Number(entry.amountCents) || 0)),
|
|
134
|
+
appliedAs: entry.appliedAs === 'tender' ? 'tender' : 'discount'
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
const register = (Array.isArray(data.payments) ? data.payments : []).filter((payment)=>payment && payment.method === 'credit' && payment.status === 'succeeded' && typeof payment.creditProviderId === 'string').map((payment)=>{
|
|
138
|
+
var _payment_creditReference, _payment_creditLabel, _payment_last4;
|
|
139
|
+
return {
|
|
140
|
+
providerId: String(payment.creditProviderId),
|
|
141
|
+
pluginId: String(payment.creditProviderId).split('.')[0],
|
|
142
|
+
reference: String((_payment_creditReference = payment.creditReference) != null ? _payment_creditReference : ''),
|
|
143
|
+
label: String((_payment_creditLabel = payment.creditLabel) != null ? _payment_creditLabel : ''),
|
|
144
|
+
last4: String((_payment_last4 = payment.last4) != null ? _payment_last4 : ''),
|
|
145
|
+
amountCents: Math.max(0, Math.trunc(Number(payment.amountCents) || 0)),
|
|
146
|
+
appliedAs: 'tender'
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
return [
|
|
150
|
+
...online,
|
|
151
|
+
...register
|
|
152
|
+
].filter((credit)=>credit.reference && credit.amountCents > 0);
|
|
153
|
+
}
|
|
119
154
|
|
|
120
155
|
//# sourceMappingURL=order-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/server/api-v1/order-view.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 { serialize } from '@aglyn/tenant-data-admin/server/api-v1-kit'\nimport { fulfillmentLineQuantities } from '../../model/order-fulfillment'\nimport { fulfillmentTrackingUrl } from '../../model/tracking-url'\nimport { orderTaxEngineView } from '../../model/commerce-tax-engine'\n\n/**\n * The public order shape from an order's data (AGL-3611): the same object the\n * API returns, so an order event and an outbound webhook carry exactly what\n * `GET /v1/sites/{id}/orders/{id}` would.\n */\nexport function orderViewFromData(id: string, data: Record<string, any>) {\n const totals = (data.totals ?? {}) as Record<string, unknown>\n const legacyTotal = Number(data.amountCents ?? NaN)\n const totalCents = Number.isFinite(Number(totals.totalCents))\n ? Number(totals.totalCents)\n : Number.isFinite(legacyTotal)\n ? legacyTotal\n : null\n const legacyFee = Number(data.feeCents ?? NaN)\n return {\n id,\n object: 'order',\n number: typeof data.number === 'number' ? data.number : null,\n status: (data.status as string) ?? null,\n channel: (data.channel as string) ?? 'online',\n currency: 'usd',\n customerEmail: data.customerEmail ?? null,\n customerName: data.customerName ?? null,\n lineItems: serialize(data.lineItems ?? []),\n totals: {\n itemsCents: Number(totals.itemsCents ?? 0),\n shippingCents: Number(totals.shippingCents ?? 0),\n taxCents: Number(totals.taxCents ?? 0),\n discountCents: Number(totals.discountCents ?? 0),\n totalCents,\n // The Connect application fee. NOT subtracted from `totalCents` — it is\n // Aglyn's cut of a total the shopper already paid in full, so a client\n // that nets it out of revenue would understate what it collected.\n feeCents: Number.isFinite(Number(totals.feeCents))\n ? Number(totals.feeCents)\n : Number.isFinite(legacyFee)\n ? legacyFee\n : 0,\n // Optional lines the buyer added at checkout (AGL-3635), inside\n // `totalCents` and outside `itemsCents`.\n extrasCents: Number(totals.extrasCents ?? 0) || 0,\n },\n // What those lines were and whose offer each was: the fact a plugin that\n // insures a parcel reads off `order.paid` to know it was bought.\n extras: (Array.isArray(data.extras) ? data.extras : [])\n .filter((entry: Record<string, unknown>) => entry && typeof entry.id === 'string')\n .map((entry: Record<string, unknown>) => ({\n id: String(entry.id),\n pluginId: String(entry.pluginId ?? ''),\n key: String(entry.key ?? ''),\n label: String(entry.label ?? ''),\n amountCents: Number(entry.amountCents ?? 0) || 0,\n quoteRef: typeof entry.quoteRef === 'string' ? entry.quoteRef : null,\n })),\n // Money already handed back, for any reason. A chargeback lands here too,\n // so `refundedCents > 0` does not by itself mean the merchant chose it.\n refundedCents: Number(data.refundedCents ?? 0),\n // Who the tax was charged under (AGL-3614): `stripe-automatic` tax is\n // Aglyn's to remit as marketplace facilitator and never reaches the\n // merchant's account, which a ledger posting the sale has to know. An\n // order from before the regime was recorded says `null`, never a guess.\n taxMode: typeof data.taxMode === 'string' && data.taxMode ? data.taxMode : null,\n // The merchant's own tax service (AGL-3631): which one priced the sale, or\n // that it was asked and the store's own rates were charged instead\n // (`status: 'fallback'`). `null` when no service was asked. The regime is\n // still `taxMode` — a service the merchant connected answers for tax the\n // merchant remits.\n taxEngine: orderTaxEngineView(data.taxEngine),\n disputed: Boolean(data.dispute),\n shippingAddress: serialize(data.shippingAddress) ?? null,\n couponCode: data.couponCode ?? null,\n // Shipment records — the half of fulfilment an integration can use\n // without a write (AGL-2460). `status` says an order is `fulfilled`; it\n // does not say which carrier took it or under what tracking number, so a\n // 3PL or accounting reconcile could see THAT an order shipped and never\n // WHICH shipment it was. The console's order dialog shows both, and an\n // order that has been shipped twice (a split shipment) is indistinguish-\n // able from one shipped once when only the status is published.\n //\n // `atMs` is a number of milliseconds, not a Firestore Timestamp, so\n // `serialize` passes it through untouched. It is republished as `at` in\n // ISO 8601 to match `created` and every other time this API emits: one\n // object publishing two time formats is a bug an integrator finds late,\n // in their own timezone conversion, and blames on their own code.\n fulfillments: (Array.isArray(data.fulfillments) ? data.fulfillments : []).map(\n (entry: Record<string, unknown>) => {\n const atMs = Number((entry ?? {}).atMs)\n return {\n id: (entry ?? {}).id ?? null,\n lineItemIds: Array.isArray((entry ?? {}).lineItemIds)\n ? (entry as { lineItemIds: unknown[] }).lineItemIds\n : [],\n // Units per line (AGL-3611); a fulfillment recorded before\n // quantities shipped every unit of the lines it names.\n lines: fulfillmentLineQuantities(\n { lineItems: Array.isArray(data.lineItems) ? data.lineItems : [] },\n (entry ?? {}) as never,\n ),\n status: (entry ?? {}).status === 'cancelled' ? 'cancelled' : 'active',\n carrier: (entry ?? {}).carrier ?? null,\n trackingNumber: (entry ?? {}).trackingNumber ?? null,\n trackingUrl: fulfillmentTrackingUrl((entry ?? {}) as never),\n labelUrl: (entry ?? {}).labelUrl ?? null,\n at: Number.isFinite(atMs) ? new Date(atMs).toISOString() : null,\n }\n },\n ),\n created: serialize(data.createdAt) ?? null,\n }\n}\n\n"],"names":["serialize","fulfillmentLineQuantities","fulfillmentTrackingUrl","orderTaxEngineView","orderViewFromData","id","data","totals","legacyTotal","Number","amountCents","NaN","totalCents","isFinite","legacyFee","feeCents","object","number","status","channel","currency","customerEmail","customerName","lineItems","itemsCents","shippingCents","taxCents","discountCents","extrasCents","extras","Array","isArray","filter","entry","map","String","pluginId","key","label","quoteRef","refundedCents","taxMode","taxEngine","disputed","Boolean","dispute","shippingAddress","couponCode","fulfillments","atMs","lineItemIds","lines","carrier","trackingNumber","trackingUrl","labelUr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Gf,MAAM,KAAK,cAAc,cAAc;gBAC7DkC,OAAO,GAAE,WAAA,CAACnB,gBAAAA,QAAS,CAAC,GAAGmB,OAAO,YAArB,WAAyB;gBAClCC,cAAc,GAAE,kBAAA,CAACpB,gBAAAA,QAAS,CAAC,GAAGoB,cAAc,YAA5B,kBAAgC;gBAChDC,aAAapD,uBAAwB+B,gBAAAA,QAAS,CAAC;gBAC/CsB,QAAQ,GAAE,YAAA,CAACtB,gBAAAA,QAAS,CAAC,GAAGsB,QAAQ,YAAtB,YAA0B;gBACpCC,IAAI/C,OAAOI,QAAQ,CAACoC,QAAQ,IAAIQ,KAAKR,MAAMS,WAAW,KAAK;YAC7D;QACF;QAEFC,OAAO,GAAE3D,cAAAA,UAAUM,KAAKsD,SAAS,aAAxB5D,cAA6B;IACxC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/server/api-v1/order-view.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 { serialize } from '@aglyn/tenant-data-admin/server/api-v1-kit'\nimport { fulfillmentLineQuantities } from '../../model/order-fulfillment'\nimport { fulfillmentTrackingUrl } from '../../model/tracking-url'\nimport { orderTaxEngineView } from '../../model/commerce-tax-engine'\n\n/**\n * The public order shape from an order's data (AGL-3611): the same object the\n * API returns, so an order event and an outbound webhook carry exactly what\n * `GET /v1/sites/{id}/orders/{id}` would.\n */\nexport function orderViewFromData(id: string, data: Record<string, any>) {\n const totals = (data.totals ?? {}) as Record<string, unknown>\n const legacyTotal = Number(data.amountCents ?? NaN)\n const totalCents = Number.isFinite(Number(totals.totalCents))\n ? Number(totals.totalCents)\n : Number.isFinite(legacyTotal)\n ? legacyTotal\n : null\n const legacyFee = Number(data.feeCents ?? NaN)\n return {\n id,\n object: 'order',\n number: typeof data.number === 'number' ? data.number : null,\n status: (data.status as string) ?? null,\n channel: (data.channel as string) ?? 'online',\n currency: 'usd',\n customerEmail: data.customerEmail ?? null,\n customerName: data.customerName ?? null,\n lineItems: serialize(data.lineItems ?? []),\n totals: {\n itemsCents: Number(totals.itemsCents ?? 0),\n shippingCents: Number(totals.shippingCents ?? 0),\n taxCents: Number(totals.taxCents ?? 0),\n discountCents: Number(totals.discountCents ?? 0),\n totalCents,\n // The Connect application fee. NOT subtracted from `totalCents` — it is\n // Aglyn's cut of a total the shopper already paid in full, so a client\n // that nets it out of revenue would understate what it collected.\n feeCents: Number.isFinite(Number(totals.feeCents))\n ? Number(totals.feeCents)\n : Number.isFinite(legacyFee)\n ? legacyFee\n : 0,\n // Optional lines the buyer added at checkout (AGL-3635), inside\n // `totalCents` and outside `itemsCents`.\n extrasCents: Number(totals.extrasCents ?? 0) || 0,\n },\n // What those lines were and whose offer each was: the fact a plugin that\n // insures a parcel reads off `order.paid` to know it was bought.\n extras: (Array.isArray(data.extras) ? data.extras : [])\n .filter((entry: Record<string, unknown>) => entry && typeof entry.id === 'string')\n .map((entry: Record<string, unknown>) => ({\n id: String(entry.id),\n pluginId: String(entry.pluginId ?? ''),\n key: String(entry.key ?? ''),\n label: String(entry.label ?? ''),\n amountCents: Number(entry.amountCents ?? 0) || 0,\n quoteRef: typeof entry.quoteRef === 'string' ? entry.quoteRef : null,\n })),\n // Store credit another plugin kept that paid part of the sale (AGL-3640):\n // a rewards redemption online comes off the goods (`discount`), one at\n // the register is one of its payments (`tender`). The provider reads its\n // own `reference` back off `order.paid` and `order.refunded`.\n credits: orderCreditsView(data),\n // Money already handed back, for any reason. A chargeback lands here too,\n // so `refundedCents > 0` does not by itself mean the merchant chose it.\n refundedCents: Number(data.refundedCents ?? 0),\n // Who the tax was charged under (AGL-3614): `stripe-automatic` tax is\n // Aglyn's to remit as marketplace facilitator and never reaches the\n // merchant's account, which a ledger posting the sale has to know. An\n // order from before the regime was recorded says `null`, never a guess.\n taxMode: typeof data.taxMode === 'string' && data.taxMode ? data.taxMode : null,\n // The merchant's own tax service (AGL-3631): which one priced the sale, or\n // that it was asked and the store's own rates were charged instead\n // (`status: 'fallback'`). `null` when no service was asked. The regime is\n // still `taxMode` — a service the merchant connected answers for tax the\n // merchant remits.\n taxEngine: orderTaxEngineView(data.taxEngine),\n disputed: Boolean(data.dispute),\n shippingAddress: serialize(data.shippingAddress) ?? null,\n couponCode: data.couponCode ?? null,\n // Shipment records — the half of fulfilment an integration can use\n // without a write (AGL-2460). `status` says an order is `fulfilled`; it\n // does not say which carrier took it or under what tracking number, so a\n // 3PL or accounting reconcile could see THAT an order shipped and never\n // WHICH shipment it was. The console's order dialog shows both, and an\n // order that has been shipped twice (a split shipment) is indistinguish-\n // able from one shipped once when only the status is published.\n //\n // `atMs` is a number of milliseconds, not a Firestore Timestamp, so\n // `serialize` passes it through untouched. It is republished as `at` in\n // ISO 8601 to match `created` and every other time this API emits: one\n // object publishing two time formats is a bug an integrator finds late,\n // in their own timezone conversion, and blames on their own code.\n fulfillments: (Array.isArray(data.fulfillments) ? data.fulfillments : []).map(\n (entry: Record<string, unknown>) => {\n const atMs = Number((entry ?? {}).atMs)\n return {\n id: (entry ?? {}).id ?? null,\n lineItemIds: Array.isArray((entry ?? {}).lineItemIds)\n ? (entry as { lineItemIds: unknown[] }).lineItemIds\n : [],\n // Units per line (AGL-3611); a fulfillment recorded before\n // quantities shipped every unit of the lines it names.\n lines: fulfillmentLineQuantities(\n { lineItems: Array.isArray(data.lineItems) ? data.lineItems : [] },\n (entry ?? {}) as never,\n ),\n status: (entry ?? {}).status === 'cancelled' ? 'cancelled' : 'active',\n carrier: (entry ?? {}).carrier ?? null,\n trackingNumber: (entry ?? {}).trackingNumber ?? null,\n trackingUrl: fulfillmentTrackingUrl((entry ?? {}) as never),\n labelUrl: (entry ?? {}).labelUrl ?? null,\n at: Number.isFinite(atMs) ? new Date(atMs).toISOString() : null,\n }\n },\n ),\n created: serialize(data.createdAt) ?? null,\n }\n}\n\n/** The plugin credits an order carries, online and at the register (AGL-3640). */\nexport function orderCreditsView(data: Record<string, any>): Array<{\n providerId: string\n pluginId: string\n reference: string\n label: string\n last4: string\n amountCents: number\n appliedAs: 'discount' | 'tender'\n}> {\n const online = (Array.isArray(data.credits) ? data.credits : [])\n .filter((entry: Record<string, unknown>) => entry && typeof entry.providerId === 'string')\n .map((entry: Record<string, unknown>) => ({\n providerId: String(entry.providerId),\n pluginId: String(entry.pluginId ?? String(entry.providerId).split('.')[0]),\n reference: String(entry.reference ?? ''),\n label: String(entry.label ?? ''),\n last4: String(entry.last4 ?? ''),\n amountCents: Math.max(0, Math.trunc(Number(entry.amountCents) || 0)),\n appliedAs: entry.appliedAs === 'tender' ? ('tender' as const) : ('discount' as const),\n }))\n const register = (Array.isArray(data.payments) ? data.payments : [])\n .filter(\n (payment: Record<string, unknown>) =>\n payment &&\n payment.method === 'credit' &&\n payment.status === 'succeeded' &&\n typeof payment.creditProviderId === 'string',\n )\n .map((payment: Record<string, unknown>) => ({\n providerId: String(payment.creditProviderId),\n pluginId: String(payment.creditProviderId).split('.')[0],\n reference: String(payment.creditReference ?? ''),\n label: String(payment.creditLabel ?? ''),\n last4: String(payment.last4 ?? ''),\n amountCents: Math.max(0, Math.trunc(Number(payment.amountCents) || 0)),\n appliedAs: 'tender' as const,\n }))\n return [...online, ...register].filter((credit) => credit.reference && credit.amountCents > 0)\n}\n"],"names":["serialize","fulfillmentLineQuantities","fulfillmentTrackingUrl","orderTaxEngineView","orderViewFromData","id","data","totals","legacyTotal","Number","amountCents","NaN","totalCents","isFinite","legacyFee","feeCents","object","number","status","channel","currency","customerEmail","customerName","lineItems","itemsCents","shippingCents","taxCents","discountCents","extrasCents","extras","Array","isArray","filter","entry","map","String","pluginId","key","label","quoteRef","credits","orderCreditsView","refundedCents","taxMode","taxEngine","disputed","Boolean","dispute","shippingAddress","couponCode","fulfillments","atMs","lineItemIds","lines","carrier","trackingNumber","trackingUrl","labelUrl","at","Date","toISOString","created","createdAt","online","providerId","split","reference","last4","Math","max","trunc","appliedAs","register","payments","payment","method","creditProviderId","creditReference","creditLabel","credit"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,SAAS,QAAQ,6CAA4C;AACtE,SAASC,yBAAyB,QAAQ,mCAA+B;AACzE,SAASC,sBAAsB,QAAQ,8BAA0B;AACjE,SAASC,kBAAkB,QAAQ,qCAAiC;AAEpE;;;;CAIC,GACD,OAAO,SAASC,kBAAkBC,EAAU,EAAEC,IAAyB;QACrDA,cACWA,mBAMFA,gBAKdA,cACCA,eAEKA,qBACDA,oBACOA,iBAEAC,oBACGA,uBACLA,kBACKA,uBAYFA,qBAqBAD,qBAaLN,YACLM,kBAqCHN;IA1GX,MAAMO,UAAUD,eAAAA,KAAKC,MAAM,YAAXD,eAAe,CAAC;IAChC,MAAME,cAAcC,QAAOH,oBAAAA,KAAKI,WAAW,YAAhBJ,oBAAoBK;IAC/C,MAAMC,aAAaH,OAAOI,QAAQ,CAACJ,OAAOF,OAAOK,UAAU,KACvDH,OAAOF,OAAOK,UAAU,IACxBH,OAAOI,QAAQ,CAACL,eACdA,cACA;IACN,MAAMM,YAAYL,QAAOH,iBAAAA,KAAKS,QAAQ,YAAbT,iBAAiBK;IAC1C,OAAO;QACLN;QACAW,QAAQ;QACRC,QAAQ,OAAOX,KAAKW,MAAM,KAAK,WAAWX,KAAKW,MAAM,GAAG;QACxDC,MAAM,GAAGZ,eAAAA,KAAKY,MAAM,YAAXZ,eAA0B;QACnCa,OAAO,GAAGb,gBAAAA,KAAKa,OAAO,YAAZb,gBAA2B;QACrCc,UAAU;QACVC,aAAa,GAAEf,sBAAAA,KAAKe,aAAa,YAAlBf,sBAAsB;QACrCgB,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