Overview
Endpoints for staff of AMPOS restaurant to manage orders.
Contact information
Contact : Howard Wang
Contact Email : idontwannarock@gmail.com
Paths
Creates a New Item
POST /api/item
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
item |
Item information for a new item to be created. |
Returns a Page of Items Matching Against Optional Keyword
GET /api/item
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Query |
keyword |
Optional keyword to match against item name, description, and additional details. |
string |
|
Query |
page |
Page number of the results you want to fetch. Starts from 0. |
integer (int32) |
|
Query |
size |
Total number of the results on a specific page. |
integer (int32) |
|
Returns List of All Item Types
GET /api/item/type
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
OK |
< TypePayload > array |
401 |
Unauthorized |
No Content |
403 |
Forbidden |
No Content |
404 |
Not Found |
No Content |
Returns a Specific Item by Their Id
GET /api/item/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the item to be obtained. |
integer (int64) |
Modifies an Existing Item
PUT /api/item/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the item to be modified. |
integer (int64) |
Body |
item |
Item information for an existing item to be modified. |
Creates a New Menu
POST /api/menu
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
menu |
Menu information of a menu to be created. |
Returns List of Available Menus Matching Against Optional Keyword
GET /api/menu
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
keyword |
Optional keyword to match against menu name. |
string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
OK |
< MenuResponsePayload > array |
401 |
Unauthorized |
No Content |
403 |
Forbidden |
No Content |
404 |
Not Found |
No Content |
Returns a Specific Menu by Their Id
GET /api/menu/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the menu to be obtained. |
integer (int64) |
Modifies an Existing Menu
PUT /api/menu/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the menu to be modified. |
integer (int64) |
Body |
menu |
Menu to be modified with complete content. |
Disable a menu.
DELETE /api/menu/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the menu to be disabled. |
integer (int64) |
Places an Order
POST /api/order
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
items |
List of items to be ordered. |
< OrderDetailRequestPayload > array |
Returns a Specific Order by Their Id
GET /api/order/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the order to be obtained. |
integer (int64) |
Checks a Specific Bill by Their Order Id
PUT /api/order/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
Id of the order to be checked. |
integer (int64) |
Adds Another Item to a Specific Order
POST /api/order/{orderId}/detail
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
orderId |
Id of the order to be added another item. |
integer (int64) |
Body |
detail |
Item and quantity to be added. |
Cancels an Item in a Specific Order
DELETE /api/order/{orderId}/detail/{detailId}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
detailId |
Id of the order detail to be canceled. |
integer (int64) |
Path |
orderId |
Id of the order, which contains the detail to be canceled. |
integer (int64) |
Definitions
ItemRequestPayload
Class representing an item in request.
Name | Description | Schema |
---|---|---|
description |
Item description |
string |
imageLocation |
Item image location |
string |
name |
Item name |
string |
price |
Item price per unit |
number |
typeIds |
Identifiers of item types |
< integer (int64) > array |
ItemResponsePayload
Class representing an item in response.
Name | Description | Schema |
---|---|---|
description |
Item description |
string |
id |
Identifier of the item |
integer (int64) |
imageLocation |
Item image location |
string |
name |
Item name |
string |
price |
Item price per unit |
number |
types |
Item types (additional details) |
< TypePayload > array |
MenuRequestPayload
Class representing a menu in request.
Name | Description | Schema |
---|---|---|
isAvailable |
Availability of the menu |
boolean |
itemIds |
Menu items |
< integer (int64) > array |
name |
Menu name |
string |
MenuResponsePayload
Class representing a menu in response.
Name | Description | Schema |
---|---|---|
id |
Identifier of the menu |
integer (int64) |
items |
Items in the menu |
< ItemResponsePayload > array |
name |
Menu name |
string |
OrderDetailRequestPayload
Class representing an item ordered in a request.
Name | Description | Schema |
---|---|---|
itemId |
Identifier of the ordered item |
integer (int64) |
quantity |
Quantity ordered |
integer (int32) |
OrderDetailResponsePayload
Class representing an order detail in a response.
Name | Description | Schema |
---|---|---|
id |
Identifier of the order detail |
integer (int64) |
item |
Item ordered |
|
quantity |
Quantity ordered |
integer (int32) |
OrderResponsePayload
Class representing an order in a response.
Name | Description | Schema |
---|---|---|
details |
List of ordered items |
< OrderDetailResponsePayload > array |
id |
Identifier of the order |
integer (int64) |
totalAmount |
Total amount of the order |
number |
PageablePayload«ItemResponsePayload»
Class representing a page of results.
Name | Description | Schema |
---|---|---|
data |
One page of data. |
< ItemResponsePayload > array |
totalElements |
Total elements. |
integer (int64) |
totalPages |
Total pages. |
integer (int32) |
ResponseEntity
Name | Schema |
---|---|
body |
object |
statusCode |
enum (100 CONTINUE, 101 SWITCHING_PROTOCOLS, 102 PROCESSING, 103 CHECKPOINT, 200 OK, 201 CREATED, 202 ACCEPTED, 203 NON_AUTHORITATIVE_INFORMATION, 204 NO_CONTENT, 205 RESET_CONTENT, 206 PARTIAL_CONTENT, 207 MULTI_STATUS, 208 ALREADY_REPORTED, 226 IM_USED, 300 MULTIPLE_CHOICES, 301 MOVED_PERMANENTLY, 302 FOUND, 302 MOVED_TEMPORARILY, 303 SEE_OTHER, 304 NOT_MODIFIED, 305 USE_PROXY, 307 TEMPORARY_REDIRECT, 308 PERMANENT_REDIRECT, 400 BAD_REQUEST, 401 UNAUTHORIZED, 402 PAYMENT_REQUIRED, 403 FORBIDDEN, 404 NOT_FOUND, 405 METHOD_NOT_ALLOWED, 406 NOT_ACCEPTABLE, 407 PROXY_AUTHENTICATION_REQUIRED, 408 REQUEST_TIMEOUT, 409 CONFLICT, 410 GONE, 411 LENGTH_REQUIRED, 412 PRECONDITION_FAILED, 413 PAYLOAD_TOO_LARGE, 413 REQUEST_ENTITY_TOO_LARGE, 414 URI_TOO_LONG, 414 REQUEST_URI_TOO_LONG, 415 UNSUPPORTED_MEDIA_TYPE, 416 REQUESTED_RANGE_NOT_SATISFIABLE, 417 EXPECTATION_FAILED, 418 I_AM_A_TEAPOT, 419 INSUFFICIENT_SPACE_ON_RESOURCE, 420 METHOD_FAILURE, 421 DESTINATION_LOCKED, 422 UNPROCESSABLE_ENTITY, 423 LOCKED, 424 FAILED_DEPENDENCY, 426 UPGRADE_REQUIRED, 428 PRECONDITION_REQUIRED, 429 TOO_MANY_REQUESTS, 431 REQUEST_HEADER_FIELDS_TOO_LARGE, 451 UNAVAILABLE_FOR_LEGAL_REASONS, 500 INTERNAL_SERVER_ERROR, 501 NOT_IMPLEMENTED, 502 BAD_GATEWAY, 503 SERVICE_UNAVAILABLE, 504 GATEWAY_TIMEOUT, 505 HTTP_VERSION_NOT_SUPPORTED, 506 VARIANT_ALSO_NEGOTIATES, 507 INSUFFICIENT_STORAGE, 508 LOOP_DETECTED, 509 BANDWIDTH_LIMIT_EXCEEDED, 510 NOT_EXTENDED, 511 NETWORK_AUTHENTICATION_REQUIRED) |
statusCodeValue |
integer (int32) |