@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/quote-requests.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { SupportedLanguage } from './platform-language.js';
|
|
2
3
|
import { type OriginReference } from './common.js';
|
|
3
4
|
/**
|
|
4
5
|
* Quote Requests (RFQ) module contracts — feature 008 workflow rewrite.
|
|
@@ -56,8 +57,8 @@ export declare const quoteRequestItemSchema: z.ZodObject<{
|
|
|
56
57
|
export type QuoteRequestItem = z.infer<typeof quoteRequestItemSchema>;
|
|
57
58
|
export declare const rfqEventTypeSchema: z.ZodEnum<{
|
|
58
59
|
completed: "completed";
|
|
59
|
-
expired: "expired";
|
|
60
60
|
created: "created";
|
|
61
|
+
expired: "expired";
|
|
61
62
|
approved: "approved";
|
|
62
63
|
submitted: "submitted";
|
|
63
64
|
modified: "modified";
|
|
@@ -74,8 +75,8 @@ export declare const quoteRequestEventSchema: z.ZodObject<{
|
|
|
74
75
|
id: z.ZodString;
|
|
75
76
|
eventType: z.ZodEnum<{
|
|
76
77
|
completed: "completed";
|
|
77
|
-
expired: "expired";
|
|
78
78
|
created: "created";
|
|
79
|
+
expired: "expired";
|
|
79
80
|
approved: "approved";
|
|
80
81
|
submitted: "submitted";
|
|
81
82
|
modified: "modified";
|
|
@@ -240,8 +241,8 @@ export declare const quoteRequestHistoryActorSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
240
241
|
export type QuoteRequestHistoryActor = z.infer<typeof quoteRequestHistoryActorSchema>;
|
|
241
242
|
export declare const quoteRequestHistoryEntryKindSchema: z.ZodEnum<{
|
|
242
243
|
completed: "completed";
|
|
243
|
-
expired: "expired";
|
|
244
244
|
created: "created";
|
|
245
|
+
expired: "expired";
|
|
245
246
|
approved: "approved";
|
|
246
247
|
submitted: "submitted";
|
|
247
248
|
modified: "modified";
|
|
@@ -255,13 +256,77 @@ export declare const quoteRequestHistoryEntryKindSchema: z.ZodEnum<{
|
|
|
255
256
|
custom_field_carry_skipped: "custom_field_carry_skipped";
|
|
256
257
|
}>;
|
|
257
258
|
export type QuoteRequestHistoryEntryKind = z.infer<typeof quoteRequestHistoryEntryKindSchema>;
|
|
259
|
+
/**
|
|
260
|
+
* `specs/179-rfq-and-customer-notifications/` — one notification delivery of a
|
|
261
|
+
* history entry (`contracts/delivery-and-ports.md` §4): who was told, through
|
|
262
|
+
* which channel, and with what outcome. Admin history only; the customer
|
|
263
|
+
* projection never carries it (FR-071). The recipient's address is never part
|
|
264
|
+
* of it — `displayName` is resolved at read, `''` when the person is gone.
|
|
265
|
+
*/
|
|
266
|
+
export declare const quoteRequestDeliveryChannelSchema: z.ZodEnum<{
|
|
267
|
+
admin_in_app: "admin_in_app";
|
|
268
|
+
admin_email: "admin_email";
|
|
269
|
+
customer_email: "customer_email";
|
|
270
|
+
customer_in_app: "customer_in_app";
|
|
271
|
+
customer_push: "customer_push";
|
|
272
|
+
}>;
|
|
273
|
+
export type QuoteRequestDeliveryChannel = z.infer<typeof quoteRequestDeliveryChannelSchema>;
|
|
274
|
+
export declare const quoteRequestDeliveryStatusSchema: z.ZodEnum<{
|
|
275
|
+
pending: "pending";
|
|
276
|
+
failed: "failed";
|
|
277
|
+
sent: "sent";
|
|
278
|
+
skipped_stale: "skipped_stale";
|
|
279
|
+
skipped_module_off: "skipped_module_off";
|
|
280
|
+
skipped_deactivated: "skipped_deactivated";
|
|
281
|
+
skipped_no_transport: "skipped_no_transport";
|
|
282
|
+
skipped_logged: "skipped_logged";
|
|
283
|
+
skipped_no_recipient: "skipped_no_recipient";
|
|
284
|
+
skipped_preference: "skipped_preference";
|
|
285
|
+
skipped_no_subscription: "skipped_no_subscription";
|
|
286
|
+
}>;
|
|
287
|
+
export type QuoteRequestDeliveryStatus = z.infer<typeof quoteRequestDeliveryStatusSchema>;
|
|
288
|
+
export declare const quoteRequestDeliverySchema: z.ZodObject<{
|
|
289
|
+
id: z.ZodString;
|
|
290
|
+
channel: z.ZodEnum<{
|
|
291
|
+
admin_in_app: "admin_in_app";
|
|
292
|
+
admin_email: "admin_email";
|
|
293
|
+
customer_email: "customer_email";
|
|
294
|
+
customer_in_app: "customer_in_app";
|
|
295
|
+
customer_push: "customer_push";
|
|
296
|
+
}>;
|
|
297
|
+
recipient: z.ZodObject<{
|
|
298
|
+
kind: z.ZodEnum<{
|
|
299
|
+
customer: "customer";
|
|
300
|
+
admin: "admin";
|
|
301
|
+
}>;
|
|
302
|
+
id: z.ZodString;
|
|
303
|
+
displayName: z.ZodString;
|
|
304
|
+
}, z.core.$strict>;
|
|
305
|
+
status: z.ZodEnum<{
|
|
306
|
+
pending: "pending";
|
|
307
|
+
failed: "failed";
|
|
308
|
+
sent: "sent";
|
|
309
|
+
skipped_stale: "skipped_stale";
|
|
310
|
+
skipped_module_off: "skipped_module_off";
|
|
311
|
+
skipped_deactivated: "skipped_deactivated";
|
|
312
|
+
skipped_no_transport: "skipped_no_transport";
|
|
313
|
+
skipped_logged: "skipped_logged";
|
|
314
|
+
skipped_no_recipient: "skipped_no_recipient";
|
|
315
|
+
skipped_preference: "skipped_preference";
|
|
316
|
+
skipped_no_subscription: "skipped_no_subscription";
|
|
317
|
+
}>;
|
|
318
|
+
attempts: z.ZodNumber;
|
|
319
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
320
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
321
|
+
}, z.core.$strict>;
|
|
322
|
+
export type QuoteRequestDelivery = z.infer<typeof quoteRequestDeliverySchema>;
|
|
258
323
|
export declare const quoteRequestHistoryEntrySchema: z.ZodObject<{
|
|
259
324
|
id: z.ZodString;
|
|
260
325
|
eventIds: z.ZodArray<z.ZodString>;
|
|
261
326
|
kind: z.ZodEnum<{
|
|
262
327
|
completed: "completed";
|
|
263
|
-
expired: "expired";
|
|
264
328
|
created: "created";
|
|
329
|
+
expired: "expired";
|
|
265
330
|
approved: "approved";
|
|
266
331
|
submitted: "submitted";
|
|
267
332
|
modified: "modified";
|
|
@@ -429,6 +494,40 @@ export declare const quoteRequestHistoryEntrySchema: z.ZodObject<{
|
|
|
429
494
|
}, z.core.$strip>>;
|
|
430
495
|
}, z.core.$strip>>;
|
|
431
496
|
}, z.core.$strip>>>;
|
|
497
|
+
deliveries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
channel: z.ZodEnum<{
|
|
500
|
+
admin_in_app: "admin_in_app";
|
|
501
|
+
admin_email: "admin_email";
|
|
502
|
+
customer_email: "customer_email";
|
|
503
|
+
customer_in_app: "customer_in_app";
|
|
504
|
+
customer_push: "customer_push";
|
|
505
|
+
}>;
|
|
506
|
+
recipient: z.ZodObject<{
|
|
507
|
+
kind: z.ZodEnum<{
|
|
508
|
+
customer: "customer";
|
|
509
|
+
admin: "admin";
|
|
510
|
+
}>;
|
|
511
|
+
id: z.ZodString;
|
|
512
|
+
displayName: z.ZodString;
|
|
513
|
+
}, z.core.$strict>;
|
|
514
|
+
status: z.ZodEnum<{
|
|
515
|
+
pending: "pending";
|
|
516
|
+
failed: "failed";
|
|
517
|
+
sent: "sent";
|
|
518
|
+
skipped_stale: "skipped_stale";
|
|
519
|
+
skipped_module_off: "skipped_module_off";
|
|
520
|
+
skipped_deactivated: "skipped_deactivated";
|
|
521
|
+
skipped_no_transport: "skipped_no_transport";
|
|
522
|
+
skipped_logged: "skipped_logged";
|
|
523
|
+
skipped_no_recipient: "skipped_no_recipient";
|
|
524
|
+
skipped_preference: "skipped_preference";
|
|
525
|
+
skipped_no_subscription: "skipped_no_subscription";
|
|
526
|
+
}>;
|
|
527
|
+
attempts: z.ZodNumber;
|
|
528
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
529
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
530
|
+
}, z.core.$strict>>>;
|
|
432
531
|
}, z.core.$strip>;
|
|
433
532
|
export type QuoteRequestHistoryEntry = z.infer<typeof quoteRequestHistoryEntrySchema>;
|
|
434
533
|
/**
|
|
@@ -448,8 +547,8 @@ export declare const quoteRequestHistorySchema: z.ZodObject<{
|
|
|
448
547
|
eventIds: z.ZodArray<z.ZodString>;
|
|
449
548
|
kind: z.ZodEnum<{
|
|
450
549
|
completed: "completed";
|
|
451
|
-
expired: "expired";
|
|
452
550
|
created: "created";
|
|
551
|
+
expired: "expired";
|
|
453
552
|
approved: "approved";
|
|
454
553
|
submitted: "submitted";
|
|
455
554
|
modified: "modified";
|
|
@@ -617,6 +716,40 @@ export declare const quoteRequestHistorySchema: z.ZodObject<{
|
|
|
617
716
|
}, z.core.$strip>>;
|
|
618
717
|
}, z.core.$strip>>;
|
|
619
718
|
}, z.core.$strip>>>;
|
|
719
|
+
deliveries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
720
|
+
id: z.ZodString;
|
|
721
|
+
channel: z.ZodEnum<{
|
|
722
|
+
admin_in_app: "admin_in_app";
|
|
723
|
+
admin_email: "admin_email";
|
|
724
|
+
customer_email: "customer_email";
|
|
725
|
+
customer_in_app: "customer_in_app";
|
|
726
|
+
customer_push: "customer_push";
|
|
727
|
+
}>;
|
|
728
|
+
recipient: z.ZodObject<{
|
|
729
|
+
kind: z.ZodEnum<{
|
|
730
|
+
customer: "customer";
|
|
731
|
+
admin: "admin";
|
|
732
|
+
}>;
|
|
733
|
+
id: z.ZodString;
|
|
734
|
+
displayName: z.ZodString;
|
|
735
|
+
}, z.core.$strict>;
|
|
736
|
+
status: z.ZodEnum<{
|
|
737
|
+
pending: "pending";
|
|
738
|
+
failed: "failed";
|
|
739
|
+
sent: "sent";
|
|
740
|
+
skipped_stale: "skipped_stale";
|
|
741
|
+
skipped_module_off: "skipped_module_off";
|
|
742
|
+
skipped_deactivated: "skipped_deactivated";
|
|
743
|
+
skipped_no_transport: "skipped_no_transport";
|
|
744
|
+
skipped_logged: "skipped_logged";
|
|
745
|
+
skipped_no_recipient: "skipped_no_recipient";
|
|
746
|
+
skipped_preference: "skipped_preference";
|
|
747
|
+
skipped_no_subscription: "skipped_no_subscription";
|
|
748
|
+
}>;
|
|
749
|
+
attempts: z.ZodNumber;
|
|
750
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
751
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
752
|
+
}, z.core.$strict>>>;
|
|
620
753
|
}, z.core.$strip>>;
|
|
621
754
|
truncated: z.ZodBoolean;
|
|
622
755
|
}, z.core.$strip>;
|
|
@@ -758,8 +891,8 @@ export declare const quoteRequestSchema: z.ZodObject<{
|
|
|
758
891
|
id: z.ZodString;
|
|
759
892
|
eventType: z.ZodEnum<{
|
|
760
893
|
completed: "completed";
|
|
761
|
-
expired: "expired";
|
|
762
894
|
created: "created";
|
|
895
|
+
expired: "expired";
|
|
763
896
|
approved: "approved";
|
|
764
897
|
submitted: "submitted";
|
|
765
898
|
modified: "modified";
|
|
@@ -827,7 +960,8 @@ export declare const quoteRequestSchema: z.ZodObject<{
|
|
|
827
960
|
id: z.ZodString;
|
|
828
961
|
name: z.ZodString;
|
|
829
962
|
legalName: z.ZodNullable<z.ZodString>;
|
|
830
|
-
taxId: z.ZodString
|
|
963
|
+
taxId: z.ZodNullable<z.ZodString>;
|
|
964
|
+
isPersonal: z.ZodBoolean;
|
|
831
965
|
vatStatus: z.ZodString;
|
|
832
966
|
}, z.core.$strip>>>;
|
|
833
967
|
customer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -842,6 +976,46 @@ export declare const quoteRequestSchema: z.ZodObject<{
|
|
|
842
976
|
version: z.ZodNumber;
|
|
843
977
|
}, z.core.$strip>;
|
|
844
978
|
export type QuoteRequest = z.infer<typeof quoteRequestSchema>;
|
|
979
|
+
/**
|
|
980
|
+
* How far a quote request is agreed (issue #456, PO ruling of 2026-11-08):
|
|
981
|
+
* `agreed` — every line has an agreed price; `partial` — some lines do;
|
|
982
|
+
* `none` — no line does (a quote without a line included).
|
|
983
|
+
*/
|
|
984
|
+
export declare const quoteRequestAgreementSchema: z.ZodEnum<{
|
|
985
|
+
none: "none";
|
|
986
|
+
agreed: "agreed";
|
|
987
|
+
partial: "partial";
|
|
988
|
+
}>;
|
|
989
|
+
export type QuoteRequestAgreement = z.infer<typeof quoteRequestAgreementSchema>;
|
|
990
|
+
/**
|
|
991
|
+
* What a quote request is worth — **one rule**, owned by `quote_requests`
|
|
992
|
+
* (issue #456, owner ruling of 2026-11-07). The quote desk list, a CRM
|
|
993
|
+
* Opportunity's link and a Project's link all show this figure; none of them
|
|
994
|
+
* re-derives it. Read it from `quoteRequestReadPort.amountOf`.
|
|
995
|
+
*
|
|
996
|
+
* - **Per line**: quantity × (agreed unit price ?? the price the customer
|
|
997
|
+
* asked for). The unit price keeps its four places; the line value is the
|
|
998
|
+
* rounding point, half-up to two places once (`lineAmountHalfUp`,
|
|
999
|
+
* `specs/conventions/pricing.md`), and the line values are summed exactly.
|
|
1000
|
+
* - **A line with neither price adds nothing** — it is not a zero price, it is
|
|
1001
|
+
* no price. A quote none of whose lines has a price has **no amount**
|
|
1002
|
+
* (`null`, shown as `—`), not `0.00`.
|
|
1003
|
+
* - Net of tax, in the currency of the first line (what the desk shows the
|
|
1004
|
+
* total in); `null` for a quote without a line.
|
|
1005
|
+
*
|
|
1006
|
+
* A consumer shows a marker only beside an amount: *Partially agreed* for
|
|
1007
|
+
* `partial`, *Not yet agreed* for `none`.
|
|
1008
|
+
*/
|
|
1009
|
+
export declare const quoteRequestAmountSchema: z.ZodObject<{
|
|
1010
|
+
amount: z.ZodNullable<z.ZodString>;
|
|
1011
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
1012
|
+
agreement: z.ZodEnum<{
|
|
1013
|
+
none: "none";
|
|
1014
|
+
agreed: "agreed";
|
|
1015
|
+
partial: "partial";
|
|
1016
|
+
}>;
|
|
1017
|
+
}, z.core.$strip>;
|
|
1018
|
+
export type QuoteRequestAmount = z.infer<typeof quoteRequestAmountSchema>;
|
|
845
1019
|
export declare const quoteRequestSummarySchema: z.ZodObject<{
|
|
846
1020
|
id: z.ZodString;
|
|
847
1021
|
businessId: z.ZodString;
|
|
@@ -872,6 +1046,13 @@ export declare const quoteRequestSummarySchema: z.ZodObject<{
|
|
|
872
1046
|
}, z.core.$strip>>;
|
|
873
1047
|
organizationName: z.ZodOptional<z.ZodString>;
|
|
874
1048
|
customerDisplayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1049
|
+
amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1050
|
+
agreement: z.ZodOptional<z.ZodEnum<{
|
|
1051
|
+
none: "none";
|
|
1052
|
+
agreed: "agreed";
|
|
1053
|
+
partial: "partial";
|
|
1054
|
+
}>>;
|
|
1055
|
+
statusName: z.ZodOptional<z.ZodString>;
|
|
875
1056
|
}, z.core.$strip>;
|
|
876
1057
|
export type QuoteRequestSummary = z.infer<typeof quoteRequestSummarySchema>;
|
|
877
1058
|
export declare const createQuoteRequestLineSchema: z.ZodObject<{
|
|
@@ -962,6 +1143,7 @@ export declare const adminCreateQuoteRequestSchema: z.ZodObject<{
|
|
|
962
1143
|
type: z.ZodString;
|
|
963
1144
|
id: z.ZodString;
|
|
964
1145
|
}, z.core.$strict>>;
|
|
1146
|
+
customFieldValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
965
1147
|
}, z.core.$strip>;
|
|
966
1148
|
export type AdminCreateQuoteRequest = z.infer<typeof adminCreateQuoteRequestSchema>;
|
|
967
1149
|
/**
|
|
@@ -1092,8 +1274,8 @@ export declare const quoteRequestAccountNegotiationSchema: z.ZodObject<{
|
|
|
1092
1274
|
effectivePriceProposalsAllowed: z.ZodBoolean;
|
|
1093
1275
|
effectiveSource: z.ZodEnum<{
|
|
1094
1276
|
default: "default";
|
|
1095
|
-
account: "account";
|
|
1096
1277
|
organization: "organization";
|
|
1278
|
+
account: "account";
|
|
1097
1279
|
}>;
|
|
1098
1280
|
updatedAt: z.ZodNullable<z.ZodString>;
|
|
1099
1281
|
}, z.core.$strip>;
|
|
@@ -1235,6 +1417,15 @@ export interface QuoteRequestLineRecord {
|
|
|
1235
1417
|
*/
|
|
1236
1418
|
export interface QuoteRequestReadPort {
|
|
1237
1419
|
findById(id: string): Promise<QuoteRequestRecord | null>;
|
|
1420
|
+
/**
|
|
1421
|
+
* A status's name in `language`, in this module's own wording (the one its
|
|
1422
|
+
* global-search results use); a code outside {@link rfqStatusSchema} answers
|
|
1423
|
+
* as it is. Published for issue #455, so that a module showing a linked
|
|
1424
|
+
* Quote Request names its status as `quote_requests` does rather than
|
|
1425
|
+
* showing the stored code or keeping a copy of the wording. Reads no quote,
|
|
1426
|
+
* so it checks no permission.
|
|
1427
|
+
*/
|
|
1428
|
+
statusName(status: string, language: SupportedLanguage): Promise<string>;
|
|
1238
1429
|
/**
|
|
1239
1430
|
* Open quotes for the given organisations. Empty `organizationIds` answers
|
|
1240
1431
|
* the empty array rather than every quote — a rep assigned nothing sees
|
|
@@ -1259,16 +1450,38 @@ export interface QuoteRequestReadPort {
|
|
|
1259
1450
|
* resolve it.
|
|
1260
1451
|
*/
|
|
1261
1452
|
findByBusinessId(businessId: string): Promise<QuoteRequestRecord | null>;
|
|
1453
|
+
/**
|
|
1454
|
+
* What the quote is worth, by the one rule of {@link quoteRequestAmountSchema},
|
|
1455
|
+
* or `null` when the quote is missing or out of the caller's scope — the
|
|
1456
|
+
* answer `findById` gives for it.
|
|
1457
|
+
*
|
|
1458
|
+
* Added for issue #456: `crm` and `projects` each kept a copy of the rule
|
|
1459
|
+
* over `listItems`, and the quote desk list a third, different one.
|
|
1460
|
+
*/
|
|
1461
|
+
amountOf(quoteRequestId: string): Promise<QuoteRequestAmount | null>;
|
|
1462
|
+
/**
|
|
1463
|
+
* The quotes of `ids` in the caller's tenant scope, in no particular order —
|
|
1464
|
+
* what {@link findById} answers for each id, in one read. A missing,
|
|
1465
|
+
* out-of-scope or malformed id is simply absent.
|
|
1466
|
+
*
|
|
1467
|
+
* Added for issue #457: `projects` read the Quote Requests linked to a
|
|
1468
|
+
* Project one `findById` at a time.
|
|
1469
|
+
*/
|
|
1470
|
+
findByIds(ids: readonly string[]): Promise<QuoteRequestRecord[]>;
|
|
1471
|
+
/**
|
|
1472
|
+
* What each quote of `quoteRequestIds` is worth, keyed by quote id — what
|
|
1473
|
+
* {@link amountOf} answers for each id, in a fixed number of reads. A quote
|
|
1474
|
+
* `amountOf` answers `null` for (missing, out of scope, malformed id) has no
|
|
1475
|
+
* entry.
|
|
1476
|
+
*
|
|
1477
|
+
* Added for issue #457, beside {@link findByIds}.
|
|
1478
|
+
*/
|
|
1479
|
+
amountsOf(quoteRequestIds: readonly string[]): Promise<Map<string, QuoteRequestAmount>>;
|
|
1262
1480
|
}
|
|
1263
1481
|
/** Who is asking, on a customer-facing quote path. */
|
|
1264
1482
|
export interface RfqCustomerContext {
|
|
1265
1483
|
customerAccountId: string;
|
|
1266
1484
|
organizationId: string;
|
|
1267
|
-
/**
|
|
1268
|
-
* True when the account holds the org-admin role on the current
|
|
1269
|
-
* organisation (FR-011 — broader visibility).
|
|
1270
|
-
*/
|
|
1271
|
-
isOrgAdmin: boolean;
|
|
1272
1485
|
}
|
|
1273
1486
|
/**
|
|
1274
1487
|
* Container name: `rfqService`. Owner: `quote_requests`.
|
|
@@ -1325,10 +1538,11 @@ export interface CreateForCustomerOptions {
|
|
|
1325
1538
|
*/
|
|
1326
1539
|
language?: string;
|
|
1327
1540
|
/**
|
|
1328
|
-
* Feature 163 — the buyer request's language tag
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1541
|
+
* Feature 163 — the buyer request's language tag, which the scope language L of every
|
|
1542
|
+
* line is resolved from against the channel's own languages (`scopeLanguageOf`), as the
|
|
1543
|
+
* basket's is. The customer routes pass the channel language the whole `Accept-Language`
|
|
1544
|
+
* asks for (`requestScopeLanguage`, issue #1011), which resolves to itself. Absent: the
|
|
1545
|
+
* channel's default language. Distinct from `language`, which falls back to a
|
|
1332
1546
|
* bundle language the channel may switch a product off in. In-process only.
|
|
1333
1547
|
*/
|
|
1334
1548
|
languageTag?: string;
|
package/dist/quote-requests.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { isoDateTimeSchema, OriginReferenceSchema, uuidSchema } from './common.js';
|
|
3
3
|
import { lineGroupInputSchema, lineGroupKeySchema, lineGroupSchema, newLineGroupInputSchema, refineLineGrouping, } from './line-groups.js';
|
|
4
|
-
import { customFieldCarrySkipSchema } from './custom-fields.js';
|
|
4
|
+
import { customFieldCarrySkipSchema, customFieldValuesSchema } from './custom-fields.js';
|
|
5
5
|
import { fourDecimalUnitPrice } from './money-input.js';
|
|
6
|
+
import { lineQuantitySchema, REQUEST_LINE_ITEMS_MAX } from './line-bounds.js';
|
|
6
7
|
/**
|
|
7
8
|
* Quote Requests (RFQ) module contracts — feature 008 workflow rewrite.
|
|
8
9
|
* Source of truth per Principle V; the backend re-uses these schemas as
|
|
@@ -259,6 +260,50 @@ export const quoteRequestHistoryEntryKindSchema = z.enum([
|
|
|
259
260
|
// Feature 162.
|
|
260
261
|
'custom_field_carry_skipped',
|
|
261
262
|
]);
|
|
263
|
+
/**
|
|
264
|
+
* `specs/179-rfq-and-customer-notifications/` — one notification delivery of a
|
|
265
|
+
* history entry (`contracts/delivery-and-ports.md` §4): who was told, through
|
|
266
|
+
* which channel, and with what outcome. Admin history only; the customer
|
|
267
|
+
* projection never carries it (FR-071). The recipient's address is never part
|
|
268
|
+
* of it — `displayName` is resolved at read, `''` when the person is gone.
|
|
269
|
+
*/
|
|
270
|
+
export const quoteRequestDeliveryChannelSchema = z.enum([
|
|
271
|
+
'admin_in_app',
|
|
272
|
+
'admin_email',
|
|
273
|
+
'customer_email',
|
|
274
|
+
'customer_in_app',
|
|
275
|
+
'customer_push',
|
|
276
|
+
]);
|
|
277
|
+
export const quoteRequestDeliveryStatusSchema = z.enum([
|
|
278
|
+
'pending',
|
|
279
|
+
'sent',
|
|
280
|
+
'skipped_stale',
|
|
281
|
+
'skipped_module_off',
|
|
282
|
+
'skipped_deactivated',
|
|
283
|
+
'skipped_no_transport',
|
|
284
|
+
'skipped_logged',
|
|
285
|
+
'skipped_no_recipient',
|
|
286
|
+
'skipped_preference',
|
|
287
|
+
'skipped_no_subscription',
|
|
288
|
+
'failed',
|
|
289
|
+
]);
|
|
290
|
+
export const quoteRequestDeliverySchema = z
|
|
291
|
+
.object({
|
|
292
|
+
id: uuidSchema,
|
|
293
|
+
channel: quoteRequestDeliveryChannelSchema,
|
|
294
|
+
recipient: z
|
|
295
|
+
.object({
|
|
296
|
+
kind: z.enum(['admin', 'customer']),
|
|
297
|
+
id: uuidSchema,
|
|
298
|
+
displayName: z.string(),
|
|
299
|
+
})
|
|
300
|
+
.strict(),
|
|
301
|
+
status: quoteRequestDeliveryStatusSchema,
|
|
302
|
+
attempts: z.number().int().nonnegative(),
|
|
303
|
+
lastError: z.string().nullable(),
|
|
304
|
+
closedAt: isoDateTimeSchema.nullable(),
|
|
305
|
+
})
|
|
306
|
+
.strict();
|
|
262
307
|
export const quoteRequestHistoryEntrySchema = z.object({
|
|
263
308
|
/** Id of the first merged event. */
|
|
264
309
|
id: uuidSchema,
|
|
@@ -305,6 +350,11 @@ export const quoteRequestHistoryEntrySchema = z.object({
|
|
|
305
350
|
})
|
|
306
351
|
.nullable()
|
|
307
352
|
.optional(),
|
|
353
|
+
/**
|
|
354
|
+
* Feature 179 — admin history only: the notification deliveries whose source
|
|
355
|
+
* event is one of `eventIds`. Absent on the customer route (FR-071).
|
|
356
|
+
*/
|
|
357
|
+
deliveries: z.array(quoteRequestDeliverySchema).optional(),
|
|
308
358
|
});
|
|
309
359
|
/**
|
|
310
360
|
* How many of a quote request's most recent events its history is built from
|
|
@@ -450,7 +500,10 @@ export const quoteRequestSchema = z.object({
|
|
|
450
500
|
id: uuidSchema,
|
|
451
501
|
name: z.string(),
|
|
452
502
|
legalName: z.string().nullable(),
|
|
453
|
-
|
|
503
|
+
/** `null` for a personal (B2C) Organization, whose tax id is an internal placeholder (#767). */
|
|
504
|
+
taxId: z.string().nullable(),
|
|
505
|
+
/** A personal (B2C) Organization: the panel labels it an individual customer (#767). */
|
|
506
|
+
isPersonal: z.boolean(),
|
|
454
507
|
vatStatus: z.string(),
|
|
455
508
|
})
|
|
456
509
|
.nullable()
|
|
@@ -474,6 +527,37 @@ export const quoteRequestSchema = z.object({
|
|
|
474
527
|
updatedAt: isoDateTimeSchema,
|
|
475
528
|
version: z.number().int().nonnegative(),
|
|
476
529
|
});
|
|
530
|
+
/**
|
|
531
|
+
* How far a quote request is agreed (issue #456, PO ruling of 2026-11-08):
|
|
532
|
+
* `agreed` — every line has an agreed price; `partial` — some lines do;
|
|
533
|
+
* `none` — no line does (a quote without a line included).
|
|
534
|
+
*/
|
|
535
|
+
export const quoteRequestAgreementSchema = z.enum(['agreed', 'partial', 'none']);
|
|
536
|
+
/**
|
|
537
|
+
* What a quote request is worth — **one rule**, owned by `quote_requests`
|
|
538
|
+
* (issue #456, owner ruling of 2026-11-07). The quote desk list, a CRM
|
|
539
|
+
* Opportunity's link and a Project's link all show this figure; none of them
|
|
540
|
+
* re-derives it. Read it from `quoteRequestReadPort.amountOf`.
|
|
541
|
+
*
|
|
542
|
+
* - **Per line**: quantity × (agreed unit price ?? the price the customer
|
|
543
|
+
* asked for). The unit price keeps its four places; the line value is the
|
|
544
|
+
* rounding point, half-up to two places once (`lineAmountHalfUp`,
|
|
545
|
+
* `specs/conventions/pricing.md`), and the line values are summed exactly.
|
|
546
|
+
* - **A line with neither price adds nothing** — it is not a zero price, it is
|
|
547
|
+
* no price. A quote none of whose lines has a price has **no amount**
|
|
548
|
+
* (`null`, shown as `—`), not `0.00`.
|
|
549
|
+
* - Net of tax, in the currency of the first line (what the desk shows the
|
|
550
|
+
* total in); `null` for a quote without a line.
|
|
551
|
+
*
|
|
552
|
+
* A consumer shows a marker only beside an amount: *Partially agreed* for
|
|
553
|
+
* `partial`, *Not yet agreed* for `none`.
|
|
554
|
+
*/
|
|
555
|
+
export const quoteRequestAmountSchema = z.object({
|
|
556
|
+
/** Two places, non-negative: `35.00`; `null` when no line has a price. */
|
|
557
|
+
amount: z.string().regex(/^\d+\.\d{2}$/).nullable(),
|
|
558
|
+
currency: z.string().length(3).nullable(),
|
|
559
|
+
agreement: quoteRequestAgreementSchema,
|
|
560
|
+
});
|
|
477
561
|
export const quoteRequestSummarySchema = z.object({
|
|
478
562
|
id: uuidSchema,
|
|
479
563
|
businessId: z.string(),
|
|
@@ -501,6 +585,19 @@ export const quoteRequestSummarySchema = z.object({
|
|
|
501
585
|
.optional(),
|
|
502
586
|
organizationName: z.string().optional(),
|
|
503
587
|
customerDisplayName: z.string().nullable().optional(),
|
|
588
|
+
/**
|
|
589
|
+
* Issue #456 — the quote's amount and how far it is agreed
|
|
590
|
+
* ({@link quoteRequestAmountSchema}). **Admin list only**; the customer list
|
|
591
|
+
* keeps its two every-line-or-`null` totals.
|
|
592
|
+
*/
|
|
593
|
+
amount: quoteRequestAmountSchema.shape.amount.optional(),
|
|
594
|
+
agreement: quoteRequestAgreementSchema.optional(),
|
|
595
|
+
/**
|
|
596
|
+
* Issue #455 — `status` named in the response language, in this module's
|
|
597
|
+
* own wording (`QuoteRequestReadPort.statusName`), for another module's link
|
|
598
|
+
* picker to show. **Admin list only**; declared by issue #1270.
|
|
599
|
+
*/
|
|
600
|
+
statusName: z.string().optional(),
|
|
504
601
|
});
|
|
505
602
|
// ---------------------------------------------------------------------------
|
|
506
603
|
// Customer-facing request schemas
|
|
@@ -508,7 +605,7 @@ export const quoteRequestSummarySchema = z.object({
|
|
|
508
605
|
export const createQuoteRequestLineSchema = z.object({
|
|
509
606
|
productId: uuidSchema,
|
|
510
607
|
variantId: uuidSchema.optional(),
|
|
511
|
-
quantity:
|
|
608
|
+
quantity: lineQuantitySchema,
|
|
512
609
|
desiredUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()).optional(),
|
|
513
610
|
lineNote: z.string().max(2000).optional(),
|
|
514
611
|
/** Feature 043 — snapshot when the line was added as a packaging unit. */
|
|
@@ -524,12 +621,12 @@ export const createQuoteRequestLineSchema = z.object({
|
|
|
524
621
|
*/
|
|
525
622
|
export const createQuoteRequestSchema = z.object({
|
|
526
623
|
headerNote: z.string().max(2000).optional(),
|
|
527
|
-
items: z.array(createQuoteRequestLineSchema).min(1).max(
|
|
624
|
+
items: z.array(createQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX),
|
|
528
625
|
});
|
|
529
626
|
export const patchQuoteRequestSchema = z
|
|
530
627
|
.object({
|
|
531
628
|
headerNote: z.string().max(2000).nullable().optional(),
|
|
532
|
-
items: z.array(createQuoteRequestLineSchema).min(1).max(
|
|
629
|
+
items: z.array(createQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX).optional(),
|
|
533
630
|
})
|
|
534
631
|
.strict();
|
|
535
632
|
export const acceptRevisionSchema = z.object({
|
|
@@ -550,7 +647,7 @@ export const resubmitQuoteRequestSchema = z
|
|
|
550
647
|
export const adminCreateQuoteRequestLineSchema = z.object({
|
|
551
648
|
productId: uuidSchema,
|
|
552
649
|
variantId: uuidSchema.optional(),
|
|
553
|
-
quantity:
|
|
650
|
+
quantity: lineQuantitySchema,
|
|
554
651
|
agreedUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()),
|
|
555
652
|
lineNote: z.string().max(2000).optional(),
|
|
556
653
|
/** Feature 159 — the `groups[].key` this line belongs to; absent or `null` = ungrouped. */
|
|
@@ -564,7 +661,7 @@ export const adminCreateQuoteRequestSchema = z
|
|
|
564
661
|
/** Feature 159 — the new quote's groups in display order; lines name them by `groupKey`. */
|
|
565
662
|
groups: z.array(newLineGroupInputSchema).optional(),
|
|
566
663
|
/** In display order: each group's lines, then the ungrouped lines. */
|
|
567
|
-
items: z.array(adminCreateQuoteRequestLineSchema).min(1),
|
|
664
|
+
items: z.array(adminCreateQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX),
|
|
568
665
|
expiresInDays: z.number().int().nonnegative().optional(),
|
|
569
666
|
/**
|
|
570
667
|
* Feature 163 (FR-018) — the sales channel the operator raises the request on:
|
|
@@ -582,6 +679,11 @@ export const adminCreateQuoteRequestSchema = z
|
|
|
582
679
|
* Not stored and not returned.
|
|
583
680
|
*/
|
|
584
681
|
origin: OriginReferenceSchema.optional(),
|
|
682
|
+
/**
|
|
683
|
+
* Feature 175 (FR-019) — the request's custom-field values, validated with
|
|
684
|
+
* the administrator's rules inside the creating Command.
|
|
685
|
+
*/
|
|
686
|
+
customFieldValues: customFieldValuesSchema.optional(),
|
|
585
687
|
})
|
|
586
688
|
.superRefine((body, ctx) => refineLineGrouping(ctx, body));
|
|
587
689
|
/**
|
|
@@ -604,7 +706,7 @@ export const adminPatchQuoteRequestLineSchema = z.object({
|
|
|
604
706
|
id: uuidSchema.optional(),
|
|
605
707
|
productId: uuidSchema,
|
|
606
708
|
variantId: uuidSchema.optional(),
|
|
607
|
-
quantity:
|
|
709
|
+
quantity: lineQuantitySchema,
|
|
608
710
|
agreedUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()).nullable().optional(),
|
|
609
711
|
lineNote: z.string().max(2000).nullable().optional(),
|
|
610
712
|
/** Feature 159 — the `groups[].key` this line belongs to; `null` = ungrouped. */
|
|
@@ -628,7 +730,7 @@ export const adminPatchQuoteRequestSchema = z
|
|
|
628
730
|
*/
|
|
629
731
|
groups: z.array(lineGroupInputSchema).optional(),
|
|
630
732
|
/** In display order: each group's lines, then the ungrouped lines. */
|
|
631
|
-
items: z.array(adminPatchQuoteRequestLineSchema).min(1).optional(),
|
|
733
|
+
items: z.array(adminPatchQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX).optional(),
|
|
632
734
|
expiresInDays: z.number().int().nonnegative().optional(),
|
|
633
735
|
/** Feature 055 — custom-field values for this quote request (validated on write). */
|
|
634
736
|
customFieldValues: z.record(z.string(), z.unknown()).optional(),
|