Skip to content

Commit

Permalink
fix(sdk): added data type validation rules for order creating (#297)
Browse files Browse the repository at this point in the history
* added data type validation rules for UNI and Eline order creating
  • Loading branch information
xuelianhan007 authored Dec 17, 2024
1 parent fe628c4 commit ea4beb2
Show file tree
Hide file tree
Showing 18 changed files with 317 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ spec:
request:
- name: mapper.order.eline.add.buyerId
title: The unique identifier of the organization that is acting as the a Buyer.
source: "@{{buyerId}}"
target: "@{{username}}"
description:
source: "@{{buyerId}}"
replaceStar: true
sourceLocation: QUERY
target: "@{{username}}"
targetLocation: PATH
customizedField: false
requiredMapping: false
- name: mapper.order.eline.add.duration
title: "order item Term duration"
source: "@{{productOrderItem[0].requestedItemTerm.duration.amount}}"
target: "@{{duration}}"
sourceLocation: BODY
sourceType: constantNumber
target: "@{{duration}}"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.duration.unit
title: "order item Term unit"
source: "@{{productOrderItem[0].requestedItemTerm.duration.units}}"
target: "@{{durationUnit}}"
sourceType: enum
sourceValues:
- calendarMonths
Expand All @@ -49,6 +49,7 @@ spec:
- businessDays
- businessHours
sourceLocation: BODY
target: "@{{durationUnit}}"
targetLocation: BODY
valueMapping:
calendarMonths: m
Expand All @@ -57,22 +58,38 @@ spec:
- name: mapper.order.eline.add.endOfTermAction
title: "MEFEndOfTermAction"
source: "@{{productOrderItem[0].requestedItemTerm.endOfTermAction}}"
target: "roll"
sourceLocation: BODY
sourceType: enum
sourceValues:
- roll
- autoDisconnect
- autoRenew
target: "roll"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.rollInterval.amount
title: " quote item Term roll duration"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.amount}}"
target: ""
sourceLocation: BODY
sourceType: constantNumber
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.rollInterval.units
title: " quote item Term roll unit"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.units}}"
target: ""
sourceLocation: BODY
sourceType: enum
sourceValues:
- calendarYears
- calendarMonths
- calendarDays
- calendarHours
- calendarMinutes
- businessDays
- businessHours
- businessMinutes
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.bandwidthUnit
Expand All @@ -82,83 +99,92 @@ spec:
sourceValues:
- MBPS
- GBPS
target: "MBPS"
sourceLocation: BODY
target: "MBPS"
targetLocation: BODY
valueMapping: {}
requiredMapping: true
- name: mapper.order.eline.add.bandwidth
title: "Bandwidth of the ELINE"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidth}}"
target: "@{{speed}}"
sourceLocation: BODY
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: "@{{speed}}"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.name
title: "The name of the ELINE"
source: "@{{productOrderItem[0].product.productConfiguration.name}}"
target: "@{{name}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{name}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.paymentType
title: "The payment type of the ELINE"
source: "@{{productOrderItem[0].product.productConfiguration.paymentType}}"
target: "@{{paymentType}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{paymentType}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.classOfService
title: "The class of Service of the Eline"
source: "@{{productOrderItem[0].product.productConfiguration.classOfService}}"
target: "@{{classOfService}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{classOfService}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.srcUNI
title: "source UNI or ENNI id"
source: "@{{productOrderItem[0].product.productRelationship[0].id}}"
target: "@{{portId}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{portId}}"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.destUNI
title: "destination UNI id"
source: "@{{productOrderItem[0].product.productRelationship[1].id}}"
target: "@{{destPortId}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{destPortId}}"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.productOffering.id
title: "id of a Product Offering"
source: "@{{productOrderItem[0].product.productOffering.id}}"
target: "ACCESS_E_LINE"
sourceLocation: BODY
sourceType: discreteStr
target: "ACCESS_E_LINE"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.product.productConfiguration.type
title: "connection type"
title: "customized product type"
source: "@{{productOrderItem[0].product.productConfiguration.type}}"
target: "@{{type}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{type}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.destUNIMetroId
title: "connection destUNIMetroId"
title: "The metro id of the destination UNI"
source: "@{{productOrderItem[0].product.productConfiguration.destUNIMetroId}}"
target: "@{{destMetroId}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{destMetroId}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.buyerCompanyId
title: "connection buyerCompanyId"
title: "The Id of buyer Company"
source: "@{{productOrderItem[0].product.productConfiguration.buyerCompanyId}}"
target: "@{{destCompany}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{destCompany}}"
targetLocation: BODY
requiredMapping: false
response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ spec:
title: >-
The unique identifier of the organization that is acting as the a
Buyer.
source: '@{{buyerId}}'
target: "@{{companyName}}"
description: ""
source: '@{{buyerId}}'
sourceLocation: QUERY
target: "@{{companyName}}"
targetLocation: PATH
requiredMapping: false
- name: mapper.order.uni.add.duration
title: "order item Term duration"
source: "@{{productOrderItem[0].requestedItemTerm.duration.amount}}"
sourceLocation: BODY
sourceType: constantNumber
target: "1"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.uni.add.duration.units
title: "order item Term unit"
source: "@{{productOrderItem[0].requestedItemTerm.duration.units}}"
Expand All @@ -49,82 +57,89 @@ spec:
- name: mapper.order.eline.add.endOfTermAction
title: "MEFEndOfTermAction"
source: "@{{productOrderItem[0].requestedItemTerm.endOfTermAction}}"
target: "roll"
sourceLocation: BODY
sourceType: discreteStr
target: "roll"
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.rollInterval.amount
title: " quote item Term roll duration"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.amount}}"
target: ""
sourceLocation: BODY
sourceType: constantNumber
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.rollInterval.units
title: " quote item Term roll unit"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.units}}"
target: ""
sourceLocation: BODY
sourceType: discreteStr
target: "calendarMonths"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.place.id
title: >-
the id of the place where the products' installation must be done.
source: '@{{productOrderItem[0].product.place[0].id}}'
target: '@{{dataCenterFacilityId}}'
description: ''
source: '@{{productOrderItem[0].product.place[0].id}}'
sourceLocation: BODY
sourceType: discreteStr
target: '@{{dataCenterFacilityId}}'
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.place.name
title: the keyName of the place where the products' installation must be done.
source: '@{{productOrderItem[0].product.place[0].keyName}}'
target: '@{{dataCenterFacility}}'
description: ''
source: '@{{productOrderItem[0].product.place[0].keyName}}'
sourceLocation: BODY
sourceType: discreteStr
target: '@{{dataCenterFacility}}'
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.bandwidthUnit
title: "The unit of bandwidth"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidthUnit}}"
sourceLocation: BODY
sourceType: enum
sourceValues:
- MBPS
- GBPS
target: "MBPS"
sourceLocation: BODY
targetLocation: BODY
requiredMapping: true
- name: mapper.order.uni.add.bandwidth
title: "Bandwidth of the UNI"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidth}}"
sourceLocation: BODY
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: "@{{speed}}"
sourceLocation: BODY
targetLocation: BODY
requiredMapping: true
- name: mapper.order.uni.add.name
title: "The name of the UNI"
source: "@{{productOrderItem[0].product.productConfiguration.name}}"
target: "@{{portName}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{portName}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.paymentType
title: "The payment type of the UNI"
source: "@{{productOrderItem[0].product.productConfiguration.paymentType}}"
target: "@{{paymentType}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{paymentType}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.productOffering.id
title: "id of a Product Offering"
source: "@{{productOrderItem[0].product.productOffering.id}}"
target: "UNI"
sourceLocation: BODY
target: "UNI"
targetLocation: BODY
requiredMapping: true
response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ spec:
- name: mapper.quote.uni.add.sync.productConfiguration.bandwidth
source: "@{{quoteItem[0].product.productConfiguration.bandwidth}}"
sourceLocation: BODY
sourceType: constantNumber
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: "@{{connections[*].bandwidth}}"
targetLocation: BODY
requiredMapping: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ spec:
- name: mapper.quote.uni.add.sync.productConfiguration.bandwidth
source: "@{{quoteItem[0].product.productConfiguration.bandwidth}}"
sourceLocation: BODY
sourceType: constantNumber
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: "@{{ports[*].speed}}"
targetLocation: BODY
requiredMapping: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ spec:
path: "$.body.relatedContactInformation[*]"
expectType: EXPECTED_TRUE
value: ${param.emailAddress}
errorMsg: "relatedContactInformation.emailAddress should exist in request"
expectedValueType: String
- name: relatedContactInformation_name
path: "$.body.relatedContactInformation[*]"
expectType: EXPECTED_TRUE
value: ${param.name}
errorMsg: "relatedContactInformation.name should exist in request"
expectedValueType: String
- name: relatedContactInformation_number
path: "$.body.relatedContactInformation[*]"
expectType: EXPECTED_TRUE
value: ${param.number}
errorMsg: "relatedContactInformation.number should exist in request"
expectedValueType: String
- name: relatedContactInformation_role
path: "$.body.relatedContactInformation[*]"
expectType: EXPECTED_TRUE
value: ${param.role}
errorMsg: "relatedContactInformation.role should exist in request"
expectedValueType: String
- name: productOrderItem_id
path: "$.body.productOrderItem[0].id"
expectType: EXPECTED_EXIST
expectType: EXPECTED_STR
value: true
errorMsg: "productOrderItem.id should exist in request"
code: 422
- name: productOrderItem_requestedItemTerm_name
path: "$.body.productOrderItem[0].requestedItemTerm.name"
expectType: EXPECTED_EXIST
expectType: EXPECTED_STR
value: true
errorMsg: "requestedItemTerm.name should exist in request"
code: 422
- name: productOrderItem[0].product.productRelationship[0].relationshipType
path: "$.body.productOrderItem[0].product.productRelationship[0].relationshipType"
expectType: EXPECTED
Expand Down
Loading

0 comments on commit ea4beb2

Please sign in to comment.