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,531 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { AppointmentStatus, CalendarProvider } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Service Appointment schema definitions.
|
|
5
|
+
* @module business-mgt/service-appointment
|
|
6
|
+
*
|
|
7
|
+
* Service appointments represent scheduled bookings for services.
|
|
8
|
+
* Supports calendar integration, pricing breakdowns, and multi-channel bookings.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Service Appointment schema.
|
|
12
|
+
* Represents a scheduled appointment for a service.
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Object} ServiceAppointment
|
|
15
|
+
* @property {string} businessServiceId - ID of the service being booked
|
|
16
|
+
* @property {string} [locationId] - Business location ID
|
|
17
|
+
* @property {string} [channelId] - Channel ID for multi-channel bookings
|
|
18
|
+
* @property {string} customerId - Customer ID
|
|
19
|
+
* @property {string} [customerName] - Customer's full name
|
|
20
|
+
* @property {string} [customerEmail] - Customer's email address
|
|
21
|
+
* @property {number} startTime - Appointment start time (Unix timestamp)
|
|
22
|
+
* @property {number} [endTime] - Appointment end time (Unix timestamp)
|
|
23
|
+
* @property {number} [duration] - Duration in minutes
|
|
24
|
+
* @property {number} [totalPrice] - Total price for the service
|
|
25
|
+
* @property {Object} [pricing] - Detailed pricing breakdown
|
|
26
|
+
* @property {number} depositPaid - Deposit amount paid
|
|
27
|
+
* @property {string} status - Current appointment status
|
|
28
|
+
* @property {string} [providerId] - Assigned provider ID (ServicePerson ID)
|
|
29
|
+
* @property {string} [serviceProviderId] - Service-provider assignment ID
|
|
30
|
+
* @property {number} [slotIndex] - Slot index for concurrent bookings
|
|
31
|
+
* @property {string} [assignedUserAccountId] - User account managing the appointment
|
|
32
|
+
* @property {string} [calendarId] - Calendar ID where appointment is stored
|
|
33
|
+
* @property {string} [calendarEventId] - External calendar event ID
|
|
34
|
+
* @property {string} [calendarProvider] - Calendar provider type
|
|
35
|
+
* @property {string} [cancelReason] - Reason for cancellation
|
|
36
|
+
* @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
|
|
37
|
+
* @property {Object} [externalRef] - External system reference
|
|
38
|
+
*/
|
|
39
|
+
export declare const ServiceAppointmentSchema: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
businessServiceId: z.ZodString;
|
|
44
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
customerId: z.ZodString;
|
|
47
|
+
customerName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
customerEmail: z.ZodOptional<z.ZodEmail>;
|
|
49
|
+
startTime: z.ZodNumber;
|
|
50
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
52
|
+
totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
53
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
subtotal: z.ZodNumber;
|
|
56
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
58
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
61
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
62
|
+
adjustmentValue: z.ZodNumber;
|
|
63
|
+
baseAmount: z.ZodNumber;
|
|
64
|
+
adjustedAmount: z.ZodNumber;
|
|
65
|
+
deltaAmount: z.ZodNumber;
|
|
66
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, z.core.$strip>>>;
|
|
68
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
69
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
71
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
code: z.ZodOptional<z.ZodString>;
|
|
75
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
76
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
77
|
+
value: z.ZodNumber;
|
|
78
|
+
discountableAmount: z.ZodNumber;
|
|
79
|
+
discountAmount: z.ZodNumber;
|
|
80
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
81
|
+
}, z.core.$strip>>>;
|
|
82
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
85
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
89
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
90
|
+
rateValue: z.ZodNumber;
|
|
91
|
+
taxableAmount: z.ZodNumber;
|
|
92
|
+
taxAmount: z.ZodNumber;
|
|
93
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
96
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
97
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
98
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
100
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
total: z.ZodNumber;
|
|
102
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
depositPaid: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
|
|
106
|
+
providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
slotIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
109
|
+
assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
|
|
113
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
116
|
+
externalId: z.ZodString;
|
|
117
|
+
source: z.ZodString;
|
|
118
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
119
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
}, z.core.$strip>>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
/**
|
|
123
|
+
* Schema for creating a new service appointment.
|
|
124
|
+
* Omits auto-generated fields and cancelReason (set during cancellation).
|
|
125
|
+
*/
|
|
126
|
+
export declare const CreateServiceAppointmentSchema: z.ZodObject<{
|
|
127
|
+
startTime: z.ZodNumber;
|
|
128
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
130
|
+
status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
|
|
131
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
customerId: z.ZodString;
|
|
133
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
|
+
totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
135
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
subtotal: z.ZodNumber;
|
|
138
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
139
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
143
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
144
|
+
adjustmentValue: z.ZodNumber;
|
|
145
|
+
baseAmount: z.ZodNumber;
|
|
146
|
+
adjustedAmount: z.ZodNumber;
|
|
147
|
+
deltaAmount: z.ZodNumber;
|
|
148
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>>>;
|
|
150
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
151
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
153
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
code: z.ZodOptional<z.ZodString>;
|
|
157
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
158
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
159
|
+
value: z.ZodNumber;
|
|
160
|
+
discountableAmount: z.ZodNumber;
|
|
161
|
+
discountAmount: z.ZodNumber;
|
|
162
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
163
|
+
}, z.core.$strip>>>;
|
|
164
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
165
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
167
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
171
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
172
|
+
rateValue: z.ZodNumber;
|
|
173
|
+
taxableAmount: z.ZodNumber;
|
|
174
|
+
taxAmount: z.ZodNumber;
|
|
175
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
176
|
+
}, z.core.$strip>>>;
|
|
177
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
178
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
179
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
180
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
181
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
182
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
total: z.ZodNumber;
|
|
184
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
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
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
businessServiceId: z.ZodString;
|
|
194
|
+
customerName: z.ZodOptional<z.ZodString>;
|
|
195
|
+
customerEmail: z.ZodOptional<z.ZodEmail>;
|
|
196
|
+
depositPaid: z.ZodDefault<z.ZodNumber>;
|
|
197
|
+
providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
slotIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
200
|
+
assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
201
|
+
calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
202
|
+
calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
/**
|
|
206
|
+
* Schema for updating an existing service appointment.
|
|
207
|
+
* All fields optional except id (required). Includes cancelReason for cancellation updates.
|
|
208
|
+
*/
|
|
209
|
+
export declare const UpdateServiceAppointmentSchema: z.ZodObject<{
|
|
210
|
+
startTime: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
endTime: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
212
|
+
duration: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
|
|
213
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>>;
|
|
214
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
215
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
channelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
217
|
+
totalPrice: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
|
|
218
|
+
pricing: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
219
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
subtotal: z.ZodNumber;
|
|
221
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
222
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
223
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
224
|
+
name: z.ZodString;
|
|
225
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
226
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
227
|
+
adjustmentValue: z.ZodNumber;
|
|
228
|
+
baseAmount: z.ZodNumber;
|
|
229
|
+
adjustedAmount: z.ZodNumber;
|
|
230
|
+
deltaAmount: z.ZodNumber;
|
|
231
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strip>>>;
|
|
233
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
234
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
236
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
237
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
code: z.ZodOptional<z.ZodString>;
|
|
240
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
241
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
242
|
+
value: z.ZodNumber;
|
|
243
|
+
discountableAmount: z.ZodNumber;
|
|
244
|
+
discountAmount: z.ZodNumber;
|
|
245
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
246
|
+
}, z.core.$strip>>>;
|
|
247
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
248
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
250
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
251
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
254
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
255
|
+
rateValue: z.ZodNumber;
|
|
256
|
+
taxableAmount: z.ZodNumber;
|
|
257
|
+
taxAmount: z.ZodNumber;
|
|
258
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
259
|
+
}, z.core.$strip>>>;
|
|
260
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
261
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
262
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
263
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
264
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
265
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
total: z.ZodNumber;
|
|
267
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
268
|
+
}, z.core.$strip>>>;
|
|
269
|
+
externalRef: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
270
|
+
externalId: z.ZodString;
|
|
271
|
+
source: z.ZodString;
|
|
272
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
273
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
274
|
+
}, z.core.$strip>>>>;
|
|
275
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
276
|
+
businessServiceId: z.ZodOptional<z.ZodString>;
|
|
277
|
+
customerName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
278
|
+
customerEmail: z.ZodOptional<z.ZodOptional<z.ZodEmail>>;
|
|
279
|
+
depositPaid: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
280
|
+
providerId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
281
|
+
serviceProviderId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
282
|
+
slotIndex: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
283
|
+
assignedUserAccountId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
284
|
+
calendarId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
285
|
+
calendarEventId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
286
|
+
calendarProvider: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>>;
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
}, z.core.$strip>;
|
|
290
|
+
export type ServiceAppointment = z.infer<typeof ServiceAppointmentSchema>;
|
|
291
|
+
export type CreateServiceAppointment = z.infer<typeof CreateServiceAppointmentSchema>;
|
|
292
|
+
export type UpdateServiceAppointment = z.infer<typeof UpdateServiceAppointmentSchema>;
|
|
293
|
+
/**
|
|
294
|
+
* Schema for creating an appointment with custom field data.
|
|
295
|
+
* Combines appointment creation with dynamic field values.
|
|
296
|
+
*/
|
|
297
|
+
export declare const CreateServiceAppointmentWithCustomDataSchema: z.ZodObject<{
|
|
298
|
+
appointment: z.ZodObject<{
|
|
299
|
+
startTime: z.ZodNumber;
|
|
300
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
302
|
+
status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
|
|
303
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
customerId: z.ZodString;
|
|
305
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
|
+
totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
307
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
308
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
subtotal: z.ZodNumber;
|
|
310
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
311
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
312
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
313
|
+
name: z.ZodString;
|
|
314
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
315
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
316
|
+
adjustmentValue: z.ZodNumber;
|
|
317
|
+
baseAmount: z.ZodNumber;
|
|
318
|
+
adjustedAmount: z.ZodNumber;
|
|
319
|
+
deltaAmount: z.ZodNumber;
|
|
320
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
323
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
325
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
326
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
code: z.ZodOptional<z.ZodString>;
|
|
329
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
330
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
331
|
+
value: z.ZodNumber;
|
|
332
|
+
discountableAmount: z.ZodNumber;
|
|
333
|
+
discountAmount: z.ZodNumber;
|
|
334
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
335
|
+
}, z.core.$strip>>>;
|
|
336
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
337
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
339
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
340
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
341
|
+
name: z.ZodString;
|
|
342
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
343
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
344
|
+
rateValue: z.ZodNumber;
|
|
345
|
+
taxableAmount: z.ZodNumber;
|
|
346
|
+
taxAmount: z.ZodNumber;
|
|
347
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
348
|
+
}, z.core.$strip>>>;
|
|
349
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
350
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
351
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
352
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
353
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
354
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
355
|
+
total: z.ZodNumber;
|
|
356
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
359
|
+
externalId: z.ZodString;
|
|
360
|
+
source: z.ZodString;
|
|
361
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
362
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
363
|
+
}, z.core.$strip>>>;
|
|
364
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
365
|
+
businessServiceId: z.ZodString;
|
|
366
|
+
customerName: z.ZodOptional<z.ZodString>;
|
|
367
|
+
customerEmail: z.ZodOptional<z.ZodEmail>;
|
|
368
|
+
depositPaid: z.ZodDefault<z.ZodNumber>;
|
|
369
|
+
providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
|
+
slotIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
372
|
+
assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
373
|
+
calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
374
|
+
calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
375
|
+
calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
customData: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
export type CreateServiceAppointmentWithCustomData = z.infer<typeof CreateServiceAppointmentWithCustomDataSchema>;
|
|
380
|
+
/**
|
|
381
|
+
* Schema for an appointment with its additional info.
|
|
382
|
+
* Used for displaying complete appointment details.
|
|
383
|
+
*/
|
|
384
|
+
export declare const ServiceAppointmentWithAdditionalInfoSchema: z.ZodObject<{
|
|
385
|
+
appointment: z.ZodObject<{
|
|
386
|
+
id: z.ZodString;
|
|
387
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
businessServiceId: z.ZodString;
|
|
390
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
391
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
customerId: z.ZodString;
|
|
393
|
+
customerName: z.ZodOptional<z.ZodString>;
|
|
394
|
+
customerEmail: z.ZodOptional<z.ZodEmail>;
|
|
395
|
+
startTime: z.ZodNumber;
|
|
396
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
397
|
+
duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
398
|
+
totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
399
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
400
|
+
subtotalBeforeTax: z.ZodOptional<z.ZodNumber>;
|
|
401
|
+
subtotal: z.ZodNumber;
|
|
402
|
+
appliedPricingRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
403
|
+
pricingRuleId: z.ZodOptional<z.ZodString>;
|
|
404
|
+
externalPricingRuleId: z.ZodOptional<z.ZodString>;
|
|
405
|
+
name: z.ZodString;
|
|
406
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").PricingRuleApplyLevel>>;
|
|
407
|
+
adjustmentType: z.ZodEnum<typeof import("../../type-definitions").PricingRuleAdjustmentType>;
|
|
408
|
+
adjustmentValue: z.ZodNumber;
|
|
409
|
+
baseAmount: z.ZodNumber;
|
|
410
|
+
adjustedAmount: z.ZodNumber;
|
|
411
|
+
deltaAmount: z.ZodNumber;
|
|
412
|
+
appliedAt: z.ZodOptional<z.ZodNumber>;
|
|
413
|
+
}, z.core.$strip>>>;
|
|
414
|
+
totalPricingAdjustmentAmount: z.ZodDefault<z.ZodNumber>;
|
|
415
|
+
subtotalAfterPricingRules: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
appliedDiscounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
417
|
+
discountRuleId: z.ZodOptional<z.ZodString>;
|
|
418
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
419
|
+
name: z.ZodString;
|
|
420
|
+
code: z.ZodOptional<z.ZodString>;
|
|
421
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").DiscountScope>>;
|
|
422
|
+
type: z.ZodEnum<typeof import("../../type-definitions").DiscountType>;
|
|
423
|
+
value: z.ZodNumber;
|
|
424
|
+
discountableAmount: z.ZodNumber;
|
|
425
|
+
discountAmount: z.ZodNumber;
|
|
426
|
+
isStacked: z.ZodDefault<z.ZodBoolean>;
|
|
427
|
+
}, z.core.$strip>>>;
|
|
428
|
+
totalDiscountAmount: z.ZodDefault<z.ZodNumber>;
|
|
429
|
+
subtotalAfterDiscount: z.ZodOptional<z.ZodNumber>;
|
|
430
|
+
appliedTaxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
431
|
+
taxRuleId: z.ZodOptional<z.ZodString>;
|
|
432
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
433
|
+
name: z.ZodString;
|
|
434
|
+
scope: z.ZodDefault<z.ZodEnum<typeof import("../../type-definitions").TaxScope>>;
|
|
435
|
+
rateType: z.ZodEnum<typeof import("../../type-definitions").TaxRateType>;
|
|
436
|
+
rateValue: z.ZodNumber;
|
|
437
|
+
taxableAmount: z.ZodNumber;
|
|
438
|
+
taxAmount: z.ZodNumber;
|
|
439
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
440
|
+
}, z.core.$strip>>>;
|
|
441
|
+
totalTaxAmount: z.ZodDefault<z.ZodNumber>;
|
|
442
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
443
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
444
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
445
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
446
|
+
subtotalAfterTax: z.ZodOptional<z.ZodNumber>;
|
|
447
|
+
total: z.ZodNumber;
|
|
448
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>>;
|
|
450
|
+
depositPaid: z.ZodDefault<z.ZodNumber>;
|
|
451
|
+
status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
|
|
452
|
+
providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
453
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
454
|
+
slotIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
455
|
+
assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
456
|
+
calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
457
|
+
calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
458
|
+
calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
|
|
459
|
+
cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
460
|
+
serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
461
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
462
|
+
externalId: z.ZodString;
|
|
463
|
+
source: z.ZodString;
|
|
464
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
465
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
466
|
+
}, z.core.$strip>>>;
|
|
467
|
+
}, z.core.$strip>;
|
|
468
|
+
additionalInfo: z.ZodObject<{
|
|
469
|
+
id: z.ZodString;
|
|
470
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
471
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
472
|
+
businessServiceId: z.ZodString;
|
|
473
|
+
appointmentId: z.ZodString;
|
|
474
|
+
customerId: z.ZodString;
|
|
475
|
+
data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
476
|
+
}, z.core.$strip>;
|
|
477
|
+
}, z.core.$strip>;
|
|
478
|
+
export type ServiceAppointmentWithAdditionalInfo = z.infer<typeof ServiceAppointmentWithAdditionalInfoSchema>;
|
|
479
|
+
/**
|
|
480
|
+
* Service appointment filter options.
|
|
481
|
+
* @interface ServiceAppointmentFilters
|
|
482
|
+
*/
|
|
483
|
+
export interface ServiceAppointmentFilters {
|
|
484
|
+
/** Text search across customer name/email */
|
|
485
|
+
search?: string;
|
|
486
|
+
/** Filter by location ID */
|
|
487
|
+
locationId?: string;
|
|
488
|
+
/** Filter by channel ID */
|
|
489
|
+
channelId?: string;
|
|
490
|
+
/** Filter by appointment status(es) */
|
|
491
|
+
status?: AppointmentStatus[];
|
|
492
|
+
/** Filter by service ID */
|
|
493
|
+
businessServiceId?: string;
|
|
494
|
+
/** Filter by customer ID */
|
|
495
|
+
customerId?: string;
|
|
496
|
+
/** Filter by assigned user account ID */
|
|
497
|
+
assignedUserAccountId?: string;
|
|
498
|
+
/** Filter by calendar provider(s) */
|
|
499
|
+
calendarProvider?: CalendarProvider[];
|
|
500
|
+
/** Filter by external source */
|
|
501
|
+
externalSource?: string;
|
|
502
|
+
/** Filter by date range (Unix timestamps) */
|
|
503
|
+
dateRange?: {
|
|
504
|
+
start?: number;
|
|
505
|
+
end?: number;
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Service appointment sorting options.
|
|
510
|
+
* @interface ServiceAppointmentSorting
|
|
511
|
+
*/
|
|
512
|
+
export interface ServiceAppointmentSorting {
|
|
513
|
+
/** Field to sort by */
|
|
514
|
+
field: "startTime" | "endTime" | "createdAt" | "customerName";
|
|
515
|
+
/** Sort direction */
|
|
516
|
+
direction: "asc" | "desc";
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Service appointment query options.
|
|
520
|
+
* @interface ServiceAppointmentQueryOptions
|
|
521
|
+
*/
|
|
522
|
+
export interface ServiceAppointmentQueryOptions {
|
|
523
|
+
/** Page number (1-indexed) */
|
|
524
|
+
page: number;
|
|
525
|
+
/** Items per page */
|
|
526
|
+
pageSize: number;
|
|
527
|
+
/** Optional filters */
|
|
528
|
+
filters?: ServiceAppointmentFilters;
|
|
529
|
+
/** Optional sorting */
|
|
530
|
+
sorting?: ServiceAppointmentSorting;
|
|
531
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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.ServiceAppointmentWithAdditionalInfoSchema = exports.CreateServiceAppointmentWithCustomDataSchema = exports.UpdateServiceAppointmentSchema = exports.CreateServiceAppointmentSchema = exports.ServiceAppointmentSchema = 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
|
+
const order_schema_1 = require("../order.schema");
|
|
11
|
+
const appointment_additional_info_schema_1 = require("./appointment-additional-info.schema");
|
|
12
|
+
/**
|
|
13
|
+
* @fileoverview Service Appointment schema definitions.
|
|
14
|
+
* @module business-mgt/service-appointment
|
|
15
|
+
*
|
|
16
|
+
* Service appointments represent scheduled bookings for services.
|
|
17
|
+
* Supports calendar integration, pricing breakdowns, and multi-channel bookings.
|
|
18
|
+
*/
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// SERVICE APPOINTMENT SCHEMA
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* Service Appointment schema.
|
|
24
|
+
* Represents a scheduled appointment for a service.
|
|
25
|
+
*
|
|
26
|
+
* @typedef {Object} ServiceAppointment
|
|
27
|
+
* @property {string} businessServiceId - ID of the service being booked
|
|
28
|
+
* @property {string} [locationId] - Business location ID
|
|
29
|
+
* @property {string} [channelId] - Channel ID for multi-channel bookings
|
|
30
|
+
* @property {string} customerId - Customer ID
|
|
31
|
+
* @property {string} [customerName] - Customer's full name
|
|
32
|
+
* @property {string} [customerEmail] - Customer's email address
|
|
33
|
+
* @property {number} startTime - Appointment start time (Unix timestamp)
|
|
34
|
+
* @property {number} [endTime] - Appointment end time (Unix timestamp)
|
|
35
|
+
* @property {number} [duration] - Duration in minutes
|
|
36
|
+
* @property {number} [totalPrice] - Total price for the service
|
|
37
|
+
* @property {Object} [pricing] - Detailed pricing breakdown
|
|
38
|
+
* @property {number} depositPaid - Deposit amount paid
|
|
39
|
+
* @property {string} status - Current appointment status
|
|
40
|
+
* @property {string} [providerId] - Assigned provider ID (ServicePerson ID)
|
|
41
|
+
* @property {string} [serviceProviderId] - Service-provider assignment ID
|
|
42
|
+
* @property {number} [slotIndex] - Slot index for concurrent bookings
|
|
43
|
+
* @property {string} [assignedUserAccountId] - User account managing the appointment
|
|
44
|
+
* @property {string} [calendarId] - Calendar ID where appointment is stored
|
|
45
|
+
* @property {string} [calendarEventId] - External calendar event ID
|
|
46
|
+
* @property {string} [calendarProvider] - Calendar provider type
|
|
47
|
+
* @property {string} [cancelReason] - Reason for cancellation
|
|
48
|
+
* @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
|
|
49
|
+
* @property {Object} [externalRef] - External system reference
|
|
50
|
+
*/
|
|
51
|
+
exports.ServiceAppointmentSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
52
|
+
businessServiceId: zod_1.default.string().describe("ID of the service being booked"),
|
|
53
|
+
locationId: zod_1.default.string().nullable().optional().describe("Business location ID"),
|
|
54
|
+
channelId: zod_1.default.string().nullable().optional().describe("Channel ID for multi-channel bookings (e.g., web, marketplace, partner)"),
|
|
55
|
+
customerId: zod_1.default.string().describe("Customer ID if registered"),
|
|
56
|
+
customerName: zod_1.default.string().optional().describe("Customer's full name"),
|
|
57
|
+
customerEmail: zod_1.default.email().optional().describe("Customer's email address"),
|
|
58
|
+
startTime: zod_1.default.number().int().positive().describe("Appointment start time as Unix timestamp"),
|
|
59
|
+
endTime: zod_1.default.number().int().positive().optional().describe("Appointment end time as Unix timestamp"),
|
|
60
|
+
duration: zod_1.default.number().int().positive().default(30).optional().describe("Duration in minutes"),
|
|
61
|
+
totalPrice: zod_1.default.number().nonnegative().default(0).optional().describe("Total price for the service"),
|
|
62
|
+
pricing: order_schema_1.OrderPricingSchema.optional().describe("Detailed pricing breakdown for the appointment"),
|
|
63
|
+
depositPaid: zod_1.default.number().nonnegative().default(0).describe("Deposit amount paid"),
|
|
64
|
+
status: zod_1.default.enum(type_definitions_1.AppointmentStatus).default(type_definitions_1.AppointmentStatus.PENDING).describe("Current appointment status"),
|
|
65
|
+
providerId: zod_1.default.string().nullable().optional().describe("Assigned provider ID (ServicePerson ID)"),
|
|
66
|
+
serviceProviderId: zod_1.default.string().nullable().optional().describe("Service-provider assignment ID used for pricing/duration overrides"),
|
|
67
|
+
slotIndex: zod_1.default.number().int().nonnegative().nullable().optional().describe("Slot index for concurrent bookings (0-based, null = single booking)"),
|
|
68
|
+
// Calendar Integration
|
|
69
|
+
assignedUserAccountId: zod_1.default.string().nullable().optional().describe("User account managing the appointment"),
|
|
70
|
+
calendarId: zod_1.default.string().nullable().optional().describe("Calendar ID where appointment is stored"),
|
|
71
|
+
calendarEventId: zod_1.default.string().nullable().optional().describe("External calendar event ID"),
|
|
72
|
+
calendarProvider: zod_1.default.enum(type_definitions_1.CalendarProvider).nullable().optional().describe("Calendar provider type"),
|
|
73
|
+
cancelReason: zod_1.default.string().nullable().optional().describe("Reason for cancellation, if applicable"),
|
|
74
|
+
serviceConversationConfigId: zod_1.default.string().nullable().optional().describe("Configuration ID for service conversation"),
|
|
75
|
+
externalRef: type_definitions_1.ExternalRefSchema.nullable().optional().describe("External system reference (when imported/synced from Calendly, Acuity, etc.)"),
|
|
76
|
+
});
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// CREATE/UPDATE SCHEMAS
|
|
79
|
+
// ============================================================================
|
|
80
|
+
/**
|
|
81
|
+
* Schema for creating a new service appointment.
|
|
82
|
+
* Omits auto-generated fields and cancelReason (set during cancellation).
|
|
83
|
+
*/
|
|
84
|
+
exports.CreateServiceAppointmentSchema = exports.ServiceAppointmentSchema.omit({
|
|
85
|
+
id: true,
|
|
86
|
+
createdAt: true,
|
|
87
|
+
updatedAt: true,
|
|
88
|
+
cancelReason: true,
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Schema for updating an existing service appointment.
|
|
92
|
+
* All fields optional except id (required). Includes cancelReason for cancellation updates.
|
|
93
|
+
*/
|
|
94
|
+
exports.UpdateServiceAppointmentSchema = exports.CreateServiceAppointmentSchema.partial().safeExtend({
|
|
95
|
+
id: zod_1.default.string().describe("Unique identifier of the ServiceAppointment to update"),
|
|
96
|
+
cancelReason: zod_1.default.string().nullable().optional().describe("Reason for cancellation, if applicable"),
|
|
97
|
+
});
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// COMPOSITE SCHEMAS
|
|
100
|
+
// ============================================================================
|
|
101
|
+
/**
|
|
102
|
+
* Schema for creating an appointment with custom field data.
|
|
103
|
+
* Combines appointment creation with dynamic field values.
|
|
104
|
+
*/
|
|
105
|
+
exports.CreateServiceAppointmentWithCustomDataSchema = zod_1.default.object({
|
|
106
|
+
appointment: exports.CreateServiceAppointmentSchema.describe("Appointment data"),
|
|
107
|
+
customData: zod_1.default.record(zod_1.default.string(), appointment_additional_info_schema_1.DynamicFieldValueSchema).default({}).describe("Custom field data captured during booking"),
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Schema for an appointment with its additional info.
|
|
111
|
+
* Used for displaying complete appointment details.
|
|
112
|
+
*/
|
|
113
|
+
exports.ServiceAppointmentWithAdditionalInfoSchema = zod_1.default.object({
|
|
114
|
+
appointment: exports.ServiceAppointmentSchema.describe("Appointment data"),
|
|
115
|
+
additionalInfo: appointment_additional_info_schema_1.AppointmentAdditionalInfoSchema.describe("Additional captured field values"),
|
|
116
|
+
});
|