-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprototype-server-api-spec.yml
More file actions
263 lines (261 loc) · 7.78 KB
/
prototype-server-api-spec.yml
File metadata and controls
263 lines (261 loc) · 7.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
openapi: 3.0.2
info:
title: Prototype Server API
description: |-
In AFT UX, we build prototypes that must feature a high level of portability between the lab and production environments. This is due to the significant differences between available hardware and the inability to connect prototypes to networks in fulfillment centers.
To provide access to testing data, the prototypes we build are served by our custom wireless database server consisting of a PC device hardwired to a Wi-Fi router that we carry into the field. It creates a local network for either wired or wireless access to the Prototype Server API which avoids the need for a network connection.
### Conventions
- Endpoints names are in camel case and indicate the action and target collection (e.g., findProducts).
- All parameter and field names are lowercase. There are no multi-word parameter names, so snake case is not utilized.
- All fields are included in each response. Empty fields will always be shown and reported as `null`.
version: 1.2.0
servers:
- url: http://192.168.1.2:3000/api/v1
tags:
- name: products
description: Mock product inventory data
- name: associates
description: Mock associate data
paths:
/findProducts:
get:
tags:
- products
summary: Find product by query parameters
description: Returns a product or list of products
parameters:
- name: barcode
in: query
style: form
explode: true
description: product barcode
schema:
type: string
example: 7304X33541737095
- name: bin
in: query
style: form
explode: true
description: current bin location
schema:
type: string
example: D211
- name: order
in: query
style: form
explode: true
schema:
type: string
example: 145
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Product'
'400':
description: Invalid parameter supplied
'404':
description: Product with matching parameter(s) not found
/insertProduct:
post:
tags:
- products
summary: Insert a product
description: The prototype workstation hardware can only scan one barcode at a time, so this endpoint is limited to adding one product per POST.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
example:
barcode: 7304X33541737095
item: Super Mario Maker - Nintendo Switch
tag: 4173 705A 5232 574A 3746 4A49
multi: false
status: intake
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
example:
barcode: 7304X33541737095
aisle: null
bin: null
item: Super Mario Maker - Nintendo Switch
tag: 4173 705A 5232 574A 3746 4A49
multi: false
order: null
rack: null
associate: null
status: intake
'400':
description: Bad request or malformed syntax
'422':
description: Could not validate one or more product field types
/updateProduct/{tag}:
post:
tags:
- products
summary: Update a product
description: The prototype workstation can only scan one barcode at a time, so this endpoint is limited to updating one product per POST.
parameters:
- name: tag
in: path
description: unique tag ID of product to be updated
required: true
schema:
type: string
- name: bin
in: query
description: unique bin location of product to be updated
schema:
type: string
- name: order
in: query
description: unique customer order number of product to be updated
schema:
type: string
- name: status
in: query
description: current status of product to be updated
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Product'
'400':
description: Invalid product tag
/deleteProduct/{tag}:
delete:
tags:
- products
summary: Deletes a product
description: The prototype workstation hardware can only scan one barcode at a time, so this endpoint is limited to adding one product per DELETE.
parameters:
- name: tag
in: path
description: unique tag ID of product to be deleted
required: true
schema:
type: string
responses:
'200':
description: OK
'400':
description: Invalid product tag
/findAssociates:
get:
tags:
- associates
summary: Find associate by query parameters
description: Returns an associate or list of associates
parameters:
- name: name
in: query
style: form
explode: true
description: associate's name
schema:
type: string
example: Matt Murphy
- name: barcode
in: query
style: form
explode: true
description: associate's security badge barcode
schema:
type: string
example: P-8-A702B241
- name: station
in: query
style: form
explode: true
description: associate's currently assigned workstation
schema:
type: string
example: 2A
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Associate'
'400':
description: Invalid parameter supplied
'404':
description: Associate with matching parameter(s) not found
components:
schemas:
Product:
required:
- barcode
- item
- tag
- multi
- status
type: object
properties:
barcode:
type: string
example: 7304X33541737095
aisle:
type: string
example: E07
bin:
type: string
example: D211
item:
type: string
example: Super Mario Maker - Nintendo Switch
tag:
type: string
example: 4173 704C 5135 354A 3653 363D
multi:
type: boolean
example: false
order:
type: string
example: 145
rack:
type: string
example: C3
associate:
type: string
example: Matt Murphy
status:
type: string
example: pick
Associate:
type: object
properties:
name:
type: string
example: Matt Murphy
barcode:
type: string
example: P-8-A702B241
station:
type: string
example: 2A
faults:
type: number
example: 0
trained:
type: boolean
example: true