Skip to main content

Get Tasks by Station

Retrieves all tasks assigned to a specific kitchen station, optionally filtered by status.

Path Parameters

station
string
required
The kitchen station identifier. Must be one of:
  • BAR - Beverage preparation station
  • HOT_KITCHEN - Hot food preparation station
  • COLD_KITCHEN - Cold food preparation station

Query Parameters

status
string
Filter tasks by status. If omitted, returns all tasks for the station. Valid values:
  • PENDING - Tasks waiting to start
  • IN_PREPARATION - Tasks currently being prepared
  • COMPLETED - Finished tasks

Response

Returns an array of task objects:
id
long
Unique identifier for the task
orderId
long
ID of the order this task belongs to
station
string
Station assigned to this task (BAR, HOT_KITCHEN, or COLD_KITCHEN)
tableNumber
string
Table number for the order
products
array
List of products to prepare in this task. Each product has:
  • name - Product name
  • type - Product type (DRINK, HOT_DISH, COLD_DISH)
createdAt
string
Timestamp when the task was created (ISO 8601 format)
status
string
Current task status (PENDING, IN_PREPARATION, or COMPLETED)
startedAt
string
Timestamp when the task preparation started (null if not started)
completedAt
string
Timestamp when the task was completed (null if not completed)

Example Request - All Tasks

curl http://localhost:8080/api/tasks/station/HOT_KITCHEN

Example Request - Filtered by Status

curl http://localhost:8080/api/tasks/station/BAR?status=PENDING

Example Response

[
  {
    "id": 1,
    "orderId": 5,
    "station": "HOT_KITCHEN",
    "tableNumber": "5",
    "products": [
      {
        "name": "Grilled Chicken",
        "type": "HOT_DISH"
      },
      {
        "name": "Pasta Carbonara",
        "type": "HOT_DISH"
      }
    ],
    "createdAt": "2026-03-06T10:30:45.123",
    "status": "PENDING",
    "startedAt": null,
    "completedAt": null
  },
  {
    "id": 2,
    "orderId": 6,
    "station": "HOT_KITCHEN",
    "tableNumber": "3",
    "products": [
      {
        "name": "Steak",
        "type": "HOT_DISH"
      }
    ],
    "createdAt": "2026-03-06T10:25:30.456",
    "status": "IN_PREPARATION",
    "startedAt": "2026-03-06T10:26:00.789",
    "completedAt": null
  }
]

Error Responses

400 Bad Request - Invalid Station:
{
  "error": "Invalid value 'INVALID_STATION' for parameter 'station'. Expected one of: BAR, HOT_KITCHEN, COLD_KITCHEN",
  "message": "Invalid parameter type",
  "timestamp": "2026-03-06T10:30:45.123",
  "status": 400
}
400 Bad Request - Invalid Status:
{
  "error": "Invalid value 'INVALID_STATUS' for parameter 'status'. Expected one of: BAR, HOT_KITCHEN, COLD_KITCHEN",
  "message": "Invalid parameter type",
  "timestamp": "2026-03-06T10:30:45.123",
  "status": 400
}

Start Task Preparation

Starts the preparation of a task, updating its status to IN_PREPARATION and recording the start timestamp.

Path Parameters

id
long
required
The unique identifier of the task to start

Response

Returns the updated task object:
id
long
Unique identifier for the task
orderId
long
ID of the order this task belongs to
station
string
Station assigned to this task
tableNumber
string
Table number for the order
products
array
List of products to prepare
createdAt
string
Timestamp when the task was created
status
string
Updated status: IN_PREPARATION
startedAt
string
Timestamp when preparation started (just set)
completedAt
string
Timestamp when completed (null for newly started tasks)

Example Request

curl -X PATCH http://localhost:8080/api/tasks/1/start

Example Response

{
  "id": 1,
  "orderId": 5,
  "station": "HOT_KITCHEN",
  "tableNumber": "5",
  "products": [
    {
      "name": "Grilled Chicken",
      "type": "HOT_DISH"
    }
  ],
  "createdAt": "2026-03-06T10:30:45.123",
  "status": "IN_PREPARATION",
  "startedAt": "2026-03-06T10:35:20.456",
  "completedAt": null
}

Error Responses

404 Not Found:
{
  "error": "Task with id 999 not found",
  "message": "Task not found",
  "timestamp": "2026-03-06T10:30:45.123",
  "status": 404
}
400 Bad Request - Invalid State:
{
  "error": "Task is already completed",
  "message": "Invalid state transition",
  "timestamp": "2026-03-06T10:30:45.123",
  "status": 400
}

Task Workflow

Tasks follow this lifecycle:
  1. Created - Task is created with PENDING status when an order is placed
  2. Started - Kitchen staff calls PATCH /api/tasks/{id}/start to begin preparation
  3. Completed - Task status moves to COMPLETED (implementation depends on business logic)

Station Assignment

Tasks are automatically assigned to stations based on product types:
Product TypeAssigned Station
DRINKBAR
HOT_DISHHOT_KITCHEN
COLD_DISHCOLD_KITCHEN
A single order with products for multiple stations will generate one task per station.

Filtering Best Practices

Get all pending tasks for a station:
curl http://localhost:8080/api/tasks/station/BAR?status=PENDING
Monitor in-progress tasks:
curl http://localhost:8080/api/tasks/station/HOT_KITCHEN?status=IN_PREPARATION
View task history:
curl http://localhost:8080/api/tasks/station/COLD_KITCHEN?status=COMPLETED

Build docs developers (and LLMs) love