Also please get the api help from
http://saravan-js.com:10300/swagger-ui.html
===========================================================
Populate catalog
/api/catalogs
[
{
"itemName": "A",
"itemPrice": 10,
"promo1": false,
"promo2": true
},
{
"itemName": "B",
"itemPrice": 5,
"promo1": false,
"promo2": true
},
{
"itemName": "C",
"itemPrice": 4,
"promo1": false,
"promo2": true
},
{
"itemName": "D",
"itemPrice": 3,
"promo1": false,
"promo2": true
},
{
"itemName": "E",
"itemPrice": 8,
"promo1": false,
"promo2": true
},
{
"itemName": "F",
"itemPrice": 2,
"promo1": false,
"promo2": false
},
{
"itemName": "G",
"itemPrice": 10,
"promo1": true,
"promo2": false
},
{
"itemName": "H",
"itemPrice": 9,
"promo1": true,
"promo2": false
},
{
"itemName": "I",
"itemPrice": 7,
"promo1": false,
"promo2": false
}
]
Use case 1 : As per Promo1, second item would be 50% discount
/api/shopping
[
{
"itemName": "I", "counts": 1
},
{
"itemName": "G", "counts": 1
},
{
"itemName": "H", "counts": 2
}
]
Use case 2 : As per Promo2, third item will be free, but third item should be cheaper from the group
/api/shopping
[
{
"itemName": "C", "counts": 2
},
{
"itemName": "A", "counts": 2
},
{
"itemName": "B", "counts": 2
},
{
"itemName": "E", "counts": 1
},
{
"itemName": "F", "counts": 2
}
]
Use Case 3 : Promo 2 third item will be free
/api/shopping
[
{
"itemName": "A", "counts": 3
},
{
"itemName": "B", "counts": 2
}
]
Use Case 4 : Promo 2 third item will be free
/api/shopping
[
{
"itemName": "A", "counts": 3
}
]