@endora-commerce/contracts 0.109.0 → 0.111.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/dist/accept-language.d.ts +31 -0
- package/dist/accept-language.js +64 -0
- package/dist/actor.d.ts +16 -0
- package/dist/addresses.d.ts +35 -0
- package/dist/addresses.js +8 -1
- package/dist/admin-actions.d.ts +2 -0
- package/dist/admin-actions.js +18 -0
- package/dist/admin-contributions.d.ts +99 -12
- package/dist/admin-contributions.js +36 -10
- package/dist/admin-roles.d.ts +17 -2
- package/dist/admin-users.d.ts +9 -0
- package/dist/admin.d.ts +114 -4
- package/dist/admin.js +98 -3
- package/dist/api-keys.d.ts +22 -0
- package/dist/api-keys.js +4 -0
- package/dist/assets-library.d.ts +45 -0
- package/dist/assets-library.js +20 -3
- package/dist/audit-logs.d.ts +12 -0
- package/dist/audit-logs.js +12 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +9 -0
- package/dist/blog.d.ts +382 -22
- package/dist/blog.js +199 -17
- package/dist/carts.d.ts +423 -36
- package/dist/carts.js +150 -12
- package/dist/catalog.d.ts +379 -208
- package/dist/catalog.js +241 -163
- package/dist/cms-brand.d.ts +14 -14
- package/dist/cms.d.ts +71 -16
- package/dist/cms.js +15 -0
- package/dist/command-hooks.d.ts +301 -0
- package/dist/command-hooks.js +248 -0
- package/dist/common.d.ts +23 -6
- package/dist/common.js +25 -2
- package/dist/comparisons.d.ts +21 -14
- package/dist/comparisons.js +2 -1
- package/dist/credit-limits.d.ts +22 -0
- package/dist/credit-limits.js +35 -0
- package/dist/crm.d.ts +134 -78
- package/dist/crm.js +21 -5
- package/dist/custom-fields.d.ts +417 -49
- package/dist/custom-fields.js +142 -1
- package/dist/customer-accounts.d.ts +324 -22
- package/dist/customer-accounts.js +43 -0
- package/dist/customer-notifications.d.ts +143 -0
- package/dist/customer-notifications.js +41 -0
- package/dist/customers.d.ts +92 -73
- package/dist/customers.js +98 -10
- package/dist/dictionary.d.ts +53 -0
- package/dist/dictionary.js +25 -0
- package/dist/document-templates.d.ts +12 -12
- package/dist/email.d.ts +34 -0
- package/dist/email.js +6 -0
- package/dist/errors.d.ts +431 -3
- package/dist/errors.js +523 -3
- package/dist/forms-logic.d.ts +79 -0
- package/dist/forms-logic.fixtures.d.ts +52 -0
- package/dist/forms-logic.fixtures.js +610 -0
- package/dist/forms-logic.js +699 -0
- package/dist/forms.d.ts +9833 -0
- package/dist/forms.js +827 -0
- package/dist/i18n.d.ts +34 -0
- package/dist/i18n.js +15 -0
- package/dist/import-export.d.ts +180 -0
- package/dist/import-export.js +60 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +30 -1
- package/dist/inventory.d.ts +9 -9
- package/dist/invoice-ledger.d.ts +13 -13
- package/dist/invoices.d.ts +126 -0
- package/dist/invoices.js +53 -0
- package/dist/line-bounds.d.ts +53 -0
- package/dist/line-bounds.js +65 -0
- package/dist/megamenu.d.ts +27 -27
- package/dist/mfa.d.ts +210 -4
- package/dist/mfa.js +136 -0
- package/dist/modules.d.ts +56 -8
- package/dist/modules.js +128 -3
- package/dist/money-decimal.d.ts +54 -0
- package/dist/money-decimal.js +95 -0
- package/dist/newsletter.d.ts +4 -4
- package/dist/orders.d.ts +246 -12
- package/dist/orders.js +140 -7
- package/dist/organization-hooks.d.ts +99 -0
- package/dist/organization-hooks.js +22 -0
- package/dist/organization-registry-lookup.d.ts +362 -0
- package/dist/organization-registry-lookup.js +196 -0
- package/dist/organization-roles.d.ts +341 -0
- package/dist/organization-roles.js +218 -0
- package/dist/organizations.d.ts +1074 -103
- package/dist/organizations.js +293 -28
- package/dist/page-builder-props.d.ts +56 -56
- package/dist/pim-connector.d.ts +7 -3
- package/dist/pim-connector.js +6 -2
- package/dist/pim-field-path.d.ts +5 -1
- package/dist/pim-field-path.js +37 -81
- package/dist/pim-locale-mapping.d.ts +131 -0
- package/dist/pim-locale-mapping.js +193 -0
- package/dist/price-books.d.ts +215 -63
- package/dist/price-books.js +47 -2
- package/dist/price-lists.d.ts +13 -10
- package/dist/product-feeds.d.ts +249 -100
- package/dist/product-feeds.js +46 -2
- package/dist/product-scope-model.d.ts +161 -0
- package/dist/product-scope-model.js +161 -0
- package/dist/product-scope-overrides.d.ts +0 -103
- package/dist/product-scope-overrides.js +0 -54
- package/dist/product-scoped-values.d.ts +2610 -0
- package/dist/product-scoped-values.js +425 -0
- package/dist/product-scopes.d.ts +199 -64
- package/dist/product-scopes.js +120 -23
- package/dist/product-tax-rates.d.ts +38 -0
- package/dist/product-tax-rates.js +45 -0
- package/dist/product-url-keys.d.ts +51 -45
- package/dist/product-url-keys.js +73 -39
- package/dist/product-value-resolver.d.ts +37 -60
- package/dist/product-value-resolver.js +36 -96
- package/dist/projects.d.ts +76 -28
- package/dist/projects.js +53 -9
- package/dist/promotions.d.ts +163 -11
- package/dist/promotions.js +23 -1
- package/dist/pwa.d.ts +41 -2
- package/dist/quick-order.d.ts +159 -9
- package/dist/quick-order.js +79 -4
- package/dist/quote-requests.d.ts +231 -17
- package/dist/quote-requests.js +111 -9
- package/dist/record-references.d.ts +15 -15
- package/dist/record-references.js +2 -3
- package/dist/record-rich-text.js +2 -1
- package/dist/returns.d.ts +214 -52
- package/dist/returns.js +143 -28
- package/dist/sales-channels.d.ts +34 -3
- package/dist/sales-channels.js +16 -1
- package/dist/saved-list-views.d.ts +28 -0
- package/dist/saved-list-views.js +14 -1
- package/dist/schema-extensions.d.ts +36 -0
- package/dist/schema-extensions.js +29 -0
- package/dist/scoped-write-encoding.d.ts +100 -0
- package/dist/scoped-write-encoding.js +135 -0
- package/dist/search.d.ts +18 -16
- package/dist/seo.d.ts +83 -30
- package/dist/seo.js +8 -1
- package/dist/settings.d.ts +173 -2
- package/dist/settings.js +53 -2
- package/dist/shopping-lists.d.ts +63 -4
- package/dist/shopping-lists.js +57 -3
- package/dist/storefront-cache-tags.d.ts +22 -0
- package/dist/storefront-cache-tags.js +12 -0
- package/dist/storefront-value-overrides.d.ts +18 -56
- package/dist/storefront-value-overrides.js +11 -86
- package/dist/tasks.d.ts +27 -27
- package/dist/taxes.d.ts +27 -0
- package/dist/taxes.js +4 -0
- package/dist/transactional-emails.d.ts +48 -22
- package/dist/webhooks.d.ts +75 -0
- package/dist/webhooks.js +24 -0
- package/package.json +5 -3
- package/dist/actor.d.ts.map +0 -1
- package/dist/actor.js.map +0 -1
- package/dist/addresses.d.ts.map +0 -1
- package/dist/addresses.js.map +0 -1
- package/dist/admin-actions.d.ts.map +0 -1
- package/dist/admin-actions.js.map +0 -1
- package/dist/admin-contributions.d.ts.map +0 -1
- package/dist/admin-contributions.js.map +0 -1
- package/dist/admin-feedback.d.ts.map +0 -1
- package/dist/admin-feedback.js.map +0 -1
- package/dist/admin-i18n.d.ts.map +0 -1
- package/dist/admin-i18n.js.map +0 -1
- package/dist/admin-name.d.ts.map +0 -1
- package/dist/admin-name.js.map +0 -1
- package/dist/admin-notifications.d.ts.map +0 -1
- package/dist/admin-notifications.js.map +0 -1
- package/dist/admin-preferences.d.ts.map +0 -1
- package/dist/admin-preferences.js.map +0 -1
- package/dist/admin-roles.d.ts.map +0 -1
- package/dist/admin-roles.js.map +0 -1
- package/dist/admin-search.d.ts.map +0 -1
- package/dist/admin-search.js.map +0 -1
- package/dist/admin-users.d.ts.map +0 -1
- package/dist/admin-users.js.map +0 -1
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js.map +0 -1
- package/dist/analytics.d.ts.map +0 -1
- package/dist/analytics.js.map +0 -1
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/assets-library.d.ts.map +0 -1
- package/dist/assets-library.js.map +0 -1
- package/dist/audit-logs.d.ts.map +0 -1
- package/dist/audit-logs.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/blog.d.ts.map +0 -1
- package/dist/blog.js.map +0 -1
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/capabilities.js.map +0 -1
- package/dist/carts.d.ts.map +0 -1
- package/dist/carts.js.map +0 -1
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js.map +0 -1
- package/dist/cms-brand.d.ts.map +0 -1
- package/dist/cms-brand.js.map +0 -1
- package/dist/cms-contact-form.d.ts.map +0 -1
- package/dist/cms-contact-form.js.map +0 -1
- package/dist/cms.d.ts.map +0 -1
- package/dist/cms.js.map +0 -1
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js.map +0 -1
- package/dist/comparisons.d.ts.map +0 -1
- package/dist/comparisons.js.map +0 -1
- package/dist/credentials.d.ts.map +0 -1
- package/dist/credentials.js.map +0 -1
- package/dist/credit-limits.d.ts.map +0 -1
- package/dist/credit-limits.js.map +0 -1
- package/dist/crm-rich-text.d.ts.map +0 -1
- package/dist/crm-rich-text.js.map +0 -1
- package/dist/crm.d.ts.map +0 -1
- package/dist/crm.js.map +0 -1
- package/dist/currencies.d.ts.map +0 -1
- package/dist/currencies.js.map +0 -1
- package/dist/custom-fields.d.ts.map +0 -1
- package/dist/custom-fields.js.map +0 -1
- package/dist/customer-accounts.d.ts.map +0 -1
- package/dist/customer-accounts.js.map +0 -1
- package/dist/customers.d.ts.map +0 -1
- package/dist/customers.js.map +0 -1
- package/dist/dictionary.d.ts.map +0 -1
- package/dist/dictionary.js.map +0 -1
- package/dist/document-templates.d.ts.map +0 -1
- package/dist/document-templates.js.map +0 -1
- package/dist/document-values.d.ts.map +0 -1
- package/dist/document-values.js.map +0 -1
- package/dist/email-address.d.ts.map +0 -1
- package/dist/email-address.js.map +0 -1
- package/dist/email.d.ts.map +0 -1
- package/dist/email.js.map +0 -1
- package/dist/envelopes.d.ts.map +0 -1
- package/dist/envelopes.js.map +0 -1
- package/dist/environment-inputs.d.ts.map +0 -1
- package/dist/environment-inputs.js.map +0 -1
- package/dist/erp-connector.d.ts.map +0 -1
- package/dist/erp-connector.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/google-analytics.d.ts.map +0 -1
- package/dist/google-analytics.js.map +0 -1
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag-manager.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/import-export.d.ts.map +0 -1
- package/dist/import-export.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inventory.d.ts.map +0 -1
- package/dist/inventory.js.map +0 -1
- package/dist/invoice-ledger.d.ts.map +0 -1
- package/dist/invoice-ledger.js.map +0 -1
- package/dist/invoices.d.ts.map +0 -1
- package/dist/invoices.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/languages.d.ts.map +0 -1
- package/dist/languages.js.map +0 -1
- package/dist/line-groups.d.ts.map +0 -1
- package/dist/line-groups.js.map +0 -1
- package/dist/linkedin-ads.d.ts.map +0 -1
- package/dist/linkedin-ads.js.map +0 -1
- package/dist/localized-name.d.ts.map +0 -1
- package/dist/localized-name.js.map +0 -1
- package/dist/megamenu.d.ts.map +0 -1
- package/dist/megamenu.js.map +0 -1
- package/dist/meta-ads.d.ts.map +0 -1
- package/dist/meta-ads.js.map +0 -1
- package/dist/mfa.d.ts.map +0 -1
- package/dist/mfa.js.map +0 -1
- package/dist/modules.d.ts.map +0 -1
- package/dist/modules.js.map +0 -1
- package/dist/money-decimal.d.ts.map +0 -1
- package/dist/money-decimal.js.map +0 -1
- package/dist/money-input.d.ts.map +0 -1
- package/dist/money-input.js.map +0 -1
- package/dist/newsletter.d.ts.map +0 -1
- package/dist/newsletter.js.map +0 -1
- package/dist/order-minimums.d.ts.map +0 -1
- package/dist/order-minimums.js.map +0 -1
- package/dist/orders.d.ts.map +0 -1
- package/dist/orders.js.map +0 -1
- package/dist/organizations.d.ts.map +0 -1
- package/dist/organizations.js.map +0 -1
- package/dist/page-builder-props.d.ts.map +0 -1
- package/dist/page-builder-props.js.map +0 -1
- package/dist/page-builder-values.d.ts.map +0 -1
- package/dist/page-builder-values.js.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/payment-methods.d.ts.map +0 -1
- package/dist/payment-methods.js.map +0 -1
- package/dist/payment-return-url.d.ts.map +0 -1
- package/dist/payment-return-url.js.map +0 -1
- package/dist/payments.d.ts.map +0 -1
- package/dist/payments.js.map +0 -1
- package/dist/pim-connector.d.ts.map +0 -1
- package/dist/pim-connector.js.map +0 -1
- package/dist/pim-field-path.d.ts.map +0 -1
- package/dist/pim-field-path.js.map +0 -1
- package/dist/platform-info.d.ts.map +0 -1
- package/dist/platform-info.js.map +0 -1
- package/dist/platform-language.d.ts.map +0 -1
- package/dist/platform-language.js.map +0 -1
- package/dist/price-book-decimal.d.ts.map +0 -1
- package/dist/price-book-decimal.js.map +0 -1
- package/dist/price-books.d.ts.map +0 -1
- package/dist/price-books.js.map +0 -1
- package/dist/price-lists.d.ts.map +0 -1
- package/dist/price-lists.js.map +0 -1
- package/dist/product-feeds.d.ts.map +0 -1
- package/dist/product-feeds.js.map +0 -1
- package/dist/product-scope-overrides.d.ts.map +0 -1
- package/dist/product-scope-overrides.js.map +0 -1
- package/dist/product-scopes.d.ts.map +0 -1
- package/dist/product-scopes.js.map +0 -1
- package/dist/product-summary-text.d.ts.map +0 -1
- package/dist/product-summary-text.js.map +0 -1
- package/dist/product-url-keys.d.ts.map +0 -1
- package/dist/product-url-keys.js.map +0 -1
- package/dist/product-value-resolver.d.ts.map +0 -1
- package/dist/product-value-resolver.js.map +0 -1
- package/dist/projects.d.ts.map +0 -1
- package/dist/projects.js.map +0 -1
- package/dist/promotions.d.ts.map +0 -1
- package/dist/promotions.js.map +0 -1
- package/dist/prompt-actions.d.ts.map +0 -1
- package/dist/prompt-actions.js.map +0 -1
- package/dist/pwa.d.ts.map +0 -1
- package/dist/pwa.js.map +0 -1
- package/dist/quick-order.d.ts.map +0 -1
- package/dist/quick-order.js.map +0 -1
- package/dist/quote-requests.d.ts.map +0 -1
- package/dist/quote-requests.js.map +0 -1
- package/dist/record-references.d.ts.map +0 -1
- package/dist/record-references.js.map +0 -1
- package/dist/record-rich-text.d.ts.map +0 -1
- package/dist/record-rich-text.js.map +0 -1
- package/dist/returns.d.ts.map +0 -1
- package/dist/returns.js.map +0 -1
- package/dist/sales-channels.d.ts.map +0 -1
- package/dist/sales-channels.js.map +0 -1
- package/dist/saved-list-views.d.ts.map +0 -1
- package/dist/saved-list-views.js.map +0 -1
- package/dist/scope-notice.d.ts.map +0 -1
- package/dist/scope-notice.js.map +0 -1
- package/dist/scoped-translations.d.ts +0 -48
- package/dist/scoped-translations.d.ts.map +0 -1
- package/dist/scoped-translations.js +0 -78
- package/dist/scoped-translations.js.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/seo.d.ts.map +0 -1
- package/dist/seo.js.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/shipments.d.ts.map +0 -1
- package/dist/shipments.js.map +0 -1
- package/dist/shipping-methods.d.ts.map +0 -1
- package/dist/shipping-methods.js.map +0 -1
- package/dist/shopping-lists.d.ts.map +0 -1
- package/dist/shopping-lists.js.map +0 -1
- package/dist/storefront-cache-tags.d.ts.map +0 -1
- package/dist/storefront-cache-tags.js.map +0 -1
- package/dist/storefront-language-path.d.ts.map +0 -1
- package/dist/storefront-language-path.js.map +0 -1
- package/dist/storefront-value-overrides.d.ts.map +0 -1
- package/dist/storefront-value-overrides.js.map +0 -1
- package/dist/tasks.d.ts.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/taxes.d.ts.map +0 -1
- package/dist/taxes.js.map +0 -1
- package/dist/text-normalization.d.ts.map +0 -1
- package/dist/text-normalization.js.map +0 -1
- package/dist/transactional-emails.d.ts.map +0 -1
- package/dist/transactional-emails.js.map +0 -1
- package/dist/webhooks.d.ts.map +0 -1
- package/dist/webhooks.js.map +0 -1
|
@@ -22,13 +22,13 @@ import { z } from 'zod';
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const RECORD_REFERENCE_TYPES: readonly ["product", "order", "admin_user", "quote_request", "task", "opportunity", "project"];
|
|
24
24
|
export declare const recordReferenceTypeSchema: z.ZodEnum<{
|
|
25
|
-
product: "product";
|
|
26
25
|
order: "order";
|
|
27
|
-
admin_user: "admin_user";
|
|
28
26
|
quote_request: "quote_request";
|
|
29
|
-
|
|
27
|
+
product: "product";
|
|
30
28
|
opportunity: "opportunity";
|
|
31
29
|
project: "project";
|
|
30
|
+
task: "task";
|
|
31
|
+
admin_user: "admin_user";
|
|
32
32
|
}>;
|
|
33
33
|
export type RecordReferenceType = z.infer<typeof recordReferenceTypeSchema>;
|
|
34
34
|
/**
|
|
@@ -82,13 +82,13 @@ export type RecordReferenceOrder = z.infer<typeof RecordReferenceOrderSchema>;
|
|
|
82
82
|
*/
|
|
83
83
|
export declare const RecordReferenceSchema: z.ZodObject<{
|
|
84
84
|
type: z.ZodEnum<{
|
|
85
|
-
product: "product";
|
|
86
85
|
order: "order";
|
|
87
|
-
admin_user: "admin_user";
|
|
88
86
|
quote_request: "quote_request";
|
|
89
|
-
|
|
87
|
+
product: "product";
|
|
90
88
|
opportunity: "opportunity";
|
|
91
89
|
project: "project";
|
|
90
|
+
task: "task";
|
|
91
|
+
admin_user: "admin_user";
|
|
92
92
|
}>;
|
|
93
93
|
id: z.ZodString;
|
|
94
94
|
available: z.ZodBoolean;
|
|
@@ -111,9 +111,9 @@ export declare const RECORD_DOCUMENT_KINDS: readonly ["order", "quote_request",
|
|
|
111
111
|
export declare const recordDocumentKindSchema: z.ZodEnum<{
|
|
112
112
|
order: "order";
|
|
113
113
|
quote_request: "quote_request";
|
|
114
|
-
task: "task";
|
|
115
114
|
opportunity: "opportunity";
|
|
116
115
|
project: "project";
|
|
116
|
+
task: "task";
|
|
117
117
|
}>;
|
|
118
118
|
export type RecordDocumentKind = z.infer<typeof recordDocumentKindSchema>;
|
|
119
119
|
export declare const RecordDocumentLookupItemSchema: z.ZodObject<{
|
|
@@ -126,9 +126,9 @@ export declare const RecordDocumentLookupGroupSchema: z.ZodObject<{
|
|
|
126
126
|
kind: z.ZodEnum<{
|
|
127
127
|
order: "order";
|
|
128
128
|
quote_request: "quote_request";
|
|
129
|
-
task: "task";
|
|
130
129
|
opportunity: "opportunity";
|
|
131
130
|
project: "project";
|
|
131
|
+
task: "task";
|
|
132
132
|
}>;
|
|
133
133
|
items: z.ZodArray<z.ZodObject<{
|
|
134
134
|
id: z.ZodString;
|
|
@@ -149,9 +149,9 @@ export declare const RecordDocumentLookupResponseSchema: z.ZodObject<{
|
|
|
149
149
|
kind: z.ZodEnum<{
|
|
150
150
|
order: "order";
|
|
151
151
|
quote_request: "quote_request";
|
|
152
|
-
task: "task";
|
|
153
152
|
opportunity: "opportunity";
|
|
154
153
|
project: "project";
|
|
154
|
+
task: "task";
|
|
155
155
|
}>;
|
|
156
156
|
items: z.ZodArray<z.ZodObject<{
|
|
157
157
|
id: z.ZodString;
|
|
@@ -179,13 +179,13 @@ export declare const RecordHistoryEntrySchema: z.ZodObject<{
|
|
|
179
179
|
after: z.ZodNullable<z.ZodUnknown>;
|
|
180
180
|
references: z.ZodArray<z.ZodObject<{
|
|
181
181
|
type: z.ZodEnum<{
|
|
182
|
-
product: "product";
|
|
183
182
|
order: "order";
|
|
184
|
-
admin_user: "admin_user";
|
|
185
183
|
quote_request: "quote_request";
|
|
186
|
-
|
|
184
|
+
product: "product";
|
|
187
185
|
opportunity: "opportunity";
|
|
188
186
|
project: "project";
|
|
187
|
+
task: "task";
|
|
188
|
+
admin_user: "admin_user";
|
|
189
189
|
}>;
|
|
190
190
|
id: z.ZodString;
|
|
191
191
|
available: z.ZodBoolean;
|
|
@@ -220,13 +220,13 @@ export declare const RecordHistoryPageSchema: z.ZodObject<{
|
|
|
220
220
|
after: z.ZodNullable<z.ZodUnknown>;
|
|
221
221
|
references: z.ZodArray<z.ZodObject<{
|
|
222
222
|
type: z.ZodEnum<{
|
|
223
|
-
product: "product";
|
|
224
223
|
order: "order";
|
|
225
|
-
admin_user: "admin_user";
|
|
226
224
|
quote_request: "quote_request";
|
|
227
|
-
|
|
225
|
+
product: "product";
|
|
228
226
|
opportunity: "opportunity";
|
|
229
227
|
project: "project";
|
|
228
|
+
task: "task";
|
|
229
|
+
admin_user: "admin_user";
|
|
230
230
|
}>;
|
|
231
231
|
id: z.ZodString;
|
|
232
232
|
available: z.ZodBoolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { UUID_SHAPE_PATTERN } from './common.js';
|
|
2
3
|
import { collectionEnvelope } from './envelopes.js';
|
|
3
4
|
/**
|
|
4
5
|
* The reference standard of every record's free text — an Opportunity's, a
|
|
@@ -33,14 +34,12 @@ export const RECORD_REFERENCE_TYPES = [
|
|
|
33
34
|
'project',
|
|
34
35
|
];
|
|
35
36
|
export const recordReferenceTypeSchema = z.enum(RECORD_REFERENCE_TYPES);
|
|
36
|
-
/** The uuid of a token, as its regular-expression source. */
|
|
37
|
-
const UUID_SOURCE = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
|
|
38
37
|
/**
|
|
39
38
|
* The source of the token expression — group 1 the type, group 2 the id. A
|
|
40
39
|
* source and not a shared `RegExp`, because a global expression carries
|
|
41
40
|
* `lastIndex` from one caller to the next: build a fresh one per use.
|
|
42
41
|
*/
|
|
43
|
-
export const REFERENCE_TOKEN_SOURCE = `\\[\\[(${RECORD_REFERENCE_TYPES.join('|')}):(${
|
|
42
|
+
export const REFERENCE_TOKEN_SOURCE = `\\[\\[(${RECORD_REFERENCE_TYPES.join('|')}):(${UUID_SHAPE_PATTERN})\\]\\]`;
|
|
44
43
|
export function formatRecordReferenceToken(type, id) {
|
|
45
44
|
return `[[${type}:${id}]]`;
|
|
46
45
|
}
|
package/dist/record-rich-text.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UUID_SHAPE_PATTERN } from './common.js';
|
|
1
2
|
import { recordReferenceTypeSchema } from './record-references.js';
|
|
2
3
|
/** The order marks are written in, outermost first — what makes the writer deterministic. */
|
|
3
4
|
const MARK_ORDER = ['bold', 'italic', 'strike'];
|
|
@@ -5,7 +6,7 @@ const MARK_DELIMITER = { bold: '**', italic: '_', strike: '~~' };
|
|
|
5
6
|
/** Characters a backslash makes literal. */
|
|
6
7
|
const ESCAPABLE = new Set(['\\', '*', '_', '~', '[', ']']);
|
|
7
8
|
const SAFE_HREF = /^(https?:\/\/[^\s()<>]+|mailto:[^\s()<>]+)$/i;
|
|
8
|
-
const REFERENCE_AT = new RegExp(`\\[\\[(${recordReferenceTypeSchema.options.join('|')}):(
|
|
9
|
+
const REFERENCE_AT = new RegExp(`\\[\\[(${recordReferenceTypeSchema.options.join('|')}):(${UUID_SHAPE_PATTERN})\\]\\]`, 'y');
|
|
9
10
|
const BULLET_LINE = /^- (.*)$/s;
|
|
10
11
|
const ORDERED_LINE = /^(\d{1,9})\. (.*)$/s;
|
|
11
12
|
const WORD_CHARACTER = /[\p{L}\p{N}]/u;
|
package/dist/returns.d.ts
CHANGED
|
@@ -20,6 +20,49 @@ export declare const resolutionTypeSchema: z.ZodEnum<{
|
|
|
20
20
|
repair: "repair";
|
|
21
21
|
}>;
|
|
22
22
|
export type ResolutionType = z.infer<typeof resolutionTypeSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* The resolutions that settle a consumer withdrawal otherwise than by a refund
|
|
25
|
+
* (issue #905, design D1). A consumer who withdraws is reimbursed by the same
|
|
26
|
+
* means of payment unless they expressly agree otherwise (Directive 2011/83
|
|
27
|
+
* art. 13(1)), so each needs the consumer's consent on record first.
|
|
28
|
+
*/
|
|
29
|
+
export declare const alternativeResolutionSchema: z.ZodEnum<{
|
|
30
|
+
credit: "credit";
|
|
31
|
+
replacement: "replacement";
|
|
32
|
+
repair: "repair";
|
|
33
|
+
}>;
|
|
34
|
+
export type AlternativeResolution = z.infer<typeof alternativeResolutionSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* Who put the consent on record. `operator_recorded` is the only source today:
|
|
37
|
+
* the consumer agrees by e-mail or telephone and an operator records it with
|
|
38
|
+
* the evidence. `consumer_storefront` is reserved for a consumer's own click on
|
|
39
|
+
* the storefront, should that be required later.
|
|
40
|
+
*/
|
|
41
|
+
export declare const alternativeConsentSourceSchema: z.ZodEnum<{
|
|
42
|
+
operator_recorded: "operator_recorded";
|
|
43
|
+
consumer_storefront: "consumer_storefront";
|
|
44
|
+
}>;
|
|
45
|
+
export type AlternativeConsentSource = z.infer<typeof alternativeConsentSourceSchema>;
|
|
46
|
+
/**
|
|
47
|
+
* The consumer's consent to settle a withdrawal as `resolution` (issue #905,
|
|
48
|
+
* design D1). `note` (the evidence) and `byAdminUserId` are the operator's:
|
|
49
|
+
* the buyer's view of a case leaves both out.
|
|
50
|
+
*/
|
|
51
|
+
export declare const alternativeResolutionConsentSchema: z.ZodObject<{
|
|
52
|
+
resolution: z.ZodEnum<{
|
|
53
|
+
credit: "credit";
|
|
54
|
+
replacement: "replacement";
|
|
55
|
+
repair: "repair";
|
|
56
|
+
}>;
|
|
57
|
+
at: z.ZodString;
|
|
58
|
+
note: z.ZodOptional<z.ZodString>;
|
|
59
|
+
byAdminUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
source: z.ZodEnum<{
|
|
61
|
+
operator_recorded: "operator_recorded";
|
|
62
|
+
consumer_storefront: "consumer_storefront";
|
|
63
|
+
}>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type AlternativeResolutionConsent = z.infer<typeof alternativeResolutionConsentSchema>;
|
|
23
66
|
/** State of a recorded refund's money movement. */
|
|
24
67
|
export declare const settlementStateSchema: z.ZodEnum<{
|
|
25
68
|
failed: "failed";
|
|
@@ -141,6 +184,7 @@ export declare const returnCaseSummarySchema: z.ZodObject<{
|
|
|
141
184
|
totalRefundAmount: z.ZodNumber;
|
|
142
185
|
currency: z.ZodString;
|
|
143
186
|
submittedAt: z.ZodString;
|
|
187
|
+
customerAccountId: z.ZodString;
|
|
144
188
|
}, z.core.$strip>;
|
|
145
189
|
export type ReturnCaseSummary = z.infer<typeof returnCaseSummarySchema>;
|
|
146
190
|
/**
|
|
@@ -244,6 +288,25 @@ export declare const returnCaseDetailSchema: z.ZodObject<{
|
|
|
244
288
|
}>;
|
|
245
289
|
invoiceId: z.ZodNullable<z.ZodString>;
|
|
246
290
|
}, z.core.$strip>>;
|
|
291
|
+
chargeRefunds: z.ZodOptional<z.ZodObject<{
|
|
292
|
+
delivery: z.ZodNumber;
|
|
293
|
+
surcharge: z.ZodNumber;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
consumerWithdrawal: z.ZodNullable<z.ZodBoolean>;
|
|
296
|
+
alternativeResolutionConsent: z.ZodNullable<z.ZodObject<{
|
|
297
|
+
resolution: z.ZodEnum<{
|
|
298
|
+
credit: "credit";
|
|
299
|
+
replacement: "replacement";
|
|
300
|
+
repair: "repair";
|
|
301
|
+
}>;
|
|
302
|
+
at: z.ZodString;
|
|
303
|
+
note: z.ZodOptional<z.ZodString>;
|
|
304
|
+
byAdminUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
|
+
source: z.ZodEnum<{
|
|
306
|
+
operator_recorded: "operator_recorded";
|
|
307
|
+
consumer_storefront: "consumer_storefront";
|
|
308
|
+
}>;
|
|
309
|
+
}, z.core.$strip>>;
|
|
247
310
|
}, z.core.$strip>;
|
|
248
311
|
export type ReturnCaseDetail = z.infer<typeof returnCaseDetailSchema>;
|
|
249
312
|
export declare const returnableLineSchema: z.ZodObject<{
|
|
@@ -339,10 +402,17 @@ export declare const adminReturnRowSchema: z.ZodObject<{
|
|
|
339
402
|
totalRefundAmount: z.ZodNumber;
|
|
340
403
|
currency: z.ZodString;
|
|
341
404
|
submittedAt: z.ZodString;
|
|
405
|
+
customerAccountId: z.ZodString;
|
|
342
406
|
customerName: z.ZodNullable<z.ZodString>;
|
|
343
407
|
organizationName: z.ZodNullable<z.ZodString>;
|
|
344
408
|
}, z.core.$strip>;
|
|
345
409
|
export type AdminReturnRow = z.infer<typeof adminReturnRowSchema>;
|
|
410
|
+
/** One order charge a settlement may refund (issue #876): the most that may be approved, and the amount prefilled. */
|
|
411
|
+
export declare const settlementChargeSchema: z.ZodObject<{
|
|
412
|
+
cap: z.ZodNumber;
|
|
413
|
+
approved: z.ZodNumber;
|
|
414
|
+
}, z.core.$strip>;
|
|
415
|
+
export type SettlementCharge = z.infer<typeof settlementChargeSchema>;
|
|
346
416
|
export declare const settlementPrefillSchema: z.ZodObject<{
|
|
347
417
|
currency: z.ZodString;
|
|
348
418
|
resolutionOptions: z.ZodArray<z.ZodEnum<{
|
|
@@ -351,6 +421,19 @@ export declare const settlementPrefillSchema: z.ZodObject<{
|
|
|
351
421
|
replacement: "replacement";
|
|
352
422
|
repair: "repair";
|
|
353
423
|
}>>;
|
|
424
|
+
defaultResolution: z.ZodEnum<{
|
|
425
|
+
refund: "refund";
|
|
426
|
+
credit: "credit";
|
|
427
|
+
replacement: "replacement";
|
|
428
|
+
repair: "repair";
|
|
429
|
+
}>;
|
|
430
|
+
consentRequiredFor: z.ZodArray<z.ZodEnum<{
|
|
431
|
+
refund: "refund";
|
|
432
|
+
credit: "credit";
|
|
433
|
+
replacement: "replacement";
|
|
434
|
+
repair: "repair";
|
|
435
|
+
}>>;
|
|
436
|
+
defaultRefundPaymentMethodId: z.ZodNullable<z.ZodString>;
|
|
354
437
|
items: z.ZodArray<z.ZodObject<{
|
|
355
438
|
returnCaseItemId: z.ZodString;
|
|
356
439
|
productName: z.ZodString;
|
|
@@ -358,6 +441,16 @@ export declare const settlementPrefillSchema: z.ZodObject<{
|
|
|
358
441
|
defaultRefundAmount: z.ZodNumber;
|
|
359
442
|
approvedRefundAmount: z.ZodNumber;
|
|
360
443
|
}, z.core.$strip>>;
|
|
444
|
+
charges: z.ZodOptional<z.ZodObject<{
|
|
445
|
+
delivery: z.ZodOptional<z.ZodObject<{
|
|
446
|
+
cap: z.ZodNumber;
|
|
447
|
+
approved: z.ZodNumber;
|
|
448
|
+
}, z.core.$strip>>;
|
|
449
|
+
surcharge: z.ZodOptional<z.ZodObject<{
|
|
450
|
+
cap: z.ZodNumber;
|
|
451
|
+
approved: z.ZodNumber;
|
|
452
|
+
}, z.core.$strip>>;
|
|
453
|
+
}, z.core.$strip>>;
|
|
361
454
|
}, z.core.$strip>;
|
|
362
455
|
export type SettlementPrefill = z.infer<typeof settlementPrefillSchema>;
|
|
363
456
|
export declare const settlementRequestSchema: z.ZodObject<{
|
|
@@ -373,8 +466,25 @@ export declare const settlementRequestSchema: z.ZodObject<{
|
|
|
373
466
|
}, z.core.$strip>>>;
|
|
374
467
|
refundPaymentMethodId: z.ZodOptional<z.ZodString>;
|
|
375
468
|
createCorrectiveInvoice: z.ZodOptional<z.ZodBoolean>;
|
|
469
|
+
deliveryRefundAmount: z.ZodOptional<z.ZodNumber>;
|
|
470
|
+
surchargeRefundAmount: z.ZodOptional<z.ZodNumber>;
|
|
376
471
|
}, z.core.$strip>;
|
|
377
472
|
export type SettlementRequest = z.infer<typeof settlementRequestSchema>;
|
|
473
|
+
/**
|
|
474
|
+
* `POST /api/v1/admin/returns/:id/alternative-consent` (issue #905, design D1):
|
|
475
|
+
* the operator records that the consumer agreed to `resolution`, when, and the
|
|
476
|
+
* evidence. The moment may not be in the future, nor before the case was filed.
|
|
477
|
+
*/
|
|
478
|
+
export declare const recordAlternativeConsentRequestSchema: z.ZodObject<{
|
|
479
|
+
resolution: z.ZodEnum<{
|
|
480
|
+
credit: "credit";
|
|
481
|
+
replacement: "replacement";
|
|
482
|
+
repair: "repair";
|
|
483
|
+
}>;
|
|
484
|
+
consentGivenAt: z.ZodString;
|
|
485
|
+
note: z.ZodString;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
export type RecordAlternativeConsentRequest = z.infer<typeof recordAlternativeConsentRequestSchema>;
|
|
378
488
|
/**
|
|
379
489
|
* What became of the corrective invoice a settlement asked for (#135).
|
|
380
490
|
*
|
|
@@ -478,17 +588,17 @@ export declare const createReturnShipmentRequestSchema: z.ZodObject<{
|
|
|
478
588
|
externalReference: z.ZodOptional<z.ZodString>;
|
|
479
589
|
}, z.core.$strip>;
|
|
480
590
|
export declare const reasonAppliesToSchema: z.ZodEnum<{
|
|
591
|
+
both: "both";
|
|
481
592
|
return: "return";
|
|
482
593
|
complaint: "complaint";
|
|
483
|
-
both: "both";
|
|
484
594
|
}>;
|
|
485
595
|
export declare const returnReasonSchema: z.ZodObject<{
|
|
486
596
|
id: z.ZodString;
|
|
487
597
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
488
598
|
appliesTo: z.ZodEnum<{
|
|
599
|
+
both: "both";
|
|
489
600
|
return: "return";
|
|
490
601
|
complaint: "complaint";
|
|
491
|
-
both: "both";
|
|
492
602
|
}>;
|
|
493
603
|
isActive: z.ZodBoolean;
|
|
494
604
|
weight: z.ZodNumber;
|
|
@@ -497,9 +607,9 @@ export type ReturnReasonDto = z.infer<typeof returnReasonSchema>;
|
|
|
497
607
|
export declare const returnReasonCreateSchema: z.ZodObject<{
|
|
498
608
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
499
609
|
appliesTo: z.ZodEnum<{
|
|
610
|
+
both: "both";
|
|
500
611
|
return: "return";
|
|
501
612
|
complaint: "complaint";
|
|
502
|
-
both: "both";
|
|
503
613
|
}>;
|
|
504
614
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
505
615
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -507,9 +617,9 @@ export declare const returnReasonCreateSchema: z.ZodObject<{
|
|
|
507
617
|
export declare const returnReasonUpdateSchema: z.ZodObject<{
|
|
508
618
|
label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
509
619
|
appliesTo: z.ZodOptional<z.ZodEnum<{
|
|
620
|
+
both: "both";
|
|
510
621
|
return: "return";
|
|
511
622
|
complaint: "complaint";
|
|
512
|
-
both: "both";
|
|
513
623
|
}>>;
|
|
514
624
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
515
625
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -552,6 +662,7 @@ export declare const adminReturnsListResponseSchema: z.ZodObject<{
|
|
|
552
662
|
totalRefundAmount: z.ZodNumber;
|
|
553
663
|
currency: z.ZodString;
|
|
554
664
|
submittedAt: z.ZodString;
|
|
665
|
+
customerAccountId: z.ZodString;
|
|
555
666
|
customerName: z.ZodNullable<z.ZodString>;
|
|
556
667
|
organizationName: z.ZodNullable<z.ZodString>;
|
|
557
668
|
}, z.core.$strip>>;
|
|
@@ -572,54 +683,6 @@ export declare const bulkTransitionResultSchema: z.ZodObject<{
|
|
|
572
683
|
}, z.core.$strip>>;
|
|
573
684
|
}, z.core.$strip>;
|
|
574
685
|
export type BulkTransitionResult = z.infer<typeof bulkTransitionResultSchema>;
|
|
575
|
-
export declare const returnSavedViewSortSchema: z.ZodObject<{
|
|
576
|
-
field: z.ZodString;
|
|
577
|
-
dir: z.ZodEnum<{
|
|
578
|
-
asc: "asc";
|
|
579
|
-
desc: "desc";
|
|
580
|
-
}>;
|
|
581
|
-
}, z.core.$strip>;
|
|
582
|
-
export declare const returnSavedViewSchema: z.ZodObject<{
|
|
583
|
-
id: z.ZodString;
|
|
584
|
-
name: z.ZodString;
|
|
585
|
-
shared: z.ZodBoolean;
|
|
586
|
-
filters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
587
|
-
sort: z.ZodObject<{
|
|
588
|
-
field: z.ZodString;
|
|
589
|
-
dir: z.ZodEnum<{
|
|
590
|
-
asc: "asc";
|
|
591
|
-
desc: "desc";
|
|
592
|
-
}>;
|
|
593
|
-
}, z.core.$strip>;
|
|
594
|
-
visibleColumns: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
595
|
-
}, z.core.$strip>;
|
|
596
|
-
export type ReturnSavedViewDto = z.infer<typeof returnSavedViewSchema>;
|
|
597
|
-
export declare const returnSavedViewCreateSchema: z.ZodObject<{
|
|
598
|
-
name: z.ZodString;
|
|
599
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
600
|
-
filters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
601
|
-
sort: z.ZodObject<{
|
|
602
|
-
field: z.ZodString;
|
|
603
|
-
dir: z.ZodEnum<{
|
|
604
|
-
asc: "asc";
|
|
605
|
-
desc: "desc";
|
|
606
|
-
}>;
|
|
607
|
-
}, z.core.$strip>;
|
|
608
|
-
visibleColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
609
|
-
}, z.core.$strip>;
|
|
610
|
-
export declare const returnSavedViewUpdateSchema: z.ZodObject<{
|
|
611
|
-
name: z.ZodOptional<z.ZodString>;
|
|
612
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
613
|
-
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
614
|
-
sort: z.ZodOptional<z.ZodObject<{
|
|
615
|
-
field: z.ZodString;
|
|
616
|
-
dir: z.ZodEnum<{
|
|
617
|
-
asc: "asc";
|
|
618
|
-
desc: "desc";
|
|
619
|
-
}>;
|
|
620
|
-
}, z.core.$strip>>;
|
|
621
|
-
visibleColumns: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
622
|
-
}, z.core.$strip>;
|
|
623
686
|
export interface PaymentRefundInput {
|
|
624
687
|
orderId: string;
|
|
625
688
|
amount: number;
|
|
@@ -660,6 +723,35 @@ export interface OrderReturnRefund {
|
|
|
660
723
|
amount: string;
|
|
661
724
|
settlementState: 'issued' | 'pending_manual' | 'failed';
|
|
662
725
|
}
|
|
726
|
+
/**
|
|
727
|
+
* How much of one order line came back (issue #435): the quantity, summed over
|
|
728
|
+
* the order's settled `return`-kind cases resolved with a refund or a credit —
|
|
729
|
+
* whether or not the money has been paid out. A replacement, a repair and a
|
|
730
|
+
* complaint are not counted: the goods were not given up for money.
|
|
731
|
+
*/
|
|
732
|
+
export interface OrderReturnedQuantity {
|
|
733
|
+
orderItemId: string;
|
|
734
|
+
/** A whole number of units, greater than 0. */
|
|
735
|
+
quantity: number;
|
|
736
|
+
/**
|
|
737
|
+
* The part of the order-level discount those cases carried back for the
|
|
738
|
+
* line, as recorded at settlement — each case line's default discount in
|
|
739
|
+
* proportion to its approved refund — summed, as a two-place decimal string
|
|
740
|
+
* (`'0.00'` without a discount). An invoice issued afterwards takes it off
|
|
741
|
+
* its discount line, so the line carries only the kept goods' share.
|
|
742
|
+
*/
|
|
743
|
+
discount: string;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* The key of the transaction-scoped advisory lock (`pg_advisory_xact_lock(hashtext(key))`)
|
|
747
|
+
* that serialises the writes about one order's returns. Owner: `returns`.
|
|
748
|
+
*
|
|
749
|
+
* `returns` takes it to create a case and to settle one; `invoices` takes it to
|
|
750
|
+
* issue an invoice (review of PR #865, F3), so an invoice is never issued from
|
|
751
|
+
* a case a settlement has moved money for but not yet recorded as resolved —
|
|
752
|
+
* it waits, and then lists only the kept lines.
|
|
753
|
+
*/
|
|
754
|
+
export declare function returnCaseOrderLockKey(orderId: string): string;
|
|
663
755
|
/**
|
|
664
756
|
* Container name: `returnRefundReadPort`. Owner: `returns`.
|
|
665
757
|
*
|
|
@@ -674,6 +766,24 @@ export interface OrderReturnRefund {
|
|
|
674
766
|
*/
|
|
675
767
|
export interface ReturnRefundReadPort {
|
|
676
768
|
listForOrder(orderId: string): Promise<OrderReturnRefund[]>;
|
|
769
|
+
/**
|
|
770
|
+
* The quantity of each order line that came back, one entry per line with
|
|
771
|
+
* any (issue #435), so an invoice issued after a return — when there is no
|
|
772
|
+
* invoice to correct yet — lists only what the buyer kept.
|
|
773
|
+
*/
|
|
774
|
+
listReturnedQuantities(orderId: string): Promise<OrderReturnedQuantity[]>;
|
|
775
|
+
/**
|
|
776
|
+
* What the order's settled `return` cases refunded of its delivery cost and
|
|
777
|
+
* of its payment surcharge (issue #876), over the same cases as
|
|
778
|
+
* {@link listReturnedQuantities}, so an invoice issued afterwards charges
|
|
779
|
+
* only what is left of each.
|
|
780
|
+
*/
|
|
781
|
+
listRefundedCharges(orderId: string): Promise<OrderRefundedCharges>;
|
|
782
|
+
}
|
|
783
|
+
/** What settled returns refunded of an order's charges (issue #876): two-place decimal strings, `0.00` for none. */
|
|
784
|
+
export interface OrderRefundedCharges {
|
|
785
|
+
delivery: string;
|
|
786
|
+
surcharge: string;
|
|
677
787
|
}
|
|
678
788
|
/**
|
|
679
789
|
* A "credit toward future orders" resolution credits the customer's
|
|
@@ -737,6 +847,18 @@ export interface OrderReturnContext {
|
|
|
737
847
|
currency: string;
|
|
738
848
|
/** When the order entered its fulfilment-completing status; null if it has not. */
|
|
739
849
|
completingStatusEnteredAt: Date | null;
|
|
850
|
+
/**
|
|
851
|
+
* When the order was placed (`specs/177-tax-id-scope/`, FR-040): an
|
|
852
|
+
* organization converted from personal to company keeps a consumer's
|
|
853
|
+
* withdrawal right for an order placed before its `convertedToCompanyAt`.
|
|
854
|
+
*/
|
|
855
|
+
placedAt: Date;
|
|
856
|
+
/**
|
|
857
|
+
* The payment method the order was paid with (issue #905): a consumer's
|
|
858
|
+
* withdrawal is refunded by the same means of payment unless they agree
|
|
859
|
+
* otherwise, so the settlement proposes it.
|
|
860
|
+
*/
|
|
861
|
+
paymentMethodId: string | null;
|
|
740
862
|
/**
|
|
741
863
|
* The VAT method the order was placed under (issue #417): `per_rate` — VAT
|
|
742
864
|
* per rate on the sum of the nets — from 0.108.0; `null` before, when the
|
|
@@ -752,6 +874,13 @@ export interface OrderReturnContext {
|
|
|
752
874
|
productsPaidTotal: string;
|
|
753
875
|
/** The order-level discount, as stored (two places) — the part of it a return carries is credited back as a discount. */
|
|
754
876
|
discountTotal: string;
|
|
877
|
+
/**
|
|
878
|
+
* Issue #876 — the order's delivery cost, as stored (two places): a
|
|
879
|
+
* consumer's withdrawal from the whole sale refunds it.
|
|
880
|
+
*/
|
|
881
|
+
deliveryTotal: string;
|
|
882
|
+
/** Issue #876 — the payment surcharge captured at placement, as stored (two places; `0.00` without one). */
|
|
883
|
+
paymentSurcharge: string;
|
|
755
884
|
lines: OrderReturnContextLine[];
|
|
756
885
|
}
|
|
757
886
|
/**
|
|
@@ -770,6 +899,14 @@ export interface OrderReturnContext {
|
|
|
770
899
|
export interface OrderReturnContextPort {
|
|
771
900
|
getReturnContext(orderId: string): Promise<OrderReturnContext | null>;
|
|
772
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* What a corrective-invoice line documents (issue #885). `returned_goods`: the
|
|
904
|
+
* units came back and are credited. `price_reduction`: a complaint settled with
|
|
905
|
+
* money (art. 106j ust. 1 pkt 2 of the Polish VAT Act), so the buyer keeps the
|
|
906
|
+
* goods and only their price is reduced.
|
|
907
|
+
*/
|
|
908
|
+
export declare const CORRECTION_LINE_BASES: readonly ["returned_goods", "price_reduction"];
|
|
909
|
+
export type CorrectionLineBasis = (typeof CORRECTION_LINE_BASES)[number];
|
|
773
910
|
export interface CorrectiveInvoiceLine {
|
|
774
911
|
/**
|
|
775
912
|
* The order item this line credits. It is the link back to the line of the
|
|
@@ -789,6 +926,15 @@ export interface CorrectiveInvoiceLine {
|
|
|
789
926
|
* a 0 % line; it still totals `amount`. Absent: no discount.
|
|
790
927
|
*/
|
|
791
928
|
discount?: number;
|
|
929
|
+
/**
|
|
930
|
+
* What the line documents (issue #885). `returned_goods` (the default when
|
|
931
|
+
* absent): `quantity` units came back and are credited. `price_reduction`: a
|
|
932
|
+
* complaint settled with money, art. 106j ust. 1 pkt 2. The buyer keeps the
|
|
933
|
+
* goods, the line is credited at `amount` as gross at the line's rate, with no
|
|
934
|
+
* discount (one is refused), and `quantity` (the units complained about) is not
|
|
935
|
+
* credited. The document stores quantity 0.
|
|
936
|
+
*/
|
|
937
|
+
basis?: CorrectionLineBasis;
|
|
792
938
|
}
|
|
793
939
|
export interface CorrectiveInvoiceInput {
|
|
794
940
|
orderId: string;
|
|
@@ -810,6 +956,22 @@ export interface CorrectiveInvoiceInput {
|
|
|
810
956
|
* Omitted, no deduplication is attempted and every call issues a document.
|
|
811
957
|
*/
|
|
812
958
|
idempotencyKey?: string;
|
|
959
|
+
/**
|
|
960
|
+
* The case's RMA number, for the label of a price-reduction line (issue #885).
|
|
961
|
+
* Absent: the label names no case.
|
|
962
|
+
*/
|
|
963
|
+
caseReference?: string;
|
|
964
|
+
/**
|
|
965
|
+
* Issue #876 — the order's charges this correction credits, gross: a
|
|
966
|
+
* consumer's withdrawal from the whole sale refunds the delivery and the
|
|
967
|
+
* payment surcharge. Each is credited at the rate of the invoice line that
|
|
968
|
+
* charged it, and never above what that line still charges. `total`
|
|
969
|
+
* includes them. Absent or 0: a return correction credits goods only.
|
|
970
|
+
*/
|
|
971
|
+
charges?: {
|
|
972
|
+
delivery?: number;
|
|
973
|
+
surcharge?: number;
|
|
974
|
+
};
|
|
813
975
|
}
|
|
814
976
|
/** A correction was issued: the document that credits the original invoice. */
|
|
815
977
|
export interface CorrectiveInvoiceIssued {
|