@ozmap/ozn-sdk
Version:
OZN SDK is a powerful tool for developers to build their own applications on top of OZN using TMForum pattern.
66 lines (65 loc) • 2.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResourcePoolManagementOutputSchema = exports.resourcePoolManagementInputSchema = void 0;
const zod_1 = require("zod");
const geographic_address_1 = require("./geographic-address");
const shared_1 = require("./shared");
const PropertySchema = zod_1.z.object({
name: zod_1.z.string(),
value: zod_1.z.string(),
});
const RelatedPartySchema = zod_1.z.object({
role: zod_1.z.string(),
property: zod_1.z.array(PropertySchema),
});
const ResourceCapacitySchema = zod_1.z.object({
place: shared_1.externalSystemsSchema,
});
const AppliedCapacityAmountSchema = zod_1.z.object({
characteristic: zod_1.z.array(shared_1.CharacteristicSchema),
});
const ReservationItemSchema = zod_1.z.object({
resourceCapacity: ResourceCapacitySchema,
appliedCapacityAmount: AppliedCapacityAmountSchema,
});
exports.resourcePoolManagementInputSchema = zod_1.z.object({
relatedParty: RelatedPartySchema,
reservationItem: zod_1.z.array(ReservationItemSchema),
});
const ResourceSpecificationSchema = zod_1.z.object({
id: zod_1.z.string(),
cellName: zod_1.z.nullable(zod_1.z.string()),
type: zod_1.z.string(),
name: zod_1.z.string(),
});
const ResourceLocationSchema = zod_1.z.object({
type: zod_1.z.string(),
labelType: zod_1.z.string(),
name: zod_1.z.string(),
description: zod_1.z.string(),
parentLocation: zod_1.z.string(),
address: geographic_address_1.geographicAddressOutputSchema,
});
const ResourceSchema = zod_1.z.object({
id: zod_1.z.string(),
name: zod_1.z.string(),
type: zod_1.z.literal('PTP'),
resourceSpecification: ResourceSpecificationSchema,
resourceLocation: ResourceLocationSchema,
});
const AppliedCapacityAmountSchemaOutput = zod_1.z.object({
resource: zod_1.z.array(ResourceSchema),
});
const ResourceCapacitySchemaOutput = zod_1.z.object({
resourcePool: shared_1.externalSystemsSchema,
});
const ReservationItemSchemaOutput = zod_1.z.object({
id: zod_1.z.string(),
reservationState: zod_1.z.literal('NEW'),
reservationStateDate: zod_1.z.string(),
resourceCapacity: ResourceCapacitySchemaOutput,
appliedCapacityAmount: AppliedCapacityAmountSchemaOutput,
});
exports.ResourcePoolManagementOutputSchema = zod_1.z.object({
reservationItem: zod_1.z.array(ReservationItemSchemaOutput),
});