Skip to content

Commit

Permalink
Adjusted .http file to match the WebApi routes
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz authored Oct 22, 2024
1 parent 955a405 commit 0750f48
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions .http
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
@clientId = dummy
@productId = dummy
@unitPrice = 100
@guestId = dummy
@roomId = dummy

### Add Product
### Check In

POST http://localhost:3000/clients/{{clientId}}/shopping-carts/current/product-items HTTP/1.1
# @name checkin
POST http://localhost:3000/guests/{{guestId}}/stays/{{roomId}} HTTP/1.1
content-type: application/json

{
"productId": "{{productId}}",
"quantity": 10
}
### No body passed

### Capture and parse the Location header
@location = {{checkin.response.headers.Location}}

### Get State

GET http://localhost:3000/clients/{{clientId}}/shopping-carts/current HTTP/1.1
GET http://localhost:3000{{location}} HTTP/1.1
content-type: application/json

### Record Charge

### Remove Product
@amount = 10

@quantity = 1

DELETE http://localhost:3000/clients/{{clientId}}/shopping-carts/current/product-items?productId={{productId}}&quantity={{quantity}}&unitPrice={{unitPrice}} HTTP/1.1
POST http://localhost:3000{{location}}/charges HTTP/1.1
content-type: application/json

### CONFIRM
{
"amount": {{amount}}
}

### Record Payment

@amount = 10

POST http://localhost:3000/clients/{{clientId}}/shopping-carts/current/confirm HTTP/1.1
POST http://localhost:3000{{location}}/payments HTTP/1.1
content-type: application/json

{
"amount": {{amount}}
}

### Cancel
### Checkout

POST http://localhost:3000/clients/{{clientId}}/shopping-carts/current HTTP/1.1
DELETE http://localhost:3000{{location}} HTTP/1.1
content-type: application/json

0 comments on commit 0750f48

Please sign in to comment.