transports 22
DESCRIPTION
TRANSPORTS 22. An easy way to serve orders. INDEX. INTRODUCTION API MOTIVATION GUI. 1 INTRODUCTION. TOPIC: TRANSPORTS COMPANY API URL - http://group22aiss.appspot.com/api/ API DOC URL - http://group22aiss.appspot.com AUTHORS Alberto Rincón Borreguero - [email protected] - PowerPoint PPT PresentationTRANSCRIPT
TRANSPORTS 22An easy way to serve orders
INDEX
1. INTRODUCTION
2. API
3. MOTIVATION
4. GUI
1 INTRODUCTION
• TOPIC: TRANSPORTS COMPANY
• API URL - http://group22aiss.appspot.com/api/
• API DOC URL - http://group22aiss.appspot.com
• AUTHORSo Alberto Rincón Borreguero - [email protected] Rafael Vázquez Sánchez - [email protected] Francisco García Moreno - [email protected]
2 API - RESOURCES
Order:{
"destinationAddress": "Akresh 8",
"sourceAddress": "Aluham, 14",
"refNumber": 7,
"driverID": 0,
"productType": "coffee",
"productQuantity": 20,
"status": "PENDING"
}
Driver:{
"surname": "Baskes","name": "Raphael","id": 1
}
2 API - STATE MACHINE
2 API - USES CASES
2 API - AUTHENTICATION
2 API - METHODS (Auth)
Logging in:• GET - /auth• Parameters (header):
o username: <the user's name here>o password: <the user's password here>
• Response:o The user's auth tokeno E.g.: PPRUD8844200LK3J4JGB22MI444JN1R
2 API - METHODS (Orders)
Create a new order:• POST - /orders/• Request:
{
"destinationAddress": "Sevilla",
"sourceAddress": "Marrakech",
"productType": "drink",
"productQuantity": 1000,
"driverID": 0,
"refNumber": 0,
"status": "PENDING"
}
2 API - METHODS (Orders)
Show a single order:• GET - /orders/{refNumber}• Response:
{
"destinationAddress": "Akresh 8",
"sourceAddress": "Aluham, 14",
"refNumber": 7,
"driverID": 0,
"productType": "coffee",
"productQuantity": 20,
"status": "PENDING“
}
2 API - METHODS (Orders)
List all orders:• GET - /orders/• Response:
[{ "destinationAddress": "Akresh 8", "sourceAddress": "Aluham, 14", "refNumber": 7, "driverID": 0, "productType": "coffee", "productQuantity": 20, "status": "PENDING"},
{ "destinationAddress": "Alame, 7", "sourceAddress": "Hamkinel, 23", "refNumber": 8, "driverID": 0, "productType": "fruit", "productQuantity": 20, "status": "PENDING"}]
2 API - METHODS (Orders)
Update an existing order: *auth required (driver/admin)
• PUT - /orders/{refNumber}• Request:
{
"destinationAddress": "Sevilla",
"sourceAddress": "Marrakech",
"productType": "drink",
"productQuantity": 1000,
"driverID": 2, <-- admin only
"refNumber": 5,
"status": "SHIPPED“ <-- driver only
}
2 API - METHODS (Drivers)
Show a single driver: *auth required (driver/admin)
• GET - /drivers/{driverID}• Response:
{
"surname": "Baskes",
"name": "Rafa",
"id": 1
}
2 API - METHODS (Drivers)
List all drivers: *auth required (admin)
• GET - /drivers/• Response:
[{ "surname": "Baskes", "name": "Rafa", "id": 1},{ "surname": "Garmo", "name": "Fran", "id": 2},
{ "surname": "Rinco", "name": "Albertitou", "id": 3}]
2 API - METHODS (Drivers)
List orders assigned to a driver: *auth required (driver)
• GET - /drivers/{driverID}/orders/• Response:
[{ "destinationAddress": "Alame, 7", "sourceAddress": "Hamkinel, 23", "refNumber": 8, "driverID": 1, "productType": "fruit", "productQuantity": 20, "status": "PENDING"},
{ "destinationAddress": "Krantiun, 8", "sourceAddress": "khonkraniu, 9", "refNumber": 18, "driverID": 3, "productType": "fish", "productQuantity": 20, "status": "PENDING"}]
3 MOTIVATION
WHY TO USE OUR API?
SECURITY: LOG IN TO MANAGE ADVANCED OPTIONS
PERSISTENCE: HAVE ALWAYS YOUR DATA AVAILABLE
IMPLEMENTATION: VERY EASY TO IMPLEMENT
WITH A GREAT DOCUMENTATION
4 GUI - NAVIGATION GRAPH
4 GUI
4 GUI
4 GUI
4 GUI
4 GUI
4 GUI
That’s it
THE END