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,90 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Service Slot Query schemas for availability lookups.
|
|
4
|
+
* @module business-mgt/service-slot-query
|
|
5
|
+
*
|
|
6
|
+
* Request/response schemas for querying available appointment slots.
|
|
7
|
+
* These are transient query objects, not persisted database models.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Local date format schema (YYYY-MM-DD).
|
|
11
|
+
*/
|
|
12
|
+
export declare const LocalDateSchema: z.ZodString;
|
|
13
|
+
/**
|
|
14
|
+
* Timezone identifier schema.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TimezoneSchema: z.ZodString;
|
|
17
|
+
/**
|
|
18
|
+
* Time of day value schema (h:mm AM/PM format).
|
|
19
|
+
*/
|
|
20
|
+
export declare const TimeOfDayValueSchema: z.ZodString;
|
|
21
|
+
/**
|
|
22
|
+
* Service slot query request schema.
|
|
23
|
+
* Used to request available appointment slots for a service.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} ServiceSlotQueryRequest
|
|
26
|
+
* @property {string} serviceId - Service ID to query slots for
|
|
27
|
+
* @property {string} localDate - Business local date (YYYY-MM-DD)
|
|
28
|
+
* @property {string} [locationId] - Optional location filter
|
|
29
|
+
* @property {string} providerId - Provider filter
|
|
30
|
+
* @property {number} maxResults - Maximum slots to return
|
|
31
|
+
*/
|
|
32
|
+
export declare const ServiceSlotQueryRequestSchema: z.ZodObject<{
|
|
33
|
+
serviceId: z.ZodString;
|
|
34
|
+
localDate: z.ZodString;
|
|
35
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
providerId: z.ZodString;
|
|
37
|
+
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
/**
|
|
40
|
+
* Service candidate slot schema.
|
|
41
|
+
* Represents an available time slot for booking.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {Object} ServiceCandidateSlot
|
|
44
|
+
* @property {string} providerId - Provider that can serve this slot
|
|
45
|
+
* @property {string} [serviceProviderId] - Optional service-provider assignment ID
|
|
46
|
+
* @property {string} startTimeOfDay - Local start time (h:mm AM/PM)
|
|
47
|
+
* @property {number} startMinuteOfDay - Local start minute in day (0-1439)
|
|
48
|
+
* @property {number} endMinuteOfDay - Local end minute in day (1-1440)
|
|
49
|
+
* @property {number} startTimeUtcSec - Slot start UTC timestamp in seconds
|
|
50
|
+
* @property {number} endTimeUtcSec - Slot end UTC timestamp in seconds
|
|
51
|
+
*/
|
|
52
|
+
export declare const ServiceCandidateSlotSchema: z.ZodObject<{
|
|
53
|
+
providerId: z.ZodString;
|
|
54
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
startTimeOfDay: z.ZodString;
|
|
56
|
+
startMinuteOfDay: z.ZodNumber;
|
|
57
|
+
endMinuteOfDay: z.ZodNumber;
|
|
58
|
+
startTimeUtcSec: z.ZodNumber;
|
|
59
|
+
endTimeUtcSec: z.ZodNumber;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
/**
|
|
62
|
+
* Service slot query response schema.
|
|
63
|
+
* Contains available slots for the requested date.
|
|
64
|
+
*
|
|
65
|
+
* @typedef {Object} ServiceSlotQueryResponse
|
|
66
|
+
* @property {string} localDate - The queried local date
|
|
67
|
+
* @property {string} timezone - Timezone used for the response
|
|
68
|
+
* @property {number} generatedAt - Generation timestamp (UTC milliseconds)
|
|
69
|
+
* @property {Array} slots - Available candidate slots
|
|
70
|
+
*/
|
|
71
|
+
export declare const ServiceSlotQueryResponseSchema: z.ZodObject<{
|
|
72
|
+
localDate: z.ZodString;
|
|
73
|
+
timezone: z.ZodString;
|
|
74
|
+
generatedAt: z.ZodNumber;
|
|
75
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
76
|
+
providerId: z.ZodString;
|
|
77
|
+
serviceProviderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
startTimeOfDay: z.ZodString;
|
|
79
|
+
startMinuteOfDay: z.ZodNumber;
|
|
80
|
+
endMinuteOfDay: z.ZodNumber;
|
|
81
|
+
startTimeUtcSec: z.ZodNumber;
|
|
82
|
+
endTimeUtcSec: z.ZodNumber;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type LocalDate = z.infer<typeof LocalDateSchema>;
|
|
86
|
+
export type Timezone = z.infer<typeof TimezoneSchema>;
|
|
87
|
+
export type TimeOfDayValue = z.infer<typeof TimeOfDayValueSchema>;
|
|
88
|
+
export type ServiceSlotQueryRequest = z.infer<typeof ServiceSlotQueryRequestSchema>;
|
|
89
|
+
export type ServiceCandidateSlot = z.infer<typeof ServiceCandidateSlotSchema>;
|
|
90
|
+
export type ServiceSlotQueryResponse = z.infer<typeof ServiceSlotQueryResponseSchema>;
|
|
@@ -0,0 +1,113 @@
|
|
|
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.ServiceSlotQueryResponseSchema = exports.ServiceCandidateSlotSchema = exports.ServiceSlotQueryRequestSchema = exports.TimeOfDayValueSchema = exports.TimezoneSchema = exports.LocalDateSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview Service Slot Query schemas for availability lookups.
|
|
10
|
+
* @module business-mgt/service-slot-query
|
|
11
|
+
*
|
|
12
|
+
* Request/response schemas for querying available appointment slots.
|
|
13
|
+
* These are transient query objects, not persisted database models.
|
|
14
|
+
*/
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// HELPER SCHEMAS
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Local date format schema (YYYY-MM-DD).
|
|
20
|
+
*/
|
|
21
|
+
exports.LocalDateSchema = zod_1.default
|
|
22
|
+
.string()
|
|
23
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, "localDate must be YYYY-MM-DD");
|
|
24
|
+
/**
|
|
25
|
+
* Timezone identifier schema.
|
|
26
|
+
*/
|
|
27
|
+
exports.TimezoneSchema = zod_1.default.string().min(1);
|
|
28
|
+
/**
|
|
29
|
+
* Time of day value schema (h:mm AM/PM format).
|
|
30
|
+
*/
|
|
31
|
+
exports.TimeOfDayValueSchema = zod_1.default
|
|
32
|
+
.string()
|
|
33
|
+
.regex(/^(0?[1-9]|1[0-2]):[0-5]\d\s?(AM|PM)$/i, "startTimeOfDay must be h:mm AM/PM");
|
|
34
|
+
// ============================================================================
|
|
35
|
+
// REQUEST SCHEMA
|
|
36
|
+
// ============================================================================
|
|
37
|
+
/**
|
|
38
|
+
* Service slot query request schema.
|
|
39
|
+
* Used to request available appointment slots for a service.
|
|
40
|
+
*
|
|
41
|
+
* @typedef {Object} ServiceSlotQueryRequest
|
|
42
|
+
* @property {string} serviceId - Service ID to query slots for
|
|
43
|
+
* @property {string} localDate - Business local date (YYYY-MM-DD)
|
|
44
|
+
* @property {string} [locationId] - Optional location filter
|
|
45
|
+
* @property {string} providerId - Provider filter
|
|
46
|
+
* @property {number} maxResults - Maximum slots to return
|
|
47
|
+
*/
|
|
48
|
+
exports.ServiceSlotQueryRequestSchema = zod_1.default.object({
|
|
49
|
+
serviceId: zod_1.default.string().describe("Service ID"),
|
|
50
|
+
localDate: exports.LocalDateSchema.describe("Business local date for slot generation"),
|
|
51
|
+
locationId: zod_1.default.string().nullable().optional().describe("Optional location filter"),
|
|
52
|
+
providerId: zod_1.default.string().describe("Optional provider filter"),
|
|
53
|
+
maxResults: zod_1.default.number().int().positive().max(1000).default(10).describe("Maximum number of slots returned"),
|
|
54
|
+
});
|
|
55
|
+
// ============================================================================
|
|
56
|
+
// CANDIDATE SLOT SCHEMA
|
|
57
|
+
// ============================================================================
|
|
58
|
+
/**
|
|
59
|
+
* Service candidate slot schema.
|
|
60
|
+
* Represents an available time slot for booking.
|
|
61
|
+
*
|
|
62
|
+
* @typedef {Object} ServiceCandidateSlot
|
|
63
|
+
* @property {string} providerId - Provider that can serve this slot
|
|
64
|
+
* @property {string} [serviceProviderId] - Optional service-provider assignment ID
|
|
65
|
+
* @property {string} startTimeOfDay - Local start time (h:mm AM/PM)
|
|
66
|
+
* @property {number} startMinuteOfDay - Local start minute in day (0-1439)
|
|
67
|
+
* @property {number} endMinuteOfDay - Local end minute in day (1-1440)
|
|
68
|
+
* @property {number} startTimeUtcSec - Slot start UTC timestamp in seconds
|
|
69
|
+
* @property {number} endTimeUtcSec - Slot end UTC timestamp in seconds
|
|
70
|
+
*/
|
|
71
|
+
exports.ServiceCandidateSlotSchema = zod_1.default.object({
|
|
72
|
+
providerId: zod_1.default.string().describe("Provider that can serve this slot"),
|
|
73
|
+
serviceProviderId: zod_1.default.string().nullable().optional().describe("Optional service-provider assignment ID"),
|
|
74
|
+
startTimeOfDay: exports.TimeOfDayValueSchema.describe("Local start time in h:mm AM/PM format"),
|
|
75
|
+
startMinuteOfDay: zod_1.default.number().int().min(0).max(1439).describe("Local start minute in day"),
|
|
76
|
+
endMinuteOfDay: zod_1.default.number().int().min(1).max(1440).describe("Local end minute in day"),
|
|
77
|
+
startTimeUtcSec: zod_1.default.number().describe("Slot start UTC timestamp in seconds"),
|
|
78
|
+
endTimeUtcSec: zod_1.default.number().describe("Slot end UTC timestamp in seconds"),
|
|
79
|
+
}).superRefine((slot, ctx) => {
|
|
80
|
+
if (slot.endMinuteOfDay <= slot.startMinuteOfDay) {
|
|
81
|
+
ctx.addIssue({
|
|
82
|
+
code: "custom",
|
|
83
|
+
path: ["endMinuteOfDay"],
|
|
84
|
+
message: "endMinuteOfDay must be greater than startMinuteOfDay",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (slot.endTimeUtcSec <= slot.startTimeUtcSec) {
|
|
88
|
+
ctx.addIssue({
|
|
89
|
+
code: "custom",
|
|
90
|
+
path: ["endTimeUtcSec"],
|
|
91
|
+
message: "endTimeUtcSec must be greater than startTimeUtcSec",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// RESPONSE SCHEMA
|
|
97
|
+
// ============================================================================
|
|
98
|
+
/**
|
|
99
|
+
* Service slot query response schema.
|
|
100
|
+
* Contains available slots for the requested date.
|
|
101
|
+
*
|
|
102
|
+
* @typedef {Object} ServiceSlotQueryResponse
|
|
103
|
+
* @property {string} localDate - The queried local date
|
|
104
|
+
* @property {string} timezone - Timezone used for the response
|
|
105
|
+
* @property {number} generatedAt - Generation timestamp (UTC milliseconds)
|
|
106
|
+
* @property {Array} slots - Available candidate slots
|
|
107
|
+
*/
|
|
108
|
+
exports.ServiceSlotQueryResponseSchema = zod_1.default.object({
|
|
109
|
+
localDate: exports.LocalDateSchema.describe("The queried local date"),
|
|
110
|
+
timezone: exports.TimezoneSchema.describe("Timezone identifier used for slot times"),
|
|
111
|
+
generatedAt: zod_1.default.number().describe("Generation timestamp in UTC milliseconds"),
|
|
112
|
+
slots: zod_1.default.array(exports.ServiceCandidateSlotSchema).describe("Available candidate slots for the requested local date"),
|
|
113
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { ServiceProviderTimeOffType, ServiceProviderTimeOffStatus } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Service Provider Time Off schema definitions.
|
|
5
|
+
* @module business-mgt/service-time-off
|
|
6
|
+
*
|
|
7
|
+
* Time off records represent periods when service providers are unavailable.
|
|
8
|
+
* Supports both recurring (weekly) and specific (one-time) time off entries.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Recurrence rule for recurring time off.
|
|
12
|
+
* Defines which days of the week the time off applies.
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Object} ServiceProviderTimeOffRecurrence
|
|
15
|
+
* @property {string[]} dayOfWeek - Days of week (0=Sunday ... 6=Saturday)
|
|
16
|
+
*/
|
|
17
|
+
export declare const ServiceProviderTimeOffRecurrenceSchema: z.ZodObject<{
|
|
18
|
+
dayOfWeek: z.ZodArray<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
/**
|
|
21
|
+
* Service Provider Time Off schema.
|
|
22
|
+
* Represents a time period when a provider is unavailable for appointments.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} ServiceProviderTimeOff
|
|
25
|
+
* @property {string} providerId - Provider ID (ServicePerson ID)
|
|
26
|
+
* @property {string} type - Time-off type (recurring or specific)
|
|
27
|
+
* @property {number} startDate - Start date/time as Unix epoch seconds
|
|
28
|
+
* @property {number} endDate - End date/time as Unix epoch seconds
|
|
29
|
+
* @property {string} [reason] - Optional reason for time off
|
|
30
|
+
* @property {string} status - Approval status
|
|
31
|
+
* @property {Object} [recurrence] - Recurrence rule for recurring time off
|
|
32
|
+
*/
|
|
33
|
+
export declare const ServiceProviderTimeOffSchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
providerId: z.ZodString;
|
|
38
|
+
type: z.ZodEnum<typeof ServiceProviderTimeOffType>;
|
|
39
|
+
startDate: z.ZodNumber;
|
|
40
|
+
endDate: z.ZodNumber;
|
|
41
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
status: z.ZodDefault<z.ZodEnum<typeof ServiceProviderTimeOffStatus>>;
|
|
43
|
+
recurrence: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
44
|
+
dayOfWeek: z.ZodArray<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
/**
|
|
48
|
+
* Schema for creating a new service provider time off record.
|
|
49
|
+
* Omits auto-generated fields.
|
|
50
|
+
*/
|
|
51
|
+
export declare const CreateServiceProviderTimeOffSchema: z.ZodObject<{
|
|
52
|
+
type: z.ZodEnum<typeof ServiceProviderTimeOffType>;
|
|
53
|
+
status: z.ZodDefault<z.ZodEnum<typeof ServiceProviderTimeOffStatus>>;
|
|
54
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
startDate: z.ZodNumber;
|
|
56
|
+
endDate: z.ZodNumber;
|
|
57
|
+
providerId: z.ZodString;
|
|
58
|
+
recurrence: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
59
|
+
dayOfWeek: z.ZodArray<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Schema for updating an existing service provider time off record.
|
|
64
|
+
* All fields optional except id (required).
|
|
65
|
+
*/
|
|
66
|
+
export declare const UpdateServiceProviderTimeOffSchema: z.ZodObject<{
|
|
67
|
+
type: z.ZodOptional<z.ZodEnum<typeof ServiceProviderTimeOffType>>;
|
|
68
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof ServiceProviderTimeOffStatus>>>;
|
|
69
|
+
reason: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
70
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
endDate: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
recurrence: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
74
|
+
dayOfWeek: z.ZodArray<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>>>>;
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type ServiceProviderTimeOffRecurrence = z.infer<typeof ServiceProviderTimeOffRecurrenceSchema>;
|
|
79
|
+
export type ServiceProviderTimeOff = z.infer<typeof ServiceProviderTimeOffSchema>;
|
|
80
|
+
export type CreateServiceProviderTimeOff = z.infer<typeof CreateServiceProviderTimeOffSchema>;
|
|
81
|
+
export type UpdateServiceProviderTimeOff = z.infer<typeof UpdateServiceProviderTimeOffSchema>;
|
|
82
|
+
/**
|
|
83
|
+
* Service provider time off filter options.
|
|
84
|
+
* @interface ServiceProviderTimeOffFilters
|
|
85
|
+
*/
|
|
86
|
+
export interface ServiceProviderTimeOffFilters {
|
|
87
|
+
/** Filter by provider ID */
|
|
88
|
+
providerId?: string;
|
|
89
|
+
/** Filter by time-off type */
|
|
90
|
+
type?: ServiceProviderTimeOffType;
|
|
91
|
+
/** Filter by approval status */
|
|
92
|
+
status?: ServiceProviderTimeOffStatus;
|
|
93
|
+
/** Filter by start date (Unix epoch seconds) */
|
|
94
|
+
fromDate?: number;
|
|
95
|
+
/** Filter by end date (Unix epoch seconds) */
|
|
96
|
+
toDate?: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Service provider time off sorting options.
|
|
100
|
+
* @interface ServiceProviderTimeOffSorting
|
|
101
|
+
*/
|
|
102
|
+
export interface ServiceProviderTimeOffSorting {
|
|
103
|
+
/** Field to sort by */
|
|
104
|
+
field: "startDate" | "endDate" | "createdAt";
|
|
105
|
+
/** Sort direction */
|
|
106
|
+
direction: "asc" | "desc";
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Service provider time off query options.
|
|
110
|
+
* @interface ServiceProviderTimeOffQueryOptions
|
|
111
|
+
*/
|
|
112
|
+
export interface ServiceProviderTimeOffQueryOptions {
|
|
113
|
+
/** Page number (1-indexed) */
|
|
114
|
+
page: number;
|
|
115
|
+
/** Items per page */
|
|
116
|
+
pageSize: number;
|
|
117
|
+
/** Optional filters */
|
|
118
|
+
filters?: ServiceProviderTimeOffFilters;
|
|
119
|
+
/** Optional sorting */
|
|
120
|
+
sorting?: ServiceProviderTimeOffSorting;
|
|
121
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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.UpdateServiceProviderTimeOffSchema = exports.CreateServiceProviderTimeOffSchema = exports.ServiceProviderTimeOffSchema = exports.ServiceProviderTimeOffRecurrenceSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
10
|
+
/**
|
|
11
|
+
* @fileoverview Service Provider Time Off schema definitions.
|
|
12
|
+
* @module business-mgt/service-time-off
|
|
13
|
+
*
|
|
14
|
+
* Time off records represent periods when service providers are unavailable.
|
|
15
|
+
* Supports both recurring (weekly) and specific (one-time) time off entries.
|
|
16
|
+
*/
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// RECURRENCE SCHEMA
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Recurrence rule for recurring time off.
|
|
22
|
+
* Defines which days of the week the time off applies.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} ServiceProviderTimeOffRecurrence
|
|
25
|
+
* @property {string[]} dayOfWeek - Days of week (0=Sunday ... 6=Saturday)
|
|
26
|
+
*/
|
|
27
|
+
exports.ServiceProviderTimeOffRecurrenceSchema = zod_1.default.object({
|
|
28
|
+
dayOfWeek: zod_1.default.array(zod_1.default.string().regex(/^[0-6]$/, "Day must be 0-6")).min(1).describe("Recurring days of week (0=Sunday ... 6=Saturday)"),
|
|
29
|
+
}).describe("Recurrence rule for recurring time off");
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// SERVICE PROVIDER TIME OFF SCHEMA
|
|
32
|
+
// ============================================================================
|
|
33
|
+
/**
|
|
34
|
+
* Service Provider Time Off schema.
|
|
35
|
+
* Represents a time period when a provider is unavailable for appointments.
|
|
36
|
+
*
|
|
37
|
+
* @typedef {Object} ServiceProviderTimeOff
|
|
38
|
+
* @property {string} providerId - Provider ID (ServicePerson ID)
|
|
39
|
+
* @property {string} type - Time-off type (recurring or specific)
|
|
40
|
+
* @property {number} startDate - Start date/time as Unix epoch seconds
|
|
41
|
+
* @property {number} endDate - End date/time as Unix epoch seconds
|
|
42
|
+
* @property {string} [reason] - Optional reason for time off
|
|
43
|
+
* @property {string} status - Approval status
|
|
44
|
+
* @property {Object} [recurrence] - Recurrence rule for recurring time off
|
|
45
|
+
*/
|
|
46
|
+
exports.ServiceProviderTimeOffSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
47
|
+
providerId: zod_1.default.string().describe("Provider ID (ServicePerson ID)"),
|
|
48
|
+
type: zod_1.default.enum(type_definitions_1.ServiceProviderTimeOffType).describe("Time-off type (recurring or specific)"),
|
|
49
|
+
startDate: zod_1.default.number().int().positive().describe("Start date/time as Unix epoch seconds"),
|
|
50
|
+
endDate: zod_1.default.number().int().positive().describe("End date/time as Unix epoch seconds"),
|
|
51
|
+
reason: zod_1.default.string().nullable().optional().describe("Optional reason for time off"),
|
|
52
|
+
status: zod_1.default.enum(type_definitions_1.ServiceProviderTimeOffStatus).default(type_definitions_1.ServiceProviderTimeOffStatus.PENDING).describe("Approval status"),
|
|
53
|
+
recurrence: exports.ServiceProviderTimeOffRecurrenceSchema.nullable().optional().describe("Recurrence rule for recurring time off"),
|
|
54
|
+
}).superRefine((data, ctx) => {
|
|
55
|
+
if (data.endDate < data.startDate) {
|
|
56
|
+
ctx.addIssue({
|
|
57
|
+
code: "custom",
|
|
58
|
+
path: ["endDate"],
|
|
59
|
+
message: "endDate must be greater than or equal to startDate",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (data.type === type_definitions_1.ServiceProviderTimeOffType.RECURRING && !data.recurrence) {
|
|
63
|
+
ctx.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
path: ["recurrence"],
|
|
66
|
+
message: "recurrence is required when type is recurring",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (data.type === type_definitions_1.ServiceProviderTimeOffType.SPECIFIC && data.recurrence) {
|
|
70
|
+
ctx.addIssue({
|
|
71
|
+
code: "custom",
|
|
72
|
+
path: ["recurrence"],
|
|
73
|
+
message: "recurrence must be empty for specific time off",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// CREATE/UPDATE SCHEMAS
|
|
79
|
+
// ============================================================================
|
|
80
|
+
/**
|
|
81
|
+
* Schema for creating a new service provider time off record.
|
|
82
|
+
* Omits auto-generated fields.
|
|
83
|
+
*/
|
|
84
|
+
exports.CreateServiceProviderTimeOffSchema = exports.ServiceProviderTimeOffSchema.omit({
|
|
85
|
+
id: true,
|
|
86
|
+
createdAt: true,
|
|
87
|
+
updatedAt: true,
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Schema for updating an existing service provider time off record.
|
|
91
|
+
* All fields optional except id (required).
|
|
92
|
+
*/
|
|
93
|
+
exports.UpdateServiceProviderTimeOffSchema = exports.CreateServiceProviderTimeOffSchema.partial().safeExtend({
|
|
94
|
+
id: zod_1.default.string().describe("Unique identifier of the ServiceProviderTimeOff to update"),
|
|
95
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Service person schema definitions for managing service providers.
|
|
4
|
+
* @module business-mgt/service-person
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Service person schema - Complete service person record.
|
|
8
|
+
*
|
|
9
|
+
* @typedef {Object} ServicePerson
|
|
10
|
+
* @property {string} accountId - User account ID of the service person
|
|
11
|
+
* @property {string} [description] - Description of the service person
|
|
12
|
+
* @property {string} serviceId - ID of the service this person provides
|
|
13
|
+
*/
|
|
14
|
+
export declare const ServicePersonSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
accountId: z.ZodString;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
serviceId: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/**
|
|
23
|
+
* Schema for creating a new service person.
|
|
24
|
+
* Omits auto-generated fields.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CreateServicePersonSchema: z.ZodObject<{
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
serviceId: z.ZodString;
|
|
29
|
+
accountId: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/**
|
|
32
|
+
* Schema for updating an existing service person.
|
|
33
|
+
* All fields are optional except id.
|
|
34
|
+
*/
|
|
35
|
+
export declare const UpdateServicePersonSchema: z.ZodObject<{
|
|
36
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
38
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export type ServicePerson = z.infer<typeof ServicePersonSchema>;
|
|
42
|
+
export type CreateServicePerson = z.infer<typeof CreateServicePersonSchema>;
|
|
43
|
+
export type UpdateServicePerson = z.infer<typeof UpdateServicePersonSchema>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateServicePersonSchema = exports.CreateServicePersonSchema = exports.ServicePersonSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Service person schema definitions for managing service providers.
|
|
8
|
+
* @module business-mgt/service-person
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Service person schema - Complete service person record.
|
|
12
|
+
*
|
|
13
|
+
* @typedef {Object} ServicePerson
|
|
14
|
+
* @property {string} accountId - User account ID of the service person
|
|
15
|
+
* @property {string} [description] - Description of the service person
|
|
16
|
+
* @property {string} serviceId - ID of the service this person provides
|
|
17
|
+
*/
|
|
18
|
+
exports.ServicePersonSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
19
|
+
accountId: zod_1.z.string().describe("User account ID linking this service provider to platform identity management for authentication, scheduling access, and availability management."),
|
|
20
|
+
description: zod_1.z.string().optional().describe("Professional bio displayed to customers during booking: qualifications, specializations, experience, languages spoken. Helps customers make informed provider selection."),
|
|
21
|
+
serviceId: zod_1.z.string().describe("References Business Service from service-config.schema that this person provides. Multiple persons can offer same service, enabling parallel scheduling and staff load distribution."),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Schema for creating a new service person.
|
|
25
|
+
* Omits auto-generated fields.
|
|
26
|
+
*/
|
|
27
|
+
exports.CreateServicePersonSchema = exports.ServicePersonSchema.omit({
|
|
28
|
+
id: true,
|
|
29
|
+
createdAt: true,
|
|
30
|
+
updatedAt: true,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Schema for updating an existing service person.
|
|
34
|
+
* All fields are optional except id.
|
|
35
|
+
*/
|
|
36
|
+
exports.UpdateServicePersonSchema = exports.CreateServicePersonSchema.partial().safeExtend({
|
|
37
|
+
id: zod_1.z.string(),
|
|
38
|
+
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TaxCatalogScope, TaxRateType, TaxScope } from "../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Tax rule schema definitions for order pricing.
|
|
5
|
+
* @module business-mgt/tax-rule
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Tax rule schema.
|
|
9
|
+
* Defines tax configurations for orders including percentage and fixed amount taxes.
|
|
10
|
+
*
|
|
11
|
+
* @typedef {Object} TaxRule
|
|
12
|
+
* @property {string} [locationId] - Business location where this tax applies
|
|
13
|
+
* @property {string} name - Tax display name
|
|
14
|
+
* @property {TaxScope} scope - Tax scope (order, item, category)
|
|
15
|
+
* @property {TaxRateType} rateType - Tax rate type (percentage, fixed)
|
|
16
|
+
* @property {number} rateValue - Tax rate value
|
|
17
|
+
* @property {string} currency - Currency code for fixed taxes
|
|
18
|
+
* @property {TaxCatalogScope} catalogScope - Catalog scope for item-level taxes
|
|
19
|
+
* @property {string} [externalTaxId] - External system tax ID
|
|
20
|
+
* @property {boolean} isInclusive - Whether tax is included in prices
|
|
21
|
+
* @property {number} priority - Priority for tax application order
|
|
22
|
+
* @property {boolean} isCompound - Whether tax compounds on other taxes
|
|
23
|
+
* @property {number} [effectiveFrom] - Start timestamp for tax validity
|
|
24
|
+
* @property {number} [effectiveTo] - End timestamp for tax validity
|
|
25
|
+
* @property {boolean} isActive - Whether tax is currently active
|
|
26
|
+
*/
|
|
27
|
+
export declare const TaxRuleSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
scope: z.ZodDefault<z.ZodEnum<typeof TaxScope>>;
|
|
34
|
+
rateType: z.ZodDefault<z.ZodEnum<typeof TaxRateType>>;
|
|
35
|
+
rateValue: z.ZodNumber;
|
|
36
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
37
|
+
catalogScope: z.ZodDefault<z.ZodEnum<typeof TaxCatalogScope>>;
|
|
38
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
41
|
+
isCompound: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
effectiveFrom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
43
|
+
effectiveTo: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
44
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
/**
|
|
47
|
+
* Schema for creating a new tax rule.
|
|
48
|
+
* Omits auto-generated fields.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CreateTaxRuleSchema: z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
54
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
scope: z.ZodDefault<z.ZodEnum<typeof TaxScope>>;
|
|
56
|
+
catalogScope: z.ZodDefault<z.ZodEnum<typeof TaxCatalogScope>>;
|
|
57
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
58
|
+
effectiveFrom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
effectiveTo: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
+
externalTaxId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
rateType: z.ZodDefault<z.ZodEnum<typeof TaxRateType>>;
|
|
62
|
+
rateValue: z.ZodNumber;
|
|
63
|
+
isInclusive: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
isCompound: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
placementIntent: z.ZodObject<{
|
|
67
|
+
mode: z.ZodEnum<{
|
|
68
|
+
BEGINNING: "BEGINNING";
|
|
69
|
+
END: "END";
|
|
70
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
71
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
72
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
73
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
74
|
+
}>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
/**
|
|
81
|
+
* Schema for updating an existing tax rule.
|
|
82
|
+
* All fields optional except id.
|
|
83
|
+
*/
|
|
84
|
+
export declare const UpdateTaxRuleSchema: z.ZodObject<{
|
|
85
|
+
name: z.ZodOptional<z.ZodString>;
|
|
86
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
87
|
+
currency: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
88
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
89
|
+
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof TaxScope>>>;
|
|
90
|
+
catalogScope: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof TaxCatalogScope>>>;
|
|
91
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
92
|
+
effectiveFrom: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
93
|
+
effectiveTo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
94
|
+
externalTaxId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
95
|
+
rateType: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof TaxRateType>>>;
|
|
96
|
+
rateValue: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
isInclusive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
98
|
+
isCompound: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
99
|
+
placement: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
100
|
+
placementIntent: z.ZodObject<{
|
|
101
|
+
mode: z.ZodEnum<{
|
|
102
|
+
BEGINNING: "BEGINNING";
|
|
103
|
+
END: "END";
|
|
104
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
105
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
106
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
107
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
108
|
+
}>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type TaxRule = z.infer<typeof TaxRuleSchema>;
|
|
116
|
+
export type CreateTaxRule = z.infer<typeof CreateTaxRuleSchema>;
|
|
117
|
+
export type UpdateTaxRule = z.infer<typeof UpdateTaxRuleSchema>;
|
|
118
|
+
/**
|
|
119
|
+
* Tax rule filter options.
|
|
120
|
+
* @interface TaxRuleFilters
|
|
121
|
+
*/
|
|
122
|
+
export interface TaxRuleFilters {
|
|
123
|
+
/** Text search across tax name */
|
|
124
|
+
search?: string;
|
|
125
|
+
/** Filter by business location ID */
|
|
126
|
+
locationId?: string;
|
|
127
|
+
/** Filter by tax scope */
|
|
128
|
+
scope?: TaxScope;
|
|
129
|
+
/** Filter by tax rate type */
|
|
130
|
+
rateType?: TaxRateType;
|
|
131
|
+
/** Filter by catalog scope */
|
|
132
|
+
catalogScope?: TaxCatalogScope;
|
|
133
|
+
/** Filter by inclusive status */
|
|
134
|
+
isInclusive?: boolean;
|
|
135
|
+
/** Filter by active status */
|
|
136
|
+
isActive?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Tax rule sorting options.
|
|
140
|
+
* @interface TaxRuleSorting
|
|
141
|
+
*/
|
|
142
|
+
export interface TaxRuleSorting {
|
|
143
|
+
/** Field to sort by */
|
|
144
|
+
field: "name" | "priority" | "rateValue" | "createdAt";
|
|
145
|
+
/** Sort direction */
|
|
146
|
+
direction: "asc" | "desc";
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Tax rule query options.
|
|
150
|
+
* @interface TaxRuleQueryOptions
|
|
151
|
+
*/
|
|
152
|
+
export interface TaxRuleQueryOptions {
|
|
153
|
+
/** Page number (1-indexed) */
|
|
154
|
+
page: number;
|
|
155
|
+
/** Items per page */
|
|
156
|
+
pageSize: number;
|
|
157
|
+
/** Optional filters */
|
|
158
|
+
filters?: TaxRuleFilters;
|
|
159
|
+
/** Optional sorting */
|
|
160
|
+
sorting?: TaxRuleSorting;
|
|
161
|
+
}
|