Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/cafe-split/components/parameters/Before.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: before
in: query
required: false
description: |
Use the `startCursor` as a value for the `before` parameter to get the next page.
Use the `startCursor` as a value for the `before` parameter to get the previous page.
schema:
type: string
14 changes: 4 additions & 10 deletions resources/cafe-split/components/parameters/Filter.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
name: filter
description: |-
Filters the collection items using space-separated `field:value` pairs.
See each list endpoint for the specific fields it supports.

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - Exact match
- `field:value1,value2` - Match any of the comma-separated values (OR)
- Time ranges: Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `status:placed` - Filter by single status.
- `status:placed,completed` - Filter by multiple statuses.
- `createdAt:30d` - Filter orders created in the last 30 days.
- `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by specific order ID.
- `status:placed createdAt:7d` - Combine multiple filters.
- `field:value` - exact match
- `field:value1,value2` - match any of the comma-separated values (OR)
- Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
in: query
required: false
schema:
Expand Down
4 changes: 2 additions & 2 deletions resources/cafe-split/components/parameters/Limit.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: limit
description: |
Use to return a number of results per page.
If there is more data, use in combination with `after` to page through the data.
Specify the number of results per page.
If there is more data, use in combination with `after` to page through all results.
in: query
required: false
schema:
Expand Down
10 changes: 3 additions & 7 deletions resources/cafe-split/components/parameters/Search.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: search
in: query
description: |-
Performs a case-insensitive text search across relevant fields in the collection.
**Fields searched depend on the endpoint:**
- **Menu items:** `name`, `photoTextDescription`
- **Orders:** `customerName`, `id`
Returns items where any of the searchable fields contain the search term as a substring.
Performs a case-insensitive text search across the endpoint's searchable fields,
returning items where any of those fields contain the search term as a substring.
See each list endpoint for the specific fields it searches.
required: false
schema:
type: string
2 changes: 1 addition & 1 deletion resources/cafe-split/components/schemas/Error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ properties:
format: uri-reference
description: |
URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type.
May be used to locate the root of this problem in the source code.
Can be used to locate the root of this problem in the source code.
example: '/some/uri-reference#specific-occurrence-context'
details:
description: Additional error details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ properties:
- string
- 'null'
format: binary
description: Photo of the menu item. Must be a PNG image and less than 1MB.
description: Photo of the menu item. Must be a PNG image less than 1MB in size.
photoUrl:
readOnly: true
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ properties:
minimum: 0
startDate:
type: string
format: date
format: date-time
description: Start date of the revenue calculation period.
endDate:
type: string
format: date
format: date-time
description: End date of the revenue calculation period.
required:
- revenue
Expand Down
31 changes: 31 additions & 0 deletions resources/cafe-split/paths/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,39 @@ get:
- $ref: ../components/parameters/After.yaml
- $ref: ../components/parameters/Before.yaml
- $ref: ../components/parameters/Sort.yaml
description: |-
Sorts the collection by a single field. Prefix with `-` for descending order
(for example, `-price`); omit the prefix for ascending order (`price`).

**Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id`
example: '-price'
- $ref: ../components/parameters/Filter.yaml
description: |-
Filters the collection items using space-separated `field:value` pairs.

**Filterable fields:** `name`, `category`, `price`, `createdAt`, `id`

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - Exact match
- `field:value1,value2` - Match any of the comma-separated values (OR)
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `category:beverage` - Filter by a single category.
- `category:beverage,dessert` - Filter by multiple categories.
- `createdAt:7d` - Menu items created in the last 7 days.
- `name:Latte` - Filter by name.
- `category:beverage price:400` - Combine multiple filters.
example: category:beverage
- $ref: ../components/parameters/Search.yaml
description: |-
Performs a case-insensitive text search across the searchable fields, returning
items where any of them contain the search term as a substring.

**Searchable fields:** `name`, `photoTextDescription`
example: Latte
- $ref: ../components/parameters/Limit.yaml
responses:
'200':
Expand Down
6 changes: 6 additions & 0 deletions resources/cafe-split/paths/order-items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ get:
parameters:
- $ref: ../components/parameters/Filter.yaml
required: true
description: |-
Selects the order whose items to return, using a single `orderId:<value>` pair
(for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`).
This filter is required and only the `orderId` field is supported.
example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7
responses:
'200':
description: Successful operation.
Expand Down
33 changes: 32 additions & 1 deletion resources/cafe-split/paths/orders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,42 @@ get:
- orders:read
parameters:
- $ref: ../components/parameters/Filter.yaml
description: |-
Filters the collection items using space-separated `field:value` pairs.

**Filterable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `id`

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - Exact match
- `field:value1,value2` - Match any of the comma-separated values (OR)
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `status:placed` - Filter by a single status.
- `status:placed,completed` - Filter by multiple statuses.
- `createdAt:30d` - Orders created in the last 30 days.
- `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order ID.
- `status:placed createdAt:7d` - Combine multiple filters.
example: status:placed
- $ref: ../components/parameters/Sort.yaml
description: |-
Sorts the collection by a single field. Prefix with `-` for descending order
(for example, `-createdAt`); omit the prefix for ascending order (`createdAt`).

**Sortable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `updatedAt`, `id`
example: '-createdAt'
- $ref: ../components/parameters/Limit.yaml
- $ref: ../components/parameters/After.yaml
- $ref: ../components/parameters/Before.yaml
- $ref: ../components/parameters/Search.yaml
description: |-
Performs a case-insensitive text search across the searchable fields, returning
items where any of them contain the search term as a substring.

**Searchable fields:** `customerName`, `id`
example: John
responses:
'200':
description: Successful operation.
Expand All @@ -35,7 +66,7 @@ post:
summary: Create order
description: |
Create a new order.
Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed.
Order items cannot be changed - if they need to be updated, cancel the order and place a new one.
operationId: createOrder
security:
- OAuth2:
Expand Down
4 changes: 2 additions & 2 deletions resources/cafe-split/paths/orders_{orderId}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ patch:
summary: Partially update an order
description: |
Update an existing order status.
Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed.
Order items cannot be changed - if they need to be updated, cancel the order and place a new one.
operationId: updateOrder
security:
- OAuth2:
Expand Down Expand Up @@ -104,7 +104,7 @@ delete:
summary: Delete an order
description: |
Delete the order.
To keep the order history, the order should be canceled instead of deleted.
To keep the order history, cancel the order instead of deleting it.
operationId: deleteOrder
security:
- OAuth2:
Expand Down
8 changes: 4 additions & 4 deletions resources/cafe-split/paths/revenue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ get:
Defaults to 30 days ago if not provided.
schema:
type: string
format: date
example: '2026-01-01'
format: date-time
example: '2026-01-01T00:00:00Z'
- name: endDate
in: query
required: false
Expand All @@ -29,8 +29,8 @@ get:
Defaults to current time if not provided.
schema:
type: string
format: date
example: '2026-01-31'
format: date-time
example: '2026-01-31T23:59:59Z'
responses:
'200':
description: Revenue statistics retrieved successfully.
Expand Down
Loading
Loading