@sixtyninecommerce/admin 0.10.0 → 0.12.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 +5772 -118
- package/dist/auth/index.d.ts +7 -1
- package/dist/auth/index.js +8 -1
- 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/documents.d.ts +142 -0
- package/dist/catalog/documents.js +114 -0
- package/dist/catalog/index.d.ts +54 -6
- package/dist/catalog/index.js +10 -1
- package/dist/catalog/metadata.d.ts +244 -0
- package/dist/catalog/metadata.js +220 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +140 -14
- package/dist/catalog/properties.js +65 -1
- package/dist/catalog/recommendations.d.ts +288 -0
- package/dist/catalog/recommendations.js +237 -0
- package/dist/catalog/reviews.d.ts +381 -0
- package/dist/catalog/reviews.js +325 -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 +293 -26
- package/dist/catalog/variants.js +164 -7
- package/dist/catalog/visibility.d.ts +38 -7
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +121 -9
- package/dist/client.js +53 -14
- package/dist/content/assets.d.ts +285 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/forms.d.ts +332 -1
- package/dist/content/forms.js +140 -4
- package/dist/content/items.d.ts +292 -0
- package/dist/content/items.js +170 -0
- package/dist/content/menus.d.ts +254 -0
- package/dist/content/menus.js +70 -0
- package/dist/content/strings.d.ts +137 -0
- package/dist/content/strings.js +82 -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/delivery-terms.d.ts +44 -0
- package/dist/customers/delivery-terms.js +32 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +462 -37
- package/dist/customers/index.js +317 -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/emails.d.ts +150 -0
- package/dist/documents/emails.js +220 -0
- package/dist/documents/index.d.ts +744 -21
- package/dist/documents/index.js +438 -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 +163 -11
- package/dist/fulfillments/index.js +135 -6
- 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 +147 -39
- package/dist/index.js +51 -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 +965 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +784 -0
- package/dist/integrations/exact-online.js +1089 -0
- package/dist/integrations/index.d.ts +44 -3
- package/dist/integrations/index.js +23 -3
- package/dist/integrations/pipeline-discoveries.d.ts +65 -0
- package/dist/integrations/pipeline-discoveries.js +65 -0
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipeline-runs.d.ts +119 -0
- package/dist/integrations/pipeline-runs.js +87 -0
- package/dist/integrations/pipelines.d.ts +87 -15
- package/dist/integrations/pipelines.js +41 -22
- package/dist/integrations/price-import.d.ts +223 -0
- package/dist/integrations/price-import.js +124 -0
- package/dist/integrations/types.d.ts +367 -3
- package/dist/integrations/types.js +4 -3
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +172 -0
- package/dist/metafields/index.d.ts +8 -1
- package/dist/metafields/index.js +10 -0
- package/dist/orders/cancel-with-money.d.ts +237 -0
- package/dist/orders/cancel-with-money.js +155 -0
- package/dist/orders/commit-edit.d.ts +23 -1
- package/dist/orders/commit-edit.js +19 -2
- package/dist/orders/deposit-policy.d.ts +3 -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 +66 -15
- package/dist/orders/index.js +25 -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 +243 -0
- package/dist/orders/list.js +487 -0
- package/dist/orders/manual-discounts.d.ts +13 -5
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/money-view.d.ts +149 -0
- package/dist/orders/money-view.js +99 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +34 -2
- package/dist/orders/plan-edit.js +112 -11
- 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 +20 -1
- package/dist/orders/surcharges.js +37 -11
- package/dist/payments/account-credit.d.ts +46 -0
- package/dist/payments/account-credit.js +42 -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 +19 -0
- package/dist/payments/credit-noted-fields.js +69 -0
- package/dist/payments/customer-consent.d.ts +30 -0
- package/dist/payments/customer-consent.js +49 -0
- package/dist/payments/index.d.ts +340 -19
- package/dist/payments/index.js +151 -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 +147 -0
- package/dist/payments/requests.js +93 -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 +106 -0
- package/dist/pickups/index.js +108 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/email-gateways.d.ts +165 -0
- package/dist/platform/email-gateways.js +78 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +162 -0
- package/dist/platform/tax.js +169 -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 +108 -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 +2370 -58
- package/dist/pos/index.js +854 -7
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +228 -0
- package/dist/pos/offline-sales.js +170 -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 +244 -0
- package/dist/pos/returns.js +83 -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 +606 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +104 -0
- package/dist/purchasing/alerts.js +88 -0
- package/dist/purchasing/backorders.d.ts +61 -0
- package/dist/purchasing/backorders.js +92 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +54 -0
- package/dist/purchasing/index.js +24 -0
- package/dist/purchasing/links.d.ts +263 -0
- package/dist/purchasing/links.js +192 -0
- package/dist/purchasing/purchase-orders.d.ts +551 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/receipts.d.ts +396 -0
- package/dist/purchasing/receipts.js +287 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/returns.d.ts +273 -0
- package/dist/purchasing/returns.js +229 -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 +518 -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 +675 -21
- package/dist/returns/index.js +756 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/seo/config.d.ts +128 -0
- package/dist/seo/config.js +95 -0
- package/dist/seo/redirects.d.ts +125 -0
- package/dist/seo/redirects.js +60 -1
- package/dist/seo/settings.d.ts +147 -0
- package/dist/seo/settings.js +209 -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 +54 -0
- package/dist/shipping/index.js +27 -0
- package/dist/shipping/methods.d.ts +205 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +668 -0
- package/dist/shipping/myparcel.js +466 -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 +324 -0
- package/dist/shipping/rate-tables.js +390 -0
- package/dist/shipping/ship-to-countries.d.ts +75 -0
- package/dist/shipping/ship-to-countries.js +47 -0
- package/dist/stock/by-location.d.ts +86 -0
- package/dist/stock/by-location.js +94 -0
- package/dist/stock/index.d.ts +18 -4
- package/dist/stock/index.js +7 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/settings.d.ts +106 -0
- package/dist/stock/settings.js +103 -0
- package/dist/stock/transfers.d.ts +386 -52
- package/dist/stock/transfers.js +222 -17
- package/dist/stored-value/index.d.ts +312 -11
- package/dist/stored-value/index.js +223 -4
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/display-policy.d.ts +105 -0
- package/dist/tax/display-policy.js +84 -0
- package/dist/tax/index.d.ts +79 -1
- package/dist/tax/index.js +52 -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 +287 -0
- package/dist/tenant/email-templates.js +271 -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,476 @@
|
|
|
1
|
+
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
2
|
+
import type { Call, ListOptions } from '../types.js';
|
|
3
|
+
/** A supplier's postal address. Every part may be null. */
|
|
4
|
+
export interface SupplierAddress {
|
|
5
|
+
streetLine1: string | null;
|
|
6
|
+
streetLine2: string | null;
|
|
7
|
+
postalCode: string | null;
|
|
8
|
+
city: string | null;
|
|
9
|
+
province: string | null;
|
|
10
|
+
/** Upper-case ISO 3166-1 alpha-2. */
|
|
11
|
+
countryCode: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** A person at a supplier: the merchant's business contact, never a customer. */
|
|
14
|
+
export interface SupplierContact {
|
|
15
|
+
id: string;
|
|
16
|
+
supplierId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
email: string | null;
|
|
19
|
+
phone: string | null;
|
|
20
|
+
/** What the person does for the supplier (`Sales`, `Accounts`). */
|
|
21
|
+
role: string | null;
|
|
22
|
+
/** Whether purchase orders go to this person: at most one per supplier, marking one clears the others. */
|
|
23
|
+
isOrderContact: boolean;
|
|
24
|
+
/** ISO-8601 UTC. */
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A supplier of the active store's PURCHASING SCOPE: its legal entity, shared by every store of
|
|
30
|
+
* that entity, or a sandbox store's own scope (purchase-orders spec §7.1). Archived, never
|
|
31
|
+
* deleted.
|
|
32
|
+
*/
|
|
33
|
+
export interface Supplier {
|
|
34
|
+
id: string;
|
|
35
|
+
/** The legal entity's id, or `sandbox:<channelId>` for a sandbox store, which purchases alone. */
|
|
36
|
+
scopeId: string;
|
|
37
|
+
/** The legal entity (Seller) id; null for a sandbox store's own scope. */
|
|
38
|
+
legalEntityId: string | null;
|
|
39
|
+
/** The store that created the supplier; its `supplier.changed` events are filed under it. */
|
|
40
|
+
originChannelId: string;
|
|
41
|
+
/** Unique in the purchasing scope. */
|
|
42
|
+
code: string;
|
|
43
|
+
name: string;
|
|
44
|
+
legalName: string | null;
|
|
45
|
+
vatNumber: string | null;
|
|
46
|
+
/** How purchases from it are taxed. A string on the wire: more values may come. */
|
|
47
|
+
vatTreatment: 'domestic' | 'intra_eu' | 'import' | 'exempt' | (string & {});
|
|
48
|
+
/** Upper-case ISO 3166-1 alpha-2. */
|
|
49
|
+
countryCode: string | null;
|
|
50
|
+
/** ISO 4217: what the supplier invoices in. */
|
|
51
|
+
currencyCode: string;
|
|
52
|
+
/** The terms as the supplier states them. */
|
|
53
|
+
paymentTerms: string | null;
|
|
54
|
+
paymentTermsDays: number | null;
|
|
55
|
+
/** An Incoterms 2020 rule (`EXW`, `DAP`, …). */
|
|
56
|
+
incoterm: string | null;
|
|
57
|
+
defaultLeadTimeDays: number | null;
|
|
58
|
+
/** Null: the purchasing default (`settings.defaultOverReceiptTolerancePct`) applies. */
|
|
59
|
+
overReceiptTolerancePct: number | null;
|
|
60
|
+
/** The supplier ships no backorders: a short delivery cancels the rest of the line. */
|
|
61
|
+
noBackorders: boolean;
|
|
62
|
+
orderEmail: string | null;
|
|
63
|
+
address: SupplierAddress | null;
|
|
64
|
+
notes: string | null;
|
|
65
|
+
/** `active` or `archived`. A string on the wire: more values may come. */
|
|
66
|
+
status: 'active' | 'archived' | (string & {});
|
|
67
|
+
/** The purchasing provider that manages it; null in Standalone mode. */
|
|
68
|
+
managedBy: string | null;
|
|
69
|
+
contacts: SupplierContact[];
|
|
70
|
+
/** ISO-8601 UTC. */
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
}
|
|
74
|
+
/** The address as a write takes it: it replaces the whole address, a part left out is cleared. */
|
|
75
|
+
export type SupplierAddressInput = Partial<SupplierAddress>;
|
|
76
|
+
/**
|
|
77
|
+
* The supplier fields a write may set. Values are trimmed by the engine; an optional one sent
|
|
78
|
+
* `null` or empty is cleared.
|
|
79
|
+
*/
|
|
80
|
+
export interface SupplierFields {
|
|
81
|
+
legalName?: string | null;
|
|
82
|
+
vatNumber?: string | null;
|
|
83
|
+
vatTreatment?: 'domestic' | 'intra_eu' | 'import' | 'exempt';
|
|
84
|
+
/** Upper-case ISO 3166-1 alpha-2. */
|
|
85
|
+
countryCode?: string | null;
|
|
86
|
+
/** ISO 4217, upper case. */
|
|
87
|
+
currencyCode?: string;
|
|
88
|
+
paymentTerms?: string | null;
|
|
89
|
+
/** 0 to 365. */
|
|
90
|
+
paymentTermsDays?: number | null;
|
|
91
|
+
/** An Incoterms 2020 rule. */
|
|
92
|
+
incoterm?: string | null;
|
|
93
|
+
/** 0 to 365. */
|
|
94
|
+
defaultLeadTimeDays?: number | null;
|
|
95
|
+
/** 0 to 100, at most two decimals; null for the purchasing default. */
|
|
96
|
+
overReceiptTolerancePct?: number | null;
|
|
97
|
+
noBackorders?: boolean;
|
|
98
|
+
orderEmail?: string | null;
|
|
99
|
+
address?: SupplierAddressInput | null;
|
|
100
|
+
/** At most 5000 characters. */
|
|
101
|
+
notes?: string | null;
|
|
102
|
+
}
|
|
103
|
+
export interface CreateSupplierInput extends SupplierFields {
|
|
104
|
+
/** Unique in the purchasing scope; at most 64 characters. */
|
|
105
|
+
code: string;
|
|
106
|
+
name: string;
|
|
107
|
+
}
|
|
108
|
+
/** A PATCH: a field left out is kept; `null` clears an optional field. */
|
|
109
|
+
export interface UpdateSupplierInput extends SupplierFields {
|
|
110
|
+
code?: string;
|
|
111
|
+
name?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface SupplierContactFields {
|
|
114
|
+
email?: string | null;
|
|
115
|
+
phone?: string | null;
|
|
116
|
+
role?: string | null;
|
|
117
|
+
isOrderContact?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface CreateSupplierContactInput extends SupplierContactFields {
|
|
120
|
+
name: string;
|
|
121
|
+
}
|
|
122
|
+
/** A PATCH: a field left out is kept; `null` clears an optional field. */
|
|
123
|
+
export interface UpdateSupplierContactInput extends SupplierContactFields {
|
|
124
|
+
name?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface SupplierListOptions extends ListOptions {
|
|
127
|
+
/** Only `active` or only `archived` suppliers; both when left out. */
|
|
128
|
+
status?: 'active' | 'archived';
|
|
129
|
+
/** Matches the name, case-insensitively, as typed. */
|
|
130
|
+
name?: string;
|
|
131
|
+
/** The exact code. */
|
|
132
|
+
code?: string;
|
|
133
|
+
/** Matches the name, code or legal name, case-insensitively, as typed. */
|
|
134
|
+
term?: string;
|
|
135
|
+
}
|
|
136
|
+
/** An archive or restore, with the staff's reason kept in the supplier's status history. */
|
|
137
|
+
export interface SupplierStatusOptions extends Call {
|
|
138
|
+
reason?: string;
|
|
139
|
+
}
|
|
140
|
+
export declare const SUPPLIER_CONTACT_FIELDS = "\n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n";
|
|
141
|
+
export declare const SUPPLIER_FIELDS = "\n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n";
|
|
142
|
+
export declare const SUPPLIERS_QUERY = "\n query Suppliers($options: SupplierListOptions) {\n suppliers(options: $options) {\n totalItems\n items { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
143
|
+
export declare const SUPPLIER_QUERY = "\n query Supplier($id: ID!) {\n supplier(id: $id) { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
144
|
+
export declare const CREATE_SUPPLIER_MUTATION = "\n mutation CreateSupplier($input: CreateSupplierInput!, $idempotencyKey: String) {\n createSupplier(input: $input, idempotencyKey: $idempotencyKey) { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
145
|
+
export declare const UPDATE_SUPPLIER_MUTATION = "\n mutation UpdateSupplier($input: UpdateSupplierInput!, $idempotencyKey: String) {\n updateSupplier(input: $input, idempotencyKey: $idempotencyKey) { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
146
|
+
export declare const ARCHIVE_SUPPLIER_MUTATION = "\n mutation ArchiveSupplier($id: ID!, $reason: String, $idempotencyKey: String) {\n archiveSupplier(id: $id, reason: $reason, idempotencyKey: $idempotencyKey) {\n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n\n }\n }\n";
|
|
147
|
+
export declare const RESTORE_SUPPLIER_MUTATION = "\n mutation RestoreSupplier($id: ID!, $reason: String, $idempotencyKey: String) {\n restoreSupplier(id: $id, reason: $reason, idempotencyKey: $idempotencyKey) {\n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n name\n legalName\n vatNumber\n vatTreatment\n countryCode\n currencyCode\n paymentTerms\n paymentTermsDays\n incoterm\n defaultLeadTimeDays\n overReceiptTolerancePct\n noBackorders\n orderEmail\n address { streetLine1 streetLine2 postalCode city province countryCode }\n notes\n status\n managedBy\n contacts { \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n\n }\n }\n";
|
|
148
|
+
export declare const CREATE_SUPPLIER_CONTACT_MUTATION = "\n mutation CreateSupplierContact($input: CreateSupplierContactInput!, $idempotencyKey: String) {\n createSupplierContact(input: $input, idempotencyKey: $idempotencyKey) {\n \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n\n }\n }\n";
|
|
149
|
+
export declare const UPDATE_SUPPLIER_CONTACT_MUTATION = "\n mutation UpdateSupplierContact($input: UpdateSupplierContactInput!, $idempotencyKey: String) {\n updateSupplierContact(input: $input, idempotencyKey: $idempotencyKey) {\n \n id\n supplierId\n name\n email\n phone\n role\n isOrderContact\n createdAt\n updatedAt\n\n }\n }\n";
|
|
150
|
+
export declare const DELETE_SUPPLIER_CONTACT_MUTATION = "\n mutation DeleteSupplierContact($id: ID!, $idempotencyKey: String) {\n deleteSupplierContact(id: $id, idempotencyKey: $idempotencyKey)\n }\n";
|
|
151
|
+
/** One price break of a supplier item: from `minQuantity` purchase units on, `unitPrice` each. */
|
|
152
|
+
export interface SupplierItemPrice {
|
|
153
|
+
id: string;
|
|
154
|
+
/** ISO 4217. */
|
|
155
|
+
currencyCode: string;
|
|
156
|
+
/** From how many purchase units on the price applies; at least 1. */
|
|
157
|
+
minQuantity: number;
|
|
158
|
+
/** Integer minor units of `currencyCode` per purchase unit. */
|
|
159
|
+
unitPrice: number;
|
|
160
|
+
/** The first day the price applies (`YYYY-MM-DD`, inclusive); null: from the start. */
|
|
161
|
+
validFrom: string | null;
|
|
162
|
+
/** The last day the price applies (`YYYY-MM-DD`, inclusive); null: no end. */
|
|
163
|
+
validUntil: string | null;
|
|
164
|
+
}
|
|
165
|
+
/** The supplier of an item, as an item answers it. */
|
|
166
|
+
export type SupplierItemSupplier = Pick<Supplier, 'id' | 'code' | 'name' | 'status' | 'currencyCode'>;
|
|
167
|
+
/** The variant of an item as the active store sees it. */
|
|
168
|
+
export interface SupplierItemVariant {
|
|
169
|
+
id: string;
|
|
170
|
+
sku: string;
|
|
171
|
+
name: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* What one supplier sells of one product variant, and how (purchase-orders spec §7.1): one per
|
|
175
|
+
* supplier and variant, in the supplier's purchasing scope.
|
|
176
|
+
*/
|
|
177
|
+
export interface SupplierItem {
|
|
178
|
+
id: string;
|
|
179
|
+
supplierId: string;
|
|
180
|
+
supplier: SupplierItemSupplier;
|
|
181
|
+
/** The supplier's purchasing scope. */
|
|
182
|
+
scopeId: string;
|
|
183
|
+
legalEntityId: string | null;
|
|
184
|
+
productVariantId: string;
|
|
185
|
+
/**
|
|
186
|
+
* Null when the active store does not hold the variant (another store of the legal entity
|
|
187
|
+
* added the item) or it was deleted.
|
|
188
|
+
*/
|
|
189
|
+
productVariant: SupplierItemVariant | null;
|
|
190
|
+
/** The supplier's own article number for the variant. */
|
|
191
|
+
supplierSku: string | null;
|
|
192
|
+
supplierBarcode: string | null;
|
|
193
|
+
/** How the purchase unit is called on the order (`box of 12`); null: the variant's own unit. */
|
|
194
|
+
purchaseUnitLabel: string | null;
|
|
195
|
+
/** Base units (the variant's stock units) per purchase unit. */
|
|
196
|
+
purchaseUnitFactor: number;
|
|
197
|
+
/** The least an order line may order, in purchase units. */
|
|
198
|
+
minimumQuantity: number;
|
|
199
|
+
/** An order line orders a multiple of this, in purchase units. */
|
|
200
|
+
orderMultiple: number;
|
|
201
|
+
/** Null: the supplier's `defaultLeadTimeDays` applies. */
|
|
202
|
+
leadTimeDays: number | null;
|
|
203
|
+
/** The supplier the variant is reordered from: at most one item per variant in the scope. */
|
|
204
|
+
preferred: boolean;
|
|
205
|
+
/** Whether the supplier ships the variant straight to the buyer. A string on the wire. */
|
|
206
|
+
dropShip: 'never' | 'always' | 'optional' | (string & {});
|
|
207
|
+
/** The purchasing provider that manages the item; null in Standalone mode. */
|
|
208
|
+
managedBy: string | null;
|
|
209
|
+
/** By currency, then minimum quantity, then the window's start. */
|
|
210
|
+
prices: SupplierItemPrice[];
|
|
211
|
+
/** ISO-8601 UTC. */
|
|
212
|
+
createdAt: string;
|
|
213
|
+
updatedAt: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The item fields an upsert may set. A PATCH of an existing item: a field left out is kept,
|
|
217
|
+
* `null` clears an optional one. A new item buys one by one, never drop-ships, is not preferred.
|
|
218
|
+
*/
|
|
219
|
+
export interface SupplierItemFields {
|
|
220
|
+
/** At most 128 characters. */
|
|
221
|
+
supplierSku?: string | null;
|
|
222
|
+
/** At most 64 characters. */
|
|
223
|
+
supplierBarcode?: string | null;
|
|
224
|
+
/** At most 64 characters. */
|
|
225
|
+
purchaseUnitLabel?: string | null;
|
|
226
|
+
/** 1 to 1000000. */
|
|
227
|
+
purchaseUnitFactor?: number;
|
|
228
|
+
/** 1 to 1000000, in purchase units. */
|
|
229
|
+
minimumQuantity?: number;
|
|
230
|
+
/** 1 to 1000000, in purchase units. */
|
|
231
|
+
orderMultiple?: number;
|
|
232
|
+
/** 0 to 365; null for the supplier's default. */
|
|
233
|
+
leadTimeDays?: number | null;
|
|
234
|
+
/** `true` clears `preferred` on the variant's other items of the purchasing scope. */
|
|
235
|
+
preferred?: boolean;
|
|
236
|
+
dropShip?: 'never' | 'always' | 'optional';
|
|
237
|
+
}
|
|
238
|
+
/** One price break as `prices.set` takes it. */
|
|
239
|
+
export interface SupplierItemPriceInput {
|
|
240
|
+
/** ISO 4217, upper case. */
|
|
241
|
+
currencyCode: string;
|
|
242
|
+
/** 1 to 1000000; default 1. */
|
|
243
|
+
minQuantity?: number;
|
|
244
|
+
/** Whole minor units per purchase unit, 0 or more. */
|
|
245
|
+
unitPrice: number;
|
|
246
|
+
/** `YYYY-MM-DD`, inclusive. */
|
|
247
|
+
validFrom?: string | null;
|
|
248
|
+
/** `YYYY-MM-DD`, inclusive, not before `validFrom`. */
|
|
249
|
+
validUntil?: string | null;
|
|
250
|
+
}
|
|
251
|
+
export interface SupplierItemListOptions extends ListOptions {
|
|
252
|
+
/** Matches the supplier SKU or barcode, case-insensitively, as typed. */
|
|
253
|
+
term?: string;
|
|
254
|
+
}
|
|
255
|
+
/** A price replacement: the whole set, or with `currencyCode` that currency's breaks only. */
|
|
256
|
+
export interface SupplierItemPricesOptions extends Call {
|
|
257
|
+
currencyCode?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* One row of a supplier price list (purchase-orders D70): the supplier's item for one variant and
|
|
261
|
+
* at most one of its price breaks. Rows naming the same supplier and SKU are ONE item; a value
|
|
262
|
+
* left out (or `null`) keeps what the item has (a new item buys one by one, never drop-ships, is
|
|
263
|
+
* not preferred), and two rows of one item may not give one field two values.
|
|
264
|
+
*/
|
|
265
|
+
export interface SupplierItemRow {
|
|
266
|
+
/** The supplier's code. May be left out when the call names the supplier (`supplierId`). */
|
|
267
|
+
supplierCode?: string | null;
|
|
268
|
+
/** The variant's SKU in the active store (exact). */
|
|
269
|
+
sku: string;
|
|
270
|
+
supplierSku?: string | null;
|
|
271
|
+
supplierBarcode?: string | null;
|
|
272
|
+
purchaseUnitLabel?: string | null;
|
|
273
|
+
purchaseUnitFactor?: number | null;
|
|
274
|
+
minimumQuantity?: number | null;
|
|
275
|
+
orderMultiple?: number | null;
|
|
276
|
+
leadTimeDays?: number | null;
|
|
277
|
+
preferred?: boolean | null;
|
|
278
|
+
dropShip?: 'never' | 'always' | 'optional' | null;
|
|
279
|
+
/** The break's currency (ISO 4217); the supplier's currency when left out. */
|
|
280
|
+
currencyCode?: string | null;
|
|
281
|
+
/** From how many purchase units on the break applies; default 1. */
|
|
282
|
+
minQuantity?: number | null;
|
|
283
|
+
/**
|
|
284
|
+
* Whole minor units per purchase unit. A row without it carries no price break (and may not
|
|
285
|
+
* give `currencyCode`, `minQuantity`, `validFrom` or `validUntil`).
|
|
286
|
+
*/
|
|
287
|
+
unitPrice?: number | null;
|
|
288
|
+
/** `YYYY-MM-DD`, inclusive. */
|
|
289
|
+
validFrom?: string | null;
|
|
290
|
+
/** `YYYY-MM-DD`, inclusive, not before `validFrom`. */
|
|
291
|
+
validUntil?: string | null;
|
|
292
|
+
}
|
|
293
|
+
/** What happened to one row of a price list or a bulk upsert. */
|
|
294
|
+
export interface SupplierItemImportRowResult {
|
|
295
|
+
/** The row's line in the CSV file (the header is line 1), or its position (from 1) in `rows`. */
|
|
296
|
+
row: number;
|
|
297
|
+
supplierCode: string | null;
|
|
298
|
+
sku: string | null;
|
|
299
|
+
/**
|
|
300
|
+
* `created`: the row's item is new. `updated`: the item or one of its currencies' price breaks
|
|
301
|
+
* changed. `unchanged`: the row's item already says it all. `failed`: nothing of the row's
|
|
302
|
+
* item was written; `errorCode` and `message` say why. A string on the wire.
|
|
303
|
+
*/
|
|
304
|
+
outcome: 'created' | 'updated' | 'unchanged' | 'failed' | (string & {});
|
|
305
|
+
/** The item written or found; null when the row failed before one was found. */
|
|
306
|
+
supplierItemId: string | null;
|
|
307
|
+
/** The refusal's code when `failed` (`SUPPLIER_INVALID`, `SUPPLIER_NOT_FOUND`, …). */
|
|
308
|
+
errorCode: string | null;
|
|
309
|
+
message: string | null;
|
|
310
|
+
}
|
|
311
|
+
/** The answer to a price list import or a bulk upsert, row by row. */
|
|
312
|
+
export interface SupplierItemImportResult {
|
|
313
|
+
/** True when nothing was written: every row was checked exactly as the write would. */
|
|
314
|
+
dryRun: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* `sha256` (hex) of the price list as read (byte-order mark dropped, line endings unified), so
|
|
317
|
+
* a caller can recognise a file it already sent; null for a bulk upsert.
|
|
318
|
+
*/
|
|
319
|
+
contentHash: string | null;
|
|
320
|
+
/** Header columns the import does not know and did not read (a typo shows up here). */
|
|
321
|
+
ignoredColumns: string[];
|
|
322
|
+
totalRows: number;
|
|
323
|
+
created: number;
|
|
324
|
+
updated: number;
|
|
325
|
+
unchanged: number;
|
|
326
|
+
failed: number;
|
|
327
|
+
/** Every row, in file order. */
|
|
328
|
+
rows: SupplierItemImportRowResult[];
|
|
329
|
+
}
|
|
330
|
+
/** `items.import`: a supplier price list as CSV text (D70 columns, header row first). */
|
|
331
|
+
export interface SupplierPriceListImportInput {
|
|
332
|
+
/**
|
|
333
|
+
* The file's text. A header row naming the columns (any case; `supplier_code` and
|
|
334
|
+
* `Supplier Code` read as `supplierCode`), then one row per price break. `unitPrice` is a
|
|
335
|
+
* decimal in the row's currency with at most two decimals (`12.50`; `12,50` too when the
|
|
336
|
+
* separator is `;` or a tab).
|
|
337
|
+
* Comma, semicolon or tab separated. At most 5000 rows.
|
|
338
|
+
*/
|
|
339
|
+
content: string;
|
|
340
|
+
/** The supplier the list is for: its rows may leave `supplierCode` out, and may not name another. */
|
|
341
|
+
supplierId?: string;
|
|
342
|
+
/** Check every row as the import would, write nothing. */
|
|
343
|
+
dryRun?: boolean;
|
|
344
|
+
}
|
|
345
|
+
/** `items.bulkUpsert`: price list rows as data. */
|
|
346
|
+
export interface SupplierItemsBulkUpsertInput {
|
|
347
|
+
/** At most 5000. */
|
|
348
|
+
rows: SupplierItemRow[];
|
|
349
|
+
/** Only this supplier's rows: they may leave `supplierCode` out, and may not name another. */
|
|
350
|
+
supplierId?: string;
|
|
351
|
+
/** Check every row as the write would, write nothing. */
|
|
352
|
+
dryRun?: boolean;
|
|
353
|
+
}
|
|
354
|
+
export declare const SUPPLIER_ITEM_FIELDS = "\n id\n supplierId\n supplier { id code name status currencyCode }\n scopeId\n legalEntityId\n productVariantId\n productVariant { id sku name }\n supplierSku\n supplierBarcode\n purchaseUnitLabel\n purchaseUnitFactor\n minimumQuantity\n orderMultiple\n leadTimeDays\n preferred\n dropShip\n managedBy\n prices { id currencyCode minQuantity unitPrice validFrom validUntil }\n createdAt\n updatedAt\n";
|
|
355
|
+
export declare const SUPPLIER_ITEMS_QUERY = "\n query SupplierItems($supplierId: ID!, $options: SupplierItemListOptions) {\n supplierItems(supplierId: $supplierId, options: $options) {\n totalItems\n items { \n id\n supplierId\n supplier { id code name status currencyCode }\n scopeId\n legalEntityId\n productVariantId\n productVariant { id sku name }\n supplierSku\n supplierBarcode\n purchaseUnitLabel\n purchaseUnitFactor\n minimumQuantity\n orderMultiple\n leadTimeDays\n preferred\n dropShip\n managedBy\n prices { id currencyCode minQuantity unitPrice validFrom validUntil }\n createdAt\n updatedAt\n }\n }\n }\n";
|
|
356
|
+
export declare const VARIANT_SUPPLIER_ITEMS_QUERY = "\n query VariantSupplierItems($productVariantId: ID!) {\n variantSupplierItems(productVariantId: $productVariantId) { \n id\n supplierId\n supplier { id code name status currencyCode }\n scopeId\n legalEntityId\n productVariantId\n productVariant { id sku name }\n supplierSku\n supplierBarcode\n purchaseUnitLabel\n purchaseUnitFactor\n minimumQuantity\n orderMultiple\n leadTimeDays\n preferred\n dropShip\n managedBy\n prices { id currencyCode minQuantity unitPrice validFrom validUntil }\n createdAt\n updatedAt\n }\n }\n";
|
|
357
|
+
export declare const UPSERT_SUPPLIER_ITEM_MUTATION = "\n mutation UpsertSupplierItem($input: UpsertSupplierItemInput!, $idempotencyKey: String) {\n upsertSupplierItem(input: $input, idempotencyKey: $idempotencyKey) { \n id\n supplierId\n supplier { id code name status currencyCode }\n scopeId\n legalEntityId\n productVariantId\n productVariant { id sku name }\n supplierSku\n supplierBarcode\n purchaseUnitLabel\n purchaseUnitFactor\n minimumQuantity\n orderMultiple\n leadTimeDays\n preferred\n dropShip\n managedBy\n prices { id currencyCode minQuantity unitPrice validFrom validUntil }\n createdAt\n updatedAt\n }\n }\n";
|
|
358
|
+
export declare const DELETE_SUPPLIER_ITEM_MUTATION = "\n mutation DeleteSupplierItem($id: ID!, $idempotencyKey: String) {\n deleteSupplierItem(id: $id, idempotencyKey: $idempotencyKey)\n }\n";
|
|
359
|
+
export declare const SET_SUPPLIER_ITEM_PRICES_MUTATION = "\n mutation SetSupplierItemPrices(\n $supplierItemId: ID!\n $prices: [SupplierItemPriceInput!]!\n $currencyCode: CurrencyCode\n $idempotencyKey: String\n ) {\n setSupplierItemPrices(\n supplierItemId: $supplierItemId\n prices: $prices\n currencyCode: $currencyCode\n idempotencyKey: $idempotencyKey\n ) { \n id\n supplierId\n supplier { id code name status currencyCode }\n scopeId\n legalEntityId\n productVariantId\n productVariant { id sku name }\n supplierSku\n supplierBarcode\n purchaseUnitLabel\n purchaseUnitFactor\n minimumQuantity\n orderMultiple\n leadTimeDays\n preferred\n dropShip\n managedBy\n prices { id currencyCode minQuantity unitPrice validFrom validUntil }\n createdAt\n updatedAt\n }\n }\n";
|
|
360
|
+
export declare const SUPPLIER_ITEM_IMPORT_RESULT_FIELDS = "\n dryRun\n contentHash\n ignoredColumns\n totalRows\n created\n updated\n unchanged\n failed\n rows { row supplierCode sku outcome supplierItemId errorCode message }\n";
|
|
361
|
+
export declare const IMPORT_SUPPLIER_PRICE_LIST_MUTATION = "\n mutation ImportSupplierPriceList(\n $input: ImportSupplierPriceListInput!\n $idempotencyKey: String\n ) {\n importSupplierPriceList(input: $input, idempotencyKey: $idempotencyKey) {\n \n dryRun\n contentHash\n ignoredColumns\n totalRows\n created\n updated\n unchanged\n failed\n rows { row supplierCode sku outcome supplierItemId errorCode message }\n\n }\n }\n";
|
|
362
|
+
export declare const BULK_UPSERT_SUPPLIER_ITEMS_MUTATION = "\n mutation BulkUpsertSupplierItems(\n $input: BulkUpsertSupplierItemsInput!\n $idempotencyKey: String\n ) {\n bulkUpsertSupplierItems(input: $input, idempotencyKey: $idempotencyKey) {\n \n dryRun\n contentHash\n ignoredColumns\n totalRows\n created\n updated\n unchanged\n failed\n rows { row supplierCode sku outcome supplierItemId errorCode message }\n\n }\n }\n";
|
|
363
|
+
/** A supplier's contacts. Each write needs `UpdateSupplier` on every store of the legal entity. */
|
|
364
|
+
export interface SupplierContactsModule {
|
|
365
|
+
/** Refusals: `SUPPLIER_NOT_FOUND` (404), `MANAGED_BY_PROVIDER` (422), `SUPPLIER_INVALID` (400). */
|
|
366
|
+
create(supplierId: string, input: CreateSupplierContactInput, call?: Call): Promise<SupplierContact>;
|
|
367
|
+
/** Refusals: `SUPPLIER_CONTACT_NOT_FOUND` (404), `MANAGED_BY_PROVIDER` (422), `SUPPLIER_INVALID` (400). */
|
|
368
|
+
update(id: string, input: UpdateSupplierContactInput, call?: Call): Promise<SupplierContact>;
|
|
369
|
+
/** True once removed. Refusals: `SUPPLIER_CONTACT_NOT_FOUND` (404), `MANAGED_BY_PROVIDER` (422). */
|
|
370
|
+
delete(id: string, call?: Call): Promise<boolean>;
|
|
371
|
+
}
|
|
372
|
+
/** An item's price breaks. Needs `UpdateSupplier` on every store of the legal entity. */
|
|
373
|
+
export interface SupplierItemPricesModule {
|
|
374
|
+
/**
|
|
375
|
+
* Replaces the item's price breaks: all of them, or with `currencyCode` that currency's only
|
|
376
|
+
* (every break given must be in it). An empty list clears what it replaces. Refusals:
|
|
377
|
+
* `SUPPLIER_ITEM_NOT_FOUND` (404), `SUPPLIER_ARCHIVED` and `MANAGED_BY_PROVIDER` (422),
|
|
378
|
+
* `SUPPLIER_INVALID` (400: two breaks of one currency and minimum on a shared day, a day that
|
|
379
|
+
* is no calendar day, more than 100 breaks).
|
|
380
|
+
*/
|
|
381
|
+
set(supplierItemId: string, prices: SupplierItemPriceInput[], options?: SupplierItemPricesOptions): Promise<SupplierItem>;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* A supplier's catalog: what it sells of which variant, and its price breaks. Reads need
|
|
385
|
+
* `ReadSupplier`; writes `UpdateSupplier` on every store of the legal entity.
|
|
386
|
+
*/
|
|
387
|
+
export interface SupplierItemsModule {
|
|
388
|
+
/**
|
|
389
|
+
* The supplier's items by supplier SKU. Pages default to 50; walking on with `.next()` or
|
|
390
|
+
* `for await` reaches every one. Refusals: `SUPPLIER_NOT_FOUND` (404).
|
|
391
|
+
*/
|
|
392
|
+
list(supplierId: string, options?: SupplierItemListOptions): Promise<Page<SupplierItem>>;
|
|
393
|
+
/**
|
|
394
|
+
* Every item of the purchasing scope for one variant the active store holds, the preferred one
|
|
395
|
+
* first, then by supplier name. Refusals: `SUPPLIER_ITEM_VARIANT_NOT_FOUND` (404).
|
|
396
|
+
*/
|
|
397
|
+
forVariant(productVariantId: string, call?: Call): Promise<SupplierItem[]>;
|
|
398
|
+
/**
|
|
399
|
+
* Creates the supplier's item for the variant, or changes the one it has (a PATCH). Refusals:
|
|
400
|
+
* `SUPPLIER_NOT_FOUND` and `SUPPLIER_ITEM_VARIANT_NOT_FOUND` (404), `SUPPLIER_ARCHIVED` and
|
|
401
|
+
* `MANAGED_BY_PROVIDER` (422), `SUPPLIER_INVALID` (400).
|
|
402
|
+
*/
|
|
403
|
+
upsert(supplierId: string, productVariantId: string, input?: SupplierItemFields, call?: Call): Promise<SupplierItem>;
|
|
404
|
+
/** True once removed, with its price breaks. Refusals: `SUPPLIER_ITEM_NOT_FOUND` (404), `SUPPLIER_ARCHIVED` (422). */
|
|
405
|
+
delete(id: string, call?: Call): Promise<boolean>;
|
|
406
|
+
prices: SupplierItemPricesModule;
|
|
407
|
+
/**
|
|
408
|
+
* Imports a supplier price list (CSV, purchase-orders D70): upserts each (supplier, SKU) item
|
|
409
|
+
* and replaces, per currency the file gives, that item's price breaks with the file's. A row
|
|
410
|
+
* that cannot be applied is answered `failed` with its reason and takes the other rows of its
|
|
411
|
+
* item with it; every other item is still written. Re-importing the same file answers every
|
|
412
|
+
* row `unchanged` and writes nothing. With `dryRun` nothing is written.
|
|
413
|
+
*
|
|
414
|
+
* Refusals of the whole file: `SUPPLIER_INVALID` (400: no header row, a required column
|
|
415
|
+
* missing, a column twice, no data rows, more than 5000 rows, unreadable CSV),
|
|
416
|
+
* `SUPPLIER_NOT_FOUND` (404) for `supplierId`. Row reasons: `SUPPLIER_INVALID`,
|
|
417
|
+
* `SUPPLIER_NOT_FOUND`, `SUPPLIER_ITEM_VARIANT_NOT_FOUND`, `SUPPLIER_ARCHIVED`,
|
|
418
|
+
* `MANAGED_BY_PROVIDER`.
|
|
419
|
+
*/
|
|
420
|
+
import(input: SupplierPriceListImportInput, call?: Call): Promise<SupplierItemImportResult>;
|
|
421
|
+
/**
|
|
422
|
+
* The same engine as `import`, for rows as data (`unitPrice` in whole minor units). Refusals:
|
|
423
|
+
* `SUPPLIER_INVALID` (400: no rows or more than 5000), `SUPPLIER_NOT_FOUND` (404) for
|
|
424
|
+
* `supplierId`; row reasons as `import`.
|
|
425
|
+
*/
|
|
426
|
+
bulkUpsert(input: SupplierItemsBulkUpsertInput, call?: Call): Promise<SupplierItemImportResult>;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* `admin.purchasing.suppliers` (purchase-orders spec §10.1). Every method needs the Purchasing
|
|
430
|
+
* plugin on the store AND purchasing switched on for its legal entity (`PURCHASING_NOT_ENABLED`,
|
|
431
|
+
* 422; `PLUGIN_ACCESS_DENIED`, 403, for an ordinary caller without the plugin), and a store that
|
|
432
|
+
* purchases (`HUB_HAS_NO_PURCHASING`, `LEGAL_ENTITY_REQUIRED`, 422).
|
|
433
|
+
*
|
|
434
|
+
* Reads need `ReadSupplier`. The suppliers are every store's of the legal entity, so every write
|
|
435
|
+
* needs its permission on EVERY store of it (`SHARED_SELLER_NOT_ALLOWED`, 403; a sandbox store is
|
|
436
|
+
* its own scope): `CreateSupplier` to create, `UpdateSupplier` to change a supplier, its
|
|
437
|
+
* contacts or its catalog (`items`), `DeleteSupplier` to archive or restore one. There is no
|
|
438
|
+
* hard delete.
|
|
439
|
+
*
|
|
440
|
+
* Every write takes `{ idempotencyKey?, tenant? }`: a repeat under one key answers the first
|
|
441
|
+
* call's result, a different body under it `IDEMPOTENCY_CONFLICT` (409).
|
|
442
|
+
*/
|
|
443
|
+
export interface PurchasingSuppliersModule {
|
|
444
|
+
/**
|
|
445
|
+
* The scope's suppliers by name. Pages default to 50; a `limit` above 100 is refused
|
|
446
|
+
* `SUPPLIER_INVALID` (400); walking on with `.next()` or `for await` reaches every one.
|
|
447
|
+
*/
|
|
448
|
+
list(options?: SupplierListOptions): Promise<Page<Supplier>>;
|
|
449
|
+
/** Null when the scope has no supplier with that id (another legal entity's included). */
|
|
450
|
+
get(id: string, call?: Call): Promise<Supplier | null>;
|
|
451
|
+
/**
|
|
452
|
+
* Creates an active supplier. The currency defaults to the purchasing currency; the VAT
|
|
453
|
+
* treatment, when left out, is derived from the countries (domestic in the legal entity's own
|
|
454
|
+
* country, intra_eu for another EU state with a VAT number, import from outside the EU).
|
|
455
|
+
* Refusals: `SUPPLIER_CODE_TAKEN` (409), `SUPPLIER_INVALID` (400).
|
|
456
|
+
*/
|
|
457
|
+
create(input: CreateSupplierInput, call?: Call): Promise<Supplier>;
|
|
458
|
+
/**
|
|
459
|
+
* Changes the fields given. A change that changes nothing writes nothing. Refusals:
|
|
460
|
+
* `SUPPLIER_NOT_FOUND` (404), `SUPPLIER_CODE_TAKEN` (409), `MANAGED_BY_PROVIDER` (422),
|
|
461
|
+
* `SUPPLIER_INVALID` (400).
|
|
462
|
+
*/
|
|
463
|
+
update(id: string, input: UpdateSupplierInput, call?: Call): Promise<Supplier>;
|
|
464
|
+
/**
|
|
465
|
+
* Archives a supplier: it stays, hidden from pickers and replenishment. An archived one is
|
|
466
|
+
* answered as it is. Refusals: `SUPPLIER_NOT_FOUND` (404), `SUPPLIER_HAS_OPEN_DOCUMENTS` and
|
|
467
|
+
* `MANAGED_BY_PROVIDER` (422).
|
|
468
|
+
*/
|
|
469
|
+
archive(id: string, options?: SupplierStatusOptions): Promise<Supplier>;
|
|
470
|
+
/** Makes an archived supplier active again; an active one is answered as it is. */
|
|
471
|
+
restore(id: string, options?: SupplierStatusOptions): Promise<Supplier>;
|
|
472
|
+
contacts: SupplierContactsModule;
|
|
473
|
+
/** What each supplier sells of which variant, with its price breaks. */
|
|
474
|
+
items: SupplierItemsModule;
|
|
475
|
+
}
|
|
476
|
+
export declare function createPurchasingSuppliersModule(transport: Transport): PurchasingSuppliersModule;
|