wiil-core-js 0.0.82
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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/core/account/index.d.ts +7 -0
- package/dist/core/account/index.js +23 -0
- package/dist/core/account/organization.schema.d.ts +118 -0
- package/dist/core/account/organization.schema.js +91 -0
- package/dist/core/account/project.schema.d.ts +121 -0
- package/dist/core/account/project.schema.js +102 -0
- package/dist/core/account/supported-business-verticals.d.ts +8 -0
- package/dist/core/account/supported-business-verticals.js +23 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
- package/dist/core/assistant-setups/index.d.ts +4 -0
- package/dist/core/assistant-setups/index.js +21 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
- package/dist/core/base.schema.d.ts +34 -0
- package/dist/core/base.schema.js +36 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
- package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
- package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
- package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
- package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
- package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
- package/dist/core/business-mgt/business-location.schema.js +176 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
- package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
- package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
- package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
- package/dist/core/business-mgt/customer-management/index.js +23 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
- package/dist/core/business-mgt/customer.schema.d.ts +111 -0
- package/dist/core/business-mgt/customer.schema.js +73 -0
- package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
- package/dist/core/business-mgt/discount-rule.schema.js +108 -0
- package/dist/core/business-mgt/index.d.ts +16 -0
- package/dist/core/business-mgt/index.js +38 -0
- package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
- package/dist/core/business-mgt/menu-config.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
- package/dist/core/business-mgt/menu-management/index.js +27 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
- package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
- package/dist/core/business-mgt/menu.order.schema.js +149 -0
- package/dist/core/business-mgt/order.schema.d.ts +222 -0
- package/dist/core/business-mgt/order.schema.js +205 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
- package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
- package/dist/core/business-mgt/product-config.schema.js +106 -0
- package/dist/core/business-mgt/product-management/index.d.ts +12 -0
- package/dist/core/business-mgt/product-management/index.js +28 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
- package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
- package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
- package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
- package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
- package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
- package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
- package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
- package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
- package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
- package/dist/core/business-mgt/product-order.schema.js +153 -0
- package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
- package/dist/core/business-mgt/property-config.schema.js +224 -0
- package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
- package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
- package/dist/core/business-mgt/property-management/index.d.ts +6 -0
- package/dist/core/business-mgt/property-management/index.js +22 -0
- package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
- package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
- package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
- package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
- package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
- package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
- package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
- package/dist/core/business-mgt/reservation.schema.js +89 -0
- package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
- package/dist/core/business-mgt/service-appointment.schema.js +69 -0
- package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
- package/dist/core/business-mgt/service-config.schema.js +102 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
- package/dist/core/business-mgt/service-management/index.d.ts +13 -0
- package/dist/core/business-mgt/service-management/index.js +29 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
- package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
- package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
- package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
- package/dist/core/business-mgt/service-person.schema.js +38 -0
- package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
- package/dist/core/business-mgt/tax-rule.schema.js +90 -0
- package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
- package/dist/core/conversation/conversation-config.schema.js +351 -0
- package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
- package/dist/core/conversation/conversation-message.schema.js +275 -0
- package/dist/core/conversation/index.d.ts +12 -0
- package/dist/core/conversation/index.js +28 -0
- package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
- package/dist/core/conversation/outbound-call.schema.js +116 -0
- package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
- package/dist/core/conversation/outbound-email.schema.js +150 -0
- package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
- package/dist/core/conversation/outbound-sms.schema.js +85 -0
- package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
- package/dist/core/conversation/outbound-template.schema.js +160 -0
- package/dist/core/conversation/translation-config.schema.d.ts +92 -0
- package/dist/core/conversation/translation-config.schema.js +88 -0
- package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
- package/dist/core/conversation/translation-conversation.schema.js +175 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +30 -0
- package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
- package/dist/core/service-configuration/agent-config.schema.js +152 -0
- package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
- package/dist/core/service-configuration/base-agent-setup.js +123 -0
- package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
- package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
- package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
- package/dist/core/service-configuration/deployment-config.schema.js +271 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
- package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
- package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
- package/dist/core/service-configuration/index.d.ts +17 -0
- package/dist/core/service-configuration/index.js +33 -0
- package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
- package/dist/core/service-configuration/instruction-config.schema.js +139 -0
- package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
- package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
- package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
- package/dist/core/service-configuration/knowledge.schema.js +106 -0
- package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
- package/dist/core/service-configuration/phone-config.schema.js +121 -0
- package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
- package/dist/core/service-configuration/phone-number.schema.js +211 -0
- package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
- package/dist/core/service-configuration/provisioning-config.js +307 -0
- package/dist/core/service-configuration/support-llm.d.ts +95 -0
- package/dist/core/service-configuration/support-llm.js +76 -0
- package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
- package/dist/core/service-configuration/voice-language.schema.js +166 -0
- package/dist/core/type-definitions/account-definitions.d.ts +82 -0
- package/dist/core/type-definitions/account-definitions.js +88 -0
- package/dist/core/type-definitions/business-definitions.d.ts +394 -0
- package/dist/core/type-definitions/business-definitions.js +447 -0
- package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
- package/dist/core/type-definitions/conversation.type.definition.js +236 -0
- package/dist/core/type-definitions/display-order.d.ts +154 -0
- package/dist/core/type-definitions/display-order.js +154 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
- package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
- package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
- package/dist/core/type-definitions/index.d.ts +10 -0
- package/dist/core/type-definitions/index.js +26 -0
- package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
- package/dist/core/type-definitions/knowledge-definitions.js +37 -0
- package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
- package/dist/core/type-definitions/service-config.definitions.js +135 -0
- package/dist/core/validators/channel-validation.d.ts +19 -0
- package/dist/core/validators/channel-validation.js +40 -0
- package/dist/core/validators/index.d.ts +5 -0
- package/dist/core/validators/index.js +21 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +24 -0
- package/dist/request/index.d.ts +5 -0
- package/dist/request/index.js +21 -0
- package/dist/request/models/index.d.ts +6 -0
- package/dist/request/models/index.js +22 -0
- package/dist/request/models/paginated-quest.schema.d.ts +33 -0
- package/dist/request/models/paginated-quest.schema.js +35 -0
- package/dist/request/models/paginated-result.schema.d.ts +124 -0
- package/dist/request/models/paginated-result.schema.js +94 -0
- package/package.json +43 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { InventoryUnit } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Product variant schema definitions for SKU-level variants.
|
|
5
|
+
* @module business-mgt/product-variant
|
|
6
|
+
*
|
|
7
|
+
* Product variants represent individual SKU-level items with axis value selections
|
|
8
|
+
* (e.g., size, color). Variants can override parent product attributes for pricing,
|
|
9
|
+
* inventory, and physical properties.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Product variant channel mapping schema.
|
|
13
|
+
* Maps variants to external platform identifiers for multi-channel synchronization.
|
|
14
|
+
*
|
|
15
|
+
* @typedef {Object} ProductVariantChannelMapping
|
|
16
|
+
* @property {string} channelId - Platform identifier (e.g., "shopify", "amazon")
|
|
17
|
+
* @property {string} externalVariantId - Variant ID in external platform
|
|
18
|
+
* @property {string} [externalProductId] - Parent product ID in external platform
|
|
19
|
+
*/
|
|
20
|
+
export declare const ProductVariantChannelMappingSchema: z.ZodObject<{
|
|
21
|
+
channelId: z.ZodString;
|
|
22
|
+
externalVariantId: z.ZodString;
|
|
23
|
+
externalProductId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
/**
|
|
26
|
+
* Product variant schema.
|
|
27
|
+
* Represents an individual SKU-level variant with axis value selections.
|
|
28
|
+
* Variants can override parent product attributes for pricing, inventory, and physical properties.
|
|
29
|
+
*
|
|
30
|
+
* @typedef {Object} ProductVariant
|
|
31
|
+
* @property {string} [productRevisionId] - Version control for product changes
|
|
32
|
+
* @property {string} productId - Parent product ID
|
|
33
|
+
* @property {Object} axisValues - Map of axisId to selected valueId
|
|
34
|
+
* @property {string} [sku] - Stock Keeping Unit identifier (overrides parent)
|
|
35
|
+
* @property {string} [barcode] - Product barcode (overrides parent)
|
|
36
|
+
* @property {string} [partNumber] - Manufacturer part number
|
|
37
|
+
* @property {string} [globalTradeItemNumber] - GTIN identifier
|
|
38
|
+
* @property {number} [price] - Variant price (overrides parent)
|
|
39
|
+
* @property {number} [cost] - Variant cost
|
|
40
|
+
* @property {number} [compareAtPrice] - Compare-at price for sale displays
|
|
41
|
+
* @property {number} [stockQuantity] - Variant stock quantity
|
|
42
|
+
* @property {number} [lowStockThreshold] - Low stock alert threshold
|
|
43
|
+
* @property {string} [unitDefinitionId] - Inventory unit definition reference
|
|
44
|
+
* @property {string} [inventoryUnit] - Inventory unit type
|
|
45
|
+
* @property {number} [weight] - Variant weight (overrides parent)
|
|
46
|
+
* @property {Object} [dimensions] - Variant dimensions (overrides parent)
|
|
47
|
+
* @property {string} [imageId] - Primary variant image ID
|
|
48
|
+
* @property {Array} [imageIds] - Variant gallery image IDs
|
|
49
|
+
* @property {Array} [channelMappings] - Per-channel external variant ID mappings
|
|
50
|
+
* @property {boolean} isActive - Whether variant is available for sale
|
|
51
|
+
* @property {boolean} isDefault - Whether this is the default variant
|
|
52
|
+
* @property {number} [orderCount] - Total orders for this variant (all time)
|
|
53
|
+
* @property {number} [recentOrderCount] - Orders in last 30 days
|
|
54
|
+
* @property {number} [lastOrderedAt] - Unix timestamp of last order
|
|
55
|
+
*/
|
|
56
|
+
export declare const ProductVariantSchema: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
productRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
productId: z.ZodString;
|
|
62
|
+
axisValues: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
63
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
+
partNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
globalTradeItemNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
68
|
+
cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
69
|
+
compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
70
|
+
stockQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
71
|
+
lowStockThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
unitDefinitionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
inventoryUnit: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof InventoryUnit>>>;
|
|
74
|
+
weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
75
|
+
dimensions: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
76
|
+
length: z.ZodNumber;
|
|
77
|
+
width: z.ZodNumber;
|
|
78
|
+
height: z.ZodNumber;
|
|
79
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
80
|
+
cm: "cm";
|
|
81
|
+
inches: "inches";
|
|
82
|
+
}>>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
imageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
imageIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
86
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
87
|
+
channelId: z.ZodString;
|
|
88
|
+
externalVariantId: z.ZodString;
|
|
89
|
+
externalProductId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
}, z.core.$strip>>>>;
|
|
91
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
92
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
93
|
+
orderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
94
|
+
recentOrderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
95
|
+
lastOrderedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
/**
|
|
98
|
+
* Schema for creating a new product variant.
|
|
99
|
+
* Omits auto-generated fields and analytics (view model only).
|
|
100
|
+
*/
|
|
101
|
+
export declare const CreateProductVariantSchema: z.ZodObject<{
|
|
102
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
103
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
105
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
106
|
+
channelId: z.ZodString;
|
|
107
|
+
externalVariantId: z.ZodString;
|
|
108
|
+
externalProductId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
+
}, z.core.$strip>>>>;
|
|
110
|
+
productRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
productId: z.ZodString;
|
|
112
|
+
axisValues: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
113
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
barcode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
partNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
globalTradeItemNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
118
|
+
compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
119
|
+
stockQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
lowStockThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
121
|
+
unitDefinitionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
inventoryUnit: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof InventoryUnit>>>;
|
|
123
|
+
weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
+
dimensions: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
125
|
+
length: z.ZodNumber;
|
|
126
|
+
width: z.ZodNumber;
|
|
127
|
+
height: z.ZodNumber;
|
|
128
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
129
|
+
cm: "cm";
|
|
130
|
+
inches: "inches";
|
|
131
|
+
}>>;
|
|
132
|
+
}, z.core.$strip>>>;
|
|
133
|
+
imageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
|
+
imageIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
/**
|
|
137
|
+
* Schema for updating an existing product variant.
|
|
138
|
+
* All fields optional except id (required).
|
|
139
|
+
*/
|
|
140
|
+
export declare const UpdateProductVariantSchema: z.ZodObject<{
|
|
141
|
+
isDefault: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
142
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
143
|
+
price: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
144
|
+
channelMappings: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
145
|
+
channelId: z.ZodString;
|
|
146
|
+
externalVariantId: z.ZodString;
|
|
147
|
+
externalProductId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
|
+
}, z.core.$strip>>>>>;
|
|
149
|
+
productRevisionId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
150
|
+
productId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
axisValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
152
|
+
sku: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
153
|
+
barcode: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
154
|
+
partNumber: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
155
|
+
globalTradeItemNumber: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
156
|
+
cost: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
157
|
+
compareAtPrice: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
158
|
+
stockQuantity: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
159
|
+
lowStockThreshold: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
160
|
+
unitDefinitionId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
161
|
+
inventoryUnit: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof InventoryUnit>>>>;
|
|
162
|
+
weight: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
163
|
+
dimensions: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
164
|
+
length: z.ZodNumber;
|
|
165
|
+
width: z.ZodNumber;
|
|
166
|
+
height: z.ZodNumber;
|
|
167
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
168
|
+
cm: "cm";
|
|
169
|
+
inches: "inches";
|
|
170
|
+
}>>;
|
|
171
|
+
}, z.core.$strip>>>>;
|
|
172
|
+
imageId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
173
|
+
imageIds: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export type ProductVariantChannelMapping = z.infer<typeof ProductVariantChannelMappingSchema>;
|
|
177
|
+
export type ProductVariant = z.infer<typeof ProductVariantSchema>;
|
|
178
|
+
export type CreateProductVariant = z.infer<typeof CreateProductVariantSchema>;
|
|
179
|
+
export type UpdateProductVariant = z.infer<typeof UpdateProductVariantSchema>;
|
|
180
|
+
/**
|
|
181
|
+
* Product variant filter options.
|
|
182
|
+
* @interface ProductVariantFilters
|
|
183
|
+
*/
|
|
184
|
+
export interface ProductVariantFilters {
|
|
185
|
+
/** Filter by parent product ID */
|
|
186
|
+
productId?: string;
|
|
187
|
+
/** Filter by axis value ID */
|
|
188
|
+
axisValueId?: string;
|
|
189
|
+
/** Filter by SKU */
|
|
190
|
+
sku?: string;
|
|
191
|
+
/** Filter by active status */
|
|
192
|
+
isActive?: boolean;
|
|
193
|
+
/** Filter by stock availability */
|
|
194
|
+
inStock?: boolean;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Product variant sorting options.
|
|
198
|
+
* @interface ProductVariantSorting
|
|
199
|
+
*/
|
|
200
|
+
export interface ProductVariantSorting {
|
|
201
|
+
/** Field to sort by */
|
|
202
|
+
field: 'sku' | 'price' | 'stockQuantity' | 'createdAt';
|
|
203
|
+
/** Sort direction */
|
|
204
|
+
direction: 'asc' | 'desc';
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Product variant query options.
|
|
208
|
+
* @interface ProductVariantQueryOptions
|
|
209
|
+
*/
|
|
210
|
+
export interface ProductVariantQueryOptions {
|
|
211
|
+
/** Page number (1-indexed) */
|
|
212
|
+
page: number;
|
|
213
|
+
/** Items per page */
|
|
214
|
+
pageSize: number;
|
|
215
|
+
/** Optional filters */
|
|
216
|
+
filters?: ProductVariantFilters;
|
|
217
|
+
/** Optional sorting */
|
|
218
|
+
sorting?: ProductVariantSorting;
|
|
219
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UpdateProductVariantSchema = exports.CreateProductVariantSchema = exports.ProductVariantSchema = exports.ProductVariantChannelMappingSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
10
|
+
/**
|
|
11
|
+
* @fileoverview Product variant schema definitions for SKU-level variants.
|
|
12
|
+
* @module business-mgt/product-variant
|
|
13
|
+
*
|
|
14
|
+
* Product variants represent individual SKU-level items with axis value selections
|
|
15
|
+
* (e.g., size, color). Variants can override parent product attributes for pricing,
|
|
16
|
+
* inventory, and physical properties.
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// VARIANT CHANNEL MAPPING SCHEMA
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Product variant channel mapping schema.
|
|
23
|
+
* Maps variants to external platform identifiers for multi-channel synchronization.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} ProductVariantChannelMapping
|
|
26
|
+
* @property {string} channelId - Platform identifier (e.g., "shopify", "amazon")
|
|
27
|
+
* @property {string} externalVariantId - Variant ID in external platform
|
|
28
|
+
* @property {string} [externalProductId] - Parent product ID in external platform
|
|
29
|
+
*/
|
|
30
|
+
exports.ProductVariantChannelMappingSchema = zod_1.default.object({
|
|
31
|
+
channelId: zod_1.default.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
32
|
+
externalVariantId: zod_1.default.string().describe("External variant ID for this specific channel"),
|
|
33
|
+
externalProductId: zod_1.default.string().nullable().optional().describe("Optional external parent product ID in this channel"),
|
|
34
|
+
}).describe("Per-channel external variant ID mapping");
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// PRODUCT VARIANT SCHEMA
|
|
37
|
+
// Individual SKU-level variants with axis value selections
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Product variant schema.
|
|
41
|
+
* Represents an individual SKU-level variant with axis value selections.
|
|
42
|
+
* Variants can override parent product attributes for pricing, inventory, and physical properties.
|
|
43
|
+
*
|
|
44
|
+
* @typedef {Object} ProductVariant
|
|
45
|
+
* @property {string} [productRevisionId] - Version control for product changes
|
|
46
|
+
* @property {string} productId - Parent product ID
|
|
47
|
+
* @property {Object} axisValues - Map of axisId to selected valueId
|
|
48
|
+
* @property {string} [sku] - Stock Keeping Unit identifier (overrides parent)
|
|
49
|
+
* @property {string} [barcode] - Product barcode (overrides parent)
|
|
50
|
+
* @property {string} [partNumber] - Manufacturer part number
|
|
51
|
+
* @property {string} [globalTradeItemNumber] - GTIN identifier
|
|
52
|
+
* @property {number} [price] - Variant price (overrides parent)
|
|
53
|
+
* @property {number} [cost] - Variant cost
|
|
54
|
+
* @property {number} [compareAtPrice] - Compare-at price for sale displays
|
|
55
|
+
* @property {number} [stockQuantity] - Variant stock quantity
|
|
56
|
+
* @property {number} [lowStockThreshold] - Low stock alert threshold
|
|
57
|
+
* @property {string} [unitDefinitionId] - Inventory unit definition reference
|
|
58
|
+
* @property {string} [inventoryUnit] - Inventory unit type
|
|
59
|
+
* @property {number} [weight] - Variant weight (overrides parent)
|
|
60
|
+
* @property {Object} [dimensions] - Variant dimensions (overrides parent)
|
|
61
|
+
* @property {string} [imageId] - Primary variant image ID
|
|
62
|
+
* @property {Array} [imageIds] - Variant gallery image IDs
|
|
63
|
+
* @property {Array} [channelMappings] - Per-channel external variant ID mappings
|
|
64
|
+
* @property {boolean} isActive - Whether variant is available for sale
|
|
65
|
+
* @property {boolean} isDefault - Whether this is the default variant
|
|
66
|
+
* @property {number} [orderCount] - Total orders for this variant (all time)
|
|
67
|
+
* @property {number} [recentOrderCount] - Orders in last 30 days
|
|
68
|
+
* @property {number} [lastOrderedAt] - Unix timestamp of last order
|
|
69
|
+
*/
|
|
70
|
+
exports.ProductVariantSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
71
|
+
productRevisionId: zod_1.default.string().nullable().optional().describe("Optional product revision ID for version-scoped data"),
|
|
72
|
+
productId: zod_1.default.string().describe("Parent product ID"),
|
|
73
|
+
// Axis value selections (e.g., { "axis_size": "value_large", "axis_color": "value_red" })
|
|
74
|
+
axisValues: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).describe("Map of axisId to selected valueId"),
|
|
75
|
+
// Override-capable fields (null = inherit from parent product)
|
|
76
|
+
sku: zod_1.default.string().nullable().optional().describe("Stock Keeping Unit identifier"),
|
|
77
|
+
barcode: zod_1.default.string().nullable().optional().describe("Product barcode (EAN-13, UPC-A, etc.)"),
|
|
78
|
+
partNumber: zod_1.default.string().nullable().optional().describe("Manufacturer part number"),
|
|
79
|
+
globalTradeItemNumber: zod_1.default.string().nullable().optional().describe("Global Trade Item Number (GTIN)"),
|
|
80
|
+
price: zod_1.default.number().nonnegative().nullable().optional().describe("Variant price"),
|
|
81
|
+
cost: zod_1.default.number().nonnegative().nullable().optional().describe("Variant cost"),
|
|
82
|
+
compareAtPrice: zod_1.default.number().nonnegative().nullable().optional().describe("Variant compare-at price"),
|
|
83
|
+
// Inventory (variant-level tracking)
|
|
84
|
+
stockQuantity: zod_1.default.number().int().nonnegative().nullable().optional().describe("Variant stock quantity"),
|
|
85
|
+
lowStockThreshold: zod_1.default.number().int().nonnegative().nullable().optional().describe("Variant low stock threshold"),
|
|
86
|
+
unitDefinitionId: zod_1.default.string().nullable().optional().describe("Optional inventory unit definition snapshot pointer for this variant"),
|
|
87
|
+
inventoryUnit: zod_1.default.enum(type_definitions_1.InventoryUnit).nullable().optional().describe("Inventory unit for this variant"),
|
|
88
|
+
// Physical attributes (overrides)
|
|
89
|
+
weight: zod_1.default.number().positive().nullable().optional().describe("Variant weight (overrides parent)"),
|
|
90
|
+
dimensions: zod_1.default.object({
|
|
91
|
+
length: zod_1.default.number().positive().describe("Length dimension"),
|
|
92
|
+
width: zod_1.default.number().positive().describe("Width dimension"),
|
|
93
|
+
height: zod_1.default.number().positive().describe("Height dimension"),
|
|
94
|
+
unit: zod_1.default.enum(['inches', 'cm']).default('inches').describe("Measurement unit"),
|
|
95
|
+
}).nullable().optional().describe("Variant dimensions (overrides parent)"),
|
|
96
|
+
// Media
|
|
97
|
+
imageId: zod_1.default.string().nullable().optional().describe("Primary variant image ID"),
|
|
98
|
+
imageIds: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Variant gallery image IDs"),
|
|
99
|
+
channelMappings: zod_1.default.array(exports.ProductVariantChannelMappingSchema).nullable().optional().describe("Per-channel external variant ID mappings"),
|
|
100
|
+
// Status
|
|
101
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this variant is available for sale"),
|
|
102
|
+
isDefault: zod_1.default.boolean().default(false).describe("Whether this is the default variant for the product"),
|
|
103
|
+
// Ordering analytics
|
|
104
|
+
orderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Total orders for this variant (all time)"),
|
|
105
|
+
recentOrderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Orders for this variant in the last 30 days"),
|
|
106
|
+
lastOrderedAt: zod_1.default.number().int().positive().nullable().optional().describe("Unix timestamp of the last order for this variant"),
|
|
107
|
+
});
|
|
108
|
+
// ============================================================================
|
|
109
|
+
// CREATE/UPDATE SCHEMAS
|
|
110
|
+
// ============================================================================
|
|
111
|
+
/**
|
|
112
|
+
* Schema for creating a new product variant.
|
|
113
|
+
* Omits auto-generated fields and analytics (view model only).
|
|
114
|
+
*/
|
|
115
|
+
exports.CreateProductVariantSchema = exports.ProductVariantSchema.omit({
|
|
116
|
+
id: true,
|
|
117
|
+
createdAt: true,
|
|
118
|
+
updatedAt: true,
|
|
119
|
+
// Omit analytics fields (view model only)
|
|
120
|
+
orderCount: true,
|
|
121
|
+
recentOrderCount: true,
|
|
122
|
+
lastOrderedAt: true,
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Schema for updating an existing product variant.
|
|
126
|
+
* All fields optional except id (required).
|
|
127
|
+
*/
|
|
128
|
+
exports.UpdateProductVariantSchema = exports.CreateProductVariantSchema.partial().safeExtend({
|
|
129
|
+
id: zod_1.default.string().describe("Unique identifier of the ProductVariant to update"),
|
|
130
|
+
});
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { OrderStatus, PaymentStatus } from "../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Product order schema definitions for retail/product sales.
|
|
5
|
+
* @module business-mgt/product-order
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base product order item schema (without productOrderId for creation).
|
|
9
|
+
*
|
|
10
|
+
* @typedef {Object} ProductOrderItemBase
|
|
11
|
+
* @property {string} productId - Product ID being ordered
|
|
12
|
+
* @property {string} itemName - Name of the product
|
|
13
|
+
* @property {string} [sku] - Product SKU
|
|
14
|
+
* @property {number} quantity - Quantity ordered
|
|
15
|
+
* @property {number} unitPrice - Price per unit
|
|
16
|
+
* @property {number} totalPrice - Total price for this item
|
|
17
|
+
* @property {string} [selectedVariant] - Selected variant (size, color, etc.)
|
|
18
|
+
* @property {string} [warrantyInfo] - Warranty information
|
|
19
|
+
* @property {string} status - Item status
|
|
20
|
+
* @property {string} [notes] - Additional notes
|
|
21
|
+
*/
|
|
22
|
+
export declare const ProductOrderItemBaseSchema: z.ZodObject<{
|
|
23
|
+
productId: z.ZodString;
|
|
24
|
+
itemName: z.ZodString;
|
|
25
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
26
|
+
quantity: z.ZodNumber;
|
|
27
|
+
unitPrice: z.ZodNumber;
|
|
28
|
+
totalPrice: z.ZodNumber;
|
|
29
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
30
|
+
warrantyInfo: z.ZodOptional<z.ZodString>;
|
|
31
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
32
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
/**
|
|
35
|
+
* Product order item schema with IDs (for existing items).
|
|
36
|
+
*/
|
|
37
|
+
export declare const ProductOrderItemSchema: z.ZodObject<{
|
|
38
|
+
productId: z.ZodString;
|
|
39
|
+
itemName: z.ZodString;
|
|
40
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
41
|
+
quantity: z.ZodNumber;
|
|
42
|
+
unitPrice: z.ZodNumber;
|
|
43
|
+
totalPrice: z.ZodNumber;
|
|
44
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
45
|
+
warrantyInfo: z.ZodOptional<z.ZodString>;
|
|
46
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
47
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
productOrderId: z.ZodString;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/**
|
|
52
|
+
* Product order schema - for retail/product sales.
|
|
53
|
+
*
|
|
54
|
+
* @typedef {Object} ProductOrder
|
|
55
|
+
* @property {string} [orderNumber] - Human-readable order number
|
|
56
|
+
* @property {string} status - Order status
|
|
57
|
+
* @property {Array} items - Items in the order
|
|
58
|
+
* @property {string} customerId - Customer ID
|
|
59
|
+
* @property {Object} [customer] - Customer information
|
|
60
|
+
* @property {Object} pricing - Pricing details
|
|
61
|
+
* @property {string} paymentStatus - Payment status
|
|
62
|
+
* @property {string} [paymentMethod] - Payment method
|
|
63
|
+
* @property {string} [paymentReference] - Payment reference
|
|
64
|
+
* @property {Object} [billingAddress] - Billing address
|
|
65
|
+
* @property {number} orderDate - Order date
|
|
66
|
+
* @property {number} [requestedDeliveryDate] - Requested delivery date
|
|
67
|
+
* @property {number} [shippedDate] - Shipped date
|
|
68
|
+
* @property {Object} [shippingAddress] - Shipping address
|
|
69
|
+
* @property {number} [deliveredDate] - Delivered date
|
|
70
|
+
* @property {string} [shippingMethod] - Shipping method
|
|
71
|
+
* @property {string} [trackingNumber] - Tracking number
|
|
72
|
+
* @property {string} [shippingCarrier] - Shipping carrier
|
|
73
|
+
* @property {string} [externalOrderId] - External order ID
|
|
74
|
+
* @property {string} source - Order source
|
|
75
|
+
* @property {string} [cancelReason] - Cancellation reason
|
|
76
|
+
* @property {string} [notes] - Additional notes
|
|
77
|
+
* @property {string} [serviceConversationConfigId] - Service conversation config ID
|
|
78
|
+
*/
|
|
79
|
+
export declare const ProductOrderSchema: z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
orderNumber: z.ZodOptional<z.ZodString>;
|
|
84
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
85
|
+
items: z.ZodArray<z.ZodObject<{
|
|
86
|
+
productId: z.ZodString;
|
|
87
|
+
itemName: z.ZodString;
|
|
88
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
89
|
+
quantity: z.ZodNumber;
|
|
90
|
+
unitPrice: z.ZodNumber;
|
|
91
|
+
totalPrice: z.ZodNumber;
|
|
92
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
93
|
+
warrantyInfo: z.ZodOptional<z.ZodString>;
|
|
94
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
95
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
productOrderId: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
customerId: z.ZodString;
|
|
100
|
+
customer: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
104
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
105
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
street: z.ZodString;
|
|
107
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
108
|
+
city: z.ZodString;
|
|
109
|
+
state: z.ZodString;
|
|
110
|
+
postalCode: z.ZodString;
|
|
111
|
+
country: z.ZodString;
|
|
112
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
pricing: z.ZodObject<{
|
|
116
|
+
subtotal: z.ZodNumber;
|
|
117
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
118
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
total: z.ZodNumber;
|
|
122
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
125
|
+
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
126
|
+
paymentReference: z.ZodOptional<z.ZodString>;
|
|
127
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
128
|
+
street: z.ZodString;
|
|
129
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
130
|
+
city: z.ZodString;
|
|
131
|
+
state: z.ZodString;
|
|
132
|
+
postalCode: z.ZodString;
|
|
133
|
+
country: z.ZodString;
|
|
134
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>>;
|
|
136
|
+
orderDate: z.ZodNumber;
|
|
137
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
shippedDate: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
140
|
+
street: z.ZodString;
|
|
141
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
142
|
+
city: z.ZodString;
|
|
143
|
+
state: z.ZodString;
|
|
144
|
+
postalCode: z.ZodString;
|
|
145
|
+
country: z.ZodString;
|
|
146
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>>>;
|
|
148
|
+
deliveredDate: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
shippingMethod: z.ZodOptional<z.ZodString>;
|
|
150
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
151
|
+
shippingCarrier: z.ZodOptional<z.ZodString>;
|
|
152
|
+
externalOrderId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
source: z.ZodDefault<z.ZodString>;
|
|
154
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
155
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
156
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
/**
|
|
159
|
+
* Schema for creating a new product order.
|
|
160
|
+
* Omits auto-generated fields and uses base items without IDs.
|
|
161
|
+
*/
|
|
162
|
+
export declare const CreateProductOrderSchema: z.ZodObject<{
|
|
163
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
164
|
+
customerId: z.ZodString;
|
|
165
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
166
|
+
pricing: z.ZodObject<{
|
|
167
|
+
subtotal: z.ZodNumber;
|
|
168
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
169
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
170
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
171
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
total: z.ZodNumber;
|
|
173
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
176
|
+
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
177
|
+
paymentReference: z.ZodOptional<z.ZodString>;
|
|
178
|
+
orderDate: z.ZodNumber;
|
|
179
|
+
externalOrderId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
source: z.ZodDefault<z.ZodString>;
|
|
181
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
182
|
+
street: z.ZodString;
|
|
183
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
184
|
+
city: z.ZodString;
|
|
185
|
+
state: z.ZodString;
|
|
186
|
+
postalCode: z.ZodString;
|
|
187
|
+
country: z.ZodString;
|
|
188
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>>>;
|
|
190
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
192
|
+
street: z.ZodString;
|
|
193
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
194
|
+
city: z.ZodString;
|
|
195
|
+
state: z.ZodString;
|
|
196
|
+
postalCode: z.ZodString;
|
|
197
|
+
country: z.ZodString;
|
|
198
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>>>;
|
|
200
|
+
shippingMethod: z.ZodOptional<z.ZodString>;
|
|
201
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
202
|
+
shippingCarrier: z.ZodOptional<z.ZodString>;
|
|
203
|
+
items: z.ZodArray<z.ZodObject<{
|
|
204
|
+
productId: z.ZodString;
|
|
205
|
+
itemName: z.ZodString;
|
|
206
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
207
|
+
quantity: z.ZodNumber;
|
|
208
|
+
unitPrice: z.ZodNumber;
|
|
209
|
+
totalPrice: z.ZodNumber;
|
|
210
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
211
|
+
warrantyInfo: z.ZodOptional<z.ZodString>;
|
|
212
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
213
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
/**
|
|
217
|
+
* Schema for updating an existing product order.
|
|
218
|
+
* All fields are optional except id.
|
|
219
|
+
*/
|
|
220
|
+
export declare const UpdateProductOrderSchema: z.ZodObject<{
|
|
221
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof OrderStatus>>>;
|
|
222
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
223
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
224
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
subtotal: z.ZodNumber;
|
|
226
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
227
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
228
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
229
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
230
|
+
total: z.ZodNumber;
|
|
231
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
paymentStatus: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>>;
|
|
234
|
+
paymentMethod: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
235
|
+
paymentReference: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
236
|
+
orderDate: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
externalOrderId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
238
|
+
source: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
239
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
240
|
+
street: z.ZodString;
|
|
241
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
242
|
+
city: z.ZodString;
|
|
243
|
+
state: z.ZodString;
|
|
244
|
+
postalCode: z.ZodString;
|
|
245
|
+
country: z.ZodString;
|
|
246
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>>>>;
|
|
248
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
249
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
250
|
+
street: z.ZodString;
|
|
251
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
252
|
+
city: z.ZodString;
|
|
253
|
+
state: z.ZodString;
|
|
254
|
+
postalCode: z.ZodString;
|
|
255
|
+
country: z.ZodString;
|
|
256
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
257
|
+
}, z.core.$strip>>>>;
|
|
258
|
+
shippingMethod: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
259
|
+
trackingNumber: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
260
|
+
shippingCarrier: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
261
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
262
|
+
productId: z.ZodString;
|
|
263
|
+
itemName: z.ZodString;
|
|
264
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
265
|
+
quantity: z.ZodNumber;
|
|
266
|
+
unitPrice: z.ZodNumber;
|
|
267
|
+
totalPrice: z.ZodNumber;
|
|
268
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
269
|
+
warrantyInfo: z.ZodOptional<z.ZodString>;
|
|
270
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
271
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strip>>>;
|
|
273
|
+
id: z.ZodString;
|
|
274
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
/**
|
|
277
|
+
* Quick status update schema for product orders.
|
|
278
|
+
*/
|
|
279
|
+
export declare const UpdateProductOrderStatusSchema: z.ZodObject<{
|
|
280
|
+
id: z.ZodString;
|
|
281
|
+
status: z.ZodEnum<typeof OrderStatus>;
|
|
282
|
+
shippedDate: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
deliveredDate: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
/**
|
|
287
|
+
* Schema for inventory updates triggered by order fulfillment.
|
|
288
|
+
*/
|
|
289
|
+
export declare const OrderInventoryUpdateSchema: z.ZodObject<{
|
|
290
|
+
orderId: z.ZodString;
|
|
291
|
+
inventoryAdjustments: z.ZodArray<z.ZodObject<{
|
|
292
|
+
productId: z.ZodString;
|
|
293
|
+
quantityUsed: z.ZodNumber;
|
|
294
|
+
reason: z.ZodLiteral<"order_fulfillment">;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
export type ProductOrderItemBase = z.infer<typeof ProductOrderItemBaseSchema>;
|
|
298
|
+
export type ProductOrderItem = z.infer<typeof ProductOrderItemSchema>;
|
|
299
|
+
export type ProductOrder = z.infer<typeof ProductOrderSchema>;
|
|
300
|
+
export type CreateProductOrder = z.infer<typeof CreateProductOrderSchema>;
|
|
301
|
+
export type UpdateProductOrder = z.infer<typeof UpdateProductOrderSchema>;
|
|
302
|
+
export type UpdateProductOrderStatus = z.infer<typeof UpdateProductOrderStatusSchema>;
|
|
303
|
+
export type CreateProductOrderItem = z.infer<typeof ProductOrderItemBaseSchema>;
|
|
304
|
+
export type OrderInventoryUpdate = z.infer<typeof OrderInventoryUpdateSchema>;
|
|
305
|
+
export interface ProductOrderFilters {
|
|
306
|
+
search?: string;
|
|
307
|
+
status?: OrderStatus[];
|
|
308
|
+
paymentStatus?: PaymentStatus[];
|
|
309
|
+
customerId?: string;
|
|
310
|
+
shippingMethod?: string;
|
|
311
|
+
source?: string;
|
|
312
|
+
dateRange?: {
|
|
313
|
+
start?: number;
|
|
314
|
+
end?: number;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
export interface ProductOrderSorting {
|
|
318
|
+
field: 'orderDate' | 'createdAt' | 'totalAmount';
|
|
319
|
+
direction: 'asc' | 'desc';
|
|
320
|
+
}
|
|
321
|
+
export interface ProductOrderQueryOptions {
|
|
322
|
+
page: number;
|
|
323
|
+
pageSize: number;
|
|
324
|
+
filters?: ProductOrderFilters;
|
|
325
|
+
sorting?: ProductOrderSorting;
|
|
326
|
+
}
|