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,122 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Service Person schema definitions for service providers/staff.
|
|
4
|
+
* @module business-mgt/service-person
|
|
5
|
+
*
|
|
6
|
+
* Service persons represent staff members who can be assigned to perform services.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Service Person schema.
|
|
10
|
+
* Represents a staff member or provider who can perform services.
|
|
11
|
+
*
|
|
12
|
+
* @typedef {Object} ServicePerson
|
|
13
|
+
* @property {string} [locationId] - Location this provider is assigned to
|
|
14
|
+
* @property {string} [userAccountId] - Linked user account ID
|
|
15
|
+
* @property {string} name - Display name for this provider
|
|
16
|
+
* @property {string} [avatar] - Provider avatar URL
|
|
17
|
+
* @property {string} [description] - Provider description/bio
|
|
18
|
+
* @property {Array} [skills] - Skill IDs this provider can perform
|
|
19
|
+
* @property {number} [commissionPercent] - Provider commission percentage (0-100)
|
|
20
|
+
* @property {string} [scheduleId] - Schedule ID for provider availability
|
|
21
|
+
* @property {boolean} bookableOnline - Whether customers can book online
|
|
22
|
+
* @property {boolean} bookableByStaff - Whether staff can assign internally
|
|
23
|
+
* @property {boolean} isActive - Whether this provider is active
|
|
24
|
+
*/
|
|
25
|
+
export declare const ServicePersonSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
userAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
33
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
35
|
+
commissionPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
36
|
+
scheduleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
bookableOnline: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
bookableByStaff: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/**
|
|
42
|
+
* Schema for creating a new service person.
|
|
43
|
+
* Omits auto-generated fields.
|
|
44
|
+
*/
|
|
45
|
+
export declare const CreateServicePersonSchema: z.ZodObject<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
userAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
52
|
+
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
53
|
+
commissionPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
|
+
scheduleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
bookableOnline: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
bookableByStaff: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
/**
|
|
59
|
+
* Schema for updating an existing service person.
|
|
60
|
+
* All fields optional except id (required).
|
|
61
|
+
*/
|
|
62
|
+
export declare const UpdateServicePersonSchema: z.ZodObject<{
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
64
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
65
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
66
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
67
|
+
userAccountId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
68
|
+
avatar: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodURL>>>;
|
|
69
|
+
skills: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
70
|
+
commissionPercent: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
71
|
+
scheduleId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
72
|
+
bookableOnline: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
73
|
+
bookableByStaff: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export type ServicePerson = z.infer<typeof ServicePersonSchema>;
|
|
77
|
+
export type CreateServicePerson = z.infer<typeof CreateServicePersonSchema>;
|
|
78
|
+
export type UpdateServicePerson = z.infer<typeof UpdateServicePersonSchema>;
|
|
79
|
+
/**
|
|
80
|
+
* Service person filter options.
|
|
81
|
+
* @interface ServicePersonFilters
|
|
82
|
+
*/
|
|
83
|
+
export interface ServicePersonFilters {
|
|
84
|
+
/** Text search across name/description */
|
|
85
|
+
search?: string;
|
|
86
|
+
/** Filter by location ID */
|
|
87
|
+
locationId?: string;
|
|
88
|
+
/** Filter by linked user account ID */
|
|
89
|
+
userAccountId?: string;
|
|
90
|
+
/** Filter by skill ID */
|
|
91
|
+
skillId?: string;
|
|
92
|
+
/** Filter by online bookability */
|
|
93
|
+
bookableOnline?: boolean;
|
|
94
|
+
/** Filter by staff bookability */
|
|
95
|
+
bookableByStaff?: boolean;
|
|
96
|
+
/** Filter by active status */
|
|
97
|
+
isActive?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Service person sorting options.
|
|
101
|
+
* @interface ServicePersonSorting
|
|
102
|
+
*/
|
|
103
|
+
export interface ServicePersonSorting {
|
|
104
|
+
/** Field to sort by */
|
|
105
|
+
field: "name" | "commissionPercent" | "createdAt";
|
|
106
|
+
/** Sort direction */
|
|
107
|
+
direction: "asc" | "desc";
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Service person query options.
|
|
111
|
+
* @interface ServicePersonQueryOptions
|
|
112
|
+
*/
|
|
113
|
+
export interface ServicePersonQueryOptions {
|
|
114
|
+
/** Page number (1-indexed) */
|
|
115
|
+
page: number;
|
|
116
|
+
/** Items per page */
|
|
117
|
+
pageSize: number;
|
|
118
|
+
/** Optional filters */
|
|
119
|
+
filters?: ServicePersonFilters;
|
|
120
|
+
/** Optional sorting */
|
|
121
|
+
sorting?: ServicePersonSorting;
|
|
122
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.UpdateServicePersonSchema = exports.CreateServicePersonSchema = exports.ServicePersonSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Service Person schema definitions for service providers/staff.
|
|
11
|
+
* @module business-mgt/service-person
|
|
12
|
+
*
|
|
13
|
+
* Service persons represent staff members who can be assigned to perform services.
|
|
14
|
+
*/
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// SERVICE PERSON SCHEMA
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Service Person schema.
|
|
20
|
+
* Represents a staff member or provider who can perform services.
|
|
21
|
+
*
|
|
22
|
+
* @typedef {Object} ServicePerson
|
|
23
|
+
* @property {string} [locationId] - Location this provider is assigned to
|
|
24
|
+
* @property {string} [userAccountId] - Linked user account ID
|
|
25
|
+
* @property {string} name - Display name for this provider
|
|
26
|
+
* @property {string} [avatar] - Provider avatar URL
|
|
27
|
+
* @property {string} [description] - Provider description/bio
|
|
28
|
+
* @property {Array} [skills] - Skill IDs this provider can perform
|
|
29
|
+
* @property {number} [commissionPercent] - Provider commission percentage (0-100)
|
|
30
|
+
* @property {string} [scheduleId] - Schedule ID for provider availability
|
|
31
|
+
* @property {boolean} bookableOnline - Whether customers can book online
|
|
32
|
+
* @property {boolean} bookableByStaff - Whether staff can assign internally
|
|
33
|
+
* @property {boolean} isActive - Whether this provider is active
|
|
34
|
+
*/
|
|
35
|
+
exports.ServicePersonSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
36
|
+
locationId: zod_1.default.string().nullable().optional().describe("Location this provider is assigned to. Null for providers available at all locations."),
|
|
37
|
+
userAccountId: zod_1.default.string().nullable().optional().describe("Linked user account ID for staff login and calendar sync."),
|
|
38
|
+
name: zod_1.default.string().min(1).describe("Display name for this provider shown to customers during booking."),
|
|
39
|
+
avatar: zod_1.default.url().nullable().optional().describe("Provider avatar URL for visual identification."),
|
|
40
|
+
description: zod_1.default.string().nullable().optional().describe("Provider description or bio displayed during booking."),
|
|
41
|
+
skills: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Skill IDs this provider can perform. Used to filter available providers per service."),
|
|
42
|
+
commissionPercent: zod_1.default.number().min(0).max(100).nullable().optional().describe("Provider commission percentage (0-100). Used for payroll calculations."),
|
|
43
|
+
scheduleId: zod_1.default.string().nullable().optional().describe("Schedule ID for provider availability. Links to scheduling system."),
|
|
44
|
+
bookableOnline: zod_1.default.boolean().default(true).describe("Whether customers can book this provider online."),
|
|
45
|
+
bookableByStaff: zod_1.default.boolean().default(true).describe("Whether staff can assign this provider internally."),
|
|
46
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this provider is active and available for booking."),
|
|
47
|
+
});
|
|
48
|
+
// ============================================================================
|
|
49
|
+
// CREATE/UPDATE SCHEMAS
|
|
50
|
+
// ============================================================================
|
|
51
|
+
/**
|
|
52
|
+
* Schema for creating a new service person.
|
|
53
|
+
* Omits auto-generated fields.
|
|
54
|
+
*/
|
|
55
|
+
exports.CreateServicePersonSchema = exports.ServicePersonSchema.omit({
|
|
56
|
+
id: true,
|
|
57
|
+
createdAt: true,
|
|
58
|
+
updatedAt: true,
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Schema for updating an existing service person.
|
|
62
|
+
* All fields optional except id (required).
|
|
63
|
+
*/
|
|
64
|
+
exports.UpdateServicePersonSchema = exports.CreateServicePersonSchema.partial().safeExtend({
|
|
65
|
+
id: zod_1.default.string().describe("Unique identifier of the ServicePerson to update"),
|
|
66
|
+
});
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { PricingChannel, PricingRuleAdjustmentType, PricingRuleApplyLevel } from "../pricing-rule.shared.schema";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Service Pricing Rule schema definitions.
|
|
5
|
+
* @module business-mgt/service-pricing-rule
|
|
6
|
+
*
|
|
7
|
+
* Service pricing rules define conditional pricing adjustments for services.
|
|
8
|
+
* Supports time-based promotions, channel-specific pricing, and service targeting.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Service pricing rule condition schema.
|
|
12
|
+
* Extends common pricing conditions with service-specific targeting.
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Object} ServicePricingRuleCondition
|
|
15
|
+
* @property {boolean} allServices - Apply to all services
|
|
16
|
+
* @property {string[]} serviceIdsAny - Apply if any of these services match
|
|
17
|
+
* @property {string[]} serviceIdsAll - Apply only if all these services are present
|
|
18
|
+
*/
|
|
19
|
+
export declare const ServicePricingRuleConditionSchema: z.ZodObject<{
|
|
20
|
+
daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
21
|
+
startMinute: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
endMinute: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
customerSegmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
channel: z.ZodDefault<z.ZodEnum<typeof PricingChannel>>;
|
|
25
|
+
allServices: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
serviceIdsAny: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
27
|
+
serviceIdsAll: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* Service Pricing Rule schema.
|
|
31
|
+
* Defines a pricing rule for service-based pricing adjustments.
|
|
32
|
+
*
|
|
33
|
+
* @typedef {Object} ServicePricingRule
|
|
34
|
+
* @property {string} [locationId] - Location scope (null for all locations)
|
|
35
|
+
* @property {string} name - Rule display name
|
|
36
|
+
* @property {string} applyLevel - Apply at ORDER or LINE level
|
|
37
|
+
* @property {boolean} isStackable - Whether rule can stack with others
|
|
38
|
+
* @property {number} priority - Rule priority (higher = applied first)
|
|
39
|
+
* @property {Array} [channelMappings] - Per-channel external rule ID mappings
|
|
40
|
+
* @property {Object} condition - Rule matching conditions
|
|
41
|
+
* @property {Object} action - Pricing adjustment action
|
|
42
|
+
* @property {number} [effectiveFrom] - Start timestamp for rule
|
|
43
|
+
* @property {number} [effectiveTo] - End timestamp for rule
|
|
44
|
+
* @property {boolean} isActive - Whether rule is active
|
|
45
|
+
*/
|
|
46
|
+
export declare const ServicePricingRuleSchema: z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof PricingRuleApplyLevel>>;
|
|
53
|
+
isStackable: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
55
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
56
|
+
channelId: z.ZodString;
|
|
57
|
+
externalPricingRuleId: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>>>;
|
|
59
|
+
condition: z.ZodDefault<z.ZodObject<{
|
|
60
|
+
daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
61
|
+
startMinute: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
endMinute: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
customerSegmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
channel: z.ZodDefault<z.ZodEnum<typeof PricingChannel>>;
|
|
65
|
+
allServices: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
serviceIdsAny: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
67
|
+
serviceIdsAll: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
action: z.ZodObject<{
|
|
70
|
+
adjustmentType: z.ZodEnum<typeof PricingRuleAdjustmentType>;
|
|
71
|
+
adjustmentValue: z.ZodNumber;
|
|
72
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
73
|
+
maxAdjustmentAmount: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
effectiveFrom: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
effectiveTo: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
/**
|
|
80
|
+
* Schema for creating a new service pricing rule.
|
|
81
|
+
* Omits auto-generated fields, includes optional placement for ordering.
|
|
82
|
+
*/
|
|
83
|
+
export declare const CreateServicePricingRuleSchema: z.ZodObject<{
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
isStackable: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
effectiveFrom: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
effectiveTo: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
applyLevel: z.ZodDefault<z.ZodEnum<typeof PricingRuleApplyLevel>>;
|
|
92
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
93
|
+
channelId: z.ZodString;
|
|
94
|
+
externalPricingRuleId: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>>>;
|
|
96
|
+
condition: z.ZodDefault<z.ZodObject<{
|
|
97
|
+
daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
98
|
+
startMinute: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
endMinute: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
customerSegmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
channel: z.ZodDefault<z.ZodEnum<typeof PricingChannel>>;
|
|
102
|
+
allServices: z.ZodDefault<z.ZodBoolean>;
|
|
103
|
+
serviceIdsAny: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
104
|
+
serviceIdsAll: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
action: z.ZodObject<{
|
|
107
|
+
adjustmentType: z.ZodEnum<typeof PricingRuleAdjustmentType>;
|
|
108
|
+
adjustmentValue: z.ZodNumber;
|
|
109
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
110
|
+
maxAdjustmentAmount: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
placementIntent: z.ZodObject<{
|
|
114
|
+
mode: z.ZodEnum<{
|
|
115
|
+
BEGINNING: "BEGINNING";
|
|
116
|
+
END: "END";
|
|
117
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
118
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
119
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
120
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
/**
|
|
128
|
+
* Schema for updating an existing service pricing rule.
|
|
129
|
+
* All fields optional except id (required).
|
|
130
|
+
*/
|
|
131
|
+
export declare const UpdateServicePricingRuleSchema: z.ZodObject<{
|
|
132
|
+
name: z.ZodOptional<z.ZodString>;
|
|
133
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
134
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
135
|
+
isStackable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
136
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
137
|
+
effectiveFrom: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
138
|
+
effectiveTo: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
139
|
+
applyLevel: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof PricingRuleApplyLevel>>>;
|
|
140
|
+
channelMappings: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
141
|
+
channelId: z.ZodString;
|
|
142
|
+
externalPricingRuleId: z.ZodString;
|
|
143
|
+
}, z.core.$strip>>>>>;
|
|
144
|
+
condition: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
145
|
+
daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
146
|
+
startMinute: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
endMinute: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
customerSegmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
channel: z.ZodDefault<z.ZodEnum<typeof PricingChannel>>;
|
|
150
|
+
allServices: z.ZodDefault<z.ZodBoolean>;
|
|
151
|
+
serviceIdsAny: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
152
|
+
serviceIdsAll: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
153
|
+
}, z.core.$strip>>>;
|
|
154
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
adjustmentType: z.ZodEnum<typeof PricingRuleAdjustmentType>;
|
|
156
|
+
adjustmentValue: z.ZodNumber;
|
|
157
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
158
|
+
maxAdjustmentAmount: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
placement: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
161
|
+
placementIntent: z.ZodObject<{
|
|
162
|
+
mode: z.ZodEnum<{
|
|
163
|
+
BEGINNING: "BEGINNING";
|
|
164
|
+
END: "END";
|
|
165
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
166
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
167
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
168
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
169
|
+
}>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
173
|
+
}, z.core.$strip>>>;
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export type ServicePricingRuleCondition = z.infer<typeof ServicePricingRuleConditionSchema>;
|
|
177
|
+
export type ServicePricingRule = z.infer<typeof ServicePricingRuleSchema>;
|
|
178
|
+
export type CreateServicePricingRule = z.infer<typeof CreateServicePricingRuleSchema>;
|
|
179
|
+
export type UpdateServicePricingRule = z.infer<typeof UpdateServicePricingRuleSchema>;
|
|
180
|
+
/**
|
|
181
|
+
* Service pricing rule filter options.
|
|
182
|
+
* @interface ServicePricingRuleFilters
|
|
183
|
+
*/
|
|
184
|
+
export interface ServicePricingRuleFilters {
|
|
185
|
+
/** Text search across name */
|
|
186
|
+
search?: string;
|
|
187
|
+
/** Filter by location ID */
|
|
188
|
+
locationId?: string;
|
|
189
|
+
/** Filter by apply level */
|
|
190
|
+
applyLevel?: PricingRuleApplyLevel;
|
|
191
|
+
/** Filter by pricing channel */
|
|
192
|
+
channel?: PricingChannel;
|
|
193
|
+
/** Filter by stackability */
|
|
194
|
+
isStackable?: boolean;
|
|
195
|
+
/** Filter by active status */
|
|
196
|
+
isActive?: boolean;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Service pricing rule sorting options.
|
|
200
|
+
* @interface ServicePricingRuleSorting
|
|
201
|
+
*/
|
|
202
|
+
export interface ServicePricingRuleSorting {
|
|
203
|
+
/** Field to sort by */
|
|
204
|
+
field: "name" | "priority" | "createdAt";
|
|
205
|
+
/** Sort direction */
|
|
206
|
+
direction: "asc" | "desc";
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Service pricing rule query options.
|
|
210
|
+
* @interface ServicePricingRuleQueryOptions
|
|
211
|
+
*/
|
|
212
|
+
export interface ServicePricingRuleQueryOptions {
|
|
213
|
+
/** Page number (1-indexed) */
|
|
214
|
+
page: number;
|
|
215
|
+
/** Items per page */
|
|
216
|
+
pageSize: number;
|
|
217
|
+
/** Optional filters */
|
|
218
|
+
filters?: ServicePricingRuleFilters;
|
|
219
|
+
/** Optional sorting */
|
|
220
|
+
sorting?: ServicePricingRuleSorting;
|
|
221
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
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.UpdateServicePricingRuleSchema = exports.CreateServicePricingRuleSchema = exports.ServicePricingRuleSchema = exports.ServicePricingRuleConditionSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const display_order_1 = require("../../type-definitions/display-order");
|
|
10
|
+
const pricing_rule_shared_schema_1 = require("../pricing-rule.shared.schema");
|
|
11
|
+
/**
|
|
12
|
+
* @fileoverview Service Pricing Rule schema definitions.
|
|
13
|
+
* @module business-mgt/service-pricing-rule
|
|
14
|
+
*
|
|
15
|
+
* Service pricing rules define conditional pricing adjustments for services.
|
|
16
|
+
* Supports time-based promotions, channel-specific pricing, and service targeting.
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// SERVICE PRICING RULE CONDITION SCHEMA
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Service pricing rule condition schema.
|
|
23
|
+
* Extends common pricing conditions with service-specific targeting.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} ServicePricingRuleCondition
|
|
26
|
+
* @property {boolean} allServices - Apply to all services
|
|
27
|
+
* @property {string[]} serviceIdsAny - Apply if any of these services match
|
|
28
|
+
* @property {string[]} serviceIdsAll - Apply only if all these services are present
|
|
29
|
+
*/
|
|
30
|
+
exports.ServicePricingRuleConditionSchema = pricing_rule_shared_schema_1.PricingRuleCommonConditionSchema.safeExtend({
|
|
31
|
+
allServices: zod_1.default.boolean().default(false).describe("Apply rule to all services"),
|
|
32
|
+
serviceIdsAny: zod_1.default.array(zod_1.default.string()).default([]).describe("Apply if any of these service IDs match"),
|
|
33
|
+
serviceIdsAll: zod_1.default.array(zod_1.default.string()).default([]).describe("Apply only if all these service IDs are present"),
|
|
34
|
+
}).superRefine((data, ctx) => {
|
|
35
|
+
const hasServiceSelectors = data.serviceIdsAny.length > 0 || data.serviceIdsAll.length > 0;
|
|
36
|
+
if (data.allServices && hasServiceSelectors) {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
code: "custom",
|
|
39
|
+
path: ["allServices"],
|
|
40
|
+
message: "allServices cannot be combined with serviceIdsAny/serviceIdsAll",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// SERVICE PRICING RULE SCHEMA
|
|
46
|
+
// ============================================================================
|
|
47
|
+
/**
|
|
48
|
+
* Service Pricing Rule schema.
|
|
49
|
+
* Defines a pricing rule for service-based pricing adjustments.
|
|
50
|
+
*
|
|
51
|
+
* @typedef {Object} ServicePricingRule
|
|
52
|
+
* @property {string} [locationId] - Location scope (null for all locations)
|
|
53
|
+
* @property {string} name - Rule display name
|
|
54
|
+
* @property {string} applyLevel - Apply at ORDER or LINE level
|
|
55
|
+
* @property {boolean} isStackable - Whether rule can stack with others
|
|
56
|
+
* @property {number} priority - Rule priority (higher = applied first)
|
|
57
|
+
* @property {Array} [channelMappings] - Per-channel external rule ID mappings
|
|
58
|
+
* @property {Object} condition - Rule matching conditions
|
|
59
|
+
* @property {Object} action - Pricing adjustment action
|
|
60
|
+
* @property {number} [effectiveFrom] - Start timestamp for rule
|
|
61
|
+
* @property {number} [effectiveTo] - End timestamp for rule
|
|
62
|
+
* @property {boolean} isActive - Whether rule is active
|
|
63
|
+
*/
|
|
64
|
+
exports.ServicePricingRuleSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
65
|
+
locationId: zod_1.default.string().nullable().optional().describe("Location ID scope. Null for all locations."),
|
|
66
|
+
name: zod_1.default.string().min(1).max(120).describe("Rule display name"),
|
|
67
|
+
applyLevel: zod_1.default.enum(pricing_rule_shared_schema_1.PricingRuleApplyLevel).default(pricing_rule_shared_schema_1.PricingRuleApplyLevel.ORDER).describe("Apply at ORDER or LINE level"),
|
|
68
|
+
isStackable: zod_1.default.boolean().default(true).describe("Whether this rule can stack with other rules"),
|
|
69
|
+
priority: zod_1.default.number().int().nonnegative().default(0).describe("Rule priority (higher = applied first)"),
|
|
70
|
+
channelMappings: zod_1.default.array(pricing_rule_shared_schema_1.PricingRuleChannelMappingSchema).nullable().optional().describe("Per-channel external pricing rule ID mappings"),
|
|
71
|
+
condition: exports.ServicePricingRuleConditionSchema.default({
|
|
72
|
+
allServices: false,
|
|
73
|
+
serviceIdsAny: [],
|
|
74
|
+
serviceIdsAll: [],
|
|
75
|
+
daysOfWeek: [],
|
|
76
|
+
channel: pricing_rule_shared_schema_1.PricingChannel.ALL,
|
|
77
|
+
}).describe("Rule matching conditions"),
|
|
78
|
+
action: pricing_rule_shared_schema_1.PricingRuleActionSchema.describe("Pricing adjustment action"),
|
|
79
|
+
effectiveFrom: zod_1.default.number().int().nonnegative().optional().describe("Unix timestamp when rule becomes active"),
|
|
80
|
+
effectiveTo: zod_1.default.number().int().nonnegative().optional().describe("Unix timestamp when rule expires"),
|
|
81
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this rule is currently active"),
|
|
82
|
+
}).superRefine((data, ctx) => {
|
|
83
|
+
if (data.action.adjustmentType === pricing_rule_shared_schema_1.PricingRuleAdjustmentType.PERCENTAGE && data.action.adjustmentValue > 100) {
|
|
84
|
+
ctx.addIssue({
|
|
85
|
+
code: "custom",
|
|
86
|
+
path: ["action", "adjustmentValue"],
|
|
87
|
+
message: "adjustmentValue cannot exceed 100 for percentage adjustments",
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (data.effectiveFrom !== undefined && data.effectiveTo !== undefined && data.effectiveTo < data.effectiveFrom) {
|
|
91
|
+
ctx.addIssue({
|
|
92
|
+
code: "custom",
|
|
93
|
+
path: ["effectiveTo"],
|
|
94
|
+
message: "effectiveTo must be greater than or equal to effectiveFrom",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// CREATE/UPDATE SCHEMAS
|
|
100
|
+
// ============================================================================
|
|
101
|
+
/**
|
|
102
|
+
* Schema for creating a new service pricing rule.
|
|
103
|
+
* Omits auto-generated fields, includes optional placement for ordering.
|
|
104
|
+
*/
|
|
105
|
+
exports.CreateServicePricingRuleSchema = exports.ServicePricingRuleSchema.omit({
|
|
106
|
+
id: true,
|
|
107
|
+
createdAt: true,
|
|
108
|
+
updatedAt: true,
|
|
109
|
+
}).safeExtend({
|
|
110
|
+
placement: display_order_1.CreateDisplayOrderPlacementSchema.optional().describe("Optional placement for display ordering"),
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* Schema for updating an existing service pricing rule.
|
|
114
|
+
* All fields optional except id (required).
|
|
115
|
+
*/
|
|
116
|
+
exports.UpdateServicePricingRuleSchema = exports.CreateServicePricingRuleSchema.partial().safeExtend({
|
|
117
|
+
id: zod_1.default.string().describe("Unique identifier of the ServicePricingRule to update"),
|
|
118
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Service Provider join schema for service-to-provider assignments.
|
|
4
|
+
* @module business-mgt/service-provider
|
|
5
|
+
*
|
|
6
|
+
* Many-to-many relationship between services and providers with per-provider overrides.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Service Provider join schema.
|
|
10
|
+
* Links services to providers with optional price/duration overrides.
|
|
11
|
+
*
|
|
12
|
+
* @typedef {Object} ServiceProvider
|
|
13
|
+
* @property {string} serviceId - Service ID being assigned
|
|
14
|
+
* @property {string} providerId - Provider ID (typically ServicePerson ID)
|
|
15
|
+
* @property {number} [priceOverride] - Provider-specific price override
|
|
16
|
+
* @property {number} [durationOverride] - Provider-specific duration override in minutes
|
|
17
|
+
* @property {boolean} active - Whether this assignment is active
|
|
18
|
+
*/
|
|
19
|
+
export declare const ServiceProviderSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
serviceId: z.ZodString;
|
|
24
|
+
providerId: z.ZodString;
|
|
25
|
+
priceOverride: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
durationOverride: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* Schema for creating a new service provider assignment.
|
|
31
|
+
* Omits auto-generated fields.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CreateServiceProviderSchema: z.ZodObject<{
|
|
34
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
serviceId: z.ZodString;
|
|
36
|
+
providerId: z.ZodString;
|
|
37
|
+
priceOverride: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
38
|
+
durationOverride: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
/**
|
|
41
|
+
* Schema for updating an existing service provider assignment.
|
|
42
|
+
* All fields optional except id (required).
|
|
43
|
+
*/
|
|
44
|
+
export declare const UpdateServiceProviderSchema: z.ZodObject<{
|
|
45
|
+
active: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
46
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
47
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
priceOverride: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
49
|
+
durationOverride: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type ServiceProvider = z.infer<typeof ServiceProviderSchema>;
|
|
53
|
+
export type CreateServiceProvider = z.infer<typeof CreateServiceProviderSchema>;
|
|
54
|
+
export type UpdateServiceProvider = z.infer<typeof UpdateServiceProviderSchema>;
|
|
55
|
+
/**
|
|
56
|
+
* Service provider filter options.
|
|
57
|
+
* @interface ServiceProviderFilters
|
|
58
|
+
*/
|
|
59
|
+
export interface ServiceProviderFilters {
|
|
60
|
+
/** Filter by service ID */
|
|
61
|
+
serviceId?: string;
|
|
62
|
+
/** Filter by provider ID */
|
|
63
|
+
providerId?: string;
|
|
64
|
+
/** Filter by active status */
|
|
65
|
+
active?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Service provider sorting options.
|
|
69
|
+
* @interface ServiceProviderSorting
|
|
70
|
+
*/
|
|
71
|
+
export interface ServiceProviderSorting {
|
|
72
|
+
/** Field to sort by */
|
|
73
|
+
field: "createdAt" | "updatedAt";
|
|
74
|
+
/** Sort direction */
|
|
75
|
+
direction: "asc" | "desc";
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Service provider query options.
|
|
79
|
+
* @interface ServiceProviderQueryOptions
|
|
80
|
+
*/
|
|
81
|
+
export interface ServiceProviderQueryOptions {
|
|
82
|
+
/** Page number (1-indexed) */
|
|
83
|
+
page: number;
|
|
84
|
+
/** Items per page */
|
|
85
|
+
pageSize: number;
|
|
86
|
+
/** Optional filters */
|
|
87
|
+
filters?: ServiceProviderFilters;
|
|
88
|
+
/** Optional sorting */
|
|
89
|
+
sorting?: ServiceProviderSorting;
|
|
90
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.UpdateServiceProviderSchema = exports.CreateServiceProviderSchema = exports.ServiceProviderSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Service Provider join schema for service-to-provider assignments.
|
|
11
|
+
* @module business-mgt/service-provider
|
|
12
|
+
*
|
|
13
|
+
* Many-to-many relationship between services and providers with per-provider overrides.
|
|
14
|
+
*/
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// SERVICE PROVIDER SCHEMA
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Service Provider join schema.
|
|
20
|
+
* Links services to providers with optional price/duration overrides.
|
|
21
|
+
*
|
|
22
|
+
* @typedef {Object} ServiceProvider
|
|
23
|
+
* @property {string} serviceId - Service ID being assigned
|
|
24
|
+
* @property {string} providerId - Provider ID (typically ServicePerson ID)
|
|
25
|
+
* @property {number} [priceOverride] - Provider-specific price override
|
|
26
|
+
* @property {number} [durationOverride] - Provider-specific duration override in minutes
|
|
27
|
+
* @property {boolean} active - Whether this assignment is active
|
|
28
|
+
*/
|
|
29
|
+
exports.ServiceProviderSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
30
|
+
serviceId: zod_1.default.string().describe("Service ID being assigned to the provider"),
|
|
31
|
+
providerId: zod_1.default.string().describe("Provider ID (typically ServicePerson ID)"),
|
|
32
|
+
priceOverride: zod_1.default.number().nonnegative().nullable().optional().describe("Provider-specific price override. Null means use service default price."),
|
|
33
|
+
durationOverride: zod_1.default.number().int().positive().nullable().optional().describe("Provider-specific duration override in minutes. Null means use service default duration."),
|
|
34
|
+
active: zod_1.default.boolean().default(true).describe("Whether this provider assignment is active"),
|
|
35
|
+
});
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// CREATE/UPDATE SCHEMAS
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Schema for creating a new service provider assignment.
|
|
41
|
+
* Omits auto-generated fields.
|
|
42
|
+
*/
|
|
43
|
+
exports.CreateServiceProviderSchema = exports.ServiceProviderSchema.omit({
|
|
44
|
+
id: true,
|
|
45
|
+
createdAt: true,
|
|
46
|
+
updatedAt: true,
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Schema for updating an existing service provider assignment.
|
|
50
|
+
* All fields optional except id (required).
|
|
51
|
+
*/
|
|
52
|
+
exports.UpdateServiceProviderSchema = exports.CreateServiceProviderSchema.partial().safeExtend({
|
|
53
|
+
id: zod_1.default.string().describe("Unique identifier of the ServiceProvider to update"),
|
|
54
|
+
});
|