Skip to content

Commit a47989c

Browse files
committed
chore: change respect e2e to use cafe api
1 parent 74364e5 commit a47989c

14 files changed

Lines changed: 1597 additions & 78 deletions

File tree

resources/cafe-split/components/parameters/Before.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: before
22
in: query
33
required: false
44
description: |
5-
Use the `startCursor` as a value for the `before` parameter to get the next page.
5+
Use the `startCursor` as a value for the `before` parameter to get the previous page.
66
schema:
77
type: string

resources/cafe-split/components/parameters/Filter.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
name: filter
22
description: |-
33
Filters the collection items using space-separated `field:value` pairs.
4+
See each list endpoint for the specific fields it supports.
45
56
**Format:** `field1:value1 field2:value2`
67
78
**Supported operators:**
8-
- `field:value` - Exact match
9-
- `field:value1,value2` - Match any of the comma-separated values (OR)
10-
- Time ranges: Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
11-
12-
**Examples:**
13-
- `status:placed` - Filter by single status.
14-
- `status:placed,completed` - Filter by multiple statuses.
15-
- `createdAt:30d` - Filter orders created in the last 30 days.
16-
- `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by specific order ID.
17-
- `status:placed createdAt:7d` - Combine multiple filters.
9+
- `field:value` - exact match
10+
- `field:value1,value2` - match any of the comma-separated values (OR)
11+
- Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
1812
in: query
1913
required: false
2014
schema:

resources/cafe-split/components/parameters/Limit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: limit
22
description: |
3-
Use to return a number of results per page.
4-
If there is more data, use in combination with `after` to page through the data.
3+
Specify the number of results per page.
4+
If there is more data, use in combination with `after` to page through all results.
55
in: query
66
required: false
77
schema:
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
name: search
22
in: query
33
description: |-
4-
Performs a case-insensitive text search across relevant fields in the collection.
5-
6-
**Fields searched depend on the endpoint:**
7-
- **Menu items:** `name`, `photoTextDescription`
8-
- **Orders:** `customerName`, `id`
9-
10-
Returns items where any of the searchable fields contain the search term as a substring.
4+
Performs a case-insensitive text search across the endpoint's searchable fields,
5+
returning items where any of those fields contain the search term as a substring.
6+
See each list endpoint for the specific fields it searches.
117
required: false
128
schema:
139
type: string

resources/cafe-split/components/schemas/Error.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ properties:
2020
format: uri-reference
2121
description: |
2222
URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type.
23-
May be used to locate the root of this problem in the source code.
23+
Can be used to locate the root of this problem in the source code.
2424
example: '/some/uri-reference#specific-occurrence-context'
2525
details:
2626
description: Additional error details.

resources/cafe-split/components/schemas/MenuBaseItem.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ properties:
3636
- string
3737
- 'null'
3838
format: binary
39-
description: Photo of the menu item. Must be a PNG image and less than 1MB.
39+
description: Photo of the menu item. Must be a PNG image less than 1MB in size.
4040
photoUrl:
4141
readOnly: true
4242
type: string

resources/cafe-split/components/schemas/RevenueStatistics.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ properties:
3333
minimum: 0
3434
startDate:
3535
type: string
36-
format: date
36+
format: date-time
3737
description: Start date of the revenue calculation period.
3838
endDate:
3939
type: string
40-
format: date
40+
format: date-time
4141
description: End date of the revenue calculation period.
4242
required:
4343
- revenue

resources/cafe-split/paths/menu.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,39 @@ get:
99
- $ref: ../components/parameters/After.yaml
1010
- $ref: ../components/parameters/Before.yaml
1111
- $ref: ../components/parameters/Sort.yaml
12+
description: |-
13+
Sorts the collection by a single field. Prefix with `-` for descending order
14+
(for example, `-price`); omit the prefix for ascending order (`price`).
15+
16+
**Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id`
17+
example: '-price'
1218
- $ref: ../components/parameters/Filter.yaml
19+
description: |-
20+
Filters the collection items using space-separated `field:value` pairs.
21+
22+
**Filterable fields:** `name`, `category`, `price`, `createdAt`, `id`
23+
24+
**Format:** `field1:value1 field2:value2`
25+
26+
**Supported operators:**
27+
- `field:value` - Exact match
28+
- `field:value1,value2` - Match any of the comma-separated values (OR)
29+
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
30+
31+
**Examples:**
32+
- `category:beverage` - Filter by a single category.
33+
- `category:beverage,dessert` - Filter by multiple categories.
34+
- `createdAt:7d` - Menu items created in the last 7 days.
35+
- `name:Latte` - Filter by name.
36+
- `category:beverage price:400` - Combine multiple filters.
37+
example: category:beverage
1338
- $ref: ../components/parameters/Search.yaml
39+
description: |-
40+
Performs a case-insensitive text search across the searchable fields, returning
41+
items where any of them contain the search term as a substring.
42+
43+
**Searchable fields:** `name`, `photoTextDescription`
44+
example: Latte
1445
- $ref: ../components/parameters/Limit.yaml
1546
responses:
1647
'200':

resources/cafe-split/paths/order-items.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ get:
1212
parameters:
1313
- $ref: ../components/parameters/Filter.yaml
1414
required: true
15+
description: |-
16+
Selects the order whose items to return, using a single `orderId:<value>` pair
17+
(for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`).
18+
19+
This filter is required and only the `orderId` field is supported.
20+
example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7
1521
responses:
1622
'200':
1723
description: Successful operation.

resources/cafe-split/paths/orders.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,42 @@ get:
99
- orders:read
1010
parameters:
1111
- $ref: ../components/parameters/Filter.yaml
12+
description: |-
13+
Filters the collection items using space-separated `field:value` pairs.
14+
15+
**Filterable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `id`
16+
17+
**Format:** `field1:value1 field2:value2`
18+
19+
**Supported operators:**
20+
- `field:value` - Exact match
21+
- `field:value1,value2` - Match any of the comma-separated values (OR)
22+
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
23+
24+
**Examples:**
25+
- `status:placed` - Filter by a single status.
26+
- `status:placed,completed` - Filter by multiple statuses.
27+
- `createdAt:30d` - Orders created in the last 30 days.
28+
- `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order ID.
29+
- `status:placed createdAt:7d` - Combine multiple filters.
30+
example: status:placed
1231
- $ref: ../components/parameters/Sort.yaml
32+
description: |-
33+
Sorts the collection by a single field. Prefix with `-` for descending order
34+
(for example, `-createdAt`); omit the prefix for ascending order (`createdAt`).
35+
36+
**Sortable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `updatedAt`, `id`
37+
example: '-createdAt'
1338
- $ref: ../components/parameters/Limit.yaml
1439
- $ref: ../components/parameters/After.yaml
1540
- $ref: ../components/parameters/Before.yaml
1641
- $ref: ../components/parameters/Search.yaml
42+
description: |-
43+
Performs a case-insensitive text search across the searchable fields, returning
44+
items where any of them contain the search term as a substring.
45+
46+
**Searchable fields:** `customerName`, `id`
47+
example: John
1748
responses:
1849
'200':
1950
description: Successful operation.
@@ -35,7 +66,7 @@ post:
3566
summary: Create order
3667
description: |
3768
Create a new order.
38-
Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed.
69+
Order items cannot be changed - if they need to be updated, cancel the order and place a new one.
3970
operationId: createOrder
4071
security:
4172
- OAuth2:

0 commit comments

Comments
 (0)