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,493 @@
|
|
|
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
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
itemName: z.ZodString;
|
|
26
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
quantity: z.ZodNumber;
|
|
28
|
+
unitPrice: z.ZodNumber;
|
|
29
|
+
totalPrice: z.ZodNumber;
|
|
30
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
31
|
+
warrantyInfo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
33
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Product order item schema with IDs (for existing items).
|
|
37
|
+
*/
|
|
38
|
+
export declare const ProductOrderItemSchema: z.ZodObject<{
|
|
39
|
+
productId: z.ZodString;
|
|
40
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
itemName: z.ZodString;
|
|
42
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
quantity: z.ZodNumber;
|
|
44
|
+
unitPrice: z.ZodNumber;
|
|
45
|
+
totalPrice: z.ZodNumber;
|
|
46
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
47
|
+
warrantyInfo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
49
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
productOrderId: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/**
|
|
54
|
+
* Product order schema - for retail/product sales.
|
|
55
|
+
*
|
|
56
|
+
* @typedef {Object} ProductOrder
|
|
57
|
+
* @property {string} [orderNumber] - Human-readable order number
|
|
58
|
+
* @property {string} status - Order status
|
|
59
|
+
* @property {Array} items - Items in the order
|
|
60
|
+
* @property {string} customerId - Customer ID
|
|
61
|
+
* @property {Object} [customer] - Customer information
|
|
62
|
+
* @property {Object} pricing - Pricing details
|
|
63
|
+
* @property {string} paymentStatus - Payment status
|
|
64
|
+
* @property {string} [paymentMethod] - Payment method
|
|
65
|
+
* @property {string} [paymentReference] - Payment reference
|
|
66
|
+
* @property {Object} [billingAddress] - Billing address
|
|
67
|
+
* @property {number} orderDate - Order date
|
|
68
|
+
* @property {number} [requestedDeliveryDate] - Requested delivery date
|
|
69
|
+
* @property {number} [shippedDate] - Shipped date
|
|
70
|
+
* @property {Object} [shippingAddress] - Shipping address
|
|
71
|
+
* @property {number} [deliveredDate] - Delivered date
|
|
72
|
+
* @property {string} [shippingMethod] - Shipping method
|
|
73
|
+
* @property {string} [trackingNumber] - Tracking number
|
|
74
|
+
* @property {string} [shippingCarrier] - Shipping carrier
|
|
75
|
+
* @property {string} [externalOrderId] - External order ID
|
|
76
|
+
* @property {string} source - Order source
|
|
77
|
+
* @property {string} [cancelReason] - Cancellation reason
|
|
78
|
+
* @property {string} [notes] - Additional notes
|
|
79
|
+
* @property {string} [serviceConversationConfigId] - Service conversation config ID
|
|
80
|
+
*/
|
|
81
|
+
export declare const ProductOrderSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
terminalId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
operatorId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
orderNumber: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
91
|
+
items: z.ZodArray<z.ZodObject<{
|
|
92
|
+
productId: z.ZodString;
|
|
93
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
itemName: z.ZodString;
|
|
95
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
quantity: z.ZodNumber;
|
|
97
|
+
unitPrice: z.ZodNumber;
|
|
98
|
+
totalPrice: z.ZodNumber;
|
|
99
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
100
|
+
warrantyInfo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
102
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
productOrderId: z.ZodString;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
customerId: z.ZodString;
|
|
107
|
+
pricing: z.ZodObject<{
|
|
108
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
subtotal: z.ZodNumber;
|
|
110
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
112
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
115
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
116
|
+
adjustmentValue: z.ZodNumber;
|
|
117
|
+
baseAmount: z.ZodNumber;
|
|
118
|
+
adjustedAmount: z.ZodNumber;
|
|
119
|
+
deltaAmount: z.ZodNumber;
|
|
120
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
}, z.core.$strip>>>;
|
|
122
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
125
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
126
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
code: z.ZodOptional<z.ZodString>;
|
|
129
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
130
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
131
|
+
value: z.ZodNumber;
|
|
132
|
+
discountableAmount: z.ZodNumber;
|
|
133
|
+
discountAmount: z.ZodNumber;
|
|
134
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
}, z.core.$strip>>>;
|
|
136
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
139
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
143
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
144
|
+
rateValue: z.ZodNumber;
|
|
145
|
+
taxableAmount: z.ZodNumber;
|
|
146
|
+
taxAmount: z.ZodNumber;
|
|
147
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>>>;
|
|
149
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
150
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
151
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
152
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
153
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
154
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
total: z.ZodNumber;
|
|
156
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
159
|
+
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
160
|
+
paymentReference: z.ZodOptional<z.ZodString>;
|
|
161
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
162
|
+
street: z.ZodString;
|
|
163
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
164
|
+
city: z.ZodString;
|
|
165
|
+
state: z.ZodString;
|
|
166
|
+
postalCode: z.ZodString;
|
|
167
|
+
country: z.ZodString;
|
|
168
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>>>;
|
|
170
|
+
orderDate: z.ZodNumber;
|
|
171
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
shippedDate: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
174
|
+
street: z.ZodString;
|
|
175
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
176
|
+
city: z.ZodString;
|
|
177
|
+
state: z.ZodString;
|
|
178
|
+
postalCode: z.ZodString;
|
|
179
|
+
country: z.ZodString;
|
|
180
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>>;
|
|
182
|
+
deliveredDate: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
shippingMethod: z.ZodOptional<z.ZodString>;
|
|
184
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
185
|
+
shippingCarrier: z.ZodOptional<z.ZodString>;
|
|
186
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
187
|
+
externalId: z.ZodString;
|
|
188
|
+
source: z.ZodString;
|
|
189
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
190
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
191
|
+
}, z.core.$strip>>>;
|
|
192
|
+
source: z.ZodDefault<z.ZodString>;
|
|
193
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
/**
|
|
198
|
+
* Schema for creating a new product order.
|
|
199
|
+
* Omits auto-generated fields and uses base items without IDs.
|
|
200
|
+
*/
|
|
201
|
+
export declare const CreateProductOrderSchema: z.ZodObject<{
|
|
202
|
+
source: z.ZodDefault<z.ZodString>;
|
|
203
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
204
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
customerId: z.ZodString;
|
|
206
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
terminalId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
209
|
+
operatorId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
210
|
+
pricing: z.ZodObject<{
|
|
211
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
subtotal: z.ZodNumber;
|
|
213
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
214
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
218
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
219
|
+
adjustmentValue: z.ZodNumber;
|
|
220
|
+
baseAmount: z.ZodNumber;
|
|
221
|
+
adjustedAmount: z.ZodNumber;
|
|
222
|
+
deltaAmount: z.ZodNumber;
|
|
223
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
}, z.core.$strip>>>;
|
|
225
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
228
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
229
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
230
|
+
name: z.ZodString;
|
|
231
|
+
code: z.ZodOptional<z.ZodString>;
|
|
232
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
233
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
234
|
+
value: z.ZodNumber;
|
|
235
|
+
discountableAmount: z.ZodNumber;
|
|
236
|
+
discountAmount: z.ZodNumber;
|
|
237
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
238
|
+
}, z.core.$strip>>>;
|
|
239
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
242
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
243
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
244
|
+
name: z.ZodString;
|
|
245
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
246
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
247
|
+
rateValue: z.ZodNumber;
|
|
248
|
+
taxableAmount: z.ZodNumber;
|
|
249
|
+
taxAmount: z.ZodNumber;
|
|
250
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
251
|
+
}, z.core.$strip>>>;
|
|
252
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
253
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
254
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
255
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
256
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
257
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
total: z.ZodNumber;
|
|
259
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
262
|
+
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
263
|
+
paymentReference: z.ZodOptional<z.ZodString>;
|
|
264
|
+
orderDate: z.ZodNumber;
|
|
265
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
266
|
+
externalId: z.ZodString;
|
|
267
|
+
source: z.ZodString;
|
|
268
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
269
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
270
|
+
}, z.core.$strip>>>;
|
|
271
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
272
|
+
street: z.ZodString;
|
|
273
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
274
|
+
city: z.ZodString;
|
|
275
|
+
state: z.ZodString;
|
|
276
|
+
postalCode: z.ZodString;
|
|
277
|
+
country: z.ZodString;
|
|
278
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strip>>>;
|
|
280
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
282
|
+
street: z.ZodString;
|
|
283
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
284
|
+
city: z.ZodString;
|
|
285
|
+
state: z.ZodString;
|
|
286
|
+
postalCode: z.ZodString;
|
|
287
|
+
country: z.ZodString;
|
|
288
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
289
|
+
}, z.core.$strip>>>;
|
|
290
|
+
shippingMethod: z.ZodOptional<z.ZodString>;
|
|
291
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
292
|
+
shippingCarrier: z.ZodOptional<z.ZodString>;
|
|
293
|
+
items: z.ZodArray<z.ZodObject<{
|
|
294
|
+
productId: z.ZodString;
|
|
295
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
296
|
+
itemName: z.ZodString;
|
|
297
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
298
|
+
quantity: z.ZodNumber;
|
|
299
|
+
unitPrice: z.ZodNumber;
|
|
300
|
+
totalPrice: z.ZodNumber;
|
|
301
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
302
|
+
warrantyInfo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
303
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
304
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
|
+
cancelReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
/**
|
|
309
|
+
* Schema for updating an existing product order.
|
|
310
|
+
* All fields are optional except id.
|
|
311
|
+
*/
|
|
312
|
+
export declare const UpdateProductOrderSchema: z.ZodObject<{
|
|
313
|
+
source: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
314
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof OrderStatus>>>;
|
|
315
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
316
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
317
|
+
channelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
318
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
319
|
+
terminalId: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
320
|
+
operatorId: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
321
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
322
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
subtotal: z.ZodNumber;
|
|
324
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
325
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
326
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
329
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
330
|
+
adjustmentValue: z.ZodNumber;
|
|
331
|
+
baseAmount: z.ZodNumber;
|
|
332
|
+
adjustedAmount: z.ZodNumber;
|
|
333
|
+
deltaAmount: z.ZodNumber;
|
|
334
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
}, z.core.$strip>>>;
|
|
336
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
337
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
339
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
340
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
341
|
+
name: z.ZodString;
|
|
342
|
+
code: z.ZodOptional<z.ZodString>;
|
|
343
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
344
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
345
|
+
value: z.ZodNumber;
|
|
346
|
+
discountableAmount: z.ZodNumber;
|
|
347
|
+
discountAmount: z.ZodNumber;
|
|
348
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
349
|
+
}, z.core.$strip>>>;
|
|
350
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
351
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
353
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
354
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
355
|
+
name: z.ZodString;
|
|
356
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
357
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
358
|
+
rateValue: z.ZodNumber;
|
|
359
|
+
taxableAmount: z.ZodNumber;
|
|
360
|
+
taxAmount: z.ZodNumber;
|
|
361
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
362
|
+
}, z.core.$strip>>>;
|
|
363
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
364
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
365
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
366
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
367
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
368
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
total: z.ZodNumber;
|
|
370
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
371
|
+
}, z.core.$strip>>;
|
|
372
|
+
paymentStatus: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>>;
|
|
373
|
+
paymentMethod: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
374
|
+
paymentReference: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
375
|
+
orderDate: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
externalRef: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
377
|
+
externalId: z.ZodString;
|
|
378
|
+
source: z.ZodString;
|
|
379
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
380
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
381
|
+
}, z.core.$strip>>>>;
|
|
382
|
+
billingAddress: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
383
|
+
street: z.ZodString;
|
|
384
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
385
|
+
city: z.ZodString;
|
|
386
|
+
state: z.ZodString;
|
|
387
|
+
postalCode: z.ZodString;
|
|
388
|
+
country: z.ZodString;
|
|
389
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
390
|
+
}, z.core.$strip>>>>;
|
|
391
|
+
requestedDeliveryDate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
392
|
+
shippingAddress: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
393
|
+
street: z.ZodString;
|
|
394
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
395
|
+
city: z.ZodString;
|
|
396
|
+
state: z.ZodString;
|
|
397
|
+
postalCode: z.ZodString;
|
|
398
|
+
country: z.ZodString;
|
|
399
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
400
|
+
}, z.core.$strip>>>>;
|
|
401
|
+
shippingMethod: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
402
|
+
trackingNumber: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
403
|
+
shippingCarrier: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
404
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
405
|
+
productId: z.ZodString;
|
|
406
|
+
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
407
|
+
itemName: z.ZodString;
|
|
408
|
+
sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
409
|
+
quantity: z.ZodNumber;
|
|
410
|
+
unitPrice: z.ZodNumber;
|
|
411
|
+
totalPrice: z.ZodNumber;
|
|
412
|
+
selectedVariant: z.ZodOptional<z.ZodString>;
|
|
413
|
+
warrantyInfo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
414
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
415
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
416
|
+
}, z.core.$strip>>>;
|
|
417
|
+
id: z.ZodString;
|
|
418
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
419
|
+
}, z.core.$strip>;
|
|
420
|
+
/**
|
|
421
|
+
* Quick status update schema for product orders.
|
|
422
|
+
*/
|
|
423
|
+
export declare const UpdateProductOrderStatusSchema: z.ZodObject<{
|
|
424
|
+
id: z.ZodString;
|
|
425
|
+
status: z.ZodEnum<typeof OrderStatus>;
|
|
426
|
+
shippedDate: z.ZodOptional<z.ZodNumber>;
|
|
427
|
+
deliveredDate: z.ZodOptional<z.ZodNumber>;
|
|
428
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
export type ProductOrderItemBase = z.infer<typeof ProductOrderItemBaseSchema>;
|
|
431
|
+
export type ProductOrderItem = z.infer<typeof ProductOrderItemSchema>;
|
|
432
|
+
export type ProductOrder = z.infer<typeof ProductOrderSchema>;
|
|
433
|
+
export type CreateProductOrder = z.infer<typeof CreateProductOrderSchema>;
|
|
434
|
+
export type UpdateProductOrder = z.infer<typeof UpdateProductOrderSchema>;
|
|
435
|
+
export type UpdateProductOrderStatus = z.infer<typeof UpdateProductOrderStatusSchema>;
|
|
436
|
+
export type CreateProductOrderItem = z.infer<typeof ProductOrderItemBaseSchema>;
|
|
437
|
+
/**
|
|
438
|
+
* Product order filter options.
|
|
439
|
+
* @interface ProductOrderFilters
|
|
440
|
+
*/
|
|
441
|
+
export interface ProductOrderFilters {
|
|
442
|
+
/** Text search across order fields */
|
|
443
|
+
search?: string;
|
|
444
|
+
/** Filter by location ID */
|
|
445
|
+
locationId?: string;
|
|
446
|
+
/** Filter by channel ID */
|
|
447
|
+
channelId?: string;
|
|
448
|
+
/** Filter by terminal ID */
|
|
449
|
+
terminalId?: string;
|
|
450
|
+
/** Filter by operator ID */
|
|
451
|
+
operatorId?: string;
|
|
452
|
+
/** Filter by order statuses */
|
|
453
|
+
status?: OrderStatus[];
|
|
454
|
+
/** Filter by payment statuses */
|
|
455
|
+
paymentStatus?: PaymentStatus[];
|
|
456
|
+
/** Filter by customer ID */
|
|
457
|
+
customerId?: string;
|
|
458
|
+
/** Filter by shipping method */
|
|
459
|
+
shippingMethod?: string;
|
|
460
|
+
/** Filter by order source */
|
|
461
|
+
source?: string;
|
|
462
|
+
/** Filter by external source platform */
|
|
463
|
+
externalSource?: string;
|
|
464
|
+
/** Filter by date range */
|
|
465
|
+
dateRange?: {
|
|
466
|
+
start?: number;
|
|
467
|
+
end?: number;
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Product order sorting options.
|
|
472
|
+
* @interface ProductOrderSorting
|
|
473
|
+
*/
|
|
474
|
+
export interface ProductOrderSorting {
|
|
475
|
+
/** Field to sort by */
|
|
476
|
+
field: 'orderDate' | 'createdAt' | 'totalAmount';
|
|
477
|
+
/** Sort direction */
|
|
478
|
+
direction: 'asc' | 'desc';
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Product order query options.
|
|
482
|
+
* @interface ProductOrderQueryOptions
|
|
483
|
+
*/
|
|
484
|
+
export interface ProductOrderQueryOptions {
|
|
485
|
+
/** Page number (1-indexed) */
|
|
486
|
+
page: number;
|
|
487
|
+
/** Items per page */
|
|
488
|
+
pageSize: number;
|
|
489
|
+
/** Optional filters */
|
|
490
|
+
filters?: ProductOrderFilters;
|
|
491
|
+
/** Optional sorting */
|
|
492
|
+
sorting?: ProductOrderSorting;
|
|
493
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
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.UpdateProductOrderStatusSchema = exports.UpdateProductOrderSchema = exports.CreateProductOrderSchema = exports.ProductOrderSchema = exports.ProductOrderItemSchema = exports.ProductOrderItemBaseSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const order_schema_1 = require("../order.schema");
|
|
10
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
11
|
+
/**
|
|
12
|
+
* @fileoverview Product order schema definitions for retail/product sales.
|
|
13
|
+
* @module business-mgt/product-order
|
|
14
|
+
*/
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// ORDER ITEM SCHEMAS
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Base product order item schema (without productOrderId for creation).
|
|
20
|
+
*
|
|
21
|
+
* @typedef {Object} ProductOrderItemBase
|
|
22
|
+
* @property {string} productId - Product ID being ordered
|
|
23
|
+
* @property {string} itemName - Name of the product
|
|
24
|
+
* @property {string} [sku] - Product SKU
|
|
25
|
+
* @property {number} quantity - Quantity ordered
|
|
26
|
+
* @property {number} unitPrice - Price per unit
|
|
27
|
+
* @property {number} totalPrice - Total price for this item
|
|
28
|
+
* @property {string} [selectedVariant] - Selected variant (size, color, etc.)
|
|
29
|
+
* @property {string} [warrantyInfo] - Warranty information
|
|
30
|
+
* @property {string} status - Item status
|
|
31
|
+
* @property {string} [notes] - Additional notes
|
|
32
|
+
*/
|
|
33
|
+
exports.ProductOrderItemBaseSchema = zod_1.default.object({
|
|
34
|
+
productId: zod_1.default.string().describe("References Product from product-config.schema being ordered. Links order item to catalog for inventory tracking, fulfillment details, and product information."),
|
|
35
|
+
variantId: zod_1.default.string().nullable().optional().describe("Product variant ID being ordered. Links to specific SKU variant for accurate inventory tracking and pricing."),
|
|
36
|
+
itemName: zod_1.default.string().describe("Display name of the product captured at order time. Preserved even if catalog product is later renamed, ensuring historical order accuracy."),
|
|
37
|
+
sku: zod_1.default.string().nullable().optional().describe("Stock Keeping Unit identifier captured at order time for warehouse fulfillment and inventory systems. Links to product catalog SKU for picking and packing."),
|
|
38
|
+
quantity: zod_1.default.number().int().positive().describe("Number of units ordered for this product. Used for inventory deduction, pricing calculations, and fulfillment quantities."),
|
|
39
|
+
unitPrice: zod_1.default.number().nonnegative().describe("Price per unit at the time of order. Captures pricing snapshot for order integrity even if catalog prices change later."),
|
|
40
|
+
totalPrice: zod_1.default.number().nonnegative().describe("Total price for this line item: unitPrice × quantity. Used in order subtotal calculations."),
|
|
41
|
+
// Retail-specific
|
|
42
|
+
selectedVariant: zod_1.default.string().optional().describe("Selected product variant specification (e.g., 'Large/Blue', 'XL', '128GB'). Captured for fulfillment accuracy and inventory tracking of specific variants."),
|
|
43
|
+
warrantyInfo: zod_1.default.string().nullable().optional().describe("Warranty terms and coverage details captured at purchase time. Preserved for customer reference and service claim validation."),
|
|
44
|
+
status: zod_1.default.enum(type_definitions_1.OrderStatus).default(type_definitions_1.OrderStatus.PENDING).describe("Current fulfillment status of this individual item. Enables per-item tracking in warehouse workflow. Defaults to PENDING."),
|
|
45
|
+
notes: zod_1.default.string().nullable().optional().describe("Internal notes about this item for warehouse or fulfillment staff. Not visible to customers.")
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Product order item schema with IDs (for existing items).
|
|
49
|
+
*/
|
|
50
|
+
exports.ProductOrderItemSchema = exports.ProductOrderItemBaseSchema.safeExtend({
|
|
51
|
+
id: zod_1.default.string().describe("Unique identifier for this product order item instance."),
|
|
52
|
+
productOrderId: zod_1.default.string().describe("References parent ProductOrder this item belongs to. Maintains order-item relationship for order management and fulfillment tracking."),
|
|
53
|
+
});
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// PRODUCT ORDER SCHEMA
|
|
56
|
+
// ============================================================================
|
|
57
|
+
/**
|
|
58
|
+
* Product order schema - for retail/product sales.
|
|
59
|
+
*
|
|
60
|
+
* @typedef {Object} ProductOrder
|
|
61
|
+
* @property {string} [orderNumber] - Human-readable order number
|
|
62
|
+
* @property {string} status - Order status
|
|
63
|
+
* @property {Array} items - Items in the order
|
|
64
|
+
* @property {string} customerId - Customer ID
|
|
65
|
+
* @property {Object} [customer] - Customer information
|
|
66
|
+
* @property {Object} pricing - Pricing details
|
|
67
|
+
* @property {string} paymentStatus - Payment status
|
|
68
|
+
* @property {string} [paymentMethod] - Payment method
|
|
69
|
+
* @property {string} [paymentReference] - Payment reference
|
|
70
|
+
* @property {Object} [billingAddress] - Billing address
|
|
71
|
+
* @property {number} orderDate - Order date
|
|
72
|
+
* @property {number} [requestedDeliveryDate] - Requested delivery date
|
|
73
|
+
* @property {number} [shippedDate] - Shipped date
|
|
74
|
+
* @property {Object} [shippingAddress] - Shipping address
|
|
75
|
+
* @property {number} [deliveredDate] - Delivered date
|
|
76
|
+
* @property {string} [shippingMethod] - Shipping method
|
|
77
|
+
* @property {string} [trackingNumber] - Tracking number
|
|
78
|
+
* @property {string} [shippingCarrier] - Shipping carrier
|
|
79
|
+
* @property {string} [externalOrderId] - External order ID
|
|
80
|
+
* @property {string} source - Order source
|
|
81
|
+
* @property {string} [cancelReason] - Cancellation reason
|
|
82
|
+
* @property {string} [notes] - Additional notes
|
|
83
|
+
* @property {string} [serviceConversationConfigId] - Service conversation config ID
|
|
84
|
+
*/
|
|
85
|
+
exports.ProductOrderSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
86
|
+
locationId: zod_1.default.string().nullable().optional().describe("Business location ID for multi-location businesses. Links order to specific warehouse/branch."),
|
|
87
|
+
channelId: zod_1.default.string().nullable().optional().describe("Channel ID for multi-channel orders (e.g., shopify, amazon, direct). Used for attribution and analytics."),
|
|
88
|
+
terminalId: zod_1.default.string().nullable().default(null).describe("Terminal/register ID that created the order. For POS integration and reconciliation."),
|
|
89
|
+
operatorId: zod_1.default.string().nullable().default(null).describe("Operator/staff user ID that created the order. For accountability and commission tracking."),
|
|
90
|
+
orderNumber: zod_1.default.string().nullable().default(null).describe("Human-readable order number displayed to customers and staff (e.g., 'ORD-12345', 'PO-2024-001'). Generated by Product Management for easy reference and communication."),
|
|
91
|
+
status: zod_1.default.enum(type_definitions_1.OrderStatus).default(type_definitions_1.OrderStatus.PENDING).describe("Current order status tracking progression from placement through fulfillment and delivery. Used by warehouse systems and customer notifications. Defaults to PENDING."),
|
|
92
|
+
items: zod_1.default.array(exports.ProductOrderItemSchema).min(1, "Order must have at least one item").describe("Products in this order with quantities, pricing, and variants. Minimum one item required for valid order."),
|
|
93
|
+
customerId: zod_1.default.string().describe("References Customer who placed this order. Links to customer profile for order history, preferences, and communication."),
|
|
94
|
+
pricing: order_schema_1.OrderPricingSchema.describe("Complete pricing breakdown including subtotal, tax, shipping fees, and discounts. From order.schema.ts for consistent pricing across order types."),
|
|
95
|
+
// Payment
|
|
96
|
+
paymentStatus: zod_1.default.enum(type_definitions_1.PaymentStatus).default(type_definitions_1.PaymentStatus.PENDING).describe("Payment processing status. Tracks whether order is paid, pending, failed, or refunded. Defaults to PENDING."),
|
|
97
|
+
paymentMethod: zod_1.default.string().optional().describe("Payment method used (e.g., 'credit_card', 'paypal', 'bank_transfer'). Captured for accounting and reconciliation."),
|
|
98
|
+
paymentReference: zod_1.default.string().optional().describe("External payment system reference or transaction ID. Used for payment verification and dispute resolution."),
|
|
99
|
+
billingAddress: order_schema_1.OrderAddress.optional().describe("Billing address for payment processing and invoicing. May differ from shipping address. Uses OrderAddress from order.schema.ts with delivery instructions support."),
|
|
100
|
+
// Retail-specific timing
|
|
101
|
+
orderDate: zod_1.default.number().describe("Unix timestamp when order was placed. Used for order history, analytics, and time-based reporting."),
|
|
102
|
+
requestedDeliveryDate: zod_1.default.number().optional().describe("Unix timestamp for customer's requested delivery date. Used for logistics planning and shipment scheduling."),
|
|
103
|
+
shippedDate: zod_1.default.number().optional().describe("Unix timestamp when order was shipped. Triggers customer shipment notifications via AI Powered Services."),
|
|
104
|
+
shippingAddress: order_schema_1.OrderAddress.optional().describe("Delivery address for shipment. Uses OrderAddress from order.schema.ts with delivery instructions field for courier guidance."),
|
|
105
|
+
deliveredDate: zod_1.default.number().optional().describe("Unix timestamp when order was delivered to customer. Used for order completion tracking and delivery performance metrics."),
|
|
106
|
+
// Shipping info
|
|
107
|
+
shippingMethod: zod_1.default.string().optional().describe("Shipping service level (e.g., 'Standard', 'Express', 'Overnight'). Determines delivery timeframe and shipping cost."),
|
|
108
|
+
trackingNumber: zod_1.default.string().optional().describe("Carrier tracking number for shipment monitoring. Enables customer self-service tracking and delivery status updates."),
|
|
109
|
+
shippingCarrier: zod_1.default.string().optional().describe("Shipping carrier name (e.g., 'UPS', 'FedEx', 'USPS'). Links tracking number to carrier's tracking system."),
|
|
110
|
+
// Integration
|
|
111
|
+
externalRef: type_definitions_1.ExternalRefSchema.nullable().optional().describe("External system reference when order is imported/synced from third-party platforms."),
|
|
112
|
+
source: zod_1.default.string().default('direct').describe("Order source channel (e.g., 'direct', 'web', 'marketplace', 'wholesale'). Used for attribution tracking and channel analytics. Defaults to 'direct'."),
|
|
113
|
+
cancelReason: zod_1.default.string().nullable().optional().describe("Reason provided when order is cancelled. Used for analytics, refund processing, and customer service follow-up."),
|
|
114
|
+
notes: zod_1.default.string().nullable().optional().describe("Internal operational notes about this order. Not visible to customers; used by warehouse and fulfillment staff for coordination."),
|
|
115
|
+
serviceConversationConfigId: zod_1.default.string().nullable().optional().describe("References the AI Powered Services conversation configuration that powered this order. Links order to deployment channel and conversation history."),
|
|
116
|
+
});
|
|
117
|
+
// ============================================================================
|
|
118
|
+
// CREATE/UPDATE SCHEMAS
|
|
119
|
+
// ============================================================================
|
|
120
|
+
/**
|
|
121
|
+
* Schema for creating a new product order.
|
|
122
|
+
* Omits auto-generated fields and uses base items without IDs.
|
|
123
|
+
*/
|
|
124
|
+
exports.CreateProductOrderSchema = exports.ProductOrderSchema.omit({
|
|
125
|
+
id: true,
|
|
126
|
+
orderNumber: true,
|
|
127
|
+
createdAt: true,
|
|
128
|
+
updatedAt: true,
|
|
129
|
+
deliveredDate: true,
|
|
130
|
+
shippedDate: true,
|
|
131
|
+
items: true,
|
|
132
|
+
cancelReason: true,
|
|
133
|
+
serviceConversationConfigId: true,
|
|
134
|
+
}).safeExtend({
|
|
135
|
+
items: zod_1.default.array(exports.ProductOrderItemBaseSchema).min(1, "Order must have at least one item"),
|
|
136
|
+
cancelReason: zod_1.default.string().nullable().default(null),
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Schema for updating an existing product order.
|
|
140
|
+
* All fields are optional except id.
|
|
141
|
+
*/
|
|
142
|
+
exports.UpdateProductOrderSchema = exports.CreateProductOrderSchema.partial().safeExtend({
|
|
143
|
+
id: zod_1.default.string(),
|
|
144
|
+
cancelReason: zod_1.default.string().nullable().optional(),
|
|
145
|
+
});
|
|
146
|
+
// ============================================================================
|
|
147
|
+
// STATUS UPDATE SCHEMA
|
|
148
|
+
// ============================================================================
|
|
149
|
+
/**
|
|
150
|
+
* Quick status update schema for product orders.
|
|
151
|
+
*/
|
|
152
|
+
exports.UpdateProductOrderStatusSchema = zod_1.default.object({
|
|
153
|
+
id: zod_1.default.string().describe("Unique identifier of the ProductOrder to update status for."),
|
|
154
|
+
status: zod_1.default.enum(type_definitions_1.OrderStatus).describe("New order status to transition to (e.g., from PENDING to PROCESSING to SHIPPED to DELIVERED). Validates against OrderStatus enum for workflow consistency."),
|
|
155
|
+
shippedDate: zod_1.default.number().optional().describe("Unix timestamp when order was shipped. Set when status transitions to SHIPPED; triggers customer notification."),
|
|
156
|
+
deliveredDate: zod_1.default.number().optional().describe("Unix timestamp when order was delivered. Set when status transitions to DELIVERED or COMPLETED; used for performance tracking."),
|
|
157
|
+
trackingNumber: zod_1.default.string().optional().describe("Carrier tracking number added when order ships. Enables customer shipment monitoring and delivery status updates."),
|
|
158
|
+
});
|