From d24c1efefa281831979808c0c5cd030bd6cff3a9 Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Tue, 20 May 2025 15:35:07 -0300 Subject: [PATCH 1/7] OZN-1058 feat #time 1h added service-ordering's schemas --- index.ts | 2 +- src/types/service-ordering.ts | 123 ++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 src/types/service-ordering.ts diff --git a/index.ts b/index.ts index 216b47a..fa9fbb1 100644 --- a/index.ts +++ b/index.ts @@ -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'; - diff --git a/src/types/service-ordering.ts b/src/types/service-ordering.ts new file mode 100644 index 0000000..86a737c --- /dev/null +++ b/src/types/service-ordering.ts @@ -0,0 +1,123 @@ +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() + +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: z.string(), + 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: z.string(), + 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; +export type ServiceOrderOutput = z.infer; \ No newline at end of file From 156a23a40491c175c5df9b6cf2ea384c2cd676d7 Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Tue, 20 May 2025 15:35:29 -0300 Subject: [PATCH 2/7] chore: bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b94306..487c664 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1066-4", + "version": "0.0.1-1058-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1066-4", + "version": "0.0.1-1058-1", "license": "MIT", "dependencies": { "zod": "^3.24.2" diff --git a/package.json b/package.json index 40f2309..7b8ab02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1066-4", + "version": "0.0.1-1058-1", "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", From a0be43f78fb4889c296de2dd9b4ecf5b33e9d15e Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Wed, 21 May 2025 10:51:39 -0300 Subject: [PATCH 3/7] OZN-1058 feat #time 10m replace string action with enum in ServiceOrderInputSchema --- src/types/service-ordering.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/types/service-ordering.ts b/src/types/service-ordering.ts index 86a737c..cbaedf7 100644 --- a/src/types/service-ordering.ts +++ b/src/types/service-ordering.ts @@ -14,6 +14,8 @@ const resourceSchema = z.array(z.object({ }) })).nullable().optional() +const actionEnum = z.enum(['add', 'modify', 'delete', 'modifyPort']); + export const ServiceOrderInputSchema = z.object({ externalId: z.string(), category: z.string(), @@ -34,7 +36,7 @@ export const ServiceOrderInputSchema = z.object({ .array( z.object({ id: z.string(), - action: z.string(), + action: actionEnum, serviceSpecification: z.array( z.object({ id: z.string(), @@ -91,7 +93,7 @@ export const ServiceOrderOutputSchema = z.object({ orderItem: z.array( z.object({ id: z.string(), - action: z.string(), + action: actionEnum, requestedCompletionDate: z.string().nullable(), state: z.string(), statusMessage: z.string().nullable(), From 6909d37d230486028cea91e5a133ad4350559bc1 Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Wed, 21 May 2025 10:52:16 -0300 Subject: [PATCH 4/7] chore: bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 487c664..07dbeab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-1", + "version": "0.0.1-1058-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-1", + "version": "0.0.1-1058-2", "license": "MIT", "dependencies": { "zod": "^3.24.2" diff --git a/package.json b/package.json index 7b8ab02..95f8614 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-1", + "version": "0.0.1-1058-2", "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", From d8293a5e76ff6cf2e559cfb5376b2ab65871d68a Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Wed, 21 May 2025 13:32:08 -0300 Subject: [PATCH 5/7] OZN-1058 feat #time 10m add CancelReservationSchema --- src/types/resource-pool-management.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/types/resource-pool-management.ts b/src/types/resource-pool-management.ts index aa1f940..6a74863 100644 --- a/src/types/resource-pool-management.ts +++ b/src/types/resource-pool-management.ts @@ -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; export type ResourcePoolManagementInput = z.infer; export type ResourcePoolManagementOutput = z.infer; From 408a64fd1207ce55a290a3698b6fa3e46886f823 Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Wed, 21 May 2025 13:32:29 -0300 Subject: [PATCH 6/7] chore: bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 07dbeab..dda6360 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-2", + "version": "0.0.1-1058-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-2", + "version": "0.0.1-1058-3", "license": "MIT", "dependencies": { "zod": "^3.24.2" diff --git a/package.json b/package.json index 95f8614..dfbabd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-2", + "version": "0.0.1-1058-3", "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", From 8f3d1070c5040986ed8578009972f2267422497e Mon Sep 17 00:00:00 2001 From: Gabriel Rabelo Date: Wed, 28 May 2025 13:46:48 -0300 Subject: [PATCH 7/7] OZN-1058 feat #time 15m add portReplaceDetailEnum --- package-lock.json | 4 +- package.json | 2 +- src/types/service-ordering.ts | 83 +++++++++++++++++++++-------------- 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index dda6360..4d0b233 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-3", + "version": "0.0.1-1058-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-3", + "version": "0.0.1-1058-4", "license": "MIT", "dependencies": { "zod": "^3.24.2" diff --git a/package.json b/package.json index dfbabd1..372d5cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ozmap/ozn-sdk", - "version": "0.0.1-1058-3", + "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", diff --git a/src/types/service-ordering.ts b/src/types/service-ordering.ts index cbaedf7..f4e1733 100644 --- a/src/types/service-ordering.ts +++ b/src/types/service-ordering.ts @@ -1,21 +1,41 @@ -import { z } from "zod"; +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 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; + export const ServiceOrderInputSchema = z.object({ externalId: z.string(), category: z.string(), @@ -28,9 +48,9 @@ export const ServiceOrderInputSchema = z.object({ z.object({ name: z.string(), value: z.string(), - }) + }), ), - }) + }), ), orderItem: z .array( @@ -40,7 +60,7 @@ export const ServiceOrderInputSchema = z.object({ serviceSpecification: z.array( z.object({ id: z.string(), - }) + }), ), service: z .array( @@ -52,24 +72,19 @@ export const ServiceOrderInputSchema = z.object({ z.object({ name: z.string(), value: z.string(), - characteristic: z - .string() - .nullable() - .optional(), - }) + characteristic: z.string().nullable().optional(), + }), ) .optional(), resource: resourceSchema, - }) + }), ) .max(1), - }) + }), ) .max(1), }); - - export const ServiceOrderOutputSchema = z.object({ id: z.string(), externalId: z.string(), @@ -86,9 +101,9 @@ export const ServiceOrderOutputSchema = z.object({ z.object({ name: z.string(), value: z.string(), - }) + }), ), - }) + }), ), orderItem: z.array( z.object({ @@ -108,16 +123,18 @@ export const ServiceOrderOutputSchema = z.object({ name: z.string().nullable(), description: z.string().nullable(), place: z.array(z.any()), - serviceCharacteristic: z.array(z.object({ - name: z.string(), - value: z.string(), - })), + 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, }), - }) + }), ), });