Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): improvement of build-in process to delete nodes #45

Merged
merged 14 commits into from
Nov 4, 2024
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

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 23 additions & 4 deletions kraken-app/kraken-app-hub/src/main/resources/mock/product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ spec:
#- classpath:/mock/apis/api.quote.yaml
#- classpath:/mock/apis/api.address.yaml
#- classpath:/mock/apis/api.product.offering.yaml
#- classpath:/mock/apis/api.inventory.yaml
#- classpath:/mock/api-specs/api-spec.order.yaml
#- classpath:/mock/api-specs/api-spec.address.yaml
#- classpath:/mock/api-specs/api-spec.quote.yaml
#- classpath:/mock/api-specs/api-spec.product.offering.yaml
#- classpath:/mock/api-specs/api-spec.inventory.yaml
#- classpath:/mock/api-targets/api-target.order.uni.add.yaml
#- classpath:/mock/api-targets/api-target.order.eline.add.yaml
#- classpath:/mock/api-targets/api-target.order.uni.read.yaml
Expand All @@ -35,6 +37,10 @@ spec:
#- classpath:/mock/api-targets/api-target.product.offering.eline.add.yaml
#- classpath:/mock/api-targets/api-target.product.offering.uni.read.yaml
#- classpath:/mock/api-targets/api-target.product.offering.eline.read.yaml
#- classpath:/mock/api-targets/api-target.inventory.uni.list.yaml
#- classpath:/mock/api-targets/api-target.inventory.uni.read.yaml
#- classpath:/mock/api-targets/api-target.inventory.eline.list.yaml
#- classpath:/mock/api-targets/api-target.inventory.eline.read.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.order.uni.add.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.order.eline.add.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.order.uni.read.yaml
Expand All @@ -55,7 +61,20 @@ spec:
#- classpath:/mock/api-targets-mappers/api-target-mapper.product.offering.eline.add.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.product.offering.uni.read.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.product.offering.eline.read.yaml
- classpath:/mock/mapping-matrix/mapping.matrix.order.yaml
- classpath:/mock/mapping-matrix/mapping.matrix.quote.yaml
- classpath:/mock/mapping-matrix/mapping.matrix.address.validation.yaml

#- classpath:/mock/api-targets-mappers/api-target-mapper.inventory.eline.list.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider to remove commented out code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inventory is in use now. So this line will be reserved for fast testing in future.

#- classpath:/mock/api-targets-mappers/api-target-mapper.inventory.eline.read.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.inventory.uni.list.yaml
#- classpath:/mock/api-targets-mappers/api-target-mapper.inventory.uni.read.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.address.validation.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.order.uni.add.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.order.uni.delete.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.order.eline.delete.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.order.eline.add.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.quote.uni.add.sync.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.quote.eline.add.sync.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.inventory.uni.read.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.inventory.eline.read.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.inventory.uni.list.yaml
#- classpath:/mock/mapping-matrix/mapping.matrix.inventory.eline.list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ void testResponseMapper() {
"/mock/api-targets-mappers/api-target-mapper.order.uni.add.yaml");
validate(expectedOrder, input4);

String expectedQuote = readCompactedFile("expected/expected-quote.json");
String expectedQuote = readCompactedFile("expected/expected-quote.eline.add.json");
String input5 =
getTarget(
"/mock/api-targets/api-target.quote.eline.add.yaml",
"/mock/api-targets-mappers/api-target-mapper.quote.eline.add.yaml");
validate(expectedQuote, input5);

