generated from FIS2425/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
347 lines (344 loc) · 8.1 KB
/
openapi.yaml
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
openapi: 3.0.0
info:
title: Clinic and Payment API
version: 1.0.0
description: API for managing clinics, plans, and payments.
servers:
- url: http://localhost:3003/api/v1
description: Development server
- url: /api/v1
description: Production server
tags:
- name: Clinic
description: Operations related to clinics
- name: Payment
description: Operations related to payments
- name: Plan
description: Operations related to plans
paths:
/plans:
get:
tags:
- Plan
summary: Retrieve all plans
responses:
'200':
description: A list of plans
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Plan'
examples:
example1:
value:
- id: "1"
name: "Basic Plan"
price: 10.0
features:
- "Feature A"
- "Feature B"
/plans/{id}:
get:
tags:
- Plan
summary: Retrieve a plan by ID
description: Retrieves details of a specific plan by its unique ID.
parameters:
- name: id
in: path
required: true
description: The unique identifier for the plan
schema:
type: string
responses:
'200':
description: Plan successfully retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/Plan'
'400':
description: Missing plan ID
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Missing plan ID
'404':
description: Plan not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Plan not found
'500':
description: Internal server error
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: An unexpected error occurred
/payments:
get:
tags:
- Payment
summary: Retrieve all payments
security:
- cookieAuth: []
responses:
'200':
description: A list of payments
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Payment'
post:
security:
- cookieAuth: []
tags:
- Payment
summary: Process a new payment
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentRequest'
responses:
'201':
description: Payment successfully processed
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
/payments/{id}:
get:
tags:
- Payment
summary: Retrieve a payment by ID
security:
- cookieAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Details of a specific payment
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
'404':
description: Payment not found
/payments/clinic/{clinicId}:
get:
tags:
- Payment
summary: Retrieve all payments by clinic ID
security:
- cookieAuth: []
parameters:
- name: clinicId
in: path
required: true
schema:
type: string
responses:
'200':
description: A list of payments for the specified clinic
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Payment'
'400':
description: Clinic ID is required
'500':
description: Server error
/clinics:
post:
tags:
- Clinic
security:
- cookieAuth: []
summary: Register a new clinic
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClinicRequest'
responses:
'201':
description: Clinic successfully registered
content:
application/json:
schema:
$ref: '#/components/schemas/Clinic'
get:
tags:
- Clinic
summary: Retrieve all clinics
responses:
'200':
description: A list of clinics
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Clinic'
/clinics/{id}:
get:
tags:
- Clinic
summary: Retrieve a clinic by ID
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Details of a specific clinic
content:
application/json:
schema:
$ref: '#/components/schemas/Clinic'
'404':
description: Clinic not found
delete:
tags:
- Clinic
summary: Delete a clinic by ID
security:
- cookieAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204':
description: Clinic successfully deleted
put:
tags:
- Clinic
summary: Update a clinic by ID
security:
- cookieAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClinicRequest'
responses:
'200':
description: Clinic successfully updated
content:
application/json:
schema:
$ref: '#/components/schemas/Clinic'
components:
schemas:
Clinic:
type: object
properties:
id:
type: string
name:
type: string
city:
type: string
district:
type: string
plan:
type: string
active:
type: boolean
postalCode:
type: string
countryCode:
type: string
ClinicRequest:
type: object
properties:
name:
type: string
city:
type: string
district:
type: string
plan:
type: string
active:
type: boolean
postalCode:
type: string
countryCode:
type: string
Payment:
type: object
properties:
id:
type: string
date:
type: string
format: date-time
clinicId:
type: string
status:
type: string
planId:
type: string
PaymentRequest:
type: object
properties:
planId:
type: string
clinicId:
type: string
Plan:
type: object
properties:
id:
type: string
name:
type: string
price:
type: number
features:
type: array
items:
type: string
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: token