Browse Source

Refine example scenario for eshop

pull/2059/head
Philipp Theyssen 1 year ago
parent
commit
a283d4be46
5 changed files with 116 additions and 29 deletions
  1. +18
    -18
      scenario-definition/operations/op_basket_add_item.json
  2. +5
    -1
      scenario-definition/operations/op_catalog_add_item.json
  3. +18
    -1
      scenario-definition/operations/op_catalog_get_items.json
  4. +19
    -0
      scenario-definition/operations/op_catalog_update_price.json
  5. +56
    -9
      scenario-definition/transactions/add_items_to_basket.json

+ 18
- 18
scenario-definition/operations/op_basket_add_item.json View File

@ -3,35 +3,35 @@
"type": "http",
"httpMethod": "post",
"arguments": [
{
"name": "buyerId",
"required": true,
"type": "guid"
},
{
"name": "items",
"name": "item-1",
"required": true,
"type": "object"
},
{
"name": "buyerId",
{
"name": "item-2",
"required": true,
"type": "guid"
},
],
"dynamicVariables": [
"type": "object"
},
{
"name": "basket-item-id",
"type": "unsignedInt"
"name": "item-3",
"required": true,
"type": "object"
}
]
"payload": {
],
"requestPayload": {
"type": "json",
"content": {
"buyerId": "{{buyerId}}",
"items": [
"id": "1",
"productId": "{{items}}",
"productName": "string",
"unitPrice": 0,
"oldUnitPrice": 0,
"quantity": 0,
"pictureUrl": ""
"{{item-1}}",
"{{item-2}}",
"{{item-3}}"
]
}
},


+ 5
- 1
scenario-definition/operations/op_catalog_add_item.json View File

@ -2,6 +2,10 @@
"id": "catalog-add-item",
"type": "http",
"httpMethod": "post",
"arguments": [
"name": "product-id",
"type": "unsignedInt"
]
"dynamicVariables": [
{
"name": "item-name",
@ -35,7 +39,7 @@
"payload": {
"type": "json",
"content": {
"id": 0,
"id": "{{product-id}}",
"name": "{{item-name}}",
"description": "{{item-description}}",
"price": "{{price}}",


+ 18
- 1
scenario-definition/operations/op_catalog_get_items.json View File

@ -7,6 +7,23 @@
"key": "pageSize",
"value": 3
}
],
],
"returnValues": [
{
"key": "item-1",
"value": "@@response.payload.data[0]@@",
"type": "object"
},
{
"key": "item-2",
"value": "@@response.payload.data[1]@@",
"type": "object"
},
{
"key": "item-3",
"value": "@@response.payload.data[2]@@",
"type": "object"
}
]
"url": "http://localhost:5101/catalog-api/api/v1/Catalog/items"
}

+ 19
- 0
scenario-definition/operations/op_catalog_update_price.json View File

@ -0,0 +1,19 @@
{
"id": "catalog-update-price",
"type": "http",
"httpMethod": "put",
"arguments": [
{
"name": "item-1",
"required": true,
"type": "object"
}
],
"payload": {
"type": "json",
"content": {
"{{item-1}}"
}
},
"url": "http://localhost:5101/catalog-api/api/v1/Catalog/items"
}

+ 56
- 9
scenario-definition/transactions/add_items_to_basket.json View File

@ -1,17 +1,64 @@
transaction:
"transaction":
{
"id": "add-items-to-basket",
"operations": [
"arguments": [
{
operationRefId: "catalog-get-items",
id: "op-1",
"name": "user-id",
"type": "guid"
}
],
"operations": [
{
"operationRefId": "catalog-get-items",
"id": "op-1",
},
{
operationRefId: "op-id-2",
id: "second-op-in-this-transaction",
arguments: [
userId,
@first-op-in-this-transaction.response.id
"operationRefId": "basket-add-item",
"id": "op-2",
"providedValues": [
{
"key": "buyerId",
"value": "{{user-id}}"
},
{
"key": "item-1",
"value":
{
"id": "1",
"productId": "@@op-1.response[0].id@@",
"productName": "@@op-1.response[0].name@@",
"unitPrice": "@@op-1.response[0].price@@",
"oldUnitPrice": "@@op-1.response[0].price@@",
"quantity": "@@op-1.response[0].availablestock@@",
"pictureUrl": ""
},
},
{
"key": "item-2",
"value":
{
"id": "2",
"productId": "@@op-1.response[1].id@@",
"productName": "@@op-1.response[1].name@@",
"unitPrice": "@@op-1.response[1].price@@",
"oldUnitPrice": "@@op-1.response[1].price@@",
"quantity": "@@op-1.response[1].availablestock@@",
"pictureUrl": ""
},
},
{
"key": "item-3",
"value":
{
"id": "3",
"productId": "@@op-1.response[2].id@@",
"productName": "@@op-1.response[2].name@@",
"unitPrice": "@@op-1.response[2].price@@",
"oldUnitPrice": "@@op-1.response[2].price@@",
"quantity": "@@op-1.response[2].availablestock@@",
"pictureUrl": ""
}
}
]
}
]


Loading…
Cancel
Save