expectedQuote = readCompactedFile("expected/expected-quote.uni.add.json");
String input6 =
getTarget(
"/mock/api-targets/api-target.quote.uni.add.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
"@type": "FieldedAddress",
"country": "${responseBody[*].company.addresses[0].country}",
"city": "${responseBody[*].company.addresses[0].city}",
"streetName": "${responseBody[*].company.addresses[0].address}"
"streetName": "${responseBody[*].company.addresses[0].address}",
"locality": "${responseBody[*].dataCenterFacility.metroId}"
}
],
"provideAlternative": "${mefRequestBody.provideAlternative}",
"submittedGeographicAddress": "${mefRequestBody.submittedGeographicAddress}",
"bestMatchGeographicAddress": {
"id": "123",
"type": "FieldedAddress",
"@type": "FieldedAddress",
"city": "Sydney",
"country": "Sydney"
"country": "Sydney",
"streetName": ""
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "${entity.id}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,entity.request.relatedContactInformation)}",
"buyerRequestedQuoteLevel": "${entity.request.buyerRequestedQuoteLevel}",
"quoteItem": [
{
Expand All @@ -10,7 +11,7 @@
"quoteItemPrice": "${entity.renderedResponse.quoteItem[0].quoteItemPrice}"
}
],
"quoteDate": "now",
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${entity.request[externalId]?:''}",
"instantSyncQuote": "${entity.request[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${entity.request[requestedQuoteCompletionDate]?:''}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"id": "${responseBody.id}",
"type": "FieldedAddress",
"@type": "FieldedAddress",
"associatedGeographicAddress": {
"country": "${responseBody.company.addresses[0].country}",
"city": "${responseBody.company.addresses[0].city}",
"streetName": "${responseBody.company.addresses[0].address}"
"streetName": "${responseBody.company.addresses[0].address}",
"locality": "${responseBody.associatedGeographicAddress.locality}"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "${entity.id}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,entity.request.relatedContactInformation)}",
"buyerRequestedQuoteLevel": "${entity.request.buyerRequestedQuoteLevel}",
"quoteItem": [
{
Expand All @@ -17,7 +18,7 @@
]
}
],
"quoteDate": "function.now()",
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${entity.request[externalId]?:''}",
"instantSyncQuote": "${entity.request[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${entity.request[requestedQuoteCompletionDate]?:''}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
]
}
],
"quoteDate": "now",
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${mefRequestBody[externalId]?:''}",
"instantSyncQuote": "${mefRequestBody[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${mefRequestBody[requestedQuoteCompletionDate]?:''}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation(env.seller.role, env.seller.name, env.seller.emailAddress, env.seller.number, mefRequestBody.relatedContactInformation)}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation(env.seller.role,env.seller.name,env.seller.emailAddress,env.seller.number,mefRequestBody.relatedContactInformation)}",
"id": "${entity.id}",
"orderDate": "function.now()",
"orderDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"productOrderItem": "${mefRequestBody.productOrderItem}",
"state": "${responseBody.status}",
"orderId":"${responseBody.id}",
"instanceId":"${responseBody.port.id}"
"orderId": "${responseBody.id}",
"instanceId": "${responseBody.port.id}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"id": "${entity.id}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,mefRequestBody.relatedContactInformation)}",
"buyerRequestedQuoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"quoteItem": [
{
"quoteItem": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}}",
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}}",
"product": "${mefRequestBody.quoteItem[0].product}",
"state": "answered",
"quoteItemPrice": [
{
"price": {
"dutyFreeAmount": {
"unit": "USD",
"value": "${responseBody.results[0].price}"
}
}
}
]
}
],
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${mefRequestBody[externalId]?:''}",
"instantSyncQuote": "${mefRequestBody[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${mefRequestBody[requestedQuoteCompletionDate]?:''}",
"quoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"state": "((mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value==''?'unableToProvide':'approved.orderable'))"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"id": "${entity.id}",
"buyerRequestedQuoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,mefRequestBody.relatedContactInformation)}",
"quoteItem": [
{
"quoteItem": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}}",
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}}",
"product": "${mefRequestBody.quoteItem[0].product}",
"state": "answered",
"quoteItemPrice": [
{
"price": {
"dutyFreeAmount": {
"unit": "USD",
"value": "${responseBody.results[0].price}"
}
}
}
]
}
],
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${mefRequestBody[externalId]?:''}",
"instantSyncQuote": "${mefRequestBody[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${mefRequestBody[requestedQuoteCompletionDate]?:''}",
"quoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"state": "((mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value==''?'unableToProvide':'approved.orderable'))"
}
Loading
Loading