java coding problem - calculate the sales tax for different products
./mvnw spring-boot:run
- use a rest client to send a POST request to http://localhost:8080/receipt
sample request 1:
{
"items": [
{
"quantity": 1,
"product": {
"name": "book",
"price": 12.49,
"exempt": true
}
},
{
"quantity": 1,
"product": {
"name": "music CD",
"price": 14.99
}
},
{
"quantity": 1,
"product": {
"name": "book",
"price": 0.85,
"exempt": true
}
}
]
}
sample request 2:
{
"items": [
{
"quantity": 1,
"product": {
"name": "box of chocolates",
"price": 10.00,
"exempt": true,
"imported": true
}
},
{
"quantity": 1,
"product": {
"name": "bottle of perfume",
"price": 47.50,
"imported": true
}
}
]
}