@sixtyninecommerce/admin 0.10.0 → 0.11.0
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/README.md +4347 -171
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/index.d.ts +9 -2
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +102 -14
- package/dist/catalog/properties.js +13 -0
- package/dist/catalog/recommendations.d.ts +261 -0
- package/dist/catalog/recommendations.js +145 -0
- package/dist/catalog/reviews.d.ts +368 -0
- package/dist/catalog/reviews.js +318 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +233 -26
- package/dist/catalog/variants.js +125 -7
- package/dist/catalog/visibility.d.ts +20 -5
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +95 -9
- package/dist/client.js +35 -7
- package/dist/content/assets.d.ts +286 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/items.d.ts +269 -0
- package/dist/content/items.js +170 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +447 -37
- package/dist/customers/index.js +313 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/index.d.ts +731 -21
- package/dist/documents/index.js +436 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +44 -10
- package/dist/fulfillments/index.js +11 -2
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +123 -35
- package/dist/index.js +45 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +423 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +248 -0
- package/dist/integrations/exact-online.js +376 -0
- package/dist/integrations/index.d.ts +29 -3
- package/dist/integrations/index.js +18 -3
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipelines.d.ts +15 -14
- package/dist/integrations/pipelines.js +6 -22
- package/dist/integrations/types.d.ts +146 -0
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +162 -0
- package/dist/orders/cancel-with-money.d.ts +227 -0
- package/dist/orders/cancel-with-money.js +153 -0
- package/dist/orders/commit-edit.d.ts +7 -1
- package/dist/orders/commit-edit.js +5 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +49 -9
- package/dist/orders/index.js +22 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +222 -0
- package/dist/orders/list.js +377 -0
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +1 -1
- package/dist/orders/plan-edit.js +4 -1
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +8 -1
- package/dist/orders/surcharges.js +3 -2
- package/dist/payments/account-credit.d.ts +30 -0
- package/dist/payments/account-credit.js +19 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +12 -0
- package/dist/payments/credit-noted-fields.js +37 -0
- package/dist/payments/index.d.ts +257 -11
- package/dist/payments/index.js +131 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +144 -0
- package/dist/payments/requests.js +92 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +104 -0
- package/dist/pickups/index.js +105 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +154 -0
- package/dist/platform/tax.js +139 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +103 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2125 -32
- package/dist/pos/index.js +742 -4
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +187 -0
- package/dist/pos/offline-sales.js +116 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +217 -0
- package/dist/pos/returns.js +53 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +604 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +89 -0
- package/dist/purchasing/alerts.js +62 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +36 -0
- package/dist/purchasing/index.js +16 -0
- package/dist/purchasing/purchase-orders.d.ts +548 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +501 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +614 -21
- package/dist/returns/index.js +695 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +48 -0
- package/dist/shipping/index.js +25 -0
- package/dist/shipping/methods.d.ts +198 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +254 -0
- package/dist/shipping/myparcel.js +178 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +179 -0
- package/dist/shipping/rate-tables.js +184 -0
- package/dist/stock/index.d.ts +10 -3
- package/dist/stock/index.js +3 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/transfers.d.ts +216 -43
- package/dist/stock/transfers.js +140 -13
- package/dist/stored-value/index.d.ts +214 -4
- package/dist/stored-value/index.js +152 -0
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/index.d.ts +76 -1
- package/dist/tax/index.js +50 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +66 -0
- package/dist/tenant/email-templates.js +54 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price lists (headless spec §9.2 `pricing`: "price lists"; W10-14): a store's B2B price lists,
|
|
3
|
+
* their entries (what each target costs), who they are assigned to, the order rules they carry,
|
|
4
|
+
* and enabling, disabling or deleting many at once.
|
|
5
|
+
*
|
|
6
|
+
* - **Money** is integer MINOR UNITS of the store's DEFAULT currency, unless an entry's
|
|
7
|
+
* `currencyCode` names another; an entry with no `currencyCode` applies in the default
|
|
8
|
+
* currency only. Its basis differs per figure:
|
|
9
|
+
* - a `fixed_price` / `fixed_amount` entry: the store's price basis (gross on a tax-inclusive
|
|
10
|
+
* store, net on a tax-exclusive one);
|
|
11
|
+
* - a list's order minimum (`minOrderAmount`): its own `minOrderAmountBasis`, `net` or
|
|
12
|
+
* `gross`, and `gross` when omitted, whatever the store's basis;
|
|
13
|
+
* - an order rule's money (a `min_order_total` threshold, a `fixed_amount` discount): the
|
|
14
|
+
* store's price basis, as the dashboard labels it (USER DECISION N7, 2026-10-13).
|
|
15
|
+
* Percentages are basis points (`1000` = 10 %).
|
|
16
|
+
* - **Order rules apply** (USER DECISION N1). A customer a list reaches gets the single best rule
|
|
17
|
+
* their order meets (the most money off), as one line-level discount named "Order discount" in
|
|
18
|
+
* the order's language. Only the most specific level of lists with rules decides (contract →
|
|
19
|
+
* customer → group → store-wide); lists at that level are compared together. A total threshold
|
|
20
|
+
* reads the goods at the customer's own prices before any other discount, in the store's price
|
|
21
|
+
* basis, leaving out shipping, fees, gift cards and stated-price lines (imports, accepted
|
|
22
|
+
* quotes, till manager prices); a quantity threshold counts the units of those same lines.
|
|
23
|
+
* Money converts into the order's currency at the order's rate (no rate: no discount). Drafts,
|
|
24
|
+
* storefront carts and till sales with a customer get it; quote, import and subscription
|
|
25
|
+
* orders never do. A placed order keeps the rule SET it was placed with: an edit takes the
|
|
26
|
+
* discount off below the threshold and gives it above it, and later rule changes never reach
|
|
27
|
+
* it. The order minimum is checked before this discount. `orderRulesCombineWithPromotions`
|
|
28
|
+
* (off by default): on, the discount and the store's coupons and promotions add up; off, a
|
|
29
|
+
* coupon or promotion on the order wins and the list's rules step aside for that order.
|
|
30
|
+
* - **Times** are ISO-8601 instants in UTC (`startsAt`, `endsAt`).
|
|
31
|
+
* - **A list locked to an order** (an order's one-time discount, read as `Order.priceList`) is
|
|
32
|
+
* never answered here: `get` answers `null`, and every write refuses it
|
|
33
|
+
* `PRICE_LIST_LOCKED_TO_ORDER` (`BusinessRuleError`, 422). Change it from its order
|
|
34
|
+
* (`orders.setOneTimeDiscounts`).
|
|
35
|
+
* - **Organizations:** a price list is the store's own row; a workspace's lists price only the
|
|
36
|
+
* workspace.
|
|
37
|
+
*
|
|
38
|
+
* Permissions: reads need `ReadCatalog`, writes `UpdateCatalog` (deleting too, as the engine's
|
|
39
|
+
* single door asks). The names behind assignments also need `ReadCustomer` (a customer) or
|
|
40
|
+
* `ReadCustomer`/`ReadCustomerGroup` (a group); without it the name is `null` and the id stays.
|
|
41
|
+
*/
|
|
42
|
+
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
43
|
+
import type { Call, ListOptions } from '../types.js';
|
|
44
|
+
export type PriceListDiscountType = 'fixed_price' | 'percentage' | 'fixed_amount' | 'chain';
|
|
45
|
+
export type PriceListTargetType = 'variant' | 'product' | 'collection' | 'facet_value';
|
|
46
|
+
export type PriceListOrderRuleDiscountType = 'percentage' | 'fixed_amount';
|
|
47
|
+
export type PriceListOrderRuleConditionType = 'min_order_total' | 'min_order_quantity';
|
|
48
|
+
/** Which total `minOrderAmount` is compared in: tax-exclusive (`net`) or tax-inclusive. */
|
|
49
|
+
export type PriceListMinOrderAmountBasis = 'net' | 'gross';
|
|
50
|
+
/**
|
|
51
|
+
* What a list search matches the term against:
|
|
52
|
+
* - `all` (the default): every facet below;
|
|
53
|
+
* - `name`: the list's own name and description;
|
|
54
|
+
* - `sku`: lists pricing a variant whose SKU STARTS WITH the term;
|
|
55
|
+
* - `product`: lists pricing a product or variant whose name contains the term;
|
|
56
|
+
* - `customer`: lists assigned to a matching customer, directly or through a group holding them
|
|
57
|
+
* (or a group whose name matches).
|
|
58
|
+
* `sku` and `product` reach a list through variant, product, collection and facet-value entries
|
|
59
|
+
* alike. A list that prices everything (a default discount, or assigned to every customer) is
|
|
60
|
+
* never matched: it would answer every search.
|
|
61
|
+
*/
|
|
62
|
+
export declare const PRICE_LIST_SEARCH_MODES: readonly ["all", "name", "sku", "product", "customer"];
|
|
63
|
+
export type PriceListSearchMode = (typeof PRICE_LIST_SEARCH_MODES)[number];
|
|
64
|
+
/** What an entries search matches: the entry's own label, or (`sku`) every entry pricing the SKU. */
|
|
65
|
+
export declare const PRICE_LIST_ENTRY_SEARCH_MODES: readonly ["all", "sku"];
|
|
66
|
+
export type PriceListEntrySearchMode = (typeof PRICE_LIST_ENTRY_SEARCH_MODES)[number];
|
|
67
|
+
/** The engine's `adminListQueryLimit`: a larger page of lists is refused. */
|
|
68
|
+
export declare const MAX_PRICE_LIST_LIST_TAKE = 1000;
|
|
69
|
+
/** The largest page of entries the engine answers. */
|
|
70
|
+
export declare const MAX_PRICE_LIST_ENTRY_TAKE = 200;
|
|
71
|
+
/** How many entries `entries.export` answers at most; `total` still counts every match. */
|
|
72
|
+
export declare const MAX_PRICE_LIST_ENTRY_EXPORT = 10000;
|
|
73
|
+
/** How many lists one `bulk` call may name. */
|
|
74
|
+
export declare const MAX_BULK_PRICE_LISTS = 100;
|
|
75
|
+
/** A search term shorter than this is ignored by the engine: the whole list answers. */
|
|
76
|
+
export declare const PRICE_LIST_SEARCH_MIN_TERM_LENGTH = 2;
|
|
77
|
+
/** How many entries `forCustomer` answers per list at most (`entriesTake`). */
|
|
78
|
+
export declare const MAX_CUSTOMER_PRICE_LIST_ENTRIES = 100;
|
|
79
|
+
/** One reason a list appeared in a search. */
|
|
80
|
+
export interface PriceListSearchMatch {
|
|
81
|
+
/** `name`, `variant`, `product`, `collection`, `facet_value`, `customer` or `customer_group`. */
|
|
82
|
+
kind: string;
|
|
83
|
+
/** The matched thing, as the merchant would recognise it (SKU, product name, customer name…). */
|
|
84
|
+
label: string;
|
|
85
|
+
}
|
|
86
|
+
/** A customer group a list is assigned to. */
|
|
87
|
+
export interface PriceListAssignmentGroup {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
}
|
|
91
|
+
/** A customer a list is assigned to. */
|
|
92
|
+
export interface PriceListAssignmentCustomer {
|
|
93
|
+
id: string;
|
|
94
|
+
firstName: string;
|
|
95
|
+
lastName: string;
|
|
96
|
+
emailAddress: string;
|
|
97
|
+
/**
|
|
98
|
+
* The company of the default billing address, else of the default shipping address, else of
|
|
99
|
+
* the first address that names one; `null` when none does.
|
|
100
|
+
*/
|
|
101
|
+
company: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Set when the caller's customer-data level blanked fields of this customer (an app installation
|
|
104
|
+
* below `customerData: full`): `""` and `null` then mean "not granted".
|
|
105
|
+
*/
|
|
106
|
+
redacted?: true;
|
|
107
|
+
}
|
|
108
|
+
/** Who a list applies to: one customer group or one customer, by id. */
|
|
109
|
+
export interface PriceListAssignmentRef {
|
|
110
|
+
id: string;
|
|
111
|
+
priceListId: string;
|
|
112
|
+
/** Exactly one of the two is set. */
|
|
113
|
+
customerGroupId: string | null;
|
|
114
|
+
customerId: string | null;
|
|
115
|
+
}
|
|
116
|
+
/** An assignment with the name behind it, as `get`, `create`, `update` and `assign` answer it. */
|
|
117
|
+
export interface PriceListAssignment extends PriceListAssignmentRef {
|
|
118
|
+
/**
|
|
119
|
+
* The group, when the assignment names one this store holds and the caller may read customer
|
|
120
|
+
* groups (`ReadCustomer` or `ReadCustomerGroup`); otherwise `null` (`customerGroupId` still
|
|
121
|
+
* names it).
|
|
122
|
+
*/
|
|
123
|
+
customerGroup: PriceListAssignmentGroup | null;
|
|
124
|
+
/**
|
|
125
|
+
* The customer, when the assignment names one this store holds (not deleted) and the caller may
|
|
126
|
+
* read customers (`ReadCustomer`); otherwise `null` (`customerId` still names them).
|
|
127
|
+
*/
|
|
128
|
+
customer: PriceListAssignmentCustomer | null;
|
|
129
|
+
/** ISO-8601 UTC. */
|
|
130
|
+
createdAt: string;
|
|
131
|
+
/** ISO-8601 UTC. */
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
}
|
|
134
|
+
/** A list's own fields. */
|
|
135
|
+
export interface PriceListFields {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
description: string | null;
|
|
139
|
+
/** A contract list outranks every customer, group and channel-wide list. */
|
|
140
|
+
isContract: boolean;
|
|
141
|
+
/** Higher first, within the list's rank (contract → customer → group → channel-wide). */
|
|
142
|
+
priority: number;
|
|
143
|
+
/** A blanket discount on everything the list does not price otherwise, in basis points. */
|
|
144
|
+
defaultDiscountBps: number | null;
|
|
145
|
+
/** ISO-8601 UTC; `null`: from always. */
|
|
146
|
+
startsAt: string | null;
|
|
147
|
+
/** ISO-8601 UTC; `null`: for ever. */
|
|
148
|
+
endsAt: string | null;
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
/** The list applies to every customer of the store, signed in or not. */
|
|
151
|
+
appliesToAllCustomers: boolean;
|
|
152
|
+
/** Invoice payment terms in days (0-365); `null`: the customer's own. */
|
|
153
|
+
paymentTermsDays: number | null;
|
|
154
|
+
/** An ERP payment-condition code instead of days (never both). */
|
|
155
|
+
paymentTermsCode: string | null;
|
|
156
|
+
/** The order minimum, in minor units compared in `minOrderAmountBasis`; `null`: none. */
|
|
157
|
+
minOrderAmount: number | null;
|
|
158
|
+
minOrderAmountBasis: PriceListMinOrderAmountBasis;
|
|
159
|
+
/** The fewest items an order may hold; `null`: none. */
|
|
160
|
+
minOrderQuantity: number | null;
|
|
161
|
+
/**
|
|
162
|
+
* May this list's order-rule discount be combined with the store's coupons and other
|
|
163
|
+
* promotions? Off (the default): a coupon or another promotion on the order wins, and the
|
|
164
|
+
* order-rule discount is dropped for that order (see **Order rules apply** in the module
|
|
165
|
+
* header).
|
|
166
|
+
*/
|
|
167
|
+
orderRulesCombineWithPromotions: boolean;
|
|
168
|
+
/** ISO-8601 UTC. */
|
|
169
|
+
createdAt: string;
|
|
170
|
+
/** ISO-8601 UTC. */
|
|
171
|
+
updatedAt: string;
|
|
172
|
+
}
|
|
173
|
+
/** A list with its assignments and the names behind them. */
|
|
174
|
+
export interface PriceList extends PriceListFields {
|
|
175
|
+
assignments: PriceListAssignment[];
|
|
176
|
+
}
|
|
177
|
+
/** One list as `list` answers it: its assignments by id, and why a search matched it. */
|
|
178
|
+
export interface PriceListListItem extends PriceListFields {
|
|
179
|
+
assignments: PriceListAssignmentRef[];
|
|
180
|
+
/** Why the list matched the search, capped for display; empty outside a search. */
|
|
181
|
+
searchMatches: PriceListSearchMatch[];
|
|
182
|
+
/** How many reasons there were before the cap (`>= searchMatches.length`); 0 outside a search. */
|
|
183
|
+
searchMatchCount: number;
|
|
184
|
+
/**
|
|
185
|
+
* Set when the caller's customer-data level withheld a match label that names a customer (an
|
|
186
|
+
* app below `customerData: full`).
|
|
187
|
+
*/
|
|
188
|
+
redacted?: true;
|
|
189
|
+
}
|
|
190
|
+
export interface PriceListListOptions extends ListOptions {
|
|
191
|
+
/** Lists to skip, 0 when omitted. Not together with `after`. */
|
|
192
|
+
skip?: number;
|
|
193
|
+
/** Lists per page, 1 to {@link MAX_PRICE_LIST_LIST_TAKE}; `limit`, else 25, when omitted. */
|
|
194
|
+
take?: number;
|
|
195
|
+
/** Find lists by what they contain (see {@link PriceListSearchMode}); trimmed. */
|
|
196
|
+
search?: string;
|
|
197
|
+
/** `all` when omitted. */
|
|
198
|
+
searchMode?: PriceListSearchMode;
|
|
199
|
+
/** Only the lists assigned to one customer or one customer group (see {@link PriceListAssignedTo}). */
|
|
200
|
+
assignedTo?: PriceListAssignedTo;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The lists an assignment names for ONE target: a customer (assigned to them directly, never
|
|
204
|
+
* through one of their groups) or a customer group; plus, with `includeChannelWide`, the store's
|
|
205
|
+
* lists for every customer. Assignment state only: a disabled or out-of-window list is listed
|
|
206
|
+
* too. What applies to a customer now, through their groups as well, is
|
|
207
|
+
* {@link PricingPriceListsModule.forCustomer}.
|
|
208
|
+
*/
|
|
209
|
+
export type PriceListAssignedTo = {
|
|
210
|
+
customerId: string;
|
|
211
|
+
customerGroupId?: never;
|
|
212
|
+
includeChannelWide?: boolean;
|
|
213
|
+
} | {
|
|
214
|
+
customerGroupId: string;
|
|
215
|
+
customerId?: never;
|
|
216
|
+
includeChannelWide?: boolean;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* How a list reaches a customer, strongest first: assigned to them (`customer`), to one of their
|
|
220
|
+
* groups (`group`), or to every customer of the store (`channel`).
|
|
221
|
+
*/
|
|
222
|
+
export type CustomerPriceListAssignmentType = 'customer' | 'group' | 'channel';
|
|
223
|
+
/** One list that applies to a customer, as {@link PricingPriceListsModule.forCustomer} answers it. */
|
|
224
|
+
export interface CustomerPriceList {
|
|
225
|
+
/** The list's own fields (its assignments are read with `get`). */
|
|
226
|
+
priceList: PriceListFields;
|
|
227
|
+
/** One of {@link CustomerPriceListAssignmentType}; a later engine may add a kind. */
|
|
228
|
+
assignmentType: CustomerPriceListAssignmentType | (string & {});
|
|
229
|
+
/**
|
|
230
|
+
* The list's first entries (`entriesTake`), ordered and labelled as `entries.list` answers
|
|
231
|
+
* them; `total` counts every entry, so `items.length < total` says the list was cut.
|
|
232
|
+
*/
|
|
233
|
+
entries: {
|
|
234
|
+
items: PriceListEntry[];
|
|
235
|
+
total: number;
|
|
236
|
+
};
|
|
237
|
+
/** Its order rules, lowest condition first. How they apply: **Order rules apply** (module header). */
|
|
238
|
+
orderRules: PriceListOrderRule[];
|
|
239
|
+
}
|
|
240
|
+
export interface CustomerPriceListsOptions extends Call {
|
|
241
|
+
/** Entries per list, 1 to {@link MAX_CUSTOMER_PRICE_LIST_ENTRIES}; that maximum when omitted. */
|
|
242
|
+
entriesTake?: number;
|
|
243
|
+
}
|
|
244
|
+
export interface CreatePriceListInput {
|
|
245
|
+
name: string;
|
|
246
|
+
description?: string | null;
|
|
247
|
+
isContract?: boolean;
|
|
248
|
+
priority?: number;
|
|
249
|
+
defaultDiscountBps?: number | null;
|
|
250
|
+
startsAt?: string | null;
|
|
251
|
+
endsAt?: string | null;
|
|
252
|
+
/** On when omitted. */
|
|
253
|
+
enabled?: boolean;
|
|
254
|
+
appliesToAllCustomers?: boolean;
|
|
255
|
+
paymentTermsDays?: number | null;
|
|
256
|
+
paymentTermsCode?: string | null;
|
|
257
|
+
minOrderAmount?: number | null;
|
|
258
|
+
/** `gross` when omitted. */
|
|
259
|
+
minOrderAmountBasis?: PriceListMinOrderAmountBasis;
|
|
260
|
+
minOrderQuantity?: number | null;
|
|
261
|
+
/** Off when omitted on create; an update that omits it keeps it. */
|
|
262
|
+
orderRulesCombineWithPromotions?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/** A PATCH: an absent field keeps what the list has; `null` clears a field that may be empty. */
|
|
265
|
+
export type UpdatePriceListInput = Partial<CreatePriceListInput>;
|
|
266
|
+
/** Who to assign a list to: exactly one of the two. */
|
|
267
|
+
export type AssignPriceListTarget = {
|
|
268
|
+
customerGroupId: string;
|
|
269
|
+
} | {
|
|
270
|
+
customerId: string;
|
|
271
|
+
};
|
|
272
|
+
export interface PriceListEntry {
|
|
273
|
+
id: string;
|
|
274
|
+
priceListId: string;
|
|
275
|
+
discountType: PriceListDiscountType;
|
|
276
|
+
targetType: PriceListTargetType;
|
|
277
|
+
variantId: string | null;
|
|
278
|
+
productId: string | null;
|
|
279
|
+
collectionId: string | null;
|
|
280
|
+
facetValueId: string | null;
|
|
281
|
+
/**
|
|
282
|
+
* Minor units for `fixed_price` and `fixed_amount`, basis points for `percentage`; `null` for a
|
|
283
|
+
* `chain` (see `chainValues`).
|
|
284
|
+
*/
|
|
285
|
+
discountValue: number | null;
|
|
286
|
+
/** A chain discount's percentages, applied one after another, in basis points. */
|
|
287
|
+
chainValues: number[] | null;
|
|
288
|
+
/** The entry applies from this quantity on (a volume tier); 1 by default. */
|
|
289
|
+
minQuantity: number;
|
|
290
|
+
/** The currency a money entry is in; `null`: the store's default currency only. */
|
|
291
|
+
currencyCode: string | null;
|
|
292
|
+
/** A variant entry's label (product and variant name); `null` for other targets. */
|
|
293
|
+
variantName: string | null;
|
|
294
|
+
variantSku: string | null;
|
|
295
|
+
/** A product, collection or facet value entry's label; `null` for a variant. */
|
|
296
|
+
targetName: string | null;
|
|
297
|
+
/** ISO-8601 UTC. */
|
|
298
|
+
createdAt: string;
|
|
299
|
+
/** ISO-8601 UTC. */
|
|
300
|
+
updatedAt: string;
|
|
301
|
+
}
|
|
302
|
+
/** An entry as `entries.bulkSet` answers it: without labels, which would cost a read per row. */
|
|
303
|
+
export type PriceListEntryWrite = Omit<PriceListEntry, 'variantName' | 'variantSku' | 'targetName'>;
|
|
304
|
+
/** What the entries of one list can be narrowed by. Several combine with AND. */
|
|
305
|
+
export interface PriceListEntryFilter {
|
|
306
|
+
targetType?: PriceListTargetType;
|
|
307
|
+
/** Free text; trimmed, and ignored below {@link PRICE_LIST_SEARCH_MIN_TERM_LENGTH}. */
|
|
308
|
+
search?: string;
|
|
309
|
+
/** `all` when omitted. */
|
|
310
|
+
searchMode?: PriceListEntrySearchMode;
|
|
311
|
+
/** Entries pricing one of these collections OR one of `facetValueIds` (one which-target group). */
|
|
312
|
+
collectionIds?: readonly string[];
|
|
313
|
+
facetValueIds?: readonly string[];
|
|
314
|
+
}
|
|
315
|
+
export interface PriceListEntryListOptions extends ListOptions, PriceListEntryFilter {
|
|
316
|
+
/** Entries to skip, 0 when omitted. Not together with `after`. */
|
|
317
|
+
skip?: number;
|
|
318
|
+
/** Entries per page, 1 to {@link MAX_PRICE_LIST_ENTRY_TAKE}; `limit`, else 50, when omitted. */
|
|
319
|
+
take?: number;
|
|
320
|
+
}
|
|
321
|
+
export interface SetPriceListEntryInput {
|
|
322
|
+
discountType: PriceListDiscountType;
|
|
323
|
+
targetType: PriceListTargetType;
|
|
324
|
+
/** The target of a `variant` entry; the other three likewise for their type. */
|
|
325
|
+
variantId?: string;
|
|
326
|
+
productId?: string;
|
|
327
|
+
collectionId?: string;
|
|
328
|
+
facetValueId?: string;
|
|
329
|
+
discountValue?: number;
|
|
330
|
+
chainValues?: number[];
|
|
331
|
+
/** 1 when omitted. */
|
|
332
|
+
minQuantity?: number;
|
|
333
|
+
/** The store's default currency when omitted. */
|
|
334
|
+
currencyCode?: string;
|
|
335
|
+
}
|
|
336
|
+
/** One filter chip: what it filters by, its label, and how many entries it covers. */
|
|
337
|
+
export interface PriceListEntryFacetCount {
|
|
338
|
+
id: string;
|
|
339
|
+
label: string;
|
|
340
|
+
count: number;
|
|
341
|
+
}
|
|
342
|
+
/** Counts for an entries filter row, scoped to the search term only (never to a chip). */
|
|
343
|
+
export interface PriceListEntryFacets {
|
|
344
|
+
/** Always the four target types, zero counts included. */
|
|
345
|
+
targetTypes: PriceListEntryFacetCount[];
|
|
346
|
+
collections: PriceListEntryFacetCount[];
|
|
347
|
+
facetValues: PriceListEntryFacetCount[];
|
|
348
|
+
/** Entries matching the term, before any chip or type filter. */
|
|
349
|
+
total: number;
|
|
350
|
+
}
|
|
351
|
+
export interface PriceListOrderRule {
|
|
352
|
+
id: string;
|
|
353
|
+
priceListId: string;
|
|
354
|
+
discountType: PriceListOrderRuleDiscountType;
|
|
355
|
+
conditionType: PriceListOrderRuleConditionType;
|
|
356
|
+
/** Minor units for `min_order_total`, an item count for `min_order_quantity`. */
|
|
357
|
+
conditionValue: number;
|
|
358
|
+
/** Basis points for `percentage`, minor units for `fixed_amount`. */
|
|
359
|
+
discountValue: number;
|
|
360
|
+
/** ISO-8601 UTC. */
|
|
361
|
+
createdAt: string;
|
|
362
|
+
/** ISO-8601 UTC. */
|
|
363
|
+
updatedAt: string;
|
|
364
|
+
}
|
|
365
|
+
export interface SetPriceListOrderRuleInput {
|
|
366
|
+
discountType: PriceListOrderRuleDiscountType;
|
|
367
|
+
conditionType: PriceListOrderRuleConditionType;
|
|
368
|
+
conditionValue: number;
|
|
369
|
+
discountValue: number;
|
|
370
|
+
}
|
|
371
|
+
export type PriceListBulkAction = 'ENABLE' | 'DISABLE' | 'DELETE';
|
|
372
|
+
export declare const PRICE_LIST_BULK_ACTIONS: readonly PriceListBulkAction[];
|
|
373
|
+
export interface PriceListBulkInput {
|
|
374
|
+
action: PriceListBulkAction;
|
|
375
|
+
/** 1 to {@link MAX_BULK_PRICE_LISTS} lists of the store, each named once. */
|
|
376
|
+
priceListIds: readonly string[];
|
|
377
|
+
}
|
|
378
|
+
/** One list's outcome in a `bulk` call. */
|
|
379
|
+
export interface PriceListBulkOutcome {
|
|
380
|
+
id: string;
|
|
381
|
+
/** `OK`, or `FAILED` (a string on the wire: read anything else as not done). */
|
|
382
|
+
status: 'OK' | 'FAILED' | (string & {});
|
|
383
|
+
/**
|
|
384
|
+
* When FAILED: the single door's own code: `ENTITY_NOT_FOUND` (no such list in this store),
|
|
385
|
+
* `PRICE_LIST_LOCKED_TO_ORDER`, …; `INTERNAL_SERVER_ERROR` for a fault the engine logged.
|
|
386
|
+
*/
|
|
387
|
+
code: string | null;
|
|
388
|
+
/** When FAILED: the door's sentence. */
|
|
389
|
+
message: string | null;
|
|
390
|
+
}
|
|
391
|
+
export interface PricingPriceListEntriesModule {
|
|
392
|
+
/**
|
|
393
|
+
* One page of a list's entries, as the engine orders them (target type, then label), each with
|
|
394
|
+
* its label. `total` counts every match. A list the store does not hold, or one locked to an
|
|
395
|
+
* order, answers an empty page.
|
|
396
|
+
*
|
|
397
|
+
* @effect read
|
|
398
|
+
* @permission ReadCatalog
|
|
399
|
+
*/
|
|
400
|
+
list(priceListId: string, options?: PriceListEntryListOptions): Promise<Page<PriceListEntry>>;
|
|
401
|
+
/**
|
|
402
|
+
* Every entry matching `filter`, up to {@link MAX_PRICE_LIST_ENTRY_EXPORT}, in one call (for a
|
|
403
|
+
* file export). `total` counts every match, so `items.length < total` says the export was cut.
|
|
404
|
+
*
|
|
405
|
+
* @effect read
|
|
406
|
+
* @permission ReadCatalog
|
|
407
|
+
*/
|
|
408
|
+
export(priceListId: string, filter?: PriceListEntryFilter, options?: Call): Promise<{
|
|
409
|
+
items: PriceListEntry[];
|
|
410
|
+
total: number;
|
|
411
|
+
}>;
|
|
412
|
+
/**
|
|
413
|
+
* The counts for a filter row, for the search term only (a chip never narrows its own count).
|
|
414
|
+
* A list the store does not hold answers zero counts.
|
|
415
|
+
*
|
|
416
|
+
* @effect read
|
|
417
|
+
* @permission ReadCatalog
|
|
418
|
+
*/
|
|
419
|
+
facets(priceListId: string, search?: {
|
|
420
|
+
search?: string;
|
|
421
|
+
searchMode?: PriceListEntrySearchMode;
|
|
422
|
+
}, options?: Call): Promise<PriceListEntryFacets>;
|
|
423
|
+
/**
|
|
424
|
+
* Add an entry, or change the one with the same target, minimum quantity and currency, and
|
|
425
|
+
* answer it with its label. The target must be the store's (`ENTITY_NOT_FOUND` otherwise, the
|
|
426
|
+
* same as an unknown id); an entry naming no target of its type, or an unknown type, is refused
|
|
427
|
+
* `PRICE_LIST_ENTRY_INVALID` (400) with `details` naming the field.
|
|
428
|
+
*
|
|
429
|
+
* @effect write
|
|
430
|
+
* @permission UpdateCatalog
|
|
431
|
+
*/
|
|
432
|
+
set(priceListId: string, input: SetPriceListEntryInput, options?: Call): Promise<PriceListEntry>;
|
|
433
|
+
/**
|
|
434
|
+
* {@link set} for many entries in ONE transaction: one refused entry writes none of them.
|
|
435
|
+
* Answers the entries without labels (see {@link PriceListEntryWrite}).
|
|
436
|
+
*
|
|
437
|
+
* @effect write
|
|
438
|
+
* @permission UpdateCatalog
|
|
439
|
+
*/
|
|
440
|
+
bulkSet(priceListId: string, entries: readonly SetPriceListEntryInput[], options?: Call): Promise<PriceListEntryWrite[]>;
|
|
441
|
+
/**
|
|
442
|
+
* Delete one entry: the price it gave goes back to the next list or the catalogue price.
|
|
443
|
+
* `ENTITY_NOT_FOUND` for an entry the store does not hold.
|
|
444
|
+
*
|
|
445
|
+
* @effect destructive
|
|
446
|
+
* @permission UpdateCatalog
|
|
447
|
+
*/
|
|
448
|
+
remove(entryId: string, options?: Call): Promise<void>;
|
|
449
|
+
}
|
|
450
|
+
export interface PricingPriceListOrderRulesModule {
|
|
451
|
+
/**
|
|
452
|
+
* A list's order rules (an order-level discount from a total or a quantity), lowest condition
|
|
453
|
+
* first. `[]` for a list the store does not hold. How they apply: **Order rules apply** in the
|
|
454
|
+
* module header.
|
|
455
|
+
*
|
|
456
|
+
* @effect read
|
|
457
|
+
* @permission ReadCatalog
|
|
458
|
+
*/
|
|
459
|
+
list(priceListId: string, options?: Call): Promise<PriceListOrderRule[]>;
|
|
460
|
+
/**
|
|
461
|
+
* ADD an order rule to a list and answer it (a list may hold several; remove one with
|
|
462
|
+
* {@link remove}). From then on it discounts the qualifying orders of the list's customers
|
|
463
|
+
* (module header); a placed order keeps the rules it was placed with.
|
|
464
|
+
* Refused `PRICE_LIST_ORDER_RULE_INVALID` (400), `details` naming every offending field: a
|
|
465
|
+
* `discountType` or `conditionType` the engine does not know, a value that is not a whole
|
|
466
|
+
* number, a negative `conditionValue` or one past its bound (1,000,000.00 for a total, 1,000,000
|
|
467
|
+
* items for a quantity), a `discountValue` below 1, a percentage above 10,000 basis points
|
|
468
|
+
* (100 %), or a fixed amount past 1,000,000.00. Nothing is saved. A value that is not a whole
|
|
469
|
+
* number or does not fit 32 bits (which GraphQL's `Int` would refuse uncoded) is refused the same
|
|
470
|
+
* way before anything is sent. Also `ENTITY_NOT_FOUND` and `PRICE_LIST_LOCKED_TO_ORDER`.
|
|
471
|
+
*
|
|
472
|
+
* @effect write
|
|
473
|
+
* @permission UpdateCatalog
|
|
474
|
+
*/
|
|
475
|
+
set(priceListId: string, input: SetPriceListOrderRuleInput, options?: Call): Promise<PriceListOrderRule>;
|
|
476
|
+
/**
|
|
477
|
+
* Delete one order rule. `ENTITY_NOT_FOUND` for a rule the store does not hold.
|
|
478
|
+
*
|
|
479
|
+
* @effect destructive
|
|
480
|
+
* @permission UpdateCatalog
|
|
481
|
+
*/
|
|
482
|
+
remove(ruleId: string, options?: Call): Promise<void>;
|
|
483
|
+
}
|
|
484
|
+
export interface PricingPriceListsModule {
|
|
485
|
+
/**
|
|
486
|
+
* One page of the store's lists, highest priority first (newest first within one priority),
|
|
487
|
+
* each with its assignments by id. With `search`, the lists matching it (see
|
|
488
|
+
* {@link PriceListSearchMode}) and why (`searchMatches`); with `assignedTo`, only the lists
|
|
489
|
+
* assigned to that customer or group (see {@link PriceListAssignedTo}).
|
|
490
|
+
*
|
|
491
|
+
* Refused before anything is sent: `INVALID_PRICE_LIST_LIST_OPTIONS` (`ValidationError`, 400)
|
|
492
|
+
* for a `take` outside 1 to {@link MAX_PRICE_LIST_LIST_TAKE}, a negative `skip`, or an
|
|
493
|
+
* `assignedTo` naming not exactly one of `customerId` and `customerGroupId`. The engine refuses
|
|
494
|
+
* the same with the same code. `assignedTo` needs an engine with `PriceListListOptions.filter`.
|
|
495
|
+
*
|
|
496
|
+
* @effect read
|
|
497
|
+
* @permission ReadCatalog
|
|
498
|
+
*/
|
|
499
|
+
list(options?: PriceListListOptions): Promise<Page<PriceListListItem>>;
|
|
500
|
+
/**
|
|
501
|
+
* The lists that apply to a customer of the store NOW, IN THE ORDER the price-list pricing
|
|
502
|
+
* tries them for each line: contracts first, then assigned to the customer, through one of
|
|
503
|
+
* their groups, to every customer; then higher priority first. Only enabled lists inside their
|
|
504
|
+
* date window, every list of the store considered; never an order's one-time discount (read
|
|
505
|
+
* that as `Order.priceList`). Each comes with its first entries and its order rules. The
|
|
506
|
+
* engine ranks them with the function its pricing uses, so a client never re-derives it.
|
|
507
|
+
*
|
|
508
|
+
* Refused: `ENTITY_NOT_FOUND` (`NotFoundError`, 404) for a customer the store does not hold
|
|
509
|
+
* (another store's, a deleted one, an unknown id: one answer); `FORBIDDEN` without
|
|
510
|
+
* `ReadCustomer`; `INVALID_PRICE_LIST_LIST_OPTIONS` (400) for an `entriesTake` outside 1 to
|
|
511
|
+
* {@link MAX_CUSTOMER_PRICE_LIST_ENTRIES}, before anything is sent. Needs an engine with
|
|
512
|
+
* `customerPriceLists`.
|
|
513
|
+
*
|
|
514
|
+
* @effect read
|
|
515
|
+
* @permission ReadCatalog
|
|
516
|
+
* @permission ReadCustomer
|
|
517
|
+
*/
|
|
518
|
+
forCustomer(customerId: string, options?: CustomerPriceListsOptions): Promise<CustomerPriceList[]>;
|
|
519
|
+
/**
|
|
520
|
+
* One list with its assignments and the names behind them, read in one call; `null` for a list
|
|
521
|
+
* the store does not hold or one locked to an order.
|
|
522
|
+
*
|
|
523
|
+
* @effect read
|
|
524
|
+
* @permission ReadCatalog
|
|
525
|
+
*/
|
|
526
|
+
get(id: string, options?: Call): Promise<PriceList | null>;
|
|
527
|
+
/**
|
|
528
|
+
* Create a list. Refused: payment terms the engine does not accept (`PAYMENT_TERMS_INVALID`,
|
|
529
|
+
* 400, `details` naming the field) and an order minimum it does not accept
|
|
530
|
+
* (`ORDER_MINIMUM_INVALID`, 400).
|
|
531
|
+
*
|
|
532
|
+
* @effect write
|
|
533
|
+
* @permission UpdateCatalog
|
|
534
|
+
*/
|
|
535
|
+
create(input: CreatePriceListInput, options?: Call): Promise<PriceList>;
|
|
536
|
+
/**
|
|
537
|
+
* Change a list (a PATCH). Refused as {@link create}, plus `ENTITY_NOT_FOUND` for a list the
|
|
538
|
+
* store does not hold and `PRICE_LIST_LOCKED_TO_ORDER`.
|
|
539
|
+
*
|
|
540
|
+
* @effect write
|
|
541
|
+
* @permission UpdateCatalog
|
|
542
|
+
*/
|
|
543
|
+
update(id: string, input: UpdatePriceListInput, options?: Call): Promise<PriceList>;
|
|
544
|
+
/**
|
|
545
|
+
* Delete a list with its assignments, entries and order rules: its customers pay what the next
|
|
546
|
+
* list or the catalogue says. `ENTITY_NOT_FOUND`, `PRICE_LIST_LOCKED_TO_ORDER`.
|
|
547
|
+
*
|
|
548
|
+
* @effect destructive
|
|
549
|
+
* @permission UpdateCatalog
|
|
550
|
+
*/
|
|
551
|
+
delete(id: string, options?: Call): Promise<void>;
|
|
552
|
+
/**
|
|
553
|
+
* Assign a list to a customer group or a customer of the store, and answer the assignment with
|
|
554
|
+
* the name behind it. Refused: another store's (or an unknown) customer or group
|
|
555
|
+
* (`ENTITY_NOT_FOUND`), the same target twice (`USER_INPUT_ERROR`, naming the list),
|
|
556
|
+
* `PRICE_LIST_LOCKED_TO_ORDER`.
|
|
557
|
+
*
|
|
558
|
+
* @effect write
|
|
559
|
+
* @permission UpdateCatalog
|
|
560
|
+
*/
|
|
561
|
+
assign(priceListId: string, target: AssignPriceListTarget, options?: Call): Promise<PriceListAssignment>;
|
|
562
|
+
/**
|
|
563
|
+
* Remove an assignment: its customers stop getting the list's prices.
|
|
564
|
+
* `ENTITY_NOT_FOUND` for an assignment the store does not hold.
|
|
565
|
+
*
|
|
566
|
+
* @effect destructive
|
|
567
|
+
* @permission UpdateCatalog
|
|
568
|
+
*/
|
|
569
|
+
unassign(assignmentId: string, options?: Call): Promise<void>;
|
|
570
|
+
/**
|
|
571
|
+
* Enable, disable or delete many lists in one call. Each list goes through its single door's
|
|
572
|
+
* rules in a transaction of its own and is reported on its own, in the order named: a refused
|
|
573
|
+
* list (`ENTITY_NOT_FOUND`, `PRICE_LIST_LOCKED_TO_ORDER`) changes nothing, and the others still
|
|
574
|
+
* go through. A selection of no list, more than {@link MAX_BULK_PRICE_LISTS} or a list named
|
|
575
|
+
* twice is refused `BULK_ACTION_INPUT_INVALID` (400) before anything is sent. Not keyed: a
|
|
576
|
+
* repeat enables or disables again, and deletes nothing twice (`ENTITY_NOT_FOUND`).
|
|
577
|
+
*
|
|
578
|
+
* @effect destructive
|
|
579
|
+
* @permission UpdateCatalog
|
|
580
|
+
*/
|
|
581
|
+
bulk(input: PriceListBulkInput, options?: Call): Promise<PriceListBulkOutcome[]>;
|
|
582
|
+
entries: PricingPriceListEntriesModule;
|
|
583
|
+
orderRules: PricingPriceListOrderRulesModule;
|
|
584
|
+
}
|
|
585
|
+
/** A list as `get`, `create` and `update` read it: with its assignments' names. */
|
|
586
|
+
export declare const PRICE_LIST_FIELDS = "\n \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n\n assignments { \n id\n priceListId\n customerGroupId\n customerId\n customerGroup {\n id\n name\n }\n customer {\n id\n firstName\n lastName\n emailAddress\n company\n }\n createdAt\n updatedAt\n }\n";
|
|
587
|
+
export declare const PRICE_LISTS_QUERY = "\n query PriceLists($options: PriceListListOptions) {\n priceLists(options: $options) {\n items {\n \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n\n assignments {\n id\n priceListId\n customerGroupId\n customerId\n }\n searchMatches {\n kind\n label\n }\n searchMatchCount\n }\n totalItems\n }\n }\n";
|
|
588
|
+
export declare const PRICE_LIST_QUERY = "\n query PriceList($id: ID!) {\n priceList(id: $id) { \n \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n\n assignments { \n id\n priceListId\n customerGroupId\n customerId\n customerGroup {\n id\n name\n }\n customer {\n id\n firstName\n lastName\n emailAddress\n company\n }\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
589
|
+
export declare const CREATE_PRICE_LIST_MUTATION = "\n mutation CreatePriceList($input: CreatePriceListInput!) {\n createPriceList(input: $input) { \n \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n\n assignments { \n id\n priceListId\n customerGroupId\n customerId\n customerGroup {\n id\n name\n }\n customer {\n id\n firstName\n lastName\n emailAddress\n company\n }\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
590
|
+
export declare const UPDATE_PRICE_LIST_MUTATION = "\n mutation UpdatePriceList($id: ID!, $input: UpdatePriceListInput!) {\n updatePriceList(id: $id, input: $input) { \n \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n\n assignments { \n id\n priceListId\n customerGroupId\n customerId\n customerGroup {\n id\n name\n }\n customer {\n id\n firstName\n lastName\n emailAddress\n company\n }\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
591
|
+
export declare const DELETE_PRICE_LIST_MUTATION = "\n mutation DeletePriceList($id: ID!) {\n deletePriceList(id: $id) { \n result\n message\n }\n }\n";
|
|
592
|
+
export declare const ASSIGN_PRICE_LIST_MUTATION = "\n mutation AssignPriceList($priceListId: ID!, $input: AssignPriceListInput!) {\n assignPriceList(priceListId: $priceListId, input: $input) { \n id\n priceListId\n customerGroupId\n customerId\n customerGroup {\n id\n name\n }\n customer {\n id\n firstName\n lastName\n emailAddress\n company\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
593
|
+
export declare const UNASSIGN_PRICE_LIST_MUTATION = "\n mutation UnassignPriceList($assignmentId: ID!) {\n unassignPriceList(assignmentId: $assignmentId) { \n result\n message\n }\n }\n";
|
|
594
|
+
export declare const BULK_PRICE_LIST_ACTION_MUTATION = "\n mutation BulkPriceListAction($input: BulkPriceListActionInput!) {\n bulkPriceListAction(input: $input) {\n items {\n id\n status\n code\n message\n }\n }\n }\n";
|
|
595
|
+
export declare const PRICE_LIST_ENTRIES_QUERY = "\n query PriceListEntries($priceListId: ID!, $options: PriceListEntryListOptions) {\n priceListEntries(priceListId: $priceListId, options: $options) {\n items { \n \n id\n priceListId\n discountType\n targetType\n variantId\n productId\n collectionId\n facetValueId\n discountValue\n chainValues\n minQuantity\n currencyCode\n createdAt\n updatedAt\n\n variantName\n variantSku\n targetName\n }\n totalItems\n }\n }\n";
|
|
596
|
+
export declare const PRICE_LIST_ENTRY_FACETS_QUERY = "\n query PriceListEntryFacets($priceListId: ID!, $search: String, $searchMode: String) {\n priceListEntryFacets(priceListId: $priceListId, search: $search, searchMode: $searchMode) {\n targetTypes { id label count }\n collections { id label count }\n facetValues { id label count }\n total\n }\n }\n";
|
|
597
|
+
export declare const SET_PRICE_LIST_ENTRY_MUTATION = "\n mutation SetPriceListEntry($priceListId: ID!, $input: SetPriceListEntryInput!) {\n setPriceListEntry(priceListId: $priceListId, input: $input) { \n \n id\n priceListId\n discountType\n targetType\n variantId\n productId\n collectionId\n facetValueId\n discountValue\n chainValues\n minQuantity\n currencyCode\n createdAt\n updatedAt\n\n variantName\n variantSku\n targetName\n }\n }\n";
|
|
598
|
+
export declare const BULK_SET_PRICE_LIST_ENTRIES_MUTATION = "\n mutation BulkSetPriceListEntries($priceListId: ID!, $entries: [SetPriceListEntryInput!]!) {\n bulkSetPriceListEntries(priceListId: $priceListId, entries: $entries) {\n \n id\n priceListId\n discountType\n targetType\n variantId\n productId\n collectionId\n facetValueId\n discountValue\n chainValues\n minQuantity\n currencyCode\n createdAt\n updatedAt\n\n }\n }\n";
|
|
599
|
+
export declare const REMOVE_PRICE_LIST_ENTRY_MUTATION = "\n mutation RemovePriceListEntry($id: ID!) {\n removePriceListEntry(id: $id) { \n result\n message\n }\n }\n";
|
|
600
|
+
export declare const PRICE_LIST_ORDER_RULES_QUERY = "\n query PriceListOrderRules($priceListId: ID!) {\n priceListOrderRules(priceListId: $priceListId) { \n id\n priceListId\n discountType\n conditionType\n conditionValue\n discountValue\n createdAt\n updatedAt\n }\n }\n";
|
|
601
|
+
export declare const SET_PRICE_LIST_ORDER_RULE_MUTATION = "\n mutation SetPriceListOrderRule($priceListId: ID!, $input: SetPriceListOrderRuleInput!) {\n setPriceListOrderRule(priceListId: $priceListId, input: $input) { \n id\n priceListId\n discountType\n conditionType\n conditionValue\n discountValue\n createdAt\n updatedAt\n }\n }\n";
|
|
602
|
+
export declare const REMOVE_PRICE_LIST_ORDER_RULE_MUTATION = "\n mutation RemovePriceListOrderRule($id: ID!) {\n removePriceListOrderRule(id: $id) { \n result\n message\n }\n }\n";
|
|
603
|
+
export declare const CUSTOMER_PRICE_LISTS_QUERY = "\n query CustomerPriceLists($customerId: ID!, $options: CustomerPriceListsOptions) {\n customerPriceLists(customerId: $customerId, options: $options) {\n priceList { \n id\n name\n description\n isContract\n priority\n defaultDiscountBps\n startsAt\n endsAt\n enabled\n appliesToAllCustomers\n paymentTermsDays\n paymentTermsCode\n minOrderAmount\n minOrderAmountBasis\n minOrderQuantity\n orderRulesCombineWithPromotions\n createdAt\n updatedAt\n }\n assignmentType\n entries {\n items { \n \n id\n priceListId\n discountType\n targetType\n variantId\n productId\n collectionId\n facetValueId\n discountValue\n chainValues\n minQuantity\n currencyCode\n createdAt\n updatedAt\n\n variantName\n variantSku\n targetName\n }\n totalItems\n }\n orderRules { \n id\n priceListId\n discountType\n conditionType\n conditionValue\n discountValue\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
604
|
+
export declare function createPricingPriceListsModule(transport: Transport): PricingPriceListsModule;
|