From af295f945a8d4fdf6838ff973cfe35556aac2691 Mon Sep 17 00:00:00 2001
From: Philipp Theyssen
Date: Tue, 28 Feb 2023 12:43:49 +0100
Subject: [PATCH] Rewrite using returnValues as implicit arguments
---
.../operations/op_catalog_get_items.json | 56 ++++++++++++++++++-
.../op_catalog_replenish_stock.json | 0
.../transactions/add_items_to_basket.json | 50 +----------------
.../update_catalog_item_price.json | 28 +++++-----
4 files changed, 68 insertions(+), 66 deletions(-)
create mode 100644 scenario-definition/operations/op_catalog_replenish_stock.json
diff --git a/scenario-definition/operations/op_catalog_get_items.json b/scenario-definition/operations/op_catalog_get_items.json
index 8f0bb9df8..e403d6d48 100644
--- a/scenario-definition/operations/op_catalog_get_items.json
+++ b/scenario-definition/operations/op_catalog_get_items.json
@@ -17,7 +17,42 @@
{
"key": "item-1-id",
"value": "response.payload.data[0].id",
+ "type": "unsignedInt"
+ },
+ {
+ "key": "item-1-description",
+ "value": "response.payload.data[0].description",
+ "type": "string"
+ },
+ {
+ "key": "item-1-picture-file-name",
+ "value": "response.payload.data[0].pictureFileName",
+ "type": "string"
+ },
+ {
+ "key": "item-1-picture-uri",
+ "value": "response.payload.data[0].pictureUri",
"type": "string"
+ },
+ {
+ "key": "item-1-catalog-type-id",
+ "value": "response.payload.data[0].catalogTypeId",
+ "type": "unsignedInt"
+ },
+ {
+ "key": "item-1-catalog-type",
+ "value": "response.payload.data[0].catalogType",
+ "type": "object"
+ },
+ {
+ "key": "item-1-catalog-brand-id",
+ "value": "response.payload.data[0].catalogBrandId",
+ "type": "unsignedInt"
+ },
+ {
+ "key": "item-1-catalog-brand",
+ "value": "response.payload.data[0].catalogBrand",
+ "type": "object"
},
{
"key": "item-1-name",
@@ -31,9 +66,24 @@
},
{
"key": "item-1-avialable-stock",
- "value": "response.payload.data[0].availablestock",
+ "value": "response.payload.data[0].availableStock",
+ "type": "unsignedInt"
+ },
+ {
+ "key": "item-1-restock-threshold",
+ "value": "response.payload.data[0].restockThreshold",
+ "type": "unsignedInt"
+ },
+ {
+ "key": "item-1-max-stock-threshold",
+ "value": "response.payload.data[0].maxStockThreshold",
"type": "unsignedInt"
},
+ {
+ "key": "item-1-on-reorder",
+ "value": "response.payload.data[0].onReorder",
+ "type": "bool"
+ },
{
"key": "item-2",
"value": "response.payload.data[1]",
@@ -42,7 +92,7 @@
{
"key": "item-2-id",
"value": "response.payload.data[1].id",
- "type": "string"
+ "type": "unsignedInt"
},
{
"key": "item-2-name",
@@ -67,7 +117,7 @@
{
"key": "item-3-id",
"value": "response.payload.data[2].id",
- "type": "string"
+ "type": "unsignedInt"
},
{
"key": "item-3-name",
diff --git a/scenario-definition/operations/op_catalog_replenish_stock.json b/scenario-definition/operations/op_catalog_replenish_stock.json
new file mode 100644
index 000000000..e69de29bb
diff --git a/scenario-definition/transactions/add_items_to_basket.json b/scenario-definition/transactions/add_items_to_basket.json
index be5b46ddf..81938905c 100644
--- a/scenario-definition/transactions/add_items_to_basket.json
+++ b/scenario-definition/transactions/add_items_to_basket.json
@@ -5,55 +5,7 @@
{
"name": "user-id",
"type": "guid"
- },
- {
- "name": "item-1-id",
- "type": "string"
- },
- {
- "name": "item-1-name",
- "type": "string"
- },
- {
- "name": "item-1-price",
- "type": "unsignedInt"
- },
- {
- "name": "item-1-available-stock",
- "type": "unsignedInt"
- },
- {
- "name": "item-2-id",
- "type": "string"
- },
- {
- "name": "item-2-name",
- "type": "string"
- },
- {
- "name": "item-2-price",
- "type": "unsignedInt"
- },
- {
- "name": "item-2-available-stock",
- "type": "unsignedInt"
- },
- {
- "name": "item-3-id",
- "type": "string"
- },
- {
- "name": "item-3-name",
- "type": "string"
- },
- {
- "name": "item-3-price",
- "type": "unsignedInt"
- },
- {
- "name": "item-3-available-stock",
- "type": "unsignedInt"
- },
+ }
],
"operations": [
{
diff --git a/scenario-definition/transactions/update_catalog_item_price.json b/scenario-definition/transactions/update_catalog_item_price.json
index 2f3b6fb02..c7c8258eb 100644
--- a/scenario-definition/transactions/update_catalog_item_price.json
+++ b/scenario-definition/transactions/update_catalog_item_price.json
@@ -20,20 +20,20 @@
"key": "item-1",
"value":
{
- "id": "@@op-1.response.data[0].id@@"
- "name": "@@op-1.response.data[0].name@@"
- "description": "@@op-1.response.data[0].description@@"
- "price": "{{new-price}}"
- "pictureFileName": "@@op-1.response.data[0].pictureFileName@@"
- "pictureUri": "@@op-1.response.data[0].pictureUri@@"
- "catalogTypeId": "@@op-1.response.data[0].catalogTypeId@@"
- "catalogType": "@@op-1.response.data[0].catalogType@@"
- "catalogBrandId": "@@op-1.response.data[0].catalogBrandId@@"
- "catalogBrand": "@@op-1.response.data[0].catalogBrand@@"
- "availableStock": "@@op-1.response.data[0].availableStock@@"
- "restockThreshold": "@@op-1.response.data[0].restockThreshold@@"
- "maxStockThreshold": "@@op-1.response.data[0].maxStockThreshold@@"
- "onReorder": "@@op-1.response.data[0].onReorder@@"
+ "id": "{{item-1-id}}",
+ "name": "{{item-1-name}}",
+ "description": "{{item-1-description}}",
+ "price": "{{new-price}}",
+ "pictureFileName": "{{item-1-picture-file-name}}",
+ "pictureUri": "{{item-1-picture-uri}}",
+ "catalogTypeId": "{{item-1-catalog-type-id}}",
+ "catalogType": "{{item-1-catalog-type}}",
+ "catalogBrandId": "{{item-1-catalog-brand-id}}",
+ "catalogBrand": "{{item-1-catalog-brand}}}",
+ "availableStock": "{{item-1-avialable-stock}}",
+ "restockThreshold": "{{item-1-restock-threshold}}",
+ "maxStockThreshold": "{{item-1-max-stock-threshold}}",
+ "onReorder": "{{item-1-on-reorder}}"
}
]
}