Skip to content

Commit

Permalink
Merge branch 'main' into update-kraken-app-portal
Browse files Browse the repository at this point in the history
  • Loading branch information
KsiBart authored Nov 7, 2024
2 parents 71ac828 + 6885516 commit 8f353bc
Show file tree
Hide file tree
Showing 56 changed files with 1,124 additions and 517 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=mycloudnexus_kraken_java
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.projectKey=${{ vars.SONAR_JAVA_PROJECT_KEY }}

nodejs-unit-test:
name: nodejs-unit-test
Expand Down Expand Up @@ -119,4 +119,8 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ vars.SONAR_ORGANIZATION }}
-Dsonar.projectKey=${{ vars.SONAR_NODEJS_PROJECT_KEY }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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)}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,mefRequestBody[relatedContactInformation]?:'')}",
"quoteItem": [
{
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,14 @@ spec:
targetLocation: BODY
customizedField: false
requiredMapping: true
- name: mapper.order.eline.add.product.id
title: product instance id
description: ""
source: ""
sourceLocation: BODY
target: "@{{productOrderItem[0].product.id}}"
targetLocation: BODY
customizedField: false
requiredMapping: false


Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,13 @@ spec:
sourceLocation: BODY
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.product.id
title: product instance id
description: ""
source: ""
sourceLocation: BODY
target: "@{{productOrderItem[0].product.id}}"
targetLocation: BODY
customizedField: false
requiredMapping: false

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ spec:
"externalId":"${entity.request[externalId]?:''}",
"productRelationship":"${entity.request.productOrderItem[0].product.productRelationship}",
"billingAccount":"${entity.request.productOrderItem[0].billingAccount}",
"productOrderItem":"${entity.renderedResponse.productOrderItem}"
"productOrderItem":[
{
"productOrderHref":"",
"productOrderItemId":"${entity.renderedResponse.productOrderItem[0]['id']}",
"productOrderId":"${entity.renderedResponse['orderId']}"
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ spec:
"externalId":"${entity.request[externalId]?:''}",
"productRelationship":"${entity.request.productOrderItem[0].product.productRelationship}",
"billingAccount":"${entity.request.productOrderItem[0].billingAccount}",
"productOrderItem":"${entity.renderedResponse.productOrderItem}"
"productOrderItem":[
{
"productOrderHref":"",
"productOrderItemId":"${entity.renderedResponse.productOrderItem[0]['id']}",
"productOrderId":"${entity.renderedResponse['orderId']}"
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
{
"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)}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation', env.seller.name, env.seller.emailAddress, env.seller.number, mefRequestBody[relatedContactInformation]?:'')}",
"quoteItem": [{
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}",
"product": "${mefRequestBody.quoteItem[0].product}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
{
"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)}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation', env.seller.name, env.seller.emailAddress, env.seller.number, mefRequestBody[relatedContactInformation]?:'')}",
"quoteItem": [
{
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ links:
- targetAssetKey: mef.sonata.api-target-mapper.address.validate
relationship: implementation.target-mapper
group: mef.sonata.api-target.address.validate
- targetAssetKey: mef.sonata.api.matrix.address.validate
- targetAssetKey: mef.sonata.api.matrix.address.validation
relationship: implementation.matrix
group: mef.sonata.api-target.address.validate
- targetAssetKey: mef.sonata.api-target-mapper.address.retrieve
relationship: implementation.target-mapper
group: mef.sonata.api-target.address.retrieve
group: mef.sonata.api-target.address.retrieve



Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,41 @@ spec:
console.log("input: " + jsonStr);
let input = JSON.parse(jsonStr);
let targetAPIConfigKey = '';
if(input.productOrderItem['product']['productConfiguration']['@type'] == 'UNI' && input.productOrderItem['action'] == 'add') {
let matrixConfigKey = '';
let errorMsg = '';
let type = input.productOrderItem['product']['productConfiguration']['@type'];
let action = input.productOrderItem['action'];
let typeArr = ['UNI', 'ACCESS_E_LINE'];
let actionArr = ['add', 'delete'];
if(type == 'UNI' && action == 'add') {
targetAPIConfigKey = 'mef.sonata.api-target.order.uni.add';
matrixConfigKey = 'mef.sonata.api.matrix.order.uni.add'
} else if(input.productOrderItem['product']['productConfiguration']['@type'] == 'ACCESS_E_LINE' && input.productOrderItem['action'] == 'add') {
} else if(type == 'ACCESS_E_LINE' && action == 'add') {
targetAPIConfigKey = 'mef.sonata.api-target.order.eline.add';
matrixConfigKey = 'mef.sonata.api.matrix.order.eline.add'
} else if(input.productOrderItem['product']['productConfiguration']['@type'] == 'UNI' && input.productOrderItem['action'] == 'delete') {
} else if(type == 'UNI' && action == 'delete') {
targetAPIConfigKey = 'mef.sonata.api-target.order.uni.delete';
matrixConfigKey = 'mef.sonata.api.matrix.order.uni.delete'
} else if(input.productOrderItem['product']['productConfiguration']['@type'] == 'ACCESS_E_LINE' && input.productOrderItem['action'] == 'delete') {
} else if(type == 'ACCESS_E_LINE' && action == 'delete') {
targetAPIConfigKey = 'mef.sonata.api-target.order.eline.delete';
matrixConfigKey = 'mef.sonata.api.matrix.order.eline.delete'
} else {
errorArr = ['api use case is not supported :'];
if (!typeArr.includes(type)){
errorArr.push(`expect productOrderItem.product.productConfiguration.@type in [ ${typeArr} ], but ${type}.`);
}
if (!actionArr.includes(action)) {
errorArr.push(`expect productOrderItem.action in [ ${actionArr} ], but ${action}`)
}
errorMsg = errorArr.join(' ');
targetAPIConfigKey = 'targetKey:notFound';
}
let ret = {
orderType: input.productOrderItem['product']['productConfiguration']['@type'],
orderAction: input.productOrderItem['action'],
targetAPIConfigKey: targetAPIConfigKey,
matrixConfigKey: matrixConfigKey
matrixConfigKey: matrixConfigKey,
errorMsg: errorMsg
};
return JSON.stringify(ret);
}
Expand Down Expand Up @@ -98,7 +113,6 @@ spec:
env:
path: ${targetApiConfig.endpoints[0].path}
method: ${targetApiConfig.endpoints[0].method}

- id: modify-request-body
actionType: buildin@modify-request-body
env:
Expand Down Expand Up @@ -303,4 +317,4 @@ links:
group: mef.sonata.api-target.order.eline.delete
- targetAssetKey: mef.sonata.api.matrix.order.eline.delete
relationship: implementation.matrix
group: mef.sonata.api-target.order.eline.delete
group: mef.sonata.api-target.order.eline.delete
Loading

0 comments on commit 8f353bc

Please sign in to comment.