-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.yml
More file actions
406 lines (398 loc) · 12.8 KB
/
Copy pathspec.yml
File metadata and controls
406 lines (398 loc) · 12.8 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
openapi: "3.1.0"
info:
title: "Competitor API"
description: "Web-facing API for the challenge"
version: "1.0.0"
tags:
- name: "challenge"
description: "Operations to be implemented by competitors"
paths:
/api/offers:
get:
summary: "Get offers"
description: "Gets offers matching specific query parameters"
operationId: getOffers
tags:
- "challenge"
parameters:
- name: "regionID"
in: query
description: "Region ID for which offers are returned. This includes offers from all subregions of this regionID. See the 'Introduction' Section in the documentation."
required: true
schema:
type: "integer"
format: "int32"
- name: "timeRangeStart"
in: query
description: "Timestamp (ms since UNIX epoch) from when offers are considered (inclusive)"
required: true
schema:
type: "integer"
format: "int64"
- name: "timeRangeEnd"
in: query
description: "Timestamp (ms since UNIX epoch) until when offers are considered (inclusive)"
required: true
schema:
type: "integer"
format: "int64"
- name: "numberDays"
in: query
description: "The number of full days (24h) the car is available within the rangeStart and rangeEnd"
required: true
schema:
type: "integer"
format: "int32"
x-go-type: "uint16"
- name: "sortOrder"
in: query
required: true
description: "The order in which offers are returned. When two offers have the same price, the one with the lexicographical smaller ID is returned first (for both sort orders)."
schema:
type: "string"
enum: ["price-asc", "price-desc"]
- name: "page"
in: query
required: true
description: "The page number from pagination"
schema:
type: "integer"
format: "int64"
x-go-type: "uint32"
- name: "pageSize"
in: query
required: true
description: "The number of offers per page"
schema:
type: "integer"
format: "int64"
x-go-type: "uint32"
- name: "priceRangeWidth"
in: query
required: true
description: "The width of the price range blocks in cents"
schema:
type: "integer"
format: "int64"
x-go-type: "uint32"
- name: "minFreeKilometerWidth"
in: query
required: true
description: "The width of the min free kilometer in km"
schema:
type: "integer"
format: "int64"
x-go-type: "uint32"
- name: "minNumberSeats"
in: query
description: "How many seats the returned cars each have"
required: false
schema:
type: "integer"
format: "int32"
x-go-type: "uint8"
- name: "minPrice"
in: query
description: "Minimum (inclusive) price the offers have in cent"
required: false
schema:
type: "number"
format: "int32"
x-go-type: "uint16"
- name: "maxPrice"
in: query
description: "Maximum (exclusive) price the offers have in cent"
required: false
schema:
type: "number"
format: "int32"
x-go-type: "uint16"
- name: "carType"
in: query
required: false
description: "The car type."
schema:
type: "string"
enum: [small, sports, luxury, family]
- name: "onlyVollkasko"
in: query
required: false
description: "Whether only offers with vollkasko are returned"
schema:
type: "boolean"
- name: "minFreeKilometer"
in: query
required: false
description: "Minimum number of kilometers that the offer includes for free"
schema:
type: "integer"
format: "int32"
x-go-type: "uint16"
responses:
"200":
description: "The IDs and data of the offers matching the query parameters. For aggregation results, see the 'Filter and Aggregations'-section in the documentation."
content:
application/json:
schema:
type: "object"
properties:
offers:
type: "array"
description: "All offers matching the query, with their IDs and additional data."
items:
$ref: "#/components/schemas/SearchResultOffer"
priceRanges:
type: "array"
description: "Buckets holding information of the number of offers within a specific price range. The results only includes buckets with at least one offer in that range sorted by start ascendingly. Bucket starts and ends are a multiple of the width."
items:
$ref: "#/components/schemas/PriceRange"
carTypeCounts:
$ref: "#/components/schemas/CarTypeCount"
description: "The the number of offers with a specific car type."
seatsCount:
type: "array"
description: "Buckets holding information of the number of offers with a specific seat count. The results only includes entries with at least one offer with that seats count sorted by numberSeats ascendingly."
items:
$ref: "#/components/schemas/SeatsCount"
freeKilometerRange:
type: "array"
description: "Buckets holding information of the number of offers within a specific free kilometer range. The results only includes buckets with at least one offer in that range sorted by the start ascendingly. Bucket starts and ends are a multiple of the width."
items:
$ref: "#/components/schemas/FreeKilometerRange"
vollkaskoCount:
$ref: "#/components/schemas/VollkaskoCount"
required:
- offers
- priceRanges
- carTypeCounts
- seatsCount
- freeKilometerRange
- vollkaskoCount
post:
summary: "Create offers"
description: "Creates multiple offers at once, includes at least one offer."
operationId: createOffers
tags:
- "challenge"
requestBody:
required: true
content:
application/json:
schema:
type: "object"
properties:
offers:
type: "array"
items:
$ref: "#/components/schemas/Offer"
responses:
"200":
description: "Offers were created"
delete:
summary: "Clean up data"
description: "Cleans up all old offer data. This excludes the static region data initially provided from S3."
operationId: cleanupData
tags:
- "challenge"
responses:
"200":
description: "Data was cleaned up"
components:
schemas:
SearchResultOffer:
type: object
properties:
ID:
type: string
format: uuid
example: "01934a57-7988-7879-bb9b-e03bd4e77b9d"
description: "The unique identifier of the offer"
data:
type: string
description: "Additional data of the offer, that is not used for filtering. For simplicity, this is just a base64 encoded 256 Byte array"
format: byte
required:
- ID
- data
Offer:
type: object
properties:
ID:
type: string
format: uuid
example: "01934a57-7988-7879-bb9b-e03bd4e77b9d"
description: "The unique identifier of the offer"
data:
type: string
description: "Additional data for the offer, that is not used for filtering. For simplicity, this is just a base64 encoded 256 Byte array"
format: byte
mostSpecificRegionID:
type: integer
format: int32
description: "The id of the most specific region the offer belongs to. This is always a leaf node."
example: 5
startDate:
type: integer
format: int64
description: "The start date of the offer in ms since UNIX epoch"
example: 1732104000000
endDate:
type: integer
format: int64
description: "The end date of the offer in ms since UNIX epoch"
example: 1732449600000
numberSeats:
type: integer
format: int32
x-go-type: uint8
description: "The number of seats the car has"
example: 5
price:
type: integer
format: int32
x-go-type: uint16
description: "The price in cents"
example: 10000
carType:
type: string
example: "luxury"
description: "The car types the offer belongs to"
hasVollkasko:
type: boolean
description: "Whether the offer has Vollkasko"
example: true
freeKilometers:
type: integer
format: int32
x-go-type: uint16
description: "The number of kilometers included for free"
example: 120
required:
- ID
- data
- mostSpecificRegionID
- price
- startDate
- endDate
- numberSeats
- carType
- hasVollkasko
- freeKilometers
PriceRange:
type: object
properties:
start:
type: integer
format: int32
x-go-type: uint16
description: "The start of the price range in cent"
example: 10000
end:
type: integer
format: int32
x-go-type: uint16
description: "The end of the price range in cent"
example: 15000
count:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers in this price range"
example: 4
required:
- start
- end
- count
CarTypeCount:
type: object
properties:
small:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with the car type small"
example: 1
sports:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with the car type sports"
example: 2
luxury:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with the car type luxury"
example: 1
family:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with the car type family"
example: 0
required:
- small
- sports
- luxury
- family
VollkaskoCount:
type: object
properties:
trueCount:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with vollkasko"
example: 3
falseCount:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers without Vollkasko"
example: 1
required:
- trueCount
- falseCount
SeatsCount:
type: object
properties:
numberSeats:
type: integer
format: int32
x-go-type: uint8
description: "The number of seats the cars have"
example: 5
count:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers with the given number of seats"
example: 4
required:
- numberSeats
- count
FreeKilometerRange:
type: object
properties:
start:
type: integer
format: int32
x-go-type: uint16
description: "The start of the free kilometer range"
example: 100
end:
type: integer
format: int32
x-go-type: uint16
description: "The end of the free kilometer range"
example: 150
count:
type: integer
format: int64
x-go-type: uint32
description: "The number of offers in this free kilometer range"
example: 4
required:
- start
- end
- count