Files
sumoc-backend/openapi.yaml
T
laaser b4d6c1ea13
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
Totally unsave loggingpage
2026-01-23 14:24:01 +01:00

1812 lines
46 KiB
YAML

openapi: 3.1.0
info:
title: SuMoC API
description: API-Dokumentation für SuMoC
version: "1.0"
servers:
- url: http://localhost:8080
description: Generated server url
security:
- bearerAuth: []
paths:
/user/setVisibilityPrivacy:
put:
tags:
- user-controller
summary: Nutzer ändert seine Sichtbarkeits- und Datenschutzeinstellungen
description: "Ein Nutzer kann seine Sichtbarkeits- und Datenschutzeinstellungen\
\ ändern, um zu steuern, wer seine Informationen sehen kann."
operationId: setVisibilityPrivacy
parameters:
- name: visibilityPrivacy
in: query
required: true
schema:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
responses:
"200":
description: Sichtbarkeits- und Datenschutzeinstellungen erfolgreich geändert
content:
application/json: {}
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Ungültige Eingabedaten
content:
application/json: {}
"409":
description: Ungültige Eingabedaten
content:
application/json: {}
/user/setPrivateName/{id}:
put:
tags:
- user-controller
summary: Update a users private name.
description: A user can change it's own private name that is shown to friends.
operationId: setPrivateName
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newPrivateName
in: query
required: true
schema:
type: string
responses:
"200":
description: Passwort erfolgreich geändert
content:
application/json: {}
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen das Passwort ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/setPassword/{id}:
put:
tags:
- user-controller
summary: Nutzer ändert sein Passwort
description: "Ein Nutzer kann sein Passwort ändern, um die Sicherheit seines\
\ Kontos zu gewährleisten."
operationId: setPassword
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newPassword
in: query
required: true
schema:
type: string
responses:
"200":
description: Passwort erfolgreich geändert
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen das Passwort ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/setEmail/{id}:
put:
tags:
- user-controller
summary: Nutzer ändert seine E-Mail-Adresse
description: "Ein Nutzer kann seine E-Mail-Adresse ändern, um sicherzustellen,\
\ dass seine Kontaktdaten aktuell sind."
operationId: setEmail
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newEmail
in: query
required: true
schema:
type: string
responses:
"200":
description: E-Mail-Adresse erfolgreich geändert
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen die Email ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
"409":
description: Die Email wurde bereits vergeben
content:
application/json: {}
/trip/validateTrip/{tripId}:
put:
tags:
- trip-controller
summary: Validate a trip for the authenticated user.
operationId: validateTrip
parameters:
- name: tripId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/trip/invalidateTrip/{tripId}:
put:
tags:
- trip-controller
summary: Invalidate a trip for the authenticated user.
operationId: invalidateTrip
parameters:
- name: tripId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/routing/preferences/update:
put:
tags:
- routing-preferences-controller
summary: Update the routing preferences of the current user
description: Updates the routing preferences for the authenticated user with
the provided settings.
operationId: updateRoutingPreferences
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RoutingPreferencesDTO"
required: true
responses:
"200":
description: OK
/notifications/register-device-token:
put:
tags:
- notification-controller
summary: Registers a device token for push notifications for the authenticated
user.
operationId: registerDeviceToken
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RegisterDeviceTokenRequest"
required: true
responses:
"200":
description: OK
/badges/modifyBadge:
put:
tags:
- badge-controller
summary: Modify a badge by ID
operationId: modifyBadgeById
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Badge"
required: true
responses:
"200":
description: Badge modified successfully
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
"404":
description: Badge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
/user/stats/add:
post:
tags:
- user-controller
summary: Add stats to the current user
description: Adds a value to a stat field for the current user. Optionally checks
and awards badges afterwards.
operationId: addStats
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AddStatRequestDTO"
required: true
responses:
"200":
description: Stats updated successfully
"400":
description: Invalid stat field / invalid input
content:
application/json: {}
"403":
description: Not authorized
content:
application/json: {}
/trip/uploadTrip:
post:
tags:
- trip-controller
summary: User uploads a new trip from the App.
operationId: uploadTrip
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NewTripDTO"
required: true
responses:
"200":
description: OK
/routing/alternative/request:
post:
tags:
- routing-controller
operationId: requestAlternativeRoutes
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RoutingAlternativeRequestDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/RouteDTO"
/friendship/unblock/{friendId}:
post:
tags:
- friendship-controller
summary: Unblock a user.
description: Unblocks the user with friendId for the logged in user.
operationId: unblockUser
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/request/{friendId}:
post:
tags:
- friendship-controller
summary: Request a friendship with another user.
description: Sends a friendship request to another user from the logged in user.
operationId: requestFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/request/by-friendcode/{friendCode}:
post:
tags:
- friendship-controller
summary: Request a friendship with another user by friend code.
description: Sends a friendship request to another user identified by their
friend code from the logged in user.
operationId: requestFriendshipByFriendcode
parameters:
- name: friendCode
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
/friendship/reject/{friendId}:
post:
tags:
- friendship-controller
summary: Reject a friendship request.
description: Rejects a pending friendship request for the logged in user from
user with friendId.
operationId: rejectFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/block/{friendId}:
post:
tags:
- friendship-controller
summary: Block a user.
description: Blocks the user with friendId for the logged in user.
operationId: blockUser
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/accept/{friendId}:
post:
tags:
- friendship-controller
summary: Accept a friendship request.
description: Accepts a pending friendship request for the logged in user from
user with friendId.
operationId: acceptFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/dev/trigger-trend-calculation:
post:
tags:
- dev-controller
operationId: triggerTrendCalculation
responses:
"200":
description: OK
/badges/createBadge:
post:
tags:
- badge-controller
summary: Create a new badge
operationId: createBadge
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Badge"
required: true
responses:
"201":
description: Badge created successfully
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
"409":
description: Badge already exists
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
/badges/checkBadgeAndAward:
post:
tags:
- badge-controller
summary: Check badges for current user and award newly unlocked ones
operationId: checkAndAwardBadges
responses:
"200":
description: Check successful
/auth/user/registration:
post:
tags:
- user-authentication-controller
summary: Registriert einen neuen Benutzer
description: Erstellt einen neuen Benutzer und gibt die Benutzerdaten zurück
operationId: registerUser
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserRegistrationDTO"
required: true
responses:
"200":
description: Benutzer erfolgreich registriert
content:
application/json:
schema:
$ref: "#/components/schemas/RegistrationResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
/auth/user/login:
post:
tags:
- user-authentication-controller
summary: Authentifiziert einen Benutzer
description: Prüft den Benutzernamen und das Passwort und gibt ein JWT zurück
operationId: login
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserAuthenticationPairDTO"
required: true
responses:
"200":
description: Erfolgreiche Anmeldung
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"401":
description: Ungültiger Benutzername oder Passwort
content:
application/json: {}
/user/profile:
get:
tags:
- user-controller
summary: Nutzer fragt sein eigenes Profil an
description: "Ein Nutzer kann sein eigenes Profil anfragen, um dessen Informationen\
\ einzusehen."
operationId: getUser
responses:
"200":
description: Nutzerprofil erfolgreich abgerufen
content:
application/json:
schema:
$ref: "#/components/schemas/MaximalUserDTO"
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/profile/{id}:
get:
tags:
- user-controller
summary: Nutzer fragt ein fremdes Nutzerprofil an
description: "Ein Nutzer kann das Profil eines anderen Nutzers anfragen, um\
\ dessen öffentliche Informationen einzusehen."
operationId: getUser_1
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Nutzerprofil erfolgreich abgerufen
content:
application/json:
schema:
$ref: "#/components/schemas/MinimalUserDTO"
"403":
description: Nutzerprofil darf nicht aufgerufen werden
content:
application/json: {}
"404":
description: Nutzerprofil nicht gefunden
content:
application/json: {}
/trip/getAllUserTrips:
get:
tags:
- trip-controller
summary: Retrieve all trips of the authenticated user.
operationId: getAllUserTrips
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/TripDTO"
/routing/preferences/get:
get:
tags:
- routing-preferences-controller
summary: Get the routing preferences of the current user
description: Retrieves the routing preferences set by the authenticated user.
operationId: getRoutingPreferences
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/RoutingPreferencesDTO"
/leaderboard/getLeaderboard:
get:
tags:
- leaderboard-controller
summary: Get the global score table
operationId: getLeaderboard
parameters:
- name: timeframe
in: query
required: true
schema:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- name: field
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully retrieved global score table
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
"400":
description: Bad request
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
/leaderboard/getFriendLeaderboard:
get:
tags:
- leaderboard-controller
summary: Get the friend score table
operationId: getFriendLeaderboard
parameters:
- name: timeframe
in: query
required: true
schema:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- name: field
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully retrieved friend score table
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
"400":
description: Bad request
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
/geocoding/reverse:
get:
tags:
- geocoding-controller
description: Returns the address at the given lat / lon.
operationId: reverse
parameters:
- name: lat
in: query
required: true
schema:
type: number
format: double
- name: lon
in: query
required: true
schema:
type: number
format: double
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/AddressDTO"
/friendship/blocked:
get:
tags:
- friendship-controller
summary: Get all users the logged in user has blocked.
description: Returns a list of all users that have been blocked by the logged
in user.
operationId: blockedUsers
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MinimalUserDTO"
/friendship/all:
get:
tags:
- friendship-controller
summary: Return all friendships of the logged in user.
description: |2
Returns all friendships of all statuses (pending, accepted, rejected, blocked) for the logged in user.
A friendship between two users always consists of one or two entries in the database. One for each direction.
The user is always the one to whom the status applies.
- If A requests friendship from B, B -> A = PENDING, A -> B = REQUESTED
- If A accepts friendship from B, B -> A = ACCEPTED, A -> B = ACCEPTED
- If A rejects friendship from B, B -> A = REJECTED
- If A blocks B, B -> A = BLOCKED
Per friendship system logic the logged in user is to whom the statuses apply.
Meaning a blocked status indicates that the logged in user has been blocked by the other user.
operationId: getFriendships
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/FriendshipDTO"
/friendship/accepted:
get:
tags:
- friendship-controller
summary: Return all accepted friends of the logged in user.
description: Returns all friends with accepted status.
operationId: getAcceptedFriendships
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/FriendshipDTO"
/dev/test-notification-from-detected-regular-trip:
get:
tags:
- dev-controller
description: Testing endpoint that mocks the detection of regular trips and
then tests the alternative calculation and notification scheduling.
operationId: testNotificationFromDetectedRegularTrip
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-meteo:
get:
tags:
- dev-controller
operationId: testMeteoClient
responses:
"200":
description: OK
/dev/test-firebase-trend-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type TREND to the provided
FCM token.
operationId: SendTestTrendNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-firebase-regular-trip-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type REGULAR_TRIP_ALTERNATIVE
to the provided FCM token.
operationId: SendTestRegularTripAlternativeNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-firebase-adhoc-route-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type ADHOC_ALTERNATIVE
to the provided FCM token.
operationId: SendTestAdhocRouteNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-clean-old-notifications:
get:
tags:
- dev-controller
description: Tests the method cleaning old notifications from the database.
operationId: testCleanOldNotifications
responses:
"200":
description: OK
/dev/queue-test-notification:
get:
tags:
- dev-controller
description: Immediately queues a notification to the fcm key specified in application-dev.properties
to be processed by the notification queue.
operationId: queueTestNotification
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/badges/getBadges/{userId}:
get:
tags:
- badge-controller
summary: Get Badges by user
operationId: getBadgesByUser
parameters:
- name: userId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badges retrieved successfully
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/UserBadgeDTO"
"404":
description: No badges found for user
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/UserBadgeDTO"
/badges/getBadge/{badgeId}:
get:
tags:
- badge-controller
summary: Get a badge by ID
operationId: getBadgeById
parameters:
- name: badgeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badge retrieved successfully
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
"404":
description: Badge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/Badge"
/badges/getAllBadges:
get:
tags:
- badge-controller
summary: Get all badges
operationId: getAllBadges
responses:
"200":
description: Badges retrieved successfully
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/Badge"
"404":
description: No badges found
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/Badge"
/user/delete/{id}:
delete:
tags:
- user-controller
summary: Nutzer löscht sein eigenes Profil
description: Ein Nutzer kann sein eigenes Profil löschen. Dies entfernt alle
seine Daten aus dem System.
operationId: deleteUser
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Nutzerprofil erfolgreich gelöscht
content:
'*/*':
schema:
type: object
"403":
description: "Keine Berechtigung, fremdes Profil zu löschen"
content:
'*/*':
schema:
type: object
"404":
description: Der Nutzer existiert nicht
content:
'*/*':
schema:
type: object
/friendship/unfriend/{friendId}:
delete:
tags:
- friendship-controller
summary: Unfriend a user.
description: Removes an accepted friendship between the logged in user and user
with friendId.
operationId: unfriend
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/badges/deleteBadge/{badgeId}:
delete:
tags:
- badge-controller
summary: Delete a badge by ID
operationId: deleteBadgeById
parameters:
- name: badgeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badge deleted successfully
"404":
description: Badge not found
components:
schemas:
LoginResponseDTO:
type: object
properties:
userDTO:
$ref: "#/components/schemas/UserDTO"
jwt:
type: string
UserDTO:
type: object
properties:
userId:
type: integer
format: int64
privateName:
type: string
publicName:
type: string
roles:
type: array
items:
type: string
enum:
- USER
- ADMIN
uniqueItems: true
id:
type: integer
format: int64
RoutingPreferencesDTO:
type: object
description: This DTO represents the user preferences for routing / alternative
route suggestions.
properties:
preferPhysicalActivity:
type: boolean
considerWeatherConditions:
type: boolean
modalitiesToConsider:
type: array
items:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
RegisterDeviceTokenRequest:
type: object
properties:
token:
type: string
provider:
type: string
enum:
- FIREBASE
Badge:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
description:
type: string
criteria:
type: object
additionalProperties:
type: integer
format: int32
AddStatRequestDTO:
type: object
properties:
stat:
type: string
value:
type: integer
format: int64
minimum: 0
scope:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- ALL
awardBadges:
type: boolean
required:
- stat
- value
NewTripDTO:
type: object
description: DTO for creating a new Trip
properties:
startPlace:
type: string
description: High level description of the trip's starting location
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
endPlace:
type: string
description: High level description of the trip's ending location
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
tripSegments:
type: array
items:
$ref: "#/components/schemas/NewTripSegmentDTO"
maxItems: 2147483647
minItems: 1
uniqueItems: true
required:
- tripSegments
NewTripSegmentDTO:
type: object
properties:
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: number
format: float
RoutingAlternativeRequestDTO:
type: object
description: This DTO represents a request for alternative routes between an
origin and a destination.
properties:
originLat:
type: number
format: double
originLon:
type: number
format: double
destinationLat:
type: number
format: double
destinationLon:
type: number
format: double
arrivalTime:
type: string
format: date-time
departureTime:
type: string
format: date-time
routingPreferencesDTO:
$ref: "#/components/schemas/RoutingPreferencesDTO"
required:
- arrivalTime
- departureTime
- destinationLat
- destinationLon
- originLat
- originLon
AddressDTO:
type: object
properties:
houseNumber:
type: string
road:
type: string
suburb:
type: string
cityDistrict:
type: string
city:
type: string
state:
type: string
iso3166_2_lvl4:
type: string
postcode:
type: string
country:
type: string
countryCode:
type: string
RouteDTO:
type: object
description: This DTO represents a suggested route as a response to a requested
alternative route.
properties:
startAddress:
$ref: "#/components/schemas/AddressDTO"
description: The actual address of the start location.
firstStopName:
type: string
description: The name of the first stop if the route uses public transport.
E.g. "Essen West" if the route starts with a footpath to the first train
leaving there.
startLat:
type: number
format: double
description: The latitude of the start address.
startLon:
type: number
format: double
description: The longitude of the start address.
endAddress:
$ref: "#/components/schemas/AddressDTO"
description: The actual address of the end location.
lastStopName:
type: string
description: The name of the last stop if the route uses public transport.
E.g. "Essen Hbf" if the route ends with a train arriving there (might
still contain a footpath afterwards).
endLat:
type: number
format: double
description: The latitude of the end address.
endLon:
type: number
format: double
description: The longitude of the end address.
startDateTime:
type: string
format: date-time
description: The start date and time of the route.
endDateTime:
type: string
format: date-time
description: The end date and time of the route.
steps:
type: array
description: The steps the route consists of.
items:
$ref: "#/components/schemas/StepDTO"
co2Savings:
type: number
format: double
description: Amount of CO2e savings in gramm compared to a car trip for
the same route.
co2Emissions:
type: number
format: double
description: CO2e emission of this route.
timeDifferenceSeconds:
type: number
format: double
description: The temporal difference in minutes compared to the original
route the user requested alternatives for.
durationSeconds:
type: integer
format: int64
physicalActivity:
type: boolean
cyclingRoute:
type: boolean
walkingRoute:
type: boolean
StepDTO:
type: object
description: A single step within a suggested alternative route.
properties:
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
lineNumber:
type: string
distanceMeters:
type: number
format: double
UserRegistrationDTO:
type: object
properties:
privateName:
type: string
publicName:
type: string
email:
type: string
password:
type: string
required:
- email
- password
- privateName
- publicName
RegistrationResponseDTO:
type: object
properties:
userDTO:
$ref: "#/components/schemas/UserDTO"
jwt:
type: string
status:
type: string
enum:
- SUCCESS
- EMAIL_EXISTS
- EMAIL_INVALID
- PUBLIC_NAME_EXISTS
- PUBLIC_NAME_FORBIDDEN
- UNKNOWN_ERROR
UserAuthenticationPairDTO:
type: object
properties:
email:
type: string
password:
type: string
required:
- email
- password
Friendship:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
friend:
$ref: "#/components/schemas/User"
status:
type: string
enum:
- REQUESTED
- PENDING
- ACCEPTED
- REJECTED
- BLOCKED
createdAt:
type: string
format: date-time
MaximalUserDTO:
type: object
properties:
id:
type: integer
format: int64
publicName:
type: string
privateName:
type: string
email:
type: string
visibilityPrivacy:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
trips:
type: array
items:
$ref: "#/components/schemas/Trip"
uniqueItems: true
friendships:
type: array
items:
$ref: "#/components/schemas/Friendship"
uniqueItems: true
NotificationToken:
type: object
properties:
userId:
type: integer
format: int64
provider:
type: string
enum:
- FIREBASE
token:
type: string
RoutingPreferences:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
preferPhysicalActivity:
type: boolean
considerWeatherConditions:
type: boolean
modalitiesToConsider:
type: array
items:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
Stats:
type: object
properties:
statsList:
$ref: "#/components/schemas/StatsList"
description: The StatsList to which these stats belong.
xp:
type: integer
format: int64
co2_SAVED:
type: integer
format: int64
km_CYCLED:
type: integer
format: int64
km_WALKED:
type: integer
format: int64
km_PUBLIC_TRANSPORT:
type: integer
format: int64
km_DRIVEN:
type: integer
format: int64
mobility_SCORE:
type: integer
format: int64
required:
- statsList
StatsList:
type: object
properties:
id:
type: integer
format: int64
description: Unique identifier of the StatsList.
example: 1
user:
$ref: "#/components/schemas/User"
description: The User to whom this StatsList belongs.
totalStats:
$ref: "#/components/schemas/Stats"
description: Total stats of the user.
monthlyStats:
$ref: "#/components/schemas/Stats"
description: Monthly stats of the user.
weeklyStats:
$ref: "#/components/schemas/Stats"
description: Weekly stats of the user.
Trip:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
startPlace:
type: string
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
startH3Cell:
type: string
endPlace:
type: string
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
endH3Cell:
type: string
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
cost:
type: number
format: float
invalidated:
type: boolean
mainModality:
type: string
description: Main modality by distance.
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
tripSegments:
type: array
items:
$ref: "#/components/schemas/TripSegment"
uniqueItems: true
TripSegment:
type: object
properties:
id:
type: integer
format: int64
trip:
$ref: "#/components/schemas/Trip"
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: integer
format: int64
User:
type: object
properties:
id:
type: integer
format: int64
publicName:
type: string
privateName:
type: string
email:
type: string
password:
type: string
visibilityPrivacy:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
friendCode:
type: string
trips:
type: array
items:
$ref: "#/components/schemas/Trip"
uniqueItems: true
friendships:
type: array
items:
$ref: "#/components/schemas/Friendship"
uniqueItems: true
roles:
type: array
items:
type: string
enum:
- USER
- ADMIN
uniqueItems: true
notificationToken:
$ref: "#/components/schemas/NotificationToken"
badges:
type: array
items:
$ref: "#/components/schemas/UserBadge"
uniqueItems: true
routingPreferences:
$ref: "#/components/schemas/RoutingPreferences"
stats:
$ref: "#/components/schemas/StatsList"
UserBadge:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
badge:
$ref: "#/components/schemas/Badge"
awardedAt:
type: string
format: date-time
MinimalUserDTO:
type: object
properties:
id:
type: integer
format: int64
displayName:
type: string
TripDTO:
type: object
description: Represents a trip uploaded to the backend by a user that is already
stored in the DB.
properties:
tripId:
type: integer
format: int64
userId:
type: integer
format: int32
startPlace:
type: string
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
endPlace:
type: string
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
tripSegments:
type: array
items:
$ref: "#/components/schemas/TripSegmentDTO"
invalidated:
type: boolean
TripSegmentDTO:
type: object
properties:
tripSegmentId:
type: integer
format: int64
tripId:
type: integer
format: int64
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: number
format: float
Leaderboard:
type: object
properties:
timeframe:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
entries:
type: array
items:
$ref: "#/components/schemas/LeaderboardEntry"
scoreType:
type: string
enum:
- XP
- CO2
- KM
LeaderboardEntry:
type: object
properties:
userId:
type: integer
format: int64
username:
type: string
isFriend:
type: boolean
score:
type: integer
format: int64
FriendshipDTO:
type: object
properties:
friendshipId:
type: integer
format: int64
userId:
type: integer
format: int64
friend:
$ref: "#/components/schemas/MinimalUserDTO"
status:
type: string
enum:
- REQUESTED
- PENDING
- ACCEPTED
- REJECTED
- BLOCKED
createdAt:
type: string
format: date-time
UserBadgeDTO:
type: object
properties:
badgeId:
type: integer
format: int64
name:
type: string
description:
type: string
criteria:
type: object
additionalProperties:
type: integer
format: int32
awardedAt:
type: string
format: date-time
securitySchemes:
bearerAuth:
type: http
name: bearerAuth
scheme: bearer
bearerFormat: JWT