@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
package/dist/price-books.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ export declare const priceBookTypeSchema: z.ZodEnum<{
|
|
|
15
15
|
}>;
|
|
16
16
|
export type PriceBookType = z.infer<typeof priceBookTypeSchema>;
|
|
17
17
|
export declare const priceBookStatusSchema: z.ZodEnum<{
|
|
18
|
-
|
|
18
|
+
scheduled: "scheduled";
|
|
19
19
|
active: "active";
|
|
20
|
+
expired: "expired";
|
|
20
21
|
draft: "draft";
|
|
21
|
-
scheduled: "scheduled";
|
|
22
22
|
}>;
|
|
23
23
|
export type PriceBookStatus = z.infer<typeof priceBookStatusSchema>;
|
|
24
24
|
export declare const priceBookAudienceKindSchema: z.ZodEnum<{
|
|
@@ -93,10 +93,10 @@ export type PriceBookPatch = z.infer<typeof priceBookPatchSchema>;
|
|
|
93
93
|
/** Derived from which selection coordinates are set; never stored. */
|
|
94
94
|
export declare const priceBookSelectionKindSchema: z.ZodEnum<{
|
|
95
95
|
all: "all";
|
|
96
|
-
variant: "variant";
|
|
97
|
-
product: "product";
|
|
98
96
|
category: "category";
|
|
97
|
+
product: "product";
|
|
99
98
|
attribute: "attribute";
|
|
99
|
+
variant: "variant";
|
|
100
100
|
category_attribute: "category_attribute";
|
|
101
101
|
}>;
|
|
102
102
|
export type PriceBookSelectionKind = z.infer<typeof priceBookSelectionKindSchema>;
|
|
@@ -281,6 +281,17 @@ export declare const basePricesWriteSchema: z.ZodObject<{
|
|
|
281
281
|
}, z.core.$strip>>;
|
|
282
282
|
}, z.core.$strip>;
|
|
283
283
|
export type BasePricesWrite = z.infer<typeof basePricesWriteSchema>;
|
|
284
|
+
/**
|
|
285
|
+
* Feature 180 (FR-021) — the answer of `PUT …/base-prices/:productId?dryRun=true`, the
|
|
286
|
+
* product editor's pre-check of a base-price write: every rule passed and nothing was written. A
|
|
287
|
+
* refusal answers as the real write does.
|
|
288
|
+
*/
|
|
289
|
+
export declare const basePricesDryRunResponseSchema: z.ZodObject<{
|
|
290
|
+
data: z.ZodObject<{
|
|
291
|
+
valid: z.ZodLiteral<true>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
export type BasePricesDryRunResponse = z.infer<typeof basePricesDryRunResponseSchema>;
|
|
284
295
|
/** Which tier priced a line (FR-030). */
|
|
285
296
|
export declare const priceSourceSchema: z.ZodEnum<{
|
|
286
297
|
base: "base";
|
|
@@ -474,10 +485,10 @@ export declare const priceBookSchema: z.ZodObject<{
|
|
|
474
485
|
regular: "regular";
|
|
475
486
|
}>;
|
|
476
487
|
status: z.ZodEnum<{
|
|
477
|
-
|
|
488
|
+
scheduled: "scheduled";
|
|
478
489
|
active: "active";
|
|
490
|
+
expired: "expired";
|
|
479
491
|
draft: "draft";
|
|
480
|
-
scheduled: "scheduled";
|
|
481
492
|
}>;
|
|
482
493
|
currencyCode: z.ZodString;
|
|
483
494
|
audience: z.ZodObject<{
|
|
@@ -508,10 +519,10 @@ export declare const priceBookRowMatchSchema: z.ZodObject<{
|
|
|
508
519
|
rowId: z.ZodString;
|
|
509
520
|
selectionKind: z.ZodEnum<{
|
|
510
521
|
all: "all";
|
|
511
|
-
variant: "variant";
|
|
512
|
-
product: "product";
|
|
513
522
|
category: "category";
|
|
523
|
+
product: "product";
|
|
514
524
|
attribute: "attribute";
|
|
525
|
+
variant: "variant";
|
|
515
526
|
category_attribute: "category_attribute";
|
|
516
527
|
}>;
|
|
517
528
|
minQuantity: z.ZodNumber;
|
|
@@ -537,10 +548,10 @@ export declare const priceBookSummarySchema: z.ZodObject<{
|
|
|
537
548
|
regular: "regular";
|
|
538
549
|
}>;
|
|
539
550
|
status: z.ZodEnum<{
|
|
540
|
-
|
|
551
|
+
scheduled: "scheduled";
|
|
541
552
|
active: "active";
|
|
553
|
+
expired: "expired";
|
|
542
554
|
draft: "draft";
|
|
543
|
-
scheduled: "scheduled";
|
|
544
555
|
}>;
|
|
545
556
|
currencyCode: z.ZodString;
|
|
546
557
|
audienceKind: z.ZodEnum<{
|
|
@@ -563,10 +574,10 @@ export declare const priceBookSummarySchema: z.ZodObject<{
|
|
|
563
574
|
rowId: z.ZodString;
|
|
564
575
|
selectionKind: z.ZodEnum<{
|
|
565
576
|
all: "all";
|
|
566
|
-
variant: "variant";
|
|
567
|
-
product: "product";
|
|
568
577
|
category: "category";
|
|
578
|
+
product: "product";
|
|
569
579
|
attribute: "attribute";
|
|
580
|
+
variant: "variant";
|
|
570
581
|
category_attribute: "category_attribute";
|
|
571
582
|
}>;
|
|
572
583
|
minQuantity: z.ZodNumber;
|
|
@@ -596,10 +607,10 @@ export declare const priceBookListQuerySchema: z.ZodObject<{
|
|
|
596
607
|
regular: "regular";
|
|
597
608
|
}>>>>;
|
|
598
609
|
status: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
599
|
-
|
|
610
|
+
scheduled: "scheduled";
|
|
600
611
|
active: "active";
|
|
612
|
+
expired: "expired";
|
|
601
613
|
draft: "draft";
|
|
602
|
-
scheduled: "scheduled";
|
|
603
614
|
}>>>>;
|
|
604
615
|
currency: z.ZodOptional<z.ZodString>;
|
|
605
616
|
channelId: z.ZodOptional<z.ZodString>;
|
|
@@ -630,10 +641,10 @@ export declare const priceBookListResponseSchema: z.ZodObject<{
|
|
|
630
641
|
regular: "regular";
|
|
631
642
|
}>;
|
|
632
643
|
status: z.ZodEnum<{
|
|
633
|
-
|
|
644
|
+
scheduled: "scheduled";
|
|
634
645
|
active: "active";
|
|
646
|
+
expired: "expired";
|
|
635
647
|
draft: "draft";
|
|
636
|
-
scheduled: "scheduled";
|
|
637
648
|
}>;
|
|
638
649
|
currencyCode: z.ZodString;
|
|
639
650
|
audienceKind: z.ZodEnum<{
|
|
@@ -656,10 +667,10 @@ export declare const priceBookListResponseSchema: z.ZodObject<{
|
|
|
656
667
|
rowId: z.ZodString;
|
|
657
668
|
selectionKind: z.ZodEnum<{
|
|
658
669
|
all: "all";
|
|
659
|
-
variant: "variant";
|
|
660
|
-
product: "product";
|
|
661
670
|
category: "category";
|
|
671
|
+
product: "product";
|
|
662
672
|
attribute: "attribute";
|
|
673
|
+
variant: "variant";
|
|
663
674
|
category_attribute: "category_attribute";
|
|
664
675
|
}>;
|
|
665
676
|
minQuantity: z.ZodNumber;
|
|
@@ -749,10 +760,10 @@ export declare const priceBookRowSchema: z.ZodObject<{
|
|
|
749
760
|
id: z.ZodString;
|
|
750
761
|
selectionKind: z.ZodEnum<{
|
|
751
762
|
all: "all";
|
|
752
|
-
variant: "variant";
|
|
753
|
-
product: "product";
|
|
754
763
|
category: "category";
|
|
764
|
+
product: "product";
|
|
755
765
|
attribute: "attribute";
|
|
766
|
+
variant: "variant";
|
|
756
767
|
category_attribute: "category_attribute";
|
|
757
768
|
}>;
|
|
758
769
|
selection: z.ZodObject<{
|
|
@@ -806,10 +817,10 @@ export type PriceBookRow = z.infer<typeof priceBookRowSchema>;
|
|
|
806
817
|
export declare const priceBookRowsQuerySchema: z.ZodObject<{
|
|
807
818
|
selectionKind: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
808
819
|
all: "all";
|
|
809
|
-
variant: "variant";
|
|
810
|
-
product: "product";
|
|
811
820
|
category: "category";
|
|
821
|
+
product: "product";
|
|
812
822
|
attribute: "attribute";
|
|
823
|
+
variant: "variant";
|
|
813
824
|
category_attribute: "category_attribute";
|
|
814
825
|
}>>>>;
|
|
815
826
|
productId: z.ZodOptional<z.ZodString>;
|
|
@@ -834,10 +845,10 @@ export declare const PRICE_BOOK_LINES_MAX_PAGE_SIZE = 500;
|
|
|
834
845
|
export declare const priceBookLinesQuerySchema: z.ZodObject<{
|
|
835
846
|
kind: z.ZodPipe<z.ZodTransform<any[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
836
847
|
all: "all";
|
|
837
|
-
variant: "variant";
|
|
838
|
-
product: "product";
|
|
839
848
|
category: "category";
|
|
849
|
+
product: "product";
|
|
840
850
|
attribute: "attribute";
|
|
851
|
+
variant: "variant";
|
|
841
852
|
category_attribute: "category_attribute";
|
|
842
853
|
}>>>>;
|
|
843
854
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -850,10 +861,10 @@ export declare const priceBookVariantLineSchema: z.ZodObject<{
|
|
|
850
861
|
selectionKey: z.ZodString;
|
|
851
862
|
selectionKind: z.ZodEnum<{
|
|
852
863
|
all: "all";
|
|
853
|
-
variant: "variant";
|
|
854
|
-
product: "product";
|
|
855
864
|
category: "category";
|
|
865
|
+
product: "product";
|
|
856
866
|
attribute: "attribute";
|
|
867
|
+
variant: "variant";
|
|
857
868
|
category_attribute: "category_attribute";
|
|
858
869
|
}>;
|
|
859
870
|
selection: z.ZodObject<{
|
|
@@ -893,10 +904,10 @@ export declare const priceBookVariantLineSchema: z.ZodObject<{
|
|
|
893
904
|
id: z.ZodString;
|
|
894
905
|
selectionKind: z.ZodEnum<{
|
|
895
906
|
all: "all";
|
|
896
|
-
variant: "variant";
|
|
897
|
-
product: "product";
|
|
898
907
|
category: "category";
|
|
908
|
+
product: "product";
|
|
899
909
|
attribute: "attribute";
|
|
910
|
+
variant: "variant";
|
|
900
911
|
category_attribute: "category_attribute";
|
|
901
912
|
}>;
|
|
902
913
|
selection: z.ZodObject<{
|
|
@@ -957,10 +968,10 @@ export declare const priceBookLineSchema: z.ZodObject<{
|
|
|
957
968
|
selectionKey: z.ZodString;
|
|
958
969
|
selectionKind: z.ZodEnum<{
|
|
959
970
|
all: "all";
|
|
960
|
-
variant: "variant";
|
|
961
|
-
product: "product";
|
|
962
971
|
category: "category";
|
|
972
|
+
product: "product";
|
|
963
973
|
attribute: "attribute";
|
|
974
|
+
variant: "variant";
|
|
964
975
|
category_attribute: "category_attribute";
|
|
965
976
|
}>;
|
|
966
977
|
selection: z.ZodObject<{
|
|
@@ -1000,10 +1011,10 @@ export declare const priceBookLineSchema: z.ZodObject<{
|
|
|
1000
1011
|
id: z.ZodString;
|
|
1001
1012
|
selectionKind: z.ZodEnum<{
|
|
1002
1013
|
all: "all";
|
|
1003
|
-
variant: "variant";
|
|
1004
|
-
product: "product";
|
|
1005
1014
|
category: "category";
|
|
1015
|
+
product: "product";
|
|
1006
1016
|
attribute: "attribute";
|
|
1017
|
+
variant: "variant";
|
|
1007
1018
|
category_attribute: "category_attribute";
|
|
1008
1019
|
}>;
|
|
1009
1020
|
selection: z.ZodObject<{
|
|
@@ -1056,10 +1067,10 @@ export declare const priceBookLineSchema: z.ZodObject<{
|
|
|
1056
1067
|
selectionKey: z.ZodString;
|
|
1057
1068
|
selectionKind: z.ZodEnum<{
|
|
1058
1069
|
all: "all";
|
|
1059
|
-
variant: "variant";
|
|
1060
|
-
product: "product";
|
|
1061
1070
|
category: "category";
|
|
1071
|
+
product: "product";
|
|
1062
1072
|
attribute: "attribute";
|
|
1073
|
+
variant: "variant";
|
|
1063
1074
|
category_attribute: "category_attribute";
|
|
1064
1075
|
}>;
|
|
1065
1076
|
selection: z.ZodObject<{
|
|
@@ -1099,10 +1110,10 @@ export declare const priceBookLineSchema: z.ZodObject<{
|
|
|
1099
1110
|
id: z.ZodString;
|
|
1100
1111
|
selectionKind: z.ZodEnum<{
|
|
1101
1112
|
all: "all";
|
|
1102
|
-
variant: "variant";
|
|
1103
|
-
product: "product";
|
|
1104
1113
|
category: "category";
|
|
1114
|
+
product: "product";
|
|
1105
1115
|
attribute: "attribute";
|
|
1116
|
+
variant: "variant";
|
|
1106
1117
|
category_attribute: "category_attribute";
|
|
1107
1118
|
}>;
|
|
1108
1119
|
selection: z.ZodObject<{
|
|
@@ -1179,10 +1190,10 @@ export declare const priceBookLinesResponseSchema: z.ZodObject<{
|
|
|
1179
1190
|
selectionKey: z.ZodString;
|
|
1180
1191
|
selectionKind: z.ZodEnum<{
|
|
1181
1192
|
all: "all";
|
|
1182
|
-
variant: "variant";
|
|
1183
|
-
product: "product";
|
|
1184
1193
|
category: "category";
|
|
1194
|
+
product: "product";
|
|
1185
1195
|
attribute: "attribute";
|
|
1196
|
+
variant: "variant";
|
|
1186
1197
|
category_attribute: "category_attribute";
|
|
1187
1198
|
}>;
|
|
1188
1199
|
selection: z.ZodObject<{
|
|
@@ -1222,10 +1233,10 @@ export declare const priceBookLinesResponseSchema: z.ZodObject<{
|
|
|
1222
1233
|
id: z.ZodString;
|
|
1223
1234
|
selectionKind: z.ZodEnum<{
|
|
1224
1235
|
all: "all";
|
|
1225
|
-
variant: "variant";
|
|
1226
|
-
product: "product";
|
|
1227
1236
|
category: "category";
|
|
1237
|
+
product: "product";
|
|
1228
1238
|
attribute: "attribute";
|
|
1239
|
+
variant: "variant";
|
|
1229
1240
|
category_attribute: "category_attribute";
|
|
1230
1241
|
}>;
|
|
1231
1242
|
selection: z.ZodObject<{
|
|
@@ -1278,10 +1289,10 @@ export declare const priceBookLinesResponseSchema: z.ZodObject<{
|
|
|
1278
1289
|
selectionKey: z.ZodString;
|
|
1279
1290
|
selectionKind: z.ZodEnum<{
|
|
1280
1291
|
all: "all";
|
|
1281
|
-
variant: "variant";
|
|
1282
|
-
product: "product";
|
|
1283
1292
|
category: "category";
|
|
1293
|
+
product: "product";
|
|
1284
1294
|
attribute: "attribute";
|
|
1295
|
+
variant: "variant";
|
|
1285
1296
|
category_attribute: "category_attribute";
|
|
1286
1297
|
}>;
|
|
1287
1298
|
selection: z.ZodObject<{
|
|
@@ -1321,10 +1332,10 @@ export declare const priceBookLinesResponseSchema: z.ZodObject<{
|
|
|
1321
1332
|
id: z.ZodString;
|
|
1322
1333
|
selectionKind: z.ZodEnum<{
|
|
1323
1334
|
all: "all";
|
|
1324
|
-
variant: "variant";
|
|
1325
|
-
product: "product";
|
|
1326
1335
|
category: "category";
|
|
1336
|
+
product: "product";
|
|
1327
1337
|
attribute: "attribute";
|
|
1338
|
+
variant: "variant";
|
|
1328
1339
|
category_attribute: "category_attribute";
|
|
1329
1340
|
}>;
|
|
1330
1341
|
selection: z.ZodObject<{
|
|
@@ -1505,10 +1516,10 @@ export declare const priceBookDiffRowSchema: z.ZodObject<{
|
|
|
1505
1516
|
id: z.ZodOptional<z.ZodString>;
|
|
1506
1517
|
selectionKind: z.ZodEnum<{
|
|
1507
1518
|
all: "all";
|
|
1508
|
-
variant: "variant";
|
|
1509
|
-
product: "product";
|
|
1510
1519
|
category: "category";
|
|
1520
|
+
product: "product";
|
|
1511
1521
|
attribute: "attribute";
|
|
1522
|
+
variant: "variant";
|
|
1512
1523
|
category_attribute: "category_attribute";
|
|
1513
1524
|
}>;
|
|
1514
1525
|
selection: z.ZodObject<{
|
|
@@ -1550,10 +1561,10 @@ export declare const priceBookRowsDryRunSchema: z.ZodObject<{
|
|
|
1550
1561
|
id: z.ZodOptional<z.ZodString>;
|
|
1551
1562
|
selectionKind: z.ZodEnum<{
|
|
1552
1563
|
all: "all";
|
|
1553
|
-
variant: "variant";
|
|
1554
|
-
product: "product";
|
|
1555
1564
|
category: "category";
|
|
1565
|
+
product: "product";
|
|
1556
1566
|
attribute: "attribute";
|
|
1567
|
+
variant: "variant";
|
|
1557
1568
|
category_attribute: "category_attribute";
|
|
1558
1569
|
}>;
|
|
1559
1570
|
selection: z.ZodObject<{
|
|
@@ -1592,10 +1603,10 @@ export declare const priceBookRowsDryRunSchema: z.ZodObject<{
|
|
|
1592
1603
|
id: z.ZodOptional<z.ZodString>;
|
|
1593
1604
|
selectionKind: z.ZodEnum<{
|
|
1594
1605
|
all: "all";
|
|
1595
|
-
variant: "variant";
|
|
1596
|
-
product: "product";
|
|
1597
1606
|
category: "category";
|
|
1607
|
+
product: "product";
|
|
1598
1608
|
attribute: "attribute";
|
|
1609
|
+
variant: "variant";
|
|
1599
1610
|
category_attribute: "category_attribute";
|
|
1600
1611
|
}>;
|
|
1601
1612
|
selection: z.ZodObject<{
|
|
@@ -1634,10 +1645,10 @@ export declare const priceBookRowsDryRunSchema: z.ZodObject<{
|
|
|
1634
1645
|
id: z.ZodOptional<z.ZodString>;
|
|
1635
1646
|
selectionKind: z.ZodEnum<{
|
|
1636
1647
|
all: "all";
|
|
1637
|
-
variant: "variant";
|
|
1638
|
-
product: "product";
|
|
1639
1648
|
category: "category";
|
|
1649
|
+
product: "product";
|
|
1640
1650
|
attribute: "attribute";
|
|
1651
|
+
variant: "variant";
|
|
1641
1652
|
category_attribute: "category_attribute";
|
|
1642
1653
|
}>;
|
|
1643
1654
|
selection: z.ZodObject<{
|
|
@@ -1675,10 +1686,10 @@ export declare const priceBookRowsDryRunSchema: z.ZodObject<{
|
|
|
1675
1686
|
id: z.ZodOptional<z.ZodString>;
|
|
1676
1687
|
selectionKind: z.ZodEnum<{
|
|
1677
1688
|
all: "all";
|
|
1678
|
-
variant: "variant";
|
|
1679
|
-
product: "product";
|
|
1680
1689
|
category: "category";
|
|
1690
|
+
product: "product";
|
|
1681
1691
|
attribute: "attribute";
|
|
1692
|
+
variant: "variant";
|
|
1682
1693
|
category_attribute: "category_attribute";
|
|
1683
1694
|
}>;
|
|
1684
1695
|
selection: z.ZodObject<{
|
|
@@ -1717,10 +1728,10 @@ export declare const priceBookRowsDryRunSchema: z.ZodObject<{
|
|
|
1717
1728
|
id: z.ZodOptional<z.ZodString>;
|
|
1718
1729
|
selectionKind: z.ZodEnum<{
|
|
1719
1730
|
all: "all";
|
|
1720
|
-
variant: "variant";
|
|
1721
|
-
product: "product";
|
|
1722
1731
|
category: "category";
|
|
1732
|
+
product: "product";
|
|
1723
1733
|
attribute: "attribute";
|
|
1734
|
+
variant: "variant";
|
|
1724
1735
|
category_attribute: "category_attribute";
|
|
1725
1736
|
}>;
|
|
1726
1737
|
selection: z.ZodObject<{
|
|
@@ -1796,10 +1807,10 @@ export declare const priceBookRowsWriteResultSchema: z.ZodObject<{
|
|
|
1796
1807
|
id: z.ZodOptional<z.ZodString>;
|
|
1797
1808
|
selectionKind: z.ZodEnum<{
|
|
1798
1809
|
all: "all";
|
|
1799
|
-
variant: "variant";
|
|
1800
|
-
product: "product";
|
|
1801
1810
|
category: "category";
|
|
1811
|
+
product: "product";
|
|
1802
1812
|
attribute: "attribute";
|
|
1813
|
+
variant: "variant";
|
|
1803
1814
|
category_attribute: "category_attribute";
|
|
1804
1815
|
}>;
|
|
1805
1816
|
selection: z.ZodObject<{
|
|
@@ -1841,10 +1852,10 @@ export declare const priceBookRowsResponseSchema: z.ZodObject<{
|
|
|
1841
1852
|
id: z.ZodString;
|
|
1842
1853
|
selectionKind: z.ZodEnum<{
|
|
1843
1854
|
all: "all";
|
|
1844
|
-
variant: "variant";
|
|
1845
|
-
product: "product";
|
|
1846
1855
|
category: "category";
|
|
1856
|
+
product: "product";
|
|
1847
1857
|
attribute: "attribute";
|
|
1858
|
+
variant: "variant";
|
|
1848
1859
|
category_attribute: "category_attribute";
|
|
1849
1860
|
}>;
|
|
1850
1861
|
selection: z.ZodObject<{
|
|
@@ -1900,11 +1911,15 @@ export declare const priceBookRowsResponseSchema: z.ZodObject<{
|
|
|
1900
1911
|
}, z.core.$strip>;
|
|
1901
1912
|
}, z.core.$strip>;
|
|
1902
1913
|
export type PriceBookRowsResponse = z.infer<typeof priceBookRowsResponseSchema>;
|
|
1903
|
-
/**
|
|
1914
|
+
/**
|
|
1915
|
+
* `…/targets/organizations?search=` and `?ids=` (G12), scope-filtered. `taxId`
|
|
1916
|
+
* is the picker's hint, `null` for a personal (B2C) Organization, whose tax id
|
|
1917
|
+
* is an internal placeholder (#767).
|
|
1918
|
+
*/
|
|
1904
1919
|
export declare const priceBookTargetOrganizationSchema: z.ZodObject<{
|
|
1905
1920
|
id: z.ZodString;
|
|
1906
1921
|
name: z.ZodString;
|
|
1907
|
-
taxId: z.ZodString
|
|
1922
|
+
taxId: z.ZodNullable<z.ZodString>;
|
|
1908
1923
|
}, z.core.$strip>;
|
|
1909
1924
|
export type PriceBookTargetOrganization = z.infer<typeof priceBookTargetOrganizationSchema>;
|
|
1910
1925
|
export declare const priceBookTargetOrganizationsResponseSchema: z.ZodObject<{
|
|
@@ -1912,7 +1927,7 @@ export declare const priceBookTargetOrganizationsResponseSchema: z.ZodObject<{
|
|
|
1912
1927
|
items: z.ZodArray<z.ZodObject<{
|
|
1913
1928
|
id: z.ZodString;
|
|
1914
1929
|
name: z.ZodString;
|
|
1915
|
-
taxId: z.ZodString
|
|
1930
|
+
taxId: z.ZodNullable<z.ZodString>;
|
|
1916
1931
|
}, z.core.$strip>>;
|
|
1917
1932
|
}, z.core.$strip>;
|
|
1918
1933
|
}, z.core.$strip>;
|
|
@@ -2203,4 +2218,141 @@ export interface PriceBookWritePort {
|
|
|
2203
2218
|
/** The books with a row naming the product (or the variant) directly — the admin G1 list, every page. */
|
|
2204
2219
|
booksPricingProduct(productId: string, variantId?: string | null): Promise<PriceBookSummary[]>;
|
|
2205
2220
|
}
|
|
2221
|
+
/** Container name of {@link PriceBookRowWritePort}. Owner: `price_lists`. */
|
|
2222
|
+
export declare const PRICE_BOOK_ROW_WRITE_PORT: "priceBookRowWritePort";
|
|
2223
|
+
/**
|
|
2224
|
+
* A variant's row in a non-base book: its own fixed tiers, or a percentage or
|
|
2225
|
+
* amount adjustment of the reference price the book's tier adjusts (the base
|
|
2226
|
+
* price for a catalogue book, the catalogue price for a buyer or sale book) at
|
|
2227
|
+
* every quantity. The shape of a base book's variant row, so one mapping serves
|
|
2228
|
+
* both ports.
|
|
2229
|
+
*/
|
|
2230
|
+
export type VariantRowWrite = VariantBaseRow;
|
|
2231
|
+
/**
|
|
2232
|
+
* What {@link PriceBookRowWritePort.replaceBookRows} writes for one product in
|
|
2233
|
+
* one non-base book: the product's fixed tiers (the base-price tier type, at
|
|
2234
|
+
* most 50) and, optionally, a row per named variant — `null` removes that
|
|
2235
|
+
* variant's rows the port can say. A variant that is not named keeps its rows,
|
|
2236
|
+
* and a row the shape cannot say (see {@link bookProductRowsSchema}) is never
|
|
2237
|
+
* replaced or removed.
|
|
2238
|
+
*/
|
|
2239
|
+
export declare const bookProductRowsWriteSchema: z.ZodObject<{
|
|
2240
|
+
product: z.ZodArray<z.ZodObject<{
|
|
2241
|
+
minQuantity: z.ZodNumber;
|
|
2242
|
+
maxQuantity: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
2243
|
+
amount: z.ZodString;
|
|
2244
|
+
}, z.core.$strip>>;
|
|
2245
|
+
variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2246
|
+
type: z.ZodLiteral<"fixed">;
|
|
2247
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
2248
|
+
minQuantity: z.ZodNumber;
|
|
2249
|
+
maxQuantity: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
2250
|
+
amount: z.ZodString;
|
|
2251
|
+
}, z.core.$strip>>;
|
|
2252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2253
|
+
type: z.ZodLiteral<"percent">;
|
|
2254
|
+
percent: z.ZodString;
|
|
2255
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2256
|
+
type: z.ZodLiteral<"amount">;
|
|
2257
|
+
amount: z.ZodString;
|
|
2258
|
+
}, z.core.$strip>], "type">>>>;
|
|
2259
|
+
}, z.core.$strip>;
|
|
2260
|
+
export type BookProductRowsWrite = z.infer<typeof bookProductRowsWriteSchema>;
|
|
2261
|
+
/**
|
|
2262
|
+
* The rows one product holds in one non-base book, in the write's shape, so a
|
|
2263
|
+
* writer can compare before it writes. `variants` names only the variants that
|
|
2264
|
+
* have rows. `complete` is `false` when the book also holds rows of the product
|
|
2265
|
+
* that this shape cannot say — a product-level percentage or amount, or an
|
|
2266
|
+
* adjustment limited to a quantity range, entered in the admin. The port
|
|
2267
|
+
* leaves such rows as they are: neither a replace nor a remove touches them.
|
|
2268
|
+
*/
|
|
2269
|
+
export declare const bookProductRowsSchema: z.ZodObject<{
|
|
2270
|
+
bookId: z.ZodString;
|
|
2271
|
+
productId: z.ZodString;
|
|
2272
|
+
currencyCode: z.ZodString;
|
|
2273
|
+
version: z.ZodNumber;
|
|
2274
|
+
product: z.ZodArray<z.ZodObject<{
|
|
2275
|
+
minQuantity: z.ZodNumber;
|
|
2276
|
+
maxQuantity: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
2277
|
+
amount: z.ZodString;
|
|
2278
|
+
}, z.core.$strip>>;
|
|
2279
|
+
variants: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2280
|
+
type: z.ZodLiteral<"fixed">;
|
|
2281
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
2282
|
+
minQuantity: z.ZodNumber;
|
|
2283
|
+
maxQuantity: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
2284
|
+
amount: z.ZodString;
|
|
2285
|
+
}, z.core.$strip>>;
|
|
2286
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2287
|
+
type: z.ZodLiteral<"percent">;
|
|
2288
|
+
percent: z.ZodString;
|
|
2289
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2290
|
+
type: z.ZodLiteral<"amount">;
|
|
2291
|
+
amount: z.ZodString;
|
|
2292
|
+
}, z.core.$strip>], "type">>;
|
|
2293
|
+
complete: z.ZodBoolean;
|
|
2294
|
+
}, z.core.$strip>;
|
|
2295
|
+
export type BookProductRows = z.infer<typeof bookProductRowsSchema>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Container name: `priceBookRowWritePort` ({@link PRICE_BOOK_ROW_WRITE_PORT}).
|
|
2298
|
+
* Owner: `price_lists` (issue #1028).
|
|
2299
|
+
*
|
|
2300
|
+
* What another module — an ERP or PIM connector that synchronises a
|
|
2301
|
+
* customer-group, organization, catalogue or sale price — may do to the rows
|
|
2302
|
+
* of **one product in one non-base book**: read them, replace them and remove
|
|
2303
|
+
* them — only the rows its write shape can say (fixed tiers, and a variant's
|
|
2304
|
+
* adjustment at every quantity); a row an administrator entered that the shape
|
|
2305
|
+
* cannot say (a product-level adjustment, an adjustment limited to a quantity
|
|
2306
|
+
* range) is never replaced or removed, and `complete: false` reports it. It
|
|
2307
|
+
* does not create books or change a header (currency, channel set,
|
|
2308
|
+
* audience, validity, status): an administrator owns which books exist and
|
|
2309
|
+
* whom they price, and a module names a book by the id the administrator chose.
|
|
2310
|
+
*
|
|
2311
|
+
* Every write is the admin row batch's own write path
|
|
2312
|
+
* (`PUT /api/v1/admin/price-books/:id/rows`): the same row rules and
|
|
2313
|
+
* refusals, one audited Command Bus run with the caller's actor
|
|
2314
|
+
* (`price_list.book_rows_set`, `price_list.book_rows_remove`) whose entry
|
|
2315
|
+
* holds names and counts, never a price or a quantity (D-288: the values go
|
|
2316
|
+
* to the book's own price-change history, by `valueChangeId`), the book's
|
|
2317
|
+
* `version` moved, and one pricing-generation bump after the commit whose
|
|
2318
|
+
* surface change names the book and the product. A write that would change
|
|
2319
|
+
* nothing writes nothing (no audit entry, no bump).
|
|
2320
|
+
*
|
|
2321
|
+
* Refusals, each an `HttpError` with a code, written before anything is:
|
|
2322
|
+
* an unknown book `404 NOT_FOUND`; a base book `409 PRICE_BOOK_BASE_BOOK`
|
|
2323
|
+
* (write base prices through {@link PriceBookWritePort}); an expired book
|
|
2324
|
+
* `409 PRICE_BOOK_EXPIRED`; an unknown product `404 NOT_FOUND`; a malformed
|
|
2325
|
+
* write `400 VALIDATION_FAILED`; tiers that break the book's rules are refused
|
|
2326
|
+
* as the admin row batch refuses them — `409 PRICE_BOOK_ROW_OVERLAP` when every
|
|
2327
|
+
* failure is an overlap, `400 PRICE_BOOK_ROW_LIMIT` when the book would hold too
|
|
2328
|
+
* many rows, `400 PRICE_BOOK_ROW_SHAPE` otherwise — with `details.errors[]`
|
|
2329
|
+
* giving each failure's own code and reason and, as `field`, its path in the
|
|
2330
|
+
* write (`product.1.minQuantity`, `variants.<id>.tiers.0.price.amount`).
|
|
2331
|
+
*
|
|
2332
|
+
* **Owner off:** the seam fails closed — resolving this port throws
|
|
2333
|
+
* `ModuleDisabledError` (503 `MODULE_DISABLED`); resolve it per use with
|
|
2334
|
+
* `lazyPort`.
|
|
2335
|
+
*/
|
|
2336
|
+
export interface PriceBookRowWritePort {
|
|
2337
|
+
/**
|
|
2338
|
+
* Replace the product's fixed tiers in one non-base book (in the book's one
|
|
2339
|
+
* currency) and, optionally, the rows of the variants named in `variants`.
|
|
2340
|
+
* Rows the write shape cannot say stay as they are; a tier that would overlap
|
|
2341
|
+
* one — even one starting at the same quantity — is refused
|
|
2342
|
+
* `409 PRICE_BOOK_ROW_OVERLAP` naming it, never written over it. Amounts are
|
|
2343
|
+
* decimal strings.
|
|
2344
|
+
*/
|
|
2345
|
+
replaceBookRows(bookId: string, productId: string, write: {
|
|
2346
|
+
product: readonly BasePriceTier[];
|
|
2347
|
+
variants?: Readonly<Record<string, VariantRowWrite | null>>;
|
|
2348
|
+
}): Promise<BookProductRows>;
|
|
2349
|
+
/**
|
|
2350
|
+
* Remove the product's (and its variants') rows the port can say from one
|
|
2351
|
+
* non-base book — rows the write shape cannot say stay, as a replace leaves
|
|
2352
|
+
* them; a no-op when there are none.
|
|
2353
|
+
*/
|
|
2354
|
+
removeBookRows(bookId: string, productId: string): Promise<void>;
|
|
2355
|
+
/** The product's rows in one non-base book, or `null` when it holds none at all. */
|
|
2356
|
+
bookRows(bookId: string, productId: string): Promise<BookProductRows | null>;
|
|
2357
|
+
}
|
|
2206
2358
|
//# sourceMappingURL=price-books.d.ts.map
|
package/dist/price-books.js
CHANGED
|
@@ -218,6 +218,14 @@ export const basePricesForCurrencySchema = z.object({
|
|
|
218
218
|
export const basePricesWriteSchema = z.object({
|
|
219
219
|
byCurrency: z.record(CURRENCY, basePricesForCurrencySchema),
|
|
220
220
|
});
|
|
221
|
+
/**
|
|
222
|
+
* Feature 180 (FR-021) — the answer of `PUT …/base-prices/:productId?dryRun=true`, the
|
|
223
|
+
* product editor's pre-check of a base-price write: every rule passed and nothing was written. A
|
|
224
|
+
* refusal answers as the real write does.
|
|
225
|
+
*/
|
|
226
|
+
export const basePricesDryRunResponseSchema = z.object({
|
|
227
|
+
data: z.object({ valid: z.literal(true) }),
|
|
228
|
+
});
|
|
221
229
|
// --- Resolution: source, cells, explanation (FR-020) ----------------------------
|
|
222
230
|
/** Which tier priced a line (FR-030). */
|
|
223
231
|
export const priceSourceSchema = z.enum(['base', 'catalogue', 'buyer', 'sale']);
|
|
@@ -670,8 +678,12 @@ export const priceBookRowsResponseSchema = z.object({
|
|
|
670
678
|
* II); the routes answered these shapes since feature 160.
|
|
671
679
|
*/
|
|
672
680
|
const targetsOf = (item) => z.object({ data: z.object({ items: z.array(item) }) });
|
|
673
|
-
/**
|
|
674
|
-
|
|
681
|
+
/**
|
|
682
|
+
* `…/targets/organizations?search=` and `?ids=` (G12), scope-filtered. `taxId`
|
|
683
|
+
* is the picker's hint, `null` for a personal (B2C) Organization, whose tax id
|
|
684
|
+
* is an internal placeholder (#767).
|
|
685
|
+
*/
|
|
686
|
+
export const priceBookTargetOrganizationSchema = z.object({ id: uuidSchema, name: z.string(), taxId: z.string().nullable() });
|
|
675
687
|
export const priceBookTargetOrganizationsResponseSchema = targetsOf(priceBookTargetOrganizationSchema);
|
|
676
688
|
/** `…/targets/customer-groups`. */
|
|
677
689
|
export const priceBookTargetCustomerGroupSchema = z.object({ id: uuidSchema, code: z.string(), name: z.string() });
|
|
@@ -774,4 +786,37 @@ export const productBasePricesSchema = z.object({
|
|
|
774
786
|
*/
|
|
775
787
|
writable: z.boolean(),
|
|
776
788
|
});
|
|
789
|
+
// --- Cross-module writes of non-base book rows (issue #1028) --------------------
|
|
790
|
+
/** Container name of {@link PriceBookRowWritePort}. Owner: `price_lists`. */
|
|
791
|
+
export const PRICE_BOOK_ROW_WRITE_PORT = 'priceBookRowWritePort';
|
|
792
|
+
/**
|
|
793
|
+
* What {@link PriceBookRowWritePort.replaceBookRows} writes for one product in
|
|
794
|
+
* one non-base book: the product's fixed tiers (the base-price tier type, at
|
|
795
|
+
* most 50) and, optionally, a row per named variant — `null` removes that
|
|
796
|
+
* variant's rows the port can say. A variant that is not named keeps its rows,
|
|
797
|
+
* and a row the shape cannot say (see {@link bookProductRowsSchema}) is never
|
|
798
|
+
* replaced or removed.
|
|
799
|
+
*/
|
|
800
|
+
export const bookProductRowsWriteSchema = z.object({
|
|
801
|
+
product: z.array(basePriceTierSchema).max(50),
|
|
802
|
+
variants: z.record(uuidSchema, variantBaseRowSchema.nullable()).optional(),
|
|
803
|
+
});
|
|
804
|
+
/**
|
|
805
|
+
* The rows one product holds in one non-base book, in the write's shape, so a
|
|
806
|
+
* writer can compare before it writes. `variants` names only the variants that
|
|
807
|
+
* have rows. `complete` is `false` when the book also holds rows of the product
|
|
808
|
+
* that this shape cannot say — a product-level percentage or amount, or an
|
|
809
|
+
* adjustment limited to a quantity range, entered in the admin. The port
|
|
810
|
+
* leaves such rows as they are: neither a replace nor a remove touches them.
|
|
811
|
+
*/
|
|
812
|
+
export const bookProductRowsSchema = z.object({
|
|
813
|
+
bookId: uuidSchema,
|
|
814
|
+
productId: uuidSchema,
|
|
815
|
+
currencyCode: CURRENCY,
|
|
816
|
+
/** The book's version after the write, as the admin API reports it. */
|
|
817
|
+
version: z.number().int().positive(),
|
|
818
|
+
product: z.array(basePriceTierSchema),
|
|
819
|
+
variants: z.record(uuidSchema, variantBaseRowSchema),
|
|
820
|
+
complete: z.boolean(),
|
|
821
|
+
});
|
|
777
822
|
//# sourceMappingURL=price-books.js.map
|