Overview

Endpoints for staff of AMPOS restaurant to manage orders.

Version information

Version : 1.0.0

Contact information

Contact : Howard Wang
Contact Email : idontwannarock@gmail.com

URI scheme

Host : localhost
BasePath : /

Tags

  • Endpoints for Managing Item or Type : Item Controller

  • Endpoints for Managing Menu : Menu Controller

  • Endpoints for Managing Order : Order Controller

Paths

Creates a New Item

POST /api/item

Parameters

Type Name Description Schema

Body

item
required

Item information for a new item to be created.

Responses

HTTP Code Description Schema

200

OK

201

Item created.
Headers :
location (string)

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Item or Type

Returns a Page of Items Matching Against Optional Keyword

GET /api/item

Parameters

Type Name Description Schema Default

Query

keyword
optional

Optional keyword to match against item name, description, and additional details.

string

Query

page
required

Page number of the results you want to fetch. Starts from 0.

integer (int32)

0

Query

size
required

Total number of the results on a specific page.

integer (int32)

10

Responses

HTTP Code Description Schema

200

OK

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Item or Type

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

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Item or Type

Returns a Specific Item by Their Id

GET /api/item/{id}

Parameters

Type Name Description Schema

Path

id
required

Id of the item to be obtained.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Item or Type

Modifies an Existing Item

PUT /api/item/{id}

Description

Properties that are not provided will be modified as empty value.

Parameters

Type Name Description Schema

Path

id
required

Id of the item to be modified.

integer (int64)

Body

item
required

Item information for an existing item to be modified.

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Item or Type

Creates a New Menu

POST /api/menu

Parameters

Type Name Description Schema

Body

menu
required

Menu information of a menu to be created.

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Menu

Returns List of Available Menus Matching Against Optional Keyword

GET /api/menu

Parameters

Type Name Description Schema

Query

keyword
optional

Optional keyword to match against menu name.

string

Responses

HTTP Code Description Schema

200

OK

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Menu

Returns a Specific Menu by Their Id

GET /api/menu/{id}

Parameters

Type Name Description Schema

Path

id
required

Id of the menu to be obtained.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Menu

Modifies an Existing Menu

PUT /api/menu/{id}

Description

Properties that are not provided will be modified as empty value.

Parameters

Type Name Description Schema

Path

id
required

Id of the menu to be modified.

integer (int64)

Body

menu
required

Menu to be modified with complete content.

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Menu

Disable a menu.

DELETE /api/menu/{id}

Parameters

Type Name Description Schema

Path

id
required

Id of the menu to be disabled.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

204

No Content

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Menu

Places an Order

POST /api/order

Parameters

Type Name Description Schema

Body

items
required

List of items to be ordered.

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Order

Returns a Specific Order by Their Id

GET /api/order/{id}

Parameters

Type Name Description Schema

Path

id
required

Id of the order to be obtained.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Order

Checks a Specific Bill by Their Order Id

PUT /api/order/{id}

Parameters

Type Name Description Schema

Path

id
required

Id of the order to be checked.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Order

Adds Another Item to a Specific Order

POST /api/order/{orderId}/detail

Parameters

Type Name Description Schema

Path

orderId
required

Id of the order to be added another item.

integer (int64)

Body

detail
required

Item and quantity to be added.

Responses

HTTP Code Description Schema

200

OK

201

Created

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes

  • application/json;charset=UTF-8

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Order

Cancels an Item in a Specific Order

DELETE /api/order/{orderId}/detail/{detailId}

Parameters

Type Name Description Schema

Path

detailId
required

Id of the order detail to be canceled.

integer (int64)

Path

orderId
required

Id of the order, which contains the detail to be canceled.

integer (int64)

Responses

HTTP Code Description Schema

200

OK

204

No Content

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

Produces

  • application/json;charset=UTF-8

Tags

  • Endpoints for Managing Order

Definitions

ItemRequestPayload

Class representing an item in request.

Name Description Schema

description
optional

Item description
Example : "A typical Neapolitan pizza, made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt and extra-virgin olive oil."

string

imageLocation
optional

Item image location
Example : "https://i.pinimg.com/originals/fd/34/b0/fd34b03d5d936a024248d0eef5eeee1b.jpg"

string

name
optional

Item name
Example : "Pizza Margherita"

string

price
optional

Item price per unit
Example : 400.0

number

typeIds
optional

Identifiers of item types
Example : [ 1 ]

< integer (int64) > array

ItemResponsePayload

Class representing an item in response.

Name Description Schema

description
optional

Item description

string

id
optional

Identifier of the item

integer (int64)

imageLocation
optional

Item image location

string

name
optional

Item name

string

price
optional

Item price per unit

number

types
optional

Item types (additional details)

< TypePayload > array

MenuRequestPayload

Class representing a menu in request.

Name Description Schema

isAvailable
optional

Availability of the menu
Example : true

boolean

itemIds
optional

Menu items
Example : [ 1, 3, 5 ]

< integer (int64) > array

name
optional

Menu name
Example : "Today’s special"

string

MenuResponsePayload

Class representing a menu in response.

Name Description Schema

id
optional

Identifier of the menu

integer (int64)

items
optional

Items in the menu

name
optional

Menu name

string

OrderDetailRequestPayload

Class representing an item ordered in a request.

Name Description Schema

itemId
optional

Identifier of the ordered item
Example : 1

integer (int64)

quantity
optional

Quantity ordered
Example : 2

integer (int32)

OrderDetailResponsePayload

Class representing an order detail in a response.

Name Description Schema

id
optional

Identifier of the order detail

integer (int64)

item
optional

Item ordered

quantity
optional

Quantity ordered

integer (int32)

OrderResponsePayload

Class representing an order in a response.

Name Description Schema

details
optional

List of ordered items

id
optional

Identifier of the order

integer (int64)

totalAmount
optional

Total amount of the order

number

PageablePayload«ItemResponsePayload»

Class representing a page of results.

Name Description Schema

data
optional

One page of data.

totalElements
optional

Total elements.

integer (int64)

totalPages
optional

Total pages.

integer (int32)

ResponseEntity

Name Schema

body
optional

object

statusCode
optional

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
optional

integer (int32)

TypePayload

Class representing a type(additional detail) of items.

Name Description Schema

id
optional

Unique identifier of the item type(additional detail).
Example : 1

integer (int64)

name
optional

Name of the item type(additional detail).
Example : "Italian"

string