@aglyn/plugins-commerce 1.0.0-beta.288 → 1.0.0-beta.289

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.
Files changed (87) hide show
  1. package/README.md +2 -2
  2. package/package.json +13 -13
  3. package/src/lib/components/commerce-console-page.js +29 -2
  4. package/src/lib/components/commerce-console-page.js.map +1 -1
  5. package/src/lib/components/console/commerce-analytics-card.component.js +4 -2
  6. package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -1
  7. package/src/lib/components/console/host-orders-card.component.js +5 -1
  8. package/src/lib/components/console/host-orders-card.component.js.map +1 -1
  9. package/src/lib/components/console/host-quotes-card.component.d.ts +34 -0
  10. package/src/lib/components/console/host-quotes-card.component.js +247 -0
  11. package/src/lib/components/console/host-quotes-card.component.js.map +1 -0
  12. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js +33 -28
  13. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js.map +1 -1
  14. package/src/lib/components/console/quote-editor-dialog.component.d.ts +45 -0
  15. package/src/lib/components/console/quote-editor-dialog.component.js +1266 -0
  16. package/src/lib/components/console/quote-editor-dialog.component.js.map +1 -0
  17. package/src/lib/components/console/quote-pay-link.component.d.ts +38 -0
  18. package/src/lib/components/console/quote-pay-link.component.js +213 -0
  19. package/src/lib/components/console/quote-pay-link.component.js.map +1 -0
  20. package/src/lib/components/console/quote-settings-card.component.d.ts +29 -0
  21. package/src/lib/components/console/quote-settings-card.component.js +121 -0
  22. package/src/lib/components/console/quote-settings-card.component.js.map +1 -0
  23. package/src/lib/components/console/tax-settings-card.component.js +4 -1
  24. package/src/lib/components/console/tax-settings-card.component.js.map +1 -1
  25. package/src/lib/components/quote-page-body.d.ts +33 -0
  26. package/src/lib/components/quote-page-body.js +696 -0
  27. package/src/lib/components/quote-page-body.js.map +1 -0
  28. package/src/lib/components/quote-page.d.ts +29 -0
  29. package/src/lib/components/quote-page.js +96 -0
  30. package/src/lib/components/quote-page.js.map +1 -0
  31. package/src/lib/components/storefront-payment-element.d.ts +7 -1
  32. package/src/lib/components/storefront-payment-element.js +8 -3
  33. package/src/lib/components/storefront-payment-element.js.map +1 -1
  34. package/src/lib/constants/orders-list-query.js +6 -1
  35. package/src/lib/constants/orders-list-query.js.map +1 -1
  36. package/src/lib/constants/quote-page.d.ts +30 -0
  37. package/src/lib/constants/quote-page.js +35 -0
  38. package/src/lib/constants/quote-page.js.map +1 -0
  39. package/src/lib/model/commerce-orders.d.ts +25 -2
  40. package/src/lib/model/commerce-orders.js +10 -1
  41. package/src/lib/model/commerce-orders.js.map +1 -1
  42. package/src/lib/model/commerce-quote-pay.d.ts +229 -0
  43. package/src/lib/model/commerce-quote-pay.js +393 -0
  44. package/src/lib/model/commerce-quote-pay.js.map +1 -0
  45. package/src/lib/model/commerce-quotes.d.ts +279 -0
  46. package/src/lib/model/commerce-quotes.js +522 -0
  47. package/src/lib/model/commerce-quotes.js.map +1 -0
  48. package/src/lib/model/index.d.ts +2 -0
  49. package/src/lib/model/index.js +2 -0
  50. package/src/lib/model/index.js.map +1 -1
  51. package/src/lib/model/plugin-permissions.d.ts +1 -1
  52. package/src/lib/model/plugin-permissions.js +20 -0
  53. package/src/lib/model/plugin-permissions.js.map +1 -1
  54. package/src/lib/server/api-v1/orders-and-products.js +6 -2
  55. package/src/lib/server/api-v1/orders-and-products.js.map +1 -1
  56. package/src/lib/server/billing-webhook.js +127 -52
  57. package/src/lib/server/billing-webhook.js.map +1 -1
  58. package/src/lib/server/checkout-session-expiry.d.ts +36 -0
  59. package/src/lib/server/checkout-session-expiry.js +63 -0
  60. package/src/lib/server/checkout-session-expiry.js.map +1 -0
  61. package/src/lib/server/draft-order.js +16 -8
  62. package/src/lib/server/draft-order.js.map +1 -1
  63. package/src/lib/server/person-eraser.d.ts +7 -0
  64. package/src/lib/server/person-eraser.js +24 -2
  65. package/src/lib/server/person-eraser.js.map +1 -1
  66. package/src/lib/server/pos-return.js +3 -1
  67. package/src/lib/server/pos-return.js.map +1 -1
  68. package/src/lib/server/quote-link-token.d.ts +39 -0
  69. package/src/lib/server/quote-link-token.js +97 -0
  70. package/src/lib/server/quote-link-token.js.map +1 -0
  71. package/src/lib/server/quote-pay.d.ts +83 -0
  72. package/src/lib/server/quote-pay.js +606 -0
  73. package/src/lib/server/quote-pay.js.map +1 -0
  74. package/src/lib/server/quote.d.ts +49 -0
  75. package/src/lib/server/quote.js +513 -0
  76. package/src/lib/server/quote.js.map +1 -0
  77. package/src/lib/server/related.js +2 -0
  78. package/src/lib/server/related.js.map +1 -1
  79. package/src/lib/server/site-page-resolver.d.ts +2 -0
  80. package/src/lib/server/site-page-resolver.js +75 -0
  81. package/src/lib/server/site-page-resolver.js.map +1 -1
  82. package/src/lib/server.js +14 -0
  83. package/src/lib/server.js.map +1 -1
  84. package/src/lib/site.js +6 -0
  85. package/src/lib/site.js.map +1 -1
  86. package/src/lib/transfer/tracking.server.js +6 -0
  87. package/src/lib/transfer/tracking.server.js.map +1 -1
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * The customer's quote page (AGL-4094), where a quote's pay link opens.
18
+ *
19
+ * The component id is persisted in screen documents; never rename it. The
20
+ * path is where the site serves the page when it has no page of its own
21
+ * there. It is `pay-quote` rather than `quote` because a business that sells
22
+ * made-to-order work often has a "Request a quote" page at `/quote` already,
23
+ * and a page of the site's own at an address always wins over this one: a pay
24
+ * link there would open the request form.
25
+ */ export const QUOTE_PAGE_COMPONENT_ID = 'quote-page';
26
+ export const QUOTE_PAGE_PATH = 'pay-quote';
27
+ /** The page's address for one quote and its signed link token, relative to the site. */ export function quotePageHref(quoteId, token) {
28
+ const query = new URLSearchParams({
29
+ q: quoteId,
30
+ t: token
31
+ });
32
+ return `/${QUOTE_PAGE_PATH}?${query.toString()}`;
33
+ }
34
+
35
+ //# sourceMappingURL=quote-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/quote-page.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The customer's quote page (AGL-4094), where a quote's pay link opens.\n *\n * The component id is persisted in screen documents; never rename it. The\n * path is where the site serves the page when it has no page of its own\n * there. It is `pay-quote` rather than `quote` because a business that sells\n * made-to-order work often has a \"Request a quote\" page at `/quote` already,\n * and a page of the site's own at an address always wins over this one: a pay\n * link there would open the request form.\n */\nexport const QUOTE_PAGE_COMPONENT_ID = 'quote-page'\n\nexport const QUOTE_PAGE_PATH = 'pay-quote'\n\n/** The page's address for one quote and its signed link token, relative to the site. */\nexport function quotePageHref(quoteId: string, token: string): string {\n const query = new URLSearchParams({ q: quoteId, t: token })\n return `/${QUOTE_PAGE_PATH}?${query.toString()}`\n}\n"],"names":["QUOTE_PAGE_COMPONENT_ID","QUOTE_PAGE_PATH","quotePageHref","quoteId","token","query","URLSearchParams","q","t","toString"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GACD,OAAO,MAAMA,0BAA0B,aAAY;AAEnD,OAAO,MAAMC,kBAAkB,YAAW;AAE1C,sFAAsF,GACtF,OAAO,SAASC,cAAcC,OAAe,EAAEC,KAAa;IAC1D,MAAMC,QAAQ,IAAIC,gBAAgB;QAAEC,GAAGJ;QAASK,GAAGJ;IAAM;IACzD,OAAO,CAAC,CAAC,EAAEH,gBAAgB,CAAC,EAAEI,MAAMI,QAAQ,IAAI;AAClD"}
@@ -23,6 +23,7 @@
23
23
  * I/O here.
24
24
  */
25
25
  import type { OrderLineModifier } from './product-modifiers';
26
+ import type { OrderQuote } from './commerce-quotes';
26
27
  import type { PaymentRisk } from '@aglyn/aglyn/app-utils/payment-risk';
27
28
  import type { ProductType } from './commerce';
28
29
  import type { StorefrontTaxMode } from './commerce-tax-decision';
@@ -31,7 +32,8 @@ import type { PosOfflineOrderStamp } from './commerce-pos-offline';
31
32
  import type { OrderFulfillmentMethod, OrderLocalDelivery, OrderPickup } from './order-local-fulfillment';
32
33
  export type OrderStatus = 'pending' | 'paid' | 'partially_fulfilled' | 'fulfilled' | 'delivered' | 'cancelled' | 'refunded';
33
34
  /**
34
- * Where the sale came through. `subscription` is a recurring cycle of a
35
+ * Where the sale came through. `quote` is an order a business quoted before
36
+ * the customer paid it (AGL-4093, `commerce-quotes.ts`). `subscription` is a recurring cycle of a
35
37
  * PHYSICAL subscription product (AGL-1750): each paid invoice mints one order
36
38
  * so fulfilment has something to pick, pack and label against, and so
37
39
  * recurring revenue reaches the surfaces that read `orders`. Digital and
@@ -39,7 +41,7 @@ export type OrderStatus = 'pending' | 'paid' | 'partially_fulfilled' | 'fulfille
39
41
  * there is nothing to ship, and AGL-1732's "a subscription is not an order"
40
42
  * stands for them.
41
43
  */
42
- export type OrderChannel = 'online' | 'pos' | 'draft' | 'subscription' | 'marketplace';
44
+ export type OrderChannel = 'online' | 'pos' | 'draft' | 'subscription' | 'marketplace' | 'quote';
43
45
  /**
44
46
  * Where an order sold on an outside channel came from (AGL-3638): a
45
47
  * marketplace that took the buyer's money and pays the merchant out. Written
@@ -83,7 +85,20 @@ export interface OrderChannelSource {
83
85
  }
84
86
  /** Snapshot of what was bought — self-contained for history. */
85
87
  export interface OrderLineItem {
88
+ /**
89
+ * The product sold. EMPTY on a line typed on a quote (`custom`), which no
90
+ * product stands behind: every reader that looks a product up by this id
91
+ * skips an empty one (AGL-4093).
92
+ */
86
93
  productId: string;
94
+ /** A line typed on a quote rather than picked from the catalog (AGL-4093). */
95
+ custom?: boolean;
96
+ /** Included at no charge (AGL-4093): `unitAmountCents` is 0. */
97
+ included?: boolean;
98
+ /** What the line is, in the business's words, beyond its name (AGL-4093). */
99
+ description?: string;
100
+ /** The product was tax-exempt when the line was priced (AGL-4093). */
101
+ taxExempt?: boolean;
87
102
  variantId?: string;
88
103
  /** Display snapshot at purchase time. */
89
104
  name: string;
@@ -623,6 +638,8 @@ export interface HostOrder {
623
638
  invoiceId?: string;
624
639
  /** Draft orders (AGL-287): the link sent to the buyer. */
625
640
  paymentLinkUrl?: string;
641
+ /** What only a quote has (channel `quote`, AGL-4093); see `commerce-quotes.ts`. */
642
+ quote?: OrderQuote;
626
643
  refundedCents?: number;
627
644
  /**
628
645
  * Line indexes an admin refunded BY NAME (AGL-2454), and therefore the lines
@@ -1120,6 +1137,12 @@ export declare function formatOrderNumber(order: Pick<HostOrder, 'number'>, docI
1120
1137
  * into the v1 shape for display; already-shaped orders pass through.
1121
1138
  */
1122
1139
  export declare function liftLegacyOrder(raw: Partial<HostOrder>): HostOrder;
1140
+ /**
1141
+ * What a report groups a line under: its product, or for a line typed on a
1142
+ * quote (no product) its name, so two different typed lines never pool into
1143
+ * one empty-id bucket.
1144
+ */
1145
+ export declare function orderLineProductKey(line: Pick<OrderLineItem, 'productId' | 'name'>): string;
1123
1146
  /**
1124
1147
  * Does this order contain `productId`?
1125
1148
  *
@@ -625,6 +625,14 @@ export function computeCheckoutSessionTotals(lineItems, session, parts) {
625
625
  }
626
626
  });
627
627
  }
628
+ /**
629
+ * What a report groups a line under: its product, or for a line typed on a
630
+ * quote (no product) its name, so two different typed lines never pool into
631
+ * one empty-id bucket.
632
+ */ export function orderLineProductKey(line) {
633
+ var _line_name;
634
+ return line.productId ? line.productId : `custom:${(_line_name = line.name) != null ? _line_name : ''}`;
635
+ }
628
636
  /**
629
637
  * Does this order contain `productId`?
630
638
  *
@@ -859,7 +867,8 @@ export function computeCheckoutSessionTotals(lineItems, session, parts) {
859
867
  pos: 'POS',
860
868
  draft: 'Draft',
861
869
  subscription: 'Subscription',
862
- marketplace: 'Marketplace'
870
+ marketplace: 'Marketplace',
871
+ quote: 'Quote'
863
872
  };
864
873
  /** Human label for a channel, tolerating a legacy/unknown value. */ export function orderChannelLabel(channel) {
865
874
  var _ref, _ORDER_CHANNEL_LABELS_;