Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export * from './src/types/geographic-address';
export * from './src/types/service-qualification';
export * from './src/types/shared';
export * from './src/types/confirm-order';
export * from './src/types/service-ordering';
export * as Auth from './src/types/auth';

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ozmap/ozn-sdk",
"version": "0.0.1-1066-4",
"version": "0.0.1-1058-4",
"description": "OZN SDK is a powerful tool for developers to build their own applications on top of OZN using TMForum pattern.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions src/types/resource-pool-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,14 @@ export const ResourcePoolManagementOutputSchema = z.object({
reservationItem: z.array(ReservationItemSchemaOutput),
});


export const CancelReservationSchema = z.object({
relatedParty: RelatedPartySchema,
reservationItem: z.object({
reservationState: z.string(),
}),
});

export type CancelReservationInput = z.infer<typeof CancelReservationSchema>;
export type ResourcePoolManagementInput = z.infer<typeof resourcePoolManagementInputSchema>;
export type ResourcePoolManagementOutput = z.infer<typeof ResourcePoolManagementOutputSchema>;
142 changes: 142 additions & 0 deletions src/types/service-ordering.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import { z } from 'zod';

const resourceSchema = z
.array(
z.object({
name: z.string(),
resource: z.object({
property: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
component: z.array(z.any()).optional(),
resource: z.array(z.any()).optional(),
}),
}),
)
.nullable()
.optional();

const actionEnum = z.enum(['add', 'modify', 'delete', 'modifyPort']);

export const PortReplaceDetailEnum = z.enum([
'crossing',
'closerCTO',
'signalIssue',
'blockedAccess',
'fullCTO',
'operationalError',
'occupied',
'noSignal',
'attenuated',
'others',
]);

export type PortReplaceDetailEnum = z.infer<typeof PortReplaceDetailEnum>;

export const ServiceOrderInputSchema = z.object({
externalId: z.string(),
category: z.string(),
orderDate: z.string(),
requesterCallback: z.string(),
relatedParty: z.array(
z.object({
role: z.string(),
property: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
}),
),
orderItem: z
.array(
z.object({
id: z.string(),
action: actionEnum,
serviceSpecification: z.array(
z.object({
id: z.string(),
}),
),
service: z
.array(
z.object({
id: z.string(),
category: z.string(),
serviceCharacteristic: z
.array(
z.object({
name: z.string(),
value: z.string(),
characteristic: z.string().nullable().optional(),
}),
)
.optional(),
resource: resourceSchema,
}),
)
.max(1),
}),
)
.max(1),
});

export const ServiceOrderOutputSchema = z.object({
id: z.string(),
externalId: z.string(),
description: z.string().nullable(),
category: z.string(),
note: z.string(),
state: z.string(),
orderDate: z.string(),
requesterCallback: z.string(),
relatedParty: z.array(
z.object({
role: z.string(),
property: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
}),
),
orderItem: z.array(
z.object({
id: z.string(),
action: actionEnum,
requestedCompletionDate: z.string().nullable(),
state: z.string(),
statusMessage: z.string().nullable(),
serviceSpecification: z.object({
id: z.string(),
}),
orderItemRelationship: z.array(z.any()),
service: z.object({
id: z.string(),
category: z.string(),
changeReason: z.string().nullable(),
name: z.string().nullable(),
description: z.string().nullable(),
place: z.array(z.any()),
serviceCharacteristic: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
serviceRelationship: z.array(z.any()),
relatedParty: z.any().nullable(),
component: z.array(z.any()).optional(),
resource: resourceSchema,
}),
}),
),
});

export type ServiceOrderInput = z.infer<typeof ServiceOrderInputSchema>;
export type ServiceOrderOutput = z.infer<typeof ServiceOrderOutputSchema>;
Loading