Add unit 3 content

This commit is contained in:
Elena Oresharova
2020-03-22 11:55:22 +01:00
parent 6a9a1bc4d6
commit 8233703815
63 changed files with 28 additions and 1542 deletions

View File

@@ -1,18 +1,14 @@
### Service Document
GET http://localhost:4004/browse
### Browse Books
GET http://localhost:4004/browse/Books
### Service $metadata document
GET http://localhost:4004/browse/$metadata
### Browse Books with expanded Authors
GET http://localhost:4004/browse/Books?$expand=author
### Browsing Books
GET http://localhost:4004/browse/Books?
# &$select=title,author
# &$expand=currency
# &sap-language=de
### Try to insert into Books
POST http://localhost:4004/browse/Books
Content-Type: application/json
### Browsing Authors
GET http://localhost:4004/admin/Authors?
# &$select=name,dateOfBirth,placeOfBirth
# &$expand=books($select=title;$expand=currency)
# &$filter=ID eq 101
# &sap-language=de
{
"title": "Anna Karenina",
"stock": 10
}

View File

@@ -1,18 +1,15 @@
### List Books with their current stocks
GET http://localhost:4004/admin/Books?$select=ID,stock
### List all Orders
### List all Orders - deep read
GET http://localhost:4004/admin/Orders?
&$expand=Items
### Submit Orders
### Submit Orders - deep insert
POST http://localhost:4004/browse/Orders
Content-Type: application/json
{ "OrderNo":"2019-09...", "Items":[
{ "OrderNo":"1234", "Items":[
{ "book_ID":201, "amount":5 },
{ "book_ID":207, "amount":3 }
]}
# Sending this three times should result in a 409: 5 exceeds stock for book #201
### Try to get the Orders
GET http://localhost:4004/browse/Orders