@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,483 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes of `admin.integrations.afas` (headless W10-53): the store's AFAS Profit connection,
|
|
3
|
+
* the AFAS lists its settings pick from, the warehouse mapping, and the customer payment terms.
|
|
4
|
+
*/
|
|
5
|
+
/** The AFAS article that carries money-only lines at one VAT rate. */
|
|
6
|
+
export interface AfasCorrectionArticle {
|
|
7
|
+
/** A percentage: `21`, `9`, `5.5`. */
|
|
8
|
+
taxRate: number;
|
|
9
|
+
itemCode: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The store's AFAS Profit connection. The App Connector token is WRITE-ONLY: no read returns it
|
|
13
|
+
* in any form, so this shape has no member for it.
|
|
14
|
+
*/
|
|
15
|
+
export interface AfasConfig {
|
|
16
|
+
id: string;
|
|
17
|
+
channelId: string;
|
|
18
|
+
/** Mirroring is on: activated orders, customers and invoices go to AFAS. */
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The AFAS environment number (`89990`) or its environment code (`T89990AA`). A stored id of
|
|
22
|
+
* another shape makes every AFAS call refuse `AFAS_CONFIG_INVALID` on `environmentId` before
|
|
23
|
+
* anything is sent.
|
|
24
|
+
*/
|
|
25
|
+
environmentId: string;
|
|
26
|
+
/** `production`, `test` or `accept`. */
|
|
27
|
+
environmentType: string;
|
|
28
|
+
orderConnectorId: string;
|
|
29
|
+
orgCustomerConnectorId: string;
|
|
30
|
+
perCustomerConnectorId: string;
|
|
31
|
+
defaultCurrency: string;
|
|
32
|
+
/** The condition new AFAS debtors get; empty when none is set (never defaulted). */
|
|
33
|
+
defaultPaymentCondition: string;
|
|
34
|
+
defaultWarehouse: string | null;
|
|
35
|
+
defaultAdministration: string | null;
|
|
36
|
+
paymentTermsEnabled: boolean;
|
|
37
|
+
paymentConditionConnectorId: string | null;
|
|
38
|
+
balanceConnectorId: string | null;
|
|
39
|
+
balanceDebtorFieldId: string | null;
|
|
40
|
+
balanceAmountFieldId: string | null;
|
|
41
|
+
invoiceReportConnectorId: string | null;
|
|
42
|
+
invoiceReportFilterFieldId: string | null;
|
|
43
|
+
debtorVatDuty: string | null;
|
|
44
|
+
debtorCollectionAccount: string | null;
|
|
45
|
+
shippingItemCode: string | null;
|
|
46
|
+
discountItemCode: string | null;
|
|
47
|
+
/** One article per VAT rate, for credit notes, free-form and discount rows. */
|
|
48
|
+
correctionArticleCodes: AfasCorrectionArticle[];
|
|
49
|
+
/** Kept for older connections; AFAS resolves the unit per article, and nothing sets it now. */
|
|
50
|
+
directInvoiceUnitCode: string | null;
|
|
51
|
+
directInvoiceJournalId: string | null;
|
|
52
|
+
/** ISO-8601. */
|
|
53
|
+
createdAt: string;
|
|
54
|
+
/** ISO-8601. */
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
}
|
|
57
|
+
/** Why an article was picked for a VAT rate when the correction articles were filled from AFAS. */
|
|
58
|
+
export type AfasCorrectionArticleReason = 'DISCOUNT_ITEM' | 'DISCOUNT_KEYWORD' | 'TEXT_LINE' | 'ROUNDING' | 'OTHER';
|
|
59
|
+
/** An article written into a VAT rate that had none. */
|
|
60
|
+
export interface AfasDetectedCorrectionArticle extends AfasCorrectionArticle {
|
|
61
|
+
description: string;
|
|
62
|
+
reason: AfasCorrectionArticleReason;
|
|
63
|
+
}
|
|
64
|
+
/** What filling the correction articles from AFAS did, per VAT rate of the store. */
|
|
65
|
+
export interface AfasCorrectionArticleFill {
|
|
66
|
+
/** The VAT rates the store charges on its catalogue. */
|
|
67
|
+
storeRates: number[];
|
|
68
|
+
/** Articles written into a rate that had none. */
|
|
69
|
+
filled: AfasDetectedCorrectionArticle[];
|
|
70
|
+
/** Rates that already had an article; left as they were. */
|
|
71
|
+
kept: number[];
|
|
72
|
+
/** Rates AFAS has no candidate article for: still to be entered by hand. */
|
|
73
|
+
unmatchedRates: number[];
|
|
74
|
+
/** Set only when detection could not run (e.g. `AFAS_READ_FAILED`). */
|
|
75
|
+
errorCode: string | null;
|
|
76
|
+
/** What to do about `errorCode`. */
|
|
77
|
+
error: string | null;
|
|
78
|
+
}
|
|
79
|
+
/** A save's answer: the connection, and what the save filled in from AFAS. */
|
|
80
|
+
export interface AfasConfigSaveResult extends AfasConfig {
|
|
81
|
+
/**
|
|
82
|
+
* The correction articles the save detected for the VAT rates that had none, when it left AFAS
|
|
83
|
+
* on with a token; null otherwise. A detection failure never fails the save: it is reported
|
|
84
|
+
* here (`errorCode`, `error`).
|
|
85
|
+
*/
|
|
86
|
+
correctionArticleFill: AfasCorrectionArticleFill | null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A PATCH of the connection: a key left out keeps the stored value. The first save must carry
|
|
90
|
+
* `environmentId` and `token`. The token is write-only: absent, null or empty keeps the stored
|
|
91
|
+
* one.
|
|
92
|
+
*/
|
|
93
|
+
export interface UpdateAfasConfigInput {
|
|
94
|
+
enabled?: boolean;
|
|
95
|
+
environmentId?: string;
|
|
96
|
+
environmentType?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The App Connector token: the whole `<token><version>1</version><data>…</data></token>`
|
|
99
|
+
* envelope, or only its hex data (32 characters or more), which the engine wraps.
|
|
100
|
+
*/
|
|
101
|
+
token?: string;
|
|
102
|
+
orderConnectorId?: string;
|
|
103
|
+
orgCustomerConnectorId?: string;
|
|
104
|
+
perCustomerConnectorId?: string;
|
|
105
|
+
defaultCurrency?: string;
|
|
106
|
+
/** An empty string clears it. */
|
|
107
|
+
defaultPaymentCondition?: string;
|
|
108
|
+
defaultWarehouse?: string | null;
|
|
109
|
+
defaultAdministration?: string | null;
|
|
110
|
+
paymentTermsEnabled?: boolean;
|
|
111
|
+
paymentConditionConnectorId?: string | null;
|
|
112
|
+
balanceConnectorId?: string | null;
|
|
113
|
+
balanceDebtorFieldId?: string | null;
|
|
114
|
+
balanceAmountFieldId?: string | null;
|
|
115
|
+
invoiceReportConnectorId?: string | null;
|
|
116
|
+
invoiceReportFilterFieldId?: string | null;
|
|
117
|
+
directInvoiceJournalId?: string | null;
|
|
118
|
+
debtorVatDuty?: string | null;
|
|
119
|
+
debtorCollectionAccount?: string | null;
|
|
120
|
+
shippingItemCode?: string | null;
|
|
121
|
+
discountItemCode?: string | null;
|
|
122
|
+
/** Replaces the whole per-VAT-rate article list; an empty list clears it. */
|
|
123
|
+
correctionArticleCodes?: AfasCorrectionArticle[];
|
|
124
|
+
}
|
|
125
|
+
/** What the connection test found: a result, not a refusal. */
|
|
126
|
+
export interface AfasConnectionVerification {
|
|
127
|
+
connected: boolean;
|
|
128
|
+
/** What the successful connection filled in; null when not connected. */
|
|
129
|
+
correctionArticles: AfasCorrectionArticleFill | null;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Values the connected AFAS environment suggests for the settings. Each is null when the
|
|
133
|
+
* connector behind it is unauthorised, empty or unreadable.
|
|
134
|
+
*/
|
|
135
|
+
export interface AfasDiscoveredDefaults {
|
|
136
|
+
/** The first administration (`AdminCd`). */
|
|
137
|
+
administration: string | null;
|
|
138
|
+
/** The first warehouse that is not blocked. */
|
|
139
|
+
warehouse: string | null;
|
|
140
|
+
/** The administration's home currency. */
|
|
141
|
+
currency: string | null;
|
|
142
|
+
/** The most common debtor payment condition. */
|
|
143
|
+
paymentCondition: string | null;
|
|
144
|
+
vatDuty: string | null;
|
|
145
|
+
collectionAccount: string | null;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* One attempt to send one record to AFAS. The request the engine sent and AFAS's raw answer are
|
|
149
|
+
* deliberately not read here: they carry customers' personal data and are kept as audit
|
|
150
|
+
* evidence, not as an API.
|
|
151
|
+
*/
|
|
152
|
+
export interface AfasSyncLog {
|
|
153
|
+
id: string;
|
|
154
|
+
channelId: string;
|
|
155
|
+
/** `order`, `customer`, `stock_transfer`, … */
|
|
156
|
+
entityType: string;
|
|
157
|
+
entityId: string;
|
|
158
|
+
/** AFAS's reference for the record, when it answered one. */
|
|
159
|
+
externalRef: string | null;
|
|
160
|
+
eventType: string;
|
|
161
|
+
/** `pending`, `success`, `failed` or `skipped`. */
|
|
162
|
+
status: string;
|
|
163
|
+
/** AFAS's HTTP status; null when it never answered. */
|
|
164
|
+
responseStatus: number | null;
|
|
165
|
+
/** Why it failed, in a sentence for staff; null otherwise. */
|
|
166
|
+
error: string | null;
|
|
167
|
+
attempt: number;
|
|
168
|
+
durationMs: number | null;
|
|
169
|
+
/** ISO-8601. */
|
|
170
|
+
createdAt: string;
|
|
171
|
+
}
|
|
172
|
+
/** Which attempts `syncLogs` lists; every member narrows, and none means all. */
|
|
173
|
+
export interface AfasSyncLogFilter {
|
|
174
|
+
entityType?: string;
|
|
175
|
+
entityId?: string;
|
|
176
|
+
status?: string;
|
|
177
|
+
}
|
|
178
|
+
/** An administration of the AFAS environment. */
|
|
179
|
+
export interface AfasAdministration {
|
|
180
|
+
adminCd: string;
|
|
181
|
+
adminNm: string;
|
|
182
|
+
adminId: number | null;
|
|
183
|
+
}
|
|
184
|
+
/** A warehouse of the AFAS environment (`Profit_Warehouses`). */
|
|
185
|
+
export interface AfasWarehouse {
|
|
186
|
+
code: string;
|
|
187
|
+
/** Null when the connector exposes no description. */
|
|
188
|
+
name: string | null;
|
|
189
|
+
blocked: boolean;
|
|
190
|
+
}
|
|
191
|
+
/** A stock location of the store paired with the AFAS warehouse its stock moves are booked on. */
|
|
192
|
+
export interface AfasWarehouseMapping {
|
|
193
|
+
id: string;
|
|
194
|
+
channelId: string;
|
|
195
|
+
stockLocationId: string;
|
|
196
|
+
/** The stock location's name, joined for display. */
|
|
197
|
+
stockLocationName: string | null;
|
|
198
|
+
/** The AFAS `Profit_Warehouses.Warehouse` code (at most 15 characters). */
|
|
199
|
+
afasWarehouse: string;
|
|
200
|
+
/** ISO-8601. */
|
|
201
|
+
createdAt: string;
|
|
202
|
+
/** ISO-8601. */
|
|
203
|
+
updatedAt: string;
|
|
204
|
+
}
|
|
205
|
+
/** One row of the store's AFAS payment-condition catalog. */
|
|
206
|
+
export interface AfasPaymentCondition {
|
|
207
|
+
id: string;
|
|
208
|
+
/** AFAS's condition code (`PayCon`). */
|
|
209
|
+
code: string;
|
|
210
|
+
description: string | null;
|
|
211
|
+
/** The payment term in days; null while not mapped. */
|
|
212
|
+
days: number | null;
|
|
213
|
+
dueImmediately: boolean;
|
|
214
|
+
/** Where the row came from: the AFAS catalog, a debtor seen with it, or a merchant edit. */
|
|
215
|
+
source: string;
|
|
216
|
+
active: boolean;
|
|
217
|
+
/** ISO-8601; null for a row no sync has touched. */
|
|
218
|
+
lastSyncedAt: string | null;
|
|
219
|
+
/** ISO-8601. */
|
|
220
|
+
createdAt: string;
|
|
221
|
+
/** ISO-8601. */
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
}
|
|
224
|
+
/** The health of the payment-terms mirror and catalog. */
|
|
225
|
+
export interface AfasPaymentTermsStatus {
|
|
226
|
+
enabled: boolean;
|
|
227
|
+
connectorId: string | null;
|
|
228
|
+
conditionCount: number;
|
|
229
|
+
/** Conditions with no day mapping yet. */
|
|
230
|
+
unmappedConditionCount: number;
|
|
231
|
+
linkedCustomers: number;
|
|
232
|
+
assigned: number;
|
|
233
|
+
unassigned: number;
|
|
234
|
+
unresolved: number;
|
|
235
|
+
stale: number;
|
|
236
|
+
/** ISO-8601; null before the first sync. */
|
|
237
|
+
lastSyncedAt: string | null;
|
|
238
|
+
}
|
|
239
|
+
/** What a payment-terms sync did. */
|
|
240
|
+
export interface AfasPaymentTermsSyncResult {
|
|
241
|
+
catalogConnectorId: string | null;
|
|
242
|
+
catalogRows: number;
|
|
243
|
+
catalogCreated: number;
|
|
244
|
+
catalogUpdated: number;
|
|
245
|
+
/** Why the catalog could not be read; the customer mirror still ran. */
|
|
246
|
+
catalogError: string | null;
|
|
247
|
+
customersLinked: number;
|
|
248
|
+
customersMatched: number;
|
|
249
|
+
customersUnassigned: number;
|
|
250
|
+
customersUnresolved: number;
|
|
251
|
+
}
|
|
252
|
+
/** A merchant's edit of one condition (created when the code is new); never overwritten by a sync. */
|
|
253
|
+
export interface UpdateAfasPaymentConditionInput {
|
|
254
|
+
code: string;
|
|
255
|
+
days?: number | null;
|
|
256
|
+
dueImmediately?: boolean;
|
|
257
|
+
description?: string | null;
|
|
258
|
+
active?: boolean;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* How an AFAS debtor row is classified. Drives which `KnSalesRelation*` connector a push uses.
|
|
262
|
+
* `UNKNOWN` when the store's `Profit_Debtor` connector exposes no classifier field: the engine
|
|
263
|
+
* then falls back to whether the customer is a business.
|
|
264
|
+
*/
|
|
265
|
+
export type AfasDebtorKind = 'ORGANISATION' | 'PERSON' | 'UNKNOWN';
|
|
266
|
+
/** An AFAS debtor (Verkooprelatie), as AFAS answers it. */
|
|
267
|
+
export interface AfasCustomerPreview {
|
|
268
|
+
/** The AFAS organisation or person number (BcCo). */
|
|
269
|
+
bcCo: string;
|
|
270
|
+
/** The Verkooprelatie code (DbId) a customer is linked by. */
|
|
271
|
+
debtorId: string;
|
|
272
|
+
name: string;
|
|
273
|
+
kind: AfasDebtorKind;
|
|
274
|
+
email: string | null;
|
|
275
|
+
phone: string | null;
|
|
276
|
+
vatNumber: string | null;
|
|
277
|
+
kvkNumber: string | null;
|
|
278
|
+
addressLine1: string | null;
|
|
279
|
+
addressLine3: string | null;
|
|
280
|
+
addressLine4: string | null;
|
|
281
|
+
currency: string | null;
|
|
282
|
+
paymentCondition: string | null;
|
|
283
|
+
blocked: boolean;
|
|
284
|
+
}
|
|
285
|
+
/** An AFAS sales order, as AFAS answers it. */
|
|
286
|
+
export interface AfasOrderPreview {
|
|
287
|
+
orNu: string;
|
|
288
|
+
debtorBcCo: string | null;
|
|
289
|
+
reference: string | null;
|
|
290
|
+
orderDate: string | null;
|
|
291
|
+
/**
|
|
292
|
+
* AFAS's own figure, a DECIMAL in major units of `currency` (`121.5`), not the platform's
|
|
293
|
+
* integer minor units: never compare it with an order's `totalWithTax` unconverted.
|
|
294
|
+
*/
|
|
295
|
+
totalAmount: number | null;
|
|
296
|
+
currency: string | null;
|
|
297
|
+
status: string | null;
|
|
298
|
+
/** True once AFAS marks it "Afgehandeld" (settled): it awaits the accountant's invoice. */
|
|
299
|
+
settled: boolean;
|
|
300
|
+
}
|
|
301
|
+
/** An AFAS delivery address, as AFAS answers it. */
|
|
302
|
+
export interface AfasAddressPreview {
|
|
303
|
+
adId: string;
|
|
304
|
+
bcCo: string | null;
|
|
305
|
+
street: string | null;
|
|
306
|
+
houseNumber: number | null;
|
|
307
|
+
postalCode: string | null;
|
|
308
|
+
city: string | null;
|
|
309
|
+
countryCode: string | null;
|
|
310
|
+
}
|
|
311
|
+
/** What pushing an order or a customer to AFAS did. */
|
|
312
|
+
export interface AfasPushResult {
|
|
313
|
+
success: boolean;
|
|
314
|
+
/** AFAS holds the sales order as invoiced; the platform stopped sending edits to it. */
|
|
315
|
+
locked: boolean;
|
|
316
|
+
/** The order was already in AFAS, so nothing was written (`success` stays true). */
|
|
317
|
+
alreadySynced: boolean;
|
|
318
|
+
/** The AFAS number of what was written (the sales order, or the debtor). */
|
|
319
|
+
externalRef: string | null;
|
|
320
|
+
/** A note for an outcome that is not an error ("already synced"). */
|
|
321
|
+
message: string | null;
|
|
322
|
+
/** Why it did not succeed; AFAS's reason, made readable. */
|
|
323
|
+
error: string | null;
|
|
324
|
+
/** The stable code of a refusal named before anything was sent, e.g. `AFAS_EXTERNAL_LINE_ARTICLE_UNSET`. */
|
|
325
|
+
errorCode: string | null;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Which AFAS path an order is on. The two are exclusive per order (mixing them books stock and
|
|
329
|
+
* receivables twice): `SALES_ORDER` (pushed with `orders.sync`, then `orders.settle`) or
|
|
330
|
+
* `DIRECT_INVOICE` (`orders.createDirectInvoice`); `NONE` before either.
|
|
331
|
+
*/
|
|
332
|
+
export type AfasOrderPath = 'SALES_ORDER' | 'DIRECT_INVOICE' | 'NONE';
|
|
333
|
+
/** An order's AFAS state, read from the platform (no AFAS call). */
|
|
334
|
+
export interface AfasOrderState {
|
|
335
|
+
path: AfasOrderPath;
|
|
336
|
+
afasSalesOrderId: string | null;
|
|
337
|
+
afasSettled: boolean;
|
|
338
|
+
/** The AFAS packing slip number (`OrNu`) of the direct invoice. */
|
|
339
|
+
afasDirectInvoiceOrNu: string | null;
|
|
340
|
+
/** The AFAS invoice number (the V-number). */
|
|
341
|
+
afasInvoiceNumber: string | null;
|
|
342
|
+
/** The AFAS invoice date, `YYYY-MM-DD`. */
|
|
343
|
+
afasInvoiceDate: string | null;
|
|
344
|
+
/** An invoice report connector is set, so `orders.invoicePdf` can answer a PDF. */
|
|
345
|
+
hasPdfReport: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* The order's state lets it be pushed as a sales order or a direct invoice: false in `Draft`,
|
|
348
|
+
* `AddingItems`, `ArrangingPayment` and `Cancelled`, where both refuse
|
|
349
|
+
* `AFAS_ORDER_STATE_BLOCKS_PUSH`. Says nothing of the path rules.
|
|
350
|
+
*/
|
|
351
|
+
stateAllowsPush: boolean;
|
|
352
|
+
/** As `stateAllowsPush`, for settling from prepaid credit, which `ArrangingPayment` allows. */
|
|
353
|
+
stateAllowsPrepaidSettlement: boolean;
|
|
354
|
+
}
|
|
355
|
+
/** What settling an AFAS sales order did. */
|
|
356
|
+
export interface AfasSettleResult {
|
|
357
|
+
success: boolean;
|
|
358
|
+
locked: boolean;
|
|
359
|
+
afasSettled: boolean;
|
|
360
|
+
error: string | null;
|
|
361
|
+
}
|
|
362
|
+
/** What creating an AFAS direct invoice did. */
|
|
363
|
+
export interface AfasDirectInvoiceResult {
|
|
364
|
+
success: boolean;
|
|
365
|
+
afasDirectInvoiceOrNu: string | null;
|
|
366
|
+
/** Resolved after the insert when AFAS answers it in time; null otherwise (filled later). */
|
|
367
|
+
afasInvoiceNumber: string | null;
|
|
368
|
+
afasInvoiceDate: string | null;
|
|
369
|
+
error: string | null;
|
|
370
|
+
/** The stable code of a refusal named before anything was sent. */
|
|
371
|
+
errorCode: string | null;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Why a stock transfer cannot be sent to AFAS now. Open on `string`: a newer engine may add a
|
|
375
|
+
* reason.
|
|
376
|
+
*/
|
|
377
|
+
export type AfasStockTransferBlockReason = 'AFAS_DISABLED' | 'NO_ADMINISTRATION' | 'STOCK_TRANSFER_UNSUPPORTED' | 'NOT_FOUND' | 'INVALID_STATE' | 'NO_LINES' | 'RETURN_BOTH_WAREHOUSES_MAPPED' | 'RETURN_NO_MAPPED_WAREHOUSE' | 'RETURN_NOT_RECEIVED' | 'RETURN_RECEIPT_UNKNOWN' | 'RETURN_NOTHING_RECEIVED' | 'NOTHING_LEFT_SOURCE' | (string & {});
|
|
378
|
+
/** Which way sending a stock transfer moves AFAS stock. */
|
|
379
|
+
export type AfasStockTransferDirection = 'DEDUCT' | 'ADD';
|
|
380
|
+
/** A stock transfer's AFAS state, read from the platform (no AFAS call). */
|
|
381
|
+
export interface AfasStockTransferState {
|
|
382
|
+
enabled: boolean;
|
|
383
|
+
pushed: boolean;
|
|
384
|
+
afasDirectInvoiceOrNu: string | null;
|
|
385
|
+
afasInvoiceNumber: string | null;
|
|
386
|
+
afasDebtorId: string | null;
|
|
387
|
+
pushedAt: string | null;
|
|
388
|
+
/** The AFAS warehouse of the source location; once pushed, the one the document was booked on. */
|
|
389
|
+
sourceAfasWarehouse: string | null;
|
|
390
|
+
/** The AFAS warehouse of the destination; null when unmapped, unread, or pushed. */
|
|
391
|
+
destinationAfasWarehouse: string | null;
|
|
392
|
+
/** True for a return of another transfer; null when the transfer could not be read. */
|
|
393
|
+
isReturn: boolean | null;
|
|
394
|
+
/** Null once pushed, and when the mapping allows no push. */
|
|
395
|
+
stockDirection: AfasStockTransferDirection | null;
|
|
396
|
+
pushable: boolean;
|
|
397
|
+
blockReason: AfasStockTransferBlockReason | null;
|
|
398
|
+
}
|
|
399
|
+
/** What sending a stock transfer to AFAS did. */
|
|
400
|
+
export interface AfasStockTransferInvoiceResult {
|
|
401
|
+
success: boolean;
|
|
402
|
+
/** A document already existed: nothing was written to AFAS again. */
|
|
403
|
+
alreadyPushed: boolean;
|
|
404
|
+
afasDirectInvoiceOrNu: string | null;
|
|
405
|
+
afasInvoiceNumber: string | null;
|
|
406
|
+
error: string | null;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* A customer's outstanding AFAS balance, read live.
|
|
410
|
+
*
|
|
411
|
+
* - `linked: false`: AFAS is off, or the customer has no AFAS debtor; use the platform ledger.
|
|
412
|
+
* - `linked: true, available: false`: AFAS could not be read; fall back to the ledger.
|
|
413
|
+
* - `linked: true, available: true`: `balance` is AFAS's figure.
|
|
414
|
+
*/
|
|
415
|
+
export interface AfasCustomerBalance {
|
|
416
|
+
linked: boolean;
|
|
417
|
+
available: boolean;
|
|
418
|
+
/** Minor units, signed (positive: the customer owes); null when not available. */
|
|
419
|
+
balance: number | null;
|
|
420
|
+
currencyCode: string | null;
|
|
421
|
+
debtorId: string | null;
|
|
422
|
+
}
|
|
423
|
+
/** The AFAS debtor a customer is linked to. */
|
|
424
|
+
export interface AfasDebtorLink {
|
|
425
|
+
/** The Verkooprelatie code (DbId). */
|
|
426
|
+
afasVrId: string;
|
|
427
|
+
/** The organisation or person number (BcCo); send it, or the next push matches by name. */
|
|
428
|
+
afasBcCo?: string | null;
|
|
429
|
+
afasKind?: AfasDebtorKind | null;
|
|
430
|
+
}
|
|
431
|
+
/** How `orders.sync` and `orders.createDirectInvoice` resolve the order's customer in AFAS. */
|
|
432
|
+
export interface AfasOrderCustomerInput {
|
|
433
|
+
/**
|
|
434
|
+
* An existing Verkooprelatie (DbId) to link before pushing, or `null` to create a new debtor.
|
|
435
|
+
* Ignored when the customer is already linked.
|
|
436
|
+
*/
|
|
437
|
+
customerAfasVrId?: string | null;
|
|
438
|
+
/** The linked debtor's BcCo; send it with `customerAfasVrId`. */
|
|
439
|
+
customerAfasBcCo?: string | null;
|
|
440
|
+
customerAfasKind?: AfasDebtorKind | null;
|
|
441
|
+
}
|
|
442
|
+
/** `orders.sync`'s choices beyond the order. */
|
|
443
|
+
export interface SyncAfasOrderInput extends AfasOrderCustomerInput {
|
|
444
|
+
/** An existing AFAS delivery address for billing, or `null` to send the address inline. */
|
|
445
|
+
billingAddressAfasId?: string | null;
|
|
446
|
+
/** An existing AFAS delivery address for shipping, or `null` to send the address inline. */
|
|
447
|
+
shippingAddressAfasId?: string | null;
|
|
448
|
+
}
|
|
449
|
+
/** `orders.createDirectInvoice`'s choices beyond the order. */
|
|
450
|
+
export interface CreateAfasDirectInvoiceInput extends AfasOrderCustomerInput {
|
|
451
|
+
/**
|
|
452
|
+
* Settle from prepaid credit: a €0 document (every line fully discounted) that books no
|
|
453
|
+
* receivable but keeps the lines, so AFAS deducts the stock. Allowed in `ArrangingPayment`.
|
|
454
|
+
*/
|
|
455
|
+
settleAsZeroValue?: boolean;
|
|
456
|
+
}
|
|
457
|
+
/** One of the customer's addresses paired with an AFAS delivery address. */
|
|
458
|
+
export interface AfasAddressMatchInput {
|
|
459
|
+
vendureAddressId: string;
|
|
460
|
+
/** An existing AFAS delivery address, or `null` to create one. */
|
|
461
|
+
afasAddressId?: string | null;
|
|
462
|
+
}
|
|
463
|
+
/** `customers.sync`'s choices beyond the customer. */
|
|
464
|
+
export interface SyncAfasCustomerInput {
|
|
465
|
+
/** An existing Verkooprelatie (DbId) to link, or `null` to create a new debtor. */
|
|
466
|
+
afasVrId?: string | null;
|
|
467
|
+
afasBcCo?: string | null;
|
|
468
|
+
afasKind?: AfasDebtorKind | null;
|
|
469
|
+
addressMatches?: AfasAddressMatchInput[];
|
|
470
|
+
}
|
|
471
|
+
/** What `customers.search` looks for; at least one of email, phone or name. */
|
|
472
|
+
export interface AfasCustomerSearchFilter {
|
|
473
|
+
email?: string;
|
|
474
|
+
phone?: string;
|
|
475
|
+
name?: string;
|
|
476
|
+
/** How many debtors to answer, 1 to `AFAS_CUSTOMER_SEARCH_LIMIT` (50); 10 by default. */
|
|
477
|
+
limit?: number;
|
|
478
|
+
}
|
|
479
|
+
/** What `stockTransfers.createInvoice` books the transfer against. */
|
|
480
|
+
export interface CreateAfasStockTransferInvoiceInput {
|
|
481
|
+
/** The AFAS relation (DbId) the €0 document is booked on; a transfer has no customer. */
|
|
482
|
+
afasDebtorId: string;
|
|
483
|
+
}
|