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,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessResourceCatalogSchema = exports.UpdateResourceSchema = exports.CreateResourceSchema = exports.ResourceSchema = exports.ChecklistTemplateItemSchema = exports.ResourceAttributeSchema = exports.ResourcePricingStrategySchema = exports.ResourcePricingTieredSchema = exports.ResourcePricingTierSchema = exports.ResourcePricingDayOfWeekSchema = exports.ResourcePricingNoneSchema = exports.ResourceCapacitySchema = exports.ResourceCapacitySingleSchema = exports.ResourceCapacityOccupancySchema = exports.ResourceCapacityRangeSchema = exports.ResourceChannelMappingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../../../base.schema");
|
|
6
|
+
const display_order_1 = require("../../../type-definitions/display-order");
|
|
7
|
+
const type_definitions_1 = require("../../../type-definitions");
|
|
8
|
+
const bookings_shared_schema_1 = require("../../bookings.shared.schema");
|
|
9
|
+
const reservation_resource_instance_schema_1 = require("./reservation-resource-instance.schema");
|
|
10
|
+
/**
|
|
11
|
+
* @fileoverview Reservation resource schema definitions.
|
|
12
|
+
* @module business-mgt/reservation-mgt/resource
|
|
13
|
+
*/
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// CHANNEL MAPPING SCHEMAS
|
|
16
|
+
// ============================================================================
|
|
17
|
+
/**
|
|
18
|
+
* Resource channel mapping schema.
|
|
19
|
+
* Maps a reservation resource to an external platform resource ID.
|
|
20
|
+
*
|
|
21
|
+
* @typedef {Object} ResourceChannelMapping
|
|
22
|
+
* @property {string} channelId - Channel identifier
|
|
23
|
+
* @property {string} externalResourceId - External resource ID
|
|
24
|
+
*/
|
|
25
|
+
exports.ResourceChannelMappingSchema = zod_1.z.object({
|
|
26
|
+
channelId: zod_1.z.string().describe("Channel ID (e.g., opentable, booking-com, resy)."),
|
|
27
|
+
externalResourceId: zod_1.z.string().describe("External resource ID for this specific channel."),
|
|
28
|
+
}).describe("Per-channel external resource ID mapping");
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// CAPACITY SCHEMAS
|
|
31
|
+
// ============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Capacity range schema.
|
|
34
|
+
* Used by table resources that support a party size range.
|
|
35
|
+
*
|
|
36
|
+
* @typedef {Object} ResourceCapacityRange
|
|
37
|
+
* @property {string} kind - Capacity mode discriminator
|
|
38
|
+
* @property {number} min - Minimum supported party size
|
|
39
|
+
* @property {number} max - Maximum supported party size
|
|
40
|
+
*/
|
|
41
|
+
exports.ResourceCapacityRangeSchema = zod_1.z.object({
|
|
42
|
+
kind: zod_1.z.literal("range"),
|
|
43
|
+
min: zod_1.z.number().int().positive().describe("Minimum supported party size."),
|
|
44
|
+
max: zod_1.z.number().int().positive().describe("Maximum supported party size."),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Occupancy capacity schema.
|
|
48
|
+
* Used by room resources with standard and maximum occupancy.
|
|
49
|
+
*
|
|
50
|
+
* @typedef {Object} ResourceCapacityOccupancy
|
|
51
|
+
* @property {string} kind - Capacity mode discriminator
|
|
52
|
+
* @property {number} standard - Standard occupancy
|
|
53
|
+
* @property {number} max - Maximum occupancy
|
|
54
|
+
* @property {number} [extraFee] - Optional fee above standard occupancy
|
|
55
|
+
*/
|
|
56
|
+
exports.ResourceCapacityOccupancySchema = zod_1.z.object({
|
|
57
|
+
kind: zod_1.z.literal("occupancy"),
|
|
58
|
+
standard: zod_1.z.number().int().positive().describe("Standard occupancy included in base room pricing."),
|
|
59
|
+
max: zod_1.z.number().int().positive().describe("Maximum allowed occupancy for the room resource."),
|
|
60
|
+
extraFee: zod_1.z.number().nonnegative().nullable().optional().describe("Optional extra fee for occupancy above standard."),
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* Single capacity schema.
|
|
64
|
+
* Used by rental resources that represent one reservable unit at a time.
|
|
65
|
+
*
|
|
66
|
+
* @typedef {Object} ResourceCapacitySingle
|
|
67
|
+
* @property {string} kind - Capacity mode discriminator
|
|
68
|
+
* @property {number} value - Single capacity value
|
|
69
|
+
* @property {number} [weightLimit] - Optional weight limit
|
|
70
|
+
* @property {string} [skillLevel] - Optional skill level requirement
|
|
71
|
+
*/
|
|
72
|
+
exports.ResourceCapacitySingleSchema = zod_1.z.object({
|
|
73
|
+
kind: zod_1.z.literal("single"),
|
|
74
|
+
value: zod_1.z.number().int().positive().describe("Single capacity value for the resource."),
|
|
75
|
+
weightLimit: zod_1.z.number().positive().nullable().optional().describe("Optional weight limit for rental resources."),
|
|
76
|
+
skillLevel: zod_1.z.string().nullable().optional().describe("Optional skill level requirement for rental eligibility."),
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* Resource capacity schema.
|
|
80
|
+
* Discriminated union of mode-specific reservation capacity models.
|
|
81
|
+
*
|
|
82
|
+
* @typedef {ResourceCapacityRange|ResourceCapacityOccupancy|ResourceCapacitySingle} ResourceCapacity
|
|
83
|
+
*/
|
|
84
|
+
exports.ResourceCapacitySchema = zod_1.z.discriminatedUnion("kind", [
|
|
85
|
+
exports.ResourceCapacityRangeSchema,
|
|
86
|
+
exports.ResourceCapacityOccupancySchema,
|
|
87
|
+
exports.ResourceCapacitySingleSchema,
|
|
88
|
+
]);
|
|
89
|
+
// ============================================================================
|
|
90
|
+
// PRICING SCHEMAS
|
|
91
|
+
// ============================================================================
|
|
92
|
+
/**
|
|
93
|
+
* No-pricing strategy schema.
|
|
94
|
+
* Used for resources that do not quote pricing during reservation.
|
|
95
|
+
*
|
|
96
|
+
* @typedef {Object} ResourcePricingNone
|
|
97
|
+
* @property {string} kind - Pricing mode discriminator
|
|
98
|
+
* @property {string} [holdPolicy] - Optional hold or cancellation policy
|
|
99
|
+
*/
|
|
100
|
+
exports.ResourcePricingNoneSchema = zod_1.z.object({
|
|
101
|
+
kind: zod_1.z.literal("none"),
|
|
102
|
+
holdPolicy: zod_1.z.string().nullable().optional().describe("Optional hold or cancellation policy shown for non-priced resources."),
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Day-of-week pricing strategy schema.
|
|
106
|
+
* Used for nightly or daily resources with weekday-specific rates.
|
|
107
|
+
*
|
|
108
|
+
* @typedef {Object} ResourcePricingDayOfWeek
|
|
109
|
+
* @property {string} kind - Pricing mode discriminator
|
|
110
|
+
* @property {Object} rates - Per-day pricing by weekday
|
|
111
|
+
*/
|
|
112
|
+
exports.ResourcePricingDayOfWeekSchema = zod_1.z.object({
|
|
113
|
+
kind: zod_1.z.literal("dayOfWeek"),
|
|
114
|
+
rates: zod_1.z.object({
|
|
115
|
+
mon: zod_1.z.number().nonnegative(),
|
|
116
|
+
tue: zod_1.z.number().nonnegative(),
|
|
117
|
+
wed: zod_1.z.number().nonnegative(),
|
|
118
|
+
thu: zod_1.z.number().nonnegative(),
|
|
119
|
+
fri: zod_1.z.number().nonnegative(),
|
|
120
|
+
sat: zod_1.z.number().nonnegative(),
|
|
121
|
+
sun: zod_1.z.number().nonnegative(),
|
|
122
|
+
}).describe("Per-day pricing by weekday."),
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Resource pricing tier schema.
|
|
126
|
+
* Defines one tier in a tiered reservation pricing strategy.
|
|
127
|
+
*
|
|
128
|
+
* @typedef {Object} ResourcePricingTier
|
|
129
|
+
* @property {number} from - Tier start quantity or duration
|
|
130
|
+
* @property {number} [to] - Tier end quantity or duration
|
|
131
|
+
* @property {number} price - Tier price
|
|
132
|
+
*/
|
|
133
|
+
exports.ResourcePricingTierSchema = zod_1.z.object({
|
|
134
|
+
from: zod_1.z.number().nonnegative().describe("Tier start quantity or duration."),
|
|
135
|
+
to: zod_1.z.number().nonnegative().nullable().optional().describe("Tier end quantity or duration. Null means the tier is open-ended."),
|
|
136
|
+
price: zod_1.z.number().nonnegative().describe("Tier price applied within this range."),
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Tiered pricing strategy schema.
|
|
140
|
+
* Used for rentals or resources priced by duration or quantity bands.
|
|
141
|
+
*
|
|
142
|
+
* @typedef {Object} ResourcePricingTiered
|
|
143
|
+
* @property {string} kind - Pricing mode discriminator
|
|
144
|
+
* @property {ResourcePricingTier[]} tiers - Pricing tiers
|
|
145
|
+
*/
|
|
146
|
+
exports.ResourcePricingTieredSchema = zod_1.z.object({
|
|
147
|
+
kind: zod_1.z.literal("tiered"),
|
|
148
|
+
tiers: zod_1.z.array(exports.ResourcePricingTierSchema).min(1).describe("Ordered pricing tiers for this resource."),
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* Resource pricing strategy schema.
|
|
152
|
+
* Discriminated union of supported reservation pricing models.
|
|
153
|
+
*
|
|
154
|
+
* @typedef {ResourcePricingNone|ResourcePricingDayOfWeek|ResourcePricingTiered} ResourcePricingStrategy
|
|
155
|
+
*/
|
|
156
|
+
exports.ResourcePricingStrategySchema = zod_1.z.discriminatedUnion("kind", [
|
|
157
|
+
exports.ResourcePricingNoneSchema,
|
|
158
|
+
exports.ResourcePricingDayOfWeekSchema,
|
|
159
|
+
exports.ResourcePricingTieredSchema,
|
|
160
|
+
]);
|
|
161
|
+
// ============================================================================
|
|
162
|
+
// ATTRIBUTE AND CHECKLIST SCHEMAS
|
|
163
|
+
// ============================================================================
|
|
164
|
+
/**
|
|
165
|
+
* Resource attribute schema.
|
|
166
|
+
* Stores flexible key/value attributes for resource catalog filtering and integrations.
|
|
167
|
+
*
|
|
168
|
+
* @typedef {Object} ResourceAttribute
|
|
169
|
+
* @property {string} key - Attribute key
|
|
170
|
+
* @property {string} value - Attribute value
|
|
171
|
+
*/
|
|
172
|
+
exports.ResourceAttributeSchema = zod_1.z.object({
|
|
173
|
+
key: zod_1.z.string().describe("Attribute key used for filtering, display, or integrations."),
|
|
174
|
+
value: zod_1.z.string().describe("Attribute value associated with this resource."),
|
|
175
|
+
});
|
|
176
|
+
/**
|
|
177
|
+
* Checklist template item schema.
|
|
178
|
+
* Defines a pickup or return inspection item used by rental reservations.
|
|
179
|
+
*
|
|
180
|
+
* @typedef {Object} ChecklistTemplateItem
|
|
181
|
+
* @property {string} id - Checklist item ID
|
|
182
|
+
* @property {string} label - Staff-facing checklist item label
|
|
183
|
+
* @property {boolean} required - Whether this item is required
|
|
184
|
+
* @property {string} phase - Pickup, return, or both
|
|
185
|
+
*/
|
|
186
|
+
exports.ChecklistTemplateItemSchema = zod_1.z.object({
|
|
187
|
+
id: zod_1.z.string().describe("Checklist item ID."),
|
|
188
|
+
label: zod_1.z.string().describe("Checklist item label shown to staff."),
|
|
189
|
+
required: zod_1.z.boolean().default(true).describe("Whether this item must be checked before completing pickup or return."),
|
|
190
|
+
phase: zod_1.z.enum(["pickup", "return", "both"]).default("both").describe("When this checklist item should be completed."),
|
|
191
|
+
});
|
|
192
|
+
// ============================================================================
|
|
193
|
+
// RESOURCE SCHEMA
|
|
194
|
+
// ============================================================================
|
|
195
|
+
/**
|
|
196
|
+
* Resource schema.
|
|
197
|
+
* Defines a reservable resource category such as a table type, room type, or rental item type.
|
|
198
|
+
*
|
|
199
|
+
* @typedef {Object} Resource
|
|
200
|
+
* @property {string} [resourceRevisionId] - Version control for resource changes
|
|
201
|
+
* @property {string} [locationId] - Business location where the resource applies
|
|
202
|
+
* @property {ResourceType} resourceType - Reservation resource type
|
|
203
|
+
* @property {string} [categoryId] - Resource category ID
|
|
204
|
+
* @property {string} name - Resource display name
|
|
205
|
+
* @property {string} [description] - Resource description
|
|
206
|
+
* @property {string[]} [imageUrls] - Public image URLs
|
|
207
|
+
* @property {number} [capacity] - Simple maximum capacity
|
|
208
|
+
* @property {Object} [capacityConfig] - Mode-specific capacity configuration
|
|
209
|
+
* @property {boolean} isAvailable - Whether the resource is available
|
|
210
|
+
* @property {ResourceChannelMapping[]} [channelMappings] - Per-channel resource mappings
|
|
211
|
+
* @property {string} [location] - Physical location label
|
|
212
|
+
* @property {string[]} amenities - Resource amenities
|
|
213
|
+
* @property {string[]} [instances] - Physical resource instance IDs
|
|
214
|
+
* @property {Object} [pricing] - Mode-specific pricing strategy
|
|
215
|
+
* @property {number} [turnoverMinutes] - Reset time between reservations
|
|
216
|
+
* @property {ResourceAttribute[]} [attributes] - Flexible resource attributes
|
|
217
|
+
* @property {Object} [bookingRules] - Booking rules shared with reservation workflows
|
|
218
|
+
* @property {ServiceDepositStrategy} [depositStrategy] - Deposit strategy
|
|
219
|
+
* @property {number} [reservationDuration] - Default reservation duration
|
|
220
|
+
* @property {ResourceReservationDurationUnit} [reservationDurationUnit] - Unit for the default duration
|
|
221
|
+
* @property {ChecklistTemplateItem[]} checklistTemplate - Rental pickup/return checklist items
|
|
222
|
+
* @property {string[]} applicableTierIds - Applicable rental tier IDs
|
|
223
|
+
* @property {number} [displayOrder] - Display order in resource listings
|
|
224
|
+
* @property {Object} [metadata] - Additional resource metadata
|
|
225
|
+
*/
|
|
226
|
+
exports.ResourceSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
227
|
+
resourceRevisionId: zod_1.z.string().nullable().optional().describe("Optional resource revision ID for version-scoped catalog data."),
|
|
228
|
+
locationId: zod_1.z.string().nullable().optional().describe("Business location ID where this resource applies. Null applies across locations."),
|
|
229
|
+
resourceType: zod_1.z.enum(type_definitions_1.ResourceType).describe("Reservation resource type, such as table, room, rental, or generic resource."),
|
|
230
|
+
categoryId: zod_1.z.string().nullable().optional().describe("Resource category ID used for grouping and filtering."),
|
|
231
|
+
name: zod_1.z.string().describe("Display name of the reservable resource."),
|
|
232
|
+
description: zod_1.z.string().nullable().optional().describe("Customer or staff-facing description of the reservable resource."),
|
|
233
|
+
imageUrls: zod_1.z.array(zod_1.z.url()).nullable().optional().describe("Public image URLs used to present the resource in reservation flows."),
|
|
234
|
+
capacity: zod_1.z.number().int().positive().nullable().optional().describe("Simple maximum capacity for the resource when a detailed capacityConfig is not needed."),
|
|
235
|
+
capacityConfig: exports.ResourceCapacitySchema.nullable().optional().describe("Mode-specific capacity configuration for table, room, or rental resources."),
|
|
236
|
+
isAvailable: zod_1.z.boolean().default(true).describe("Whether this resource is available for new reservations."),
|
|
237
|
+
channelMappings: zod_1.z.array(exports.ResourceChannelMappingSchema).nullable().optional().describe("Per-channel resource ID mappings for external platform synchronization."),
|
|
238
|
+
location: zod_1.z.string().optional().describe("Physical location label for the resource, such as floor, building, or pickup area."),
|
|
239
|
+
amenities: zod_1.z.array(zod_1.z.string()).default([]).describe("Amenities or features available for this resource."),
|
|
240
|
+
instances: zod_1.z.array(zod_1.z.string()).nullable().optional().describe("Resource instance IDs for physical units under this resource."),
|
|
241
|
+
pricing: exports.ResourcePricingStrategySchema.nullable().optional().describe("Mode-specific pricing strategy for slot or quote generation."),
|
|
242
|
+
turnoverMinutes: zod_1.z.number().int().nonnegative().nullable().optional().describe("Turnover or reset time in minutes between reservations."),
|
|
243
|
+
attributes: zod_1.z.array(exports.ResourceAttributeSchema).nullable().optional().describe("Flexible key/value attributes for filtering, display, or integrations."),
|
|
244
|
+
bookingRules: bookings_shared_schema_1.ServiceBookingRulesSchema.nullable().optional().describe("Booking rules shared with service and reservation workflows."),
|
|
245
|
+
depositStrategy: zod_1.z.enum(bookings_shared_schema_1.ServiceDepositStrategy).nullable().optional().describe("Deposit strategy shared with service and reservation workflows."),
|
|
246
|
+
reservationDuration: zod_1.z.number().int().positive().nullable().optional().describe("Default reservation duration for this resource."),
|
|
247
|
+
reservationDurationUnit: zod_1.z.enum(type_definitions_1.ResourceReservationDurationUnit).optional().nullable().describe("Unit of the default reservation duration."),
|
|
248
|
+
checklistTemplate: zod_1.z.array(exports.ChecklistTemplateItemSchema).default([]).describe("Pickup and return checklist template items for rental resources."),
|
|
249
|
+
applicableTierIds: zod_1.z.array(zod_1.z.string()).default([]).describe("Rental tier IDs from ReservationSettings that apply to this resource."),
|
|
250
|
+
displayOrder: zod_1.z.number().int().nonnegative().nullable().optional().describe("Numeric display order for resource listings. Lower numbers appear first."),
|
|
251
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional structured metadata for resource integrations and rendering."),
|
|
252
|
+
}).superRefine((data, ctx) => {
|
|
253
|
+
if (data.capacityConfig?.kind === "range" && data.capacityConfig.max < data.capacityConfig.min) {
|
|
254
|
+
ctx.addIssue({
|
|
255
|
+
code: "custom",
|
|
256
|
+
path: ["capacityConfig", "max"],
|
|
257
|
+
message: "capacityConfig.max must be greater than or equal to capacityConfig.min",
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (data.capacityConfig?.kind === "occupancy" && data.capacityConfig.max < data.capacityConfig.standard) {
|
|
261
|
+
ctx.addIssue({
|
|
262
|
+
code: "custom",
|
|
263
|
+
path: ["capacityConfig", "max"],
|
|
264
|
+
message: "capacityConfig.max must be greater than or equal to capacityConfig.standard",
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (data.resourceType === type_definitions_1.ResourceType.TABLE) {
|
|
268
|
+
if (data.capacityConfig?.kind && data.capacityConfig.kind !== "range") {
|
|
269
|
+
ctx.addIssue({
|
|
270
|
+
code: "custom",
|
|
271
|
+
path: ["capacityConfig", "kind"],
|
|
272
|
+
message: "Table resources must use capacityConfig.kind 'range'",
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (data.pricing?.kind && data.pricing.kind !== "none") {
|
|
276
|
+
ctx.addIssue({
|
|
277
|
+
code: "custom",
|
|
278
|
+
path: ["pricing", "kind"],
|
|
279
|
+
message: "Table resources must use pricing.kind 'none'",
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (data.resourceType === type_definitions_1.ResourceType.ROOM) {
|
|
284
|
+
if (data.capacityConfig?.kind && data.capacityConfig.kind !== "occupancy") {
|
|
285
|
+
ctx.addIssue({
|
|
286
|
+
code: "custom",
|
|
287
|
+
path: ["capacityConfig", "kind"],
|
|
288
|
+
message: "Room resources must use capacityConfig.kind 'occupancy'",
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
if (data.pricing?.kind && data.pricing.kind !== "dayOfWeek") {
|
|
292
|
+
ctx.addIssue({
|
|
293
|
+
code: "custom",
|
|
294
|
+
path: ["pricing", "kind"],
|
|
295
|
+
message: "Room resources must use pricing.kind 'dayOfWeek'",
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (data.resourceType === type_definitions_1.ResourceType.RENTAL) {
|
|
300
|
+
if (data.capacityConfig?.kind && data.capacityConfig.kind !== "single") {
|
|
301
|
+
ctx.addIssue({
|
|
302
|
+
code: "custom",
|
|
303
|
+
path: ["capacityConfig", "kind"],
|
|
304
|
+
message: "Rental resources must use capacityConfig.kind 'single'",
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (data.pricing?.kind && data.pricing.kind !== "tiered") {
|
|
308
|
+
ctx.addIssue({
|
|
309
|
+
code: "custom",
|
|
310
|
+
path: ["pricing", "kind"],
|
|
311
|
+
message: "Rental resources must use pricing.kind 'tiered'",
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
// ============================================================================
|
|
317
|
+
// CREATE/UPDATE SCHEMAS
|
|
318
|
+
// ============================================================================
|
|
319
|
+
/**
|
|
320
|
+
* Object shape for creating a reservation resource.
|
|
321
|
+
* Omits auto-generated fields and replaces the read-model `instances` ID list with
|
|
322
|
+
* embedded instance definitions to be created alongside the resource.
|
|
323
|
+
*/
|
|
324
|
+
const CreateResourceObjectSchema = exports.ResourceSchema.omit({
|
|
325
|
+
id: true,
|
|
326
|
+
createdAt: true,
|
|
327
|
+
updatedAt: true,
|
|
328
|
+
// Replaced below with embedded create-instance definitions (no parent resourceId)
|
|
329
|
+
instances: true,
|
|
330
|
+
}).safeExtend({
|
|
331
|
+
placement: display_order_1.CreateDisplayOrderPlacementSchema.optional().describe("Optional placement for display ordering."),
|
|
332
|
+
instances: zod_1.z.array(reservation_resource_instance_schema_1.CreateResourceInstanceSchema.omit({ resourceId: true })).default([]).describe("Physical instances to create with this resource. At least one is required for every resource type except table; the parent resource ID is assigned by the server."),
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* Schema for creating a new reservation resource.
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* A reservation resource must be created with at least one instance, except for
|
|
339
|
+
* table resources, where instances are optional at creation time.
|
|
340
|
+
*/
|
|
341
|
+
exports.CreateResourceSchema = CreateResourceObjectSchema.superRefine((data, ctx) => {
|
|
342
|
+
if (data.resourceType !== type_definitions_1.ResourceType.TABLE && data.instances.length < 1) {
|
|
343
|
+
ctx.addIssue({
|
|
344
|
+
code: "custom",
|
|
345
|
+
path: ["instances"],
|
|
346
|
+
message: "A reservation resource must have at least one instance, except for table resources",
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
/**
|
|
351
|
+
* Schema for updating an existing reservation resource.
|
|
352
|
+
* All fields optional except id. The create-time instance requirement is not enforced on update.
|
|
353
|
+
*/
|
|
354
|
+
exports.UpdateResourceSchema = CreateResourceObjectSchema.partial().safeExtend({
|
|
355
|
+
id: zod_1.z.string().describe("Unique identifier of the reservation resource to update."),
|
|
356
|
+
});
|
|
357
|
+
/**
|
|
358
|
+
* Business resource catalog schema.
|
|
359
|
+
* Represents the complete reservation resource catalog for a business context.
|
|
360
|
+
*
|
|
361
|
+
* @typedef {Resource[]} BusinessResourceCatalog
|
|
362
|
+
*/
|
|
363
|
+
exports.BusinessResourceCatalogSchema = zod_1.z.array(exports.ResourceSchema).describe("Schema representing a business resource catalog");
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Resource versioning schema definitions for reservation resources.
|
|
4
|
+
* @module business-mgt/reservation-mgt/resource-versioning
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Resource revision lifecycle status.
|
|
8
|
+
*
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ResourceRevisionStatus {
|
|
12
|
+
DRAFT = "draft",
|
|
13
|
+
ACTIVE = "active",
|
|
14
|
+
ARCHIVED = "archived"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Strategy for deriving a new resource revision.
|
|
18
|
+
*
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
export declare enum ResourceRevisionDeriveStrategy {
|
|
22
|
+
COPY_CURRENT = "copy_current",
|
|
23
|
+
EMPTY = "empty"
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resource definition schema.
|
|
27
|
+
* Represents the stable identity for a versioned reservation resource catalog.
|
|
28
|
+
*
|
|
29
|
+
* @typedef {Object} ResourceDefinition
|
|
30
|
+
* @property {string} name - Resource definition display name
|
|
31
|
+
* @property {string} [description] - Resource definition description
|
|
32
|
+
* @property {boolean} isActive - Whether this definition is active
|
|
33
|
+
*/
|
|
34
|
+
export declare const ResourceDefinitionSchema: z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
/**
|
|
43
|
+
* Resource revision schema.
|
|
44
|
+
* Represents a specific editable or published version of a resource definition.
|
|
45
|
+
*
|
|
46
|
+
* @typedef {Object} ResourceRevision
|
|
47
|
+
* @property {string} resourceId - Resource definition ID
|
|
48
|
+
* @property {string} [label] - Human-readable revision label
|
|
49
|
+
* @property {ResourceRevisionStatus} status - Current revision status
|
|
50
|
+
* @property {string} [derivedFromRevisionId] - Source revision ID
|
|
51
|
+
* @property {number} [publishedAt] - Publication timestamp
|
|
52
|
+
*/
|
|
53
|
+
export declare const ResourceRevisionSchema: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
resourceId: z.ZodString;
|
|
58
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
status: z.ZodDefault<z.ZodEnum<typeof ResourceRevisionStatus>>;
|
|
60
|
+
derivedFromRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
/**
|
|
64
|
+
* Schema for creating a new resource definition.
|
|
65
|
+
* Omits auto-generated fields.
|
|
66
|
+
*/
|
|
67
|
+
export declare const CreateResourceDefinitionSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
/**
|
|
73
|
+
* Schema for updating an existing resource definition.
|
|
74
|
+
* All fields optional except id.
|
|
75
|
+
*/
|
|
76
|
+
export declare const UpdateResourceDefinitionSchema: z.ZodObject<{
|
|
77
|
+
name: z.ZodOptional<z.ZodString>;
|
|
78
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
79
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
/**
|
|
83
|
+
* Schema for creating a new resource revision.
|
|
84
|
+
* Omits auto-generated fields.
|
|
85
|
+
*/
|
|
86
|
+
export declare const CreateResourceRevisionSchema: z.ZodObject<{
|
|
87
|
+
status: z.ZodDefault<z.ZodEnum<typeof ResourceRevisionStatus>>;
|
|
88
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
resourceId: z.ZodString;
|
|
90
|
+
derivedFromRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* Schema for updating an existing resource revision.
|
|
95
|
+
* All fields optional except id.
|
|
96
|
+
*/
|
|
97
|
+
export declare const UpdateResourceRevisionSchema: z.ZodObject<{
|
|
98
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof ResourceRevisionStatus>>>;
|
|
99
|
+
label: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
100
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
derivedFromRevisionId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
102
|
+
publishedAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/**
|
|
106
|
+
* Request schema for deriving a new resource revision.
|
|
107
|
+
*
|
|
108
|
+
* @typedef {Object} DeriveResourceRevisionRequest
|
|
109
|
+
* @property {string} resourceId - Resource definition ID
|
|
110
|
+
* @property {string} [sourceRevisionId] - Source revision ID
|
|
111
|
+
* @property {ResourceRevisionDeriveStrategy} strategy - Derivation strategy
|
|
112
|
+
* @property {string} [label] - Optional derived revision label
|
|
113
|
+
*/
|
|
114
|
+
export declare const DeriveResourceRevisionRequestSchema: z.ZodObject<{
|
|
115
|
+
resourceId: z.ZodString;
|
|
116
|
+
sourceRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
strategy: z.ZodDefault<z.ZodEnum<typeof ResourceRevisionDeriveStrategy>>;
|
|
118
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
/**
|
|
121
|
+
* Result schema returned after deriving a resource revision.
|
|
122
|
+
*
|
|
123
|
+
* @typedef {Object} DeriveResourceRevisionResult
|
|
124
|
+
* @property {string} resourceId - Resource definition ID
|
|
125
|
+
* @property {string} resourceRevisionId - Created revision ID
|
|
126
|
+
*/
|
|
127
|
+
export declare const DeriveResourceRevisionResultSchema: z.ZodObject<{
|
|
128
|
+
resourceId: z.ZodString;
|
|
129
|
+
resourceRevisionId: z.ZodString;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/**
|
|
132
|
+
* Resource revision context schema.
|
|
133
|
+
* Identifies a resource definition and the revision currently in use.
|
|
134
|
+
*
|
|
135
|
+
* @typedef {Object} ResourceRevisionContext
|
|
136
|
+
* @property {string} resourceId - Resource definition ID
|
|
137
|
+
* @property {string} resourceRevisionId - Resource revision ID
|
|
138
|
+
*/
|
|
139
|
+
export declare const ResourceRevisionContextSchema: z.ZodObject<{
|
|
140
|
+
resourceId: z.ZodString;
|
|
141
|
+
resourceRevisionId: z.ZodString;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export type ResourceDefinition = z.infer<typeof ResourceDefinitionSchema>;
|
|
144
|
+
export type ResourceRevision = z.infer<typeof ResourceRevisionSchema>;
|
|
145
|
+
export type CreateResourceDefinition = z.infer<typeof CreateResourceDefinitionSchema>;
|
|
146
|
+
export type UpdateResourceDefinition = z.infer<typeof UpdateResourceDefinitionSchema>;
|
|
147
|
+
export type CreateResourceRevision = z.infer<typeof CreateResourceRevisionSchema>;
|
|
148
|
+
export type UpdateResourceRevision = z.infer<typeof UpdateResourceRevisionSchema>;
|
|
149
|
+
export type DeriveResourceRevisionRequest = z.infer<typeof DeriveResourceRevisionRequestSchema>;
|
|
150
|
+
export type DeriveResourceRevisionResult = z.infer<typeof DeriveResourceRevisionResultSchema>;
|
|
151
|
+
export type ResourceRevisionContext = z.infer<typeof ResourceRevisionContextSchema>;
|
|
@@ -0,0 +1,147 @@
|
|
|
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.ResourceRevisionContextSchema = exports.DeriveResourceRevisionResultSchema = exports.DeriveResourceRevisionRequestSchema = exports.UpdateResourceRevisionSchema = exports.CreateResourceRevisionSchema = exports.UpdateResourceDefinitionSchema = exports.CreateResourceDefinitionSchema = exports.ResourceRevisionSchema = exports.ResourceDefinitionSchema = exports.ResourceRevisionDeriveStrategy = exports.ResourceRevisionStatus = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Resource versioning schema definitions for reservation resources.
|
|
11
|
+
* @module business-mgt/reservation-mgt/resource-versioning
|
|
12
|
+
*/
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// ENUMS
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Resource revision lifecycle status.
|
|
18
|
+
*
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
var ResourceRevisionStatus;
|
|
22
|
+
(function (ResourceRevisionStatus) {
|
|
23
|
+
ResourceRevisionStatus["DRAFT"] = "draft";
|
|
24
|
+
ResourceRevisionStatus["ACTIVE"] = "active";
|
|
25
|
+
ResourceRevisionStatus["ARCHIVED"] = "archived";
|
|
26
|
+
})(ResourceRevisionStatus || (exports.ResourceRevisionStatus = ResourceRevisionStatus = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Strategy for deriving a new resource revision.
|
|
29
|
+
*
|
|
30
|
+
* @enum {string}
|
|
31
|
+
*/
|
|
32
|
+
var ResourceRevisionDeriveStrategy;
|
|
33
|
+
(function (ResourceRevisionDeriveStrategy) {
|
|
34
|
+
ResourceRevisionDeriveStrategy["COPY_CURRENT"] = "copy_current";
|
|
35
|
+
ResourceRevisionDeriveStrategy["EMPTY"] = "empty";
|
|
36
|
+
})(ResourceRevisionDeriveStrategy || (exports.ResourceRevisionDeriveStrategy = ResourceRevisionDeriveStrategy = {}));
|
|
37
|
+
// ============================================================================
|
|
38
|
+
// RESOURCE VERSIONING SCHEMAS
|
|
39
|
+
// ============================================================================
|
|
40
|
+
/**
|
|
41
|
+
* Resource definition schema.
|
|
42
|
+
* Represents the stable identity for a versioned reservation resource catalog.
|
|
43
|
+
*
|
|
44
|
+
* @typedef {Object} ResourceDefinition
|
|
45
|
+
* @property {string} name - Resource definition display name
|
|
46
|
+
* @property {string} [description] - Resource definition description
|
|
47
|
+
* @property {boolean} isActive - Whether this definition is active
|
|
48
|
+
*/
|
|
49
|
+
exports.ResourceDefinitionSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
50
|
+
name: zod_1.default.string().min(1).describe("Display name for the versioned resource definition."),
|
|
51
|
+
description: zod_1.default.string().nullable().optional().describe("Optional description of the resource definition and its intended reservation use."),
|
|
52
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this resource definition is active and available for revision management."),
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Resource revision schema.
|
|
56
|
+
* Represents a specific editable or published version of a resource definition.
|
|
57
|
+
*
|
|
58
|
+
* @typedef {Object} ResourceRevision
|
|
59
|
+
* @property {string} resourceId - Resource definition ID
|
|
60
|
+
* @property {string} [label] - Human-readable revision label
|
|
61
|
+
* @property {ResourceRevisionStatus} status - Current revision status
|
|
62
|
+
* @property {string} [derivedFromRevisionId] - Source revision ID
|
|
63
|
+
* @property {number} [publishedAt] - Publication timestamp
|
|
64
|
+
*/
|
|
65
|
+
exports.ResourceRevisionSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
66
|
+
resourceId: zod_1.default.string().describe("Resource definition ID that owns this revision."),
|
|
67
|
+
label: zod_1.default.string().nullable().optional().describe("Human-readable revision label, such as 'Summer layout' or 'Q4 rental fleet'."),
|
|
68
|
+
status: zod_1.default.enum(ResourceRevisionStatus).default(ResourceRevisionStatus.DRAFT).describe("Lifecycle status for this resource revision."),
|
|
69
|
+
derivedFromRevisionId: zod_1.default.string().nullable().optional().describe("Source revision ID when this revision was derived from an existing revision."),
|
|
70
|
+
publishedAt: zod_1.default.number().int().positive().nullable().optional().describe("Unix timestamp when this revision was published."),
|
|
71
|
+
});
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// CREATE/UPDATE SCHEMAS
|
|
74
|
+
// ============================================================================
|
|
75
|
+
/**
|
|
76
|
+
* Schema for creating a new resource definition.
|
|
77
|
+
* Omits auto-generated fields.
|
|
78
|
+
*/
|
|
79
|
+
exports.CreateResourceDefinitionSchema = exports.ResourceDefinitionSchema.omit({
|
|
80
|
+
id: true,
|
|
81
|
+
createdAt: true,
|
|
82
|
+
updatedAt: true,
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Schema for updating an existing resource definition.
|
|
86
|
+
* All fields optional except id.
|
|
87
|
+
*/
|
|
88
|
+
exports.UpdateResourceDefinitionSchema = exports.CreateResourceDefinitionSchema.partial().safeExtend({
|
|
89
|
+
id: zod_1.default.string().describe("Unique identifier of the resource definition to update."),
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* Schema for creating a new resource revision.
|
|
93
|
+
* Omits auto-generated fields.
|
|
94
|
+
*/
|
|
95
|
+
exports.CreateResourceRevisionSchema = exports.ResourceRevisionSchema.omit({
|
|
96
|
+
id: true,
|
|
97
|
+
createdAt: true,
|
|
98
|
+
updatedAt: true,
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Schema for updating an existing resource revision.
|
|
102
|
+
* All fields optional except id.
|
|
103
|
+
*/
|
|
104
|
+
exports.UpdateResourceRevisionSchema = exports.CreateResourceRevisionSchema.partial().safeExtend({
|
|
105
|
+
id: zod_1.default.string().describe("Unique identifier of the resource revision to update."),
|
|
106
|
+
});
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// DERIVATION SCHEMAS
|
|
109
|
+
// ============================================================================
|
|
110
|
+
/**
|
|
111
|
+
* Request schema for deriving a new resource revision.
|
|
112
|
+
*
|
|
113
|
+
* @typedef {Object} DeriveResourceRevisionRequest
|
|
114
|
+
* @property {string} resourceId - Resource definition ID
|
|
115
|
+
* @property {string} [sourceRevisionId] - Source revision ID
|
|
116
|
+
* @property {ResourceRevisionDeriveStrategy} strategy - Derivation strategy
|
|
117
|
+
* @property {string} [label] - Optional derived revision label
|
|
118
|
+
*/
|
|
119
|
+
exports.DeriveResourceRevisionRequestSchema = zod_1.default.object({
|
|
120
|
+
resourceId: zod_1.default.string().describe("Resource definition ID to derive a revision for."),
|
|
121
|
+
sourceRevisionId: zod_1.default.string().nullable().optional().describe("Optional source revision ID used when strategy is COPY_CURRENT."),
|
|
122
|
+
strategy: zod_1.default.enum(ResourceRevisionDeriveStrategy).default(ResourceRevisionDeriveStrategy.COPY_CURRENT).describe("Derivation strategy for the new revision."),
|
|
123
|
+
label: zod_1.default.string().nullable().optional().describe("Optional label for the derived revision."),
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* Result schema returned after deriving a resource revision.
|
|
127
|
+
*
|
|
128
|
+
* @typedef {Object} DeriveResourceRevisionResult
|
|
129
|
+
* @property {string} resourceId - Resource definition ID
|
|
130
|
+
* @property {string} resourceRevisionId - Created revision ID
|
|
131
|
+
*/
|
|
132
|
+
exports.DeriveResourceRevisionResultSchema = zod_1.default.object({
|
|
133
|
+
resourceId: zod_1.default.string().describe("Resource definition ID that owns the derived revision."),
|
|
134
|
+
resourceRevisionId: zod_1.default.string().describe("Newly created resource revision ID."),
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
* Resource revision context schema.
|
|
138
|
+
* Identifies a resource definition and the revision currently in use.
|
|
139
|
+
*
|
|
140
|
+
* @typedef {Object} ResourceRevisionContext
|
|
141
|
+
* @property {string} resourceId - Resource definition ID
|
|
142
|
+
* @property {string} resourceRevisionId - Resource revision ID
|
|
143
|
+
*/
|
|
144
|
+
exports.ResourceRevisionContextSchema = zod_1.default.object({
|
|
145
|
+
resourceId: zod_1.default.string().describe("Resource definition ID."),
|
|
146
|
+
resourceRevisionId: zod_1.default.string().describe("Resource revision ID."),
|
|
147
|
+
});
|