Newer
Older
openapi: 3.0.1
info:
title: Notification module
description: |
Hand-made OpenAPI document for Notification module.
version: 1.0.0
servers:
tags:
- name: NotificationService
components:
schemas:
NotificationDto:
type: object
title: Notification
description: Notification to be send to receivers
required:
- message
properties:
message:
type: string
receivers:
type: array
items:
type: string
description: Email addresses the notification is sent to
description: Subject of the email
CarComponentNotificationDto:
type: object
title: CarComponentNotification
required:
- carComponent
- receivers
properties:
carComponent:
$ref: "#/components/schemas/CarComponentDto"
receivers:
type: array
items:
type: string
description: Email addresses the notification is sent to
ApplicationNotificationDto:
type: object
title: ApplicationNotification
required:
- application
- receivers
properties:
application:
$ref: "#/components/schemas/ApplicationDto"
receivers:
type: array
items:
type: string
description: Email addresses the notification is sent to
ConfirmationDto:
type: object
title: Confirmation
properties:
message:
type: string
subject:
type: string
receivers:
type: array
items:
type: string
description: Email addresses the notification was sent to
sender:
type: string
description: Email address from which the notification was sent
CarComponentType:
type: string
description: Type of a component
enum:
- CHASSIS
- ENGINE
- FRONTWING
- SUSPENSION
CarComponentDto:
type: object
title: Component
description: Component of a car
required:
- id
- componentType
- information
properties:
id:
type: integer
format: int64
description: Id of the component
example: 1
componentType:
$ref: '#/components/schemas/CarComponentType'
weight:
type: number
description: Weight of the component
example: 50.5
information:
type: string
description: Specific information about component
example: lightweight front wing v2 (black)
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
ApplicationStatus:
type: string
description: Status of application
enum:
- pending
- rejected
- accepted
ApplicationDto:
type: object
title: Application
description: Application for becoming driver
required:
- id
- name
- surname
- fillingOutDate
- email
properties:
id:
type: integer
description: Id of the application
example: 1
format: int64
name:
type: string
description: Name of the person
example: Max
surname:
type: string
description: Surname of the person
example: Verstappen
birthday:
type: string
description: Date of birth
example: 09-30-1997
format: date
email:
type: string
description: Email address of the person
fillingOutDate:
type: string
description: Date of filling out the application
example: 09-30-1997
format: date
status:
$ref: '#/components/schemas/ApplicationStatus'
responses:
Unexpected:
description: Unexpected error
content:
application/json:
schema:
type: object
title: Unexpected
properties:
message:
type: string
paths:
/notification:
post:
tags:
- NotificationService
summary: Creates and sends notification(s)
operationId: notify
requestBody:
required: true
description: Request body with receiver and message for new notification
content:
application/json:
schema:
$ref: '#/components/schemas/NotificationDto'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConfirmationDto'
$ref: '#/components/responses/Unexpected'
/notification/component:
post:
tags:
- NotificationService
summary: Creates and sends notification(s) about new component
requestBody:
required: true
description: Request body with receiver and car component for new notification
content:
application/json:
schema:
$ref: '#/components/schemas/CarComponentNotificationDto'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConfirmationDto'
default:
$ref: '#/components/responses/Unexpected'
post:
tags:
- NotificationService
summary: Creates and sends notification(s)
operationId: notifyNewApplication
requestBody:
required: true
description: Request body with receiver and message for new notification
content:
application/json:
schema:
$ref: '#/components/schemas/ApplicationNotificationDto'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConfirmationDto'
default:
$ref: '#/components/responses/Unexpected'
/notification/application/status:
post:
tags:
- NotificationService
summary: Creates and sends notification
operationId: notifyApplicationStatusChange
requestBody:
required: true
description: Request body with receiver and message for new notification
content:
application/json:
schema:
$ref: '#/components/schemas/ApplicationNotificationDto'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConfirmationDto'
default:
$ref: '#/components/responses/Unexpected'