@@ -90,11 +90,11 @@ import {
90
90
* startPoint:
91
91
* type: string
92
92
* minLength: 1
93
- * example: A
93
+ * example: "{ \"lat\": \"-34.655\", \"lng\": \"150.590\" }"
94
94
* endPoint:
95
95
* type: string
96
96
* minLength: 1
97
- * example: B
97
+ * example: "{ \"lat\": \"-34.655\", \"lng\": \"150.590\" }"
98
98
* status:
99
99
* type: string
100
100
* enum: [pending, confirmed, cancelled, done]
@@ -109,11 +109,6 @@ import {
109
109
* format: number
110
110
* minimum: 1
111
111
* example: 1
112
- * driverId:
113
- * type: number
114
- * format: number
115
- * minimum: 1
116
- * example: 1
117
112
* customerName:
118
113
* type: string
119
114
* pattern: ^[A-Za-z][\s'A-Za-z-]{0,39}$
@@ -124,6 +119,45 @@ import {
124
119
* pattern: ^\+\d{8,19}$
125
120
* nullable: true
126
121
* example: +123456789
122
+ * shift:
123
+ * type: object
124
+ * properties:
125
+ * id:
126
+ * type: number
127
+ * minimum: 1
128
+ * example: 1
129
+ * driver:
130
+ * type: object
131
+ * properties:
132
+ * id:
133
+ * type: number
134
+ * minimum: 1
135
+ * example: 1
136
+ * firstName:
137
+ * $ref: '#/components/schemas/Customer-sign-up-request/properties/firstName'
138
+ * lastName:
139
+ * $ref: '#/components/schemas/Customer-sign-up-request/properties/lastName'
140
+ * phone:
141
+ * $ref: '#/components/schemas/Customer-sign-up-request/properties/phone'
142
+ * email:
143
+ * $ref: '#/components/schemas/Customer-sign-up-request/properties/email'
144
+ * driverLicenseNumber:
145
+ * type: string
146
+ * minLength: 10
147
+ * example: AAA 123456
148
+ * truck:
149
+ * type: object
150
+ * properties:
151
+ * id:
152
+ * type: number
153
+ * minimum: 1
154
+ * example: 1
155
+ * licensePlateNumber:
156
+ * type: string
157
+ * minLength: 3
158
+ * maxLength: 10
159
+ * pattern: ^(?!.*\\s)[\\dA-ZЁА-Я-]{3,10}}$
160
+ * example: DD1111RR
127
161
*
128
162
* CreateOrderWithRegisteredUser:
129
163
* type: object
@@ -187,6 +221,27 @@ import {
187
221
* type: string
188
222
* enum:
189
223
* - Driver does not exist!
224
+ *
225
+ * TruckNotExistError:
226
+ * allOf:
227
+ * - $ref: '#/components/schemas/ErrorType'
228
+ * - type: object
229
+ * properties:
230
+ * message:
231
+ * type: string
232
+ * enum:
233
+ * - Truck does not exist!
234
+ *
235
+ * ShiftNotOpenError:
236
+ * allOf:
237
+ * - $ref: '#/components/schemas/ErrorType'
238
+ * - type: object
239
+ * properties:
240
+ * message:
241
+ * type: string
242
+ * enum:
243
+ * - This truck is not inactive, please choose another one!
244
+ *
190
245
* BusinessNotExistError:
191
246
* allOf:
192
247
* - $ref: '#/components/schemas/ErrorType'
@@ -338,16 +393,16 @@ class OrderController extends Controller {
338
393
* application/json:
339
394
* schema:
340
395
* $ref: '#/components/schemas/Order'
341
- * 400 :
396
+ * 404 :
342
397
* description:
343
398
* Order creation error
344
399
* content:
345
400
* application/json:
346
401
* schema:
347
402
* oneOf:
348
403
* - $ref: '#/components/schemas/DriverNotExistError'
349
- * - $ref: '#/components/schemas/OrderCreationError '
350
- *
404
+ * - $ref: '#/components/schemas/TruckNotExistError '
405
+ * - $ref: '#/components/schemas/ShiftNotOpenError'
351
406
*/
352
407
private async create (
353
408
options : ApiHandlerOptions < {
@@ -460,7 +515,10 @@ class OrderController extends Controller {
460
515
* content:
461
516
* plain/text:
462
517
* schema:
463
- * $ref: '#/components/schemas/OrderDoesNotExist'
518
+ * oneOf:
519
+ * - $ref: '#/components/schemas/OrderDoesNotExist'
520
+ * - $ref: '#/components/schemas/TruckNotExistError'
521
+ * - $ref: '#/components/schemas/DriverNotExistError'
464
522
* 401:
465
523
* UnauthorizedError:
466
524
* description:
@@ -505,10 +563,7 @@ class OrderController extends Controller {
505
563
* schema:
506
564
* type: array
507
565
* items:
508
- * type: object
509
- * properties:
510
- * items:
511
- * $ref: '#/components/schemas/Order'
566
+ * $ref: '#/components/schemas/Order'
512
567
* 401:
513
568
* UnauthorizedError:
514
569
* description:
@@ -517,7 +572,7 @@ class OrderController extends Controller {
517
572
* plain/text:
518
573
* schema:
519
574
* $ref: '#/components/schemas/UnauthorizedError'
520
- * 400 :
575
+ * 404 :
521
576
* UnauthorizedError:
522
577
* description:
523
578
* You are not authorized
@@ -569,7 +624,9 @@ class OrderController extends Controller {
569
624
* content:
570
625
* plain/text:
571
626
* schema:
572
- * $ref: '#/components/schemas/OrderDoesNotExist'
627
+ * oneOf:
628
+ * - $ref: '#/components/schemas/OrderDoesNotExist'
629
+ * - $ref: '#/components/schemas/BusinessDoesNotExist'
573
630
* 401:
574
631
* UnauthorizedError:
575
632
* description:
0 commit comments