From 6ca56589c398628a76d1a120115cb1ea87b2342c Mon Sep 17 00:00:00 2001 From: f-s-h Date: Sun, 24 May 2026 19:38:51 +0200 Subject: [PATCH 01/15] Implemented path routing for services --- docker-compose.yml | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 85fc028..c726b1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,8 +8,10 @@ services: - 5000 labels: - "traefik.enable=true" - - "traefik.http.routers.py-genai-helper.entrypoints=py-genai-helper" - - "traefik.http.routers.py-genai-helper.rule=PathPrefix(`/`)" + - "traefik.http.routers.py-genai-helper.entrypoints=web" + - "traefik.http.routers.py-genai-helper.rule=PathPrefix(`/api/v1/helper`)" + - "traefik.http.middlewares.helper-stripprefix.stripprefix.prefixes=/api/v1/helper" + - "traefik.http.routers.py-genai-helper.middlewares=helper-stripprefix" - "traefik.http.services.py-genai-helper.loadbalancer.server.port=5000" networks: - proxy @@ -29,8 +31,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.organization-service.entrypoints=organization-service" - - "traefik.http.routers.organization-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.organization-service.entrypoints=web" + - "traefik.http.routers.organization-service.rule=PathPrefix(`/api/v1/organization`)" + - "traefik.http.middlewares.organization-stripprefix.stripprefix.prefixes=/api/v1/organization" + - "traefik.http.routers.organization-service.middlewares=organization-stripprefix" - "traefik.http.services.organization-service.loadbalancer.server.port=8080" networks: - proxy @@ -51,8 +55,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.member-service.entrypoints=member-service" - - "traefik.http.routers.member-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.member-service.entrypoints=web" + - "traefik.http.routers.member-service.rule=PathPrefix(`/api/v1/members`)" + - "traefik.http.middlewares.member-stripprefix.stripprefix.prefixes=/api/v1/members" + - "traefik.http.routers.member-service.middlewares=member-stripprefix" - "traefik.http.services.member-service.loadbalancer.server.port=8080" networks: - proxy @@ -73,8 +79,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.event-service.entrypoints=event-service" - - "traefik.http.routers.event-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.event-service.entrypoints=web" + - "traefik.http.routers.event-service.rule=PathPrefix(`/api/v1/events`)" + - "traefik.http.middlewares.event-stripprefix.stripprefix.prefixes=/api/v1/events" + - "traefik.http.routers.event-service.middlewares=event-stripprefix" - "traefik.http.services.event-service.loadbalancer.server.port=8080" networks: - proxy @@ -95,8 +103,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.feedback-service.entrypoints=feedback-service" - - "traefik.http.routers.feedback-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.feedback-service.entrypoints=web" + - "traefik.http.routers.feedback-service.rule=PathPrefix(`/api/v1/feedback`)" + - "traefik.http.middlewares.feedback-stripprefix.stripprefix.prefixes=/api/v1/feedback" + - "traefik.http.routers.feedback-service.middlewares=feedback-stripprefix" - "traefik.http.services.feedback-service.loadbalancer.server.port=8080" networks: - proxy @@ -117,8 +127,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.finance-service.entrypoints=finance-service" - - "traefik.http.routers.finance-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.finance-service.entrypoints=web" + - "traefik.http.routers.finance-service.rule=PathPrefix(`/api/v1/finances`)" + - "traefik.http.middlewares.finance-stripprefix.stripprefix.prefixes=/api/v1/finances" + - "traefik.http.routers.finance-service.middlewares=finance-stripprefix" - "traefik.http.services.finance-service.loadbalancer.server.port=8080" networks: - proxy @@ -139,8 +151,10 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=update labels: - "traefik.enable=true" - - "traefik.http.routers.letter-service.entrypoints=letter-service" - - "traefik.http.routers.letter-service.rule=PathPrefix(`/`)" + - "traefik.http.routers.letter-service.entrypoints=web" + - "traefik.http.routers.letter-service.rule=PathPrefix(`/api/v1/letters`)" + - "traefik.http.middlewares.letter-stripprefix.stripprefix.prefixes=/api/v1/letters" + - "traefik.http.routers.letter-service.middlewares=letter-stripprefix" - "traefik.http.services.letter-service.loadbalancer.server.port=8080" networks: - proxy @@ -161,7 +175,7 @@ services: - py-genai-helper labels: - "traefik.enable=true" - - "traefik.http.routers.web-client.entrypoints=web-client" + - "traefik.http.routers.web-client.entrypoints=web" - "traefik.http.routers.web-client.rule=PathPrefix(`/`)" - "traefik.http.services.web-client.loadbalancer.server.port=8080" networks: @@ -175,23 +189,9 @@ services: - "--providers.docker=true" - "--providers.docker.exposedByDefault=false" - "--providers.docker.network=proxy" - - "--entrypoints.py-genai-helper.address=:5000" - - "--entrypoints.organization-service.address=:8001" - - "--entrypoints.member-service.address=:8002" - - "--entrypoints.event-service.address=:8003" - - "--entrypoints.feedback-service.address=:8004" - - "--entrypoints.finance-service.address=:8005" - - "--entrypoints.letter-service.address=:8006" - - "--entrypoints.web-client.address=:3000" + - "--entrypoints.web.address=:80" ports: - - "3000:3000" - - "5000:5000" - - "8001:8001" - - "8002:8002" - - "8003:8003" - - "8004:8004" - - "8005:8005" - - "8006:8006" + - "80:80" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro From d6d9ef06eae201539f53edd49aa6c428b68ab335 Mon Sep 17 00:00:00 2001 From: FadyGergesRezk <84906847+FadyGergesRezk@users.noreply.github.com> Date: Mon, 25 May 2026 19:06:47 +0200 Subject: [PATCH 02/15] hook web-client to backend services via /api/v1 path routing --- web-client/src/features/events/api.ts | 14 +++----------- web-client/src/features/events/client.ts | 5 +++++ web-client/src/features/events/types.ts | 4 ---- web-client/src/features/letters/api.ts | 14 +++----------- web-client/src/features/letters/client.ts | 5 +++++ web-client/src/features/letters/types.ts | 4 ---- web-client/src/features/members/api.ts | 14 +++----------- web-client/src/features/members/client.ts | 5 +++++ web-client/src/features/members/types.ts | 4 ---- web-client/src/features/payments/api.ts | 14 +++----------- web-client/src/features/payments/client.ts | 5 +++++ web-client/src/features/payments/types.ts | 4 ---- 12 files changed, 32 insertions(+), 60 deletions(-) create mode 100644 web-client/src/features/events/client.ts delete mode 100644 web-client/src/features/events/types.ts create mode 100644 web-client/src/features/letters/client.ts delete mode 100644 web-client/src/features/letters/types.ts create mode 100644 web-client/src/features/members/client.ts delete mode 100644 web-client/src/features/members/types.ts create mode 100644 web-client/src/features/payments/client.ts delete mode 100644 web-client/src/features/payments/types.ts diff --git a/web-client/src/features/events/api.ts b/web-client/src/features/events/api.ts index 09b7d33..e308447 100644 --- a/web-client/src/features/events/api.ts +++ b/web-client/src/features/events/api.ts @@ -1,14 +1,6 @@ -import type { HelloResponse } from '@/features/events/types' - -function mockEventsHello(): Promise { - return Promise.resolve({ - service: 'event-service', - message: 'Hello from event-service (mock placeholder)', - }) -} +import { eventsClient } from '@/features/events/client' export async function getEventsHello(): Promise { - // TODO: Replace mock with real endpoint when backend is available. - const data = await mockEventsHello() - return `${data.service}: ${data.message}` + const res = await eventsClient.get('/hello') + return res.data } diff --git a/web-client/src/features/events/client.ts b/web-client/src/features/events/client.ts new file mode 100644 index 0000000..b9f66de --- /dev/null +++ b/web-client/src/features/events/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const eventsClient = axios.create({ + baseURL: '/api/v1/events', +}) diff --git a/web-client/src/features/events/types.ts b/web-client/src/features/events/types.ts deleted file mode 100644 index e1abb1a..0000000 --- a/web-client/src/features/events/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type HelloResponse = { - service: string - message: string -} diff --git a/web-client/src/features/letters/api.ts b/web-client/src/features/letters/api.ts index 831af2a..c6f1b69 100644 --- a/web-client/src/features/letters/api.ts +++ b/web-client/src/features/letters/api.ts @@ -1,14 +1,6 @@ -import type { HelloResponse } from '@/features/letters/types' - -function mockLettersHello(): Promise { - return Promise.resolve({ - service: 'letter-service', - message: 'Hello from letter-service (mock placeholder)', - }) -} +import { lettersClient } from '@/features/letters/client' export async function getLettersHello(): Promise { - // TODO: Replace mock with real endpoint when backend is available. - const data = await mockLettersHello() - return `${data.service}: ${data.message}` + const res = await lettersClient.get('/hello') + return res.data } diff --git a/web-client/src/features/letters/client.ts b/web-client/src/features/letters/client.ts new file mode 100644 index 0000000..d977eaa --- /dev/null +++ b/web-client/src/features/letters/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const lettersClient = axios.create({ + baseURL: '/api/v1/letters', +}) diff --git a/web-client/src/features/letters/types.ts b/web-client/src/features/letters/types.ts deleted file mode 100644 index e1abb1a..0000000 --- a/web-client/src/features/letters/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type HelloResponse = { - service: string - message: string -} diff --git a/web-client/src/features/members/api.ts b/web-client/src/features/members/api.ts index 0e47770..8ccde2c 100644 --- a/web-client/src/features/members/api.ts +++ b/web-client/src/features/members/api.ts @@ -1,14 +1,6 @@ -import type { HelloResponse } from '@/features/members/types' - -function mockMembersHello(): Promise { - return Promise.resolve({ - service: 'member-service', - message: 'Hello from member-service (mock placeholder)', - }) -} +import { membersClient } from '@/features/members/client' export async function getMembersHello(): Promise { - // TODO: Replace mock with real endpoint when backend is available. - const data = await mockMembersHello() - return `${data.service}: ${data.message}` + const res = await membersClient.get('/hello') + return res.data } diff --git a/web-client/src/features/members/client.ts b/web-client/src/features/members/client.ts new file mode 100644 index 0000000..303cb4d --- /dev/null +++ b/web-client/src/features/members/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const membersClient = axios.create({ + baseURL: '/api/v1/members', +}) diff --git a/web-client/src/features/members/types.ts b/web-client/src/features/members/types.ts deleted file mode 100644 index e1abb1a..0000000 --- a/web-client/src/features/members/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type HelloResponse = { - service: string - message: string -} diff --git a/web-client/src/features/payments/api.ts b/web-client/src/features/payments/api.ts index 8dc5323..bb6f870 100644 --- a/web-client/src/features/payments/api.ts +++ b/web-client/src/features/payments/api.ts @@ -1,14 +1,6 @@ -import type { HelloResponse } from '@/features/payments/types' - -function mockPaymentsHello(): Promise { - return Promise.resolve({ - service: 'payment-service', - message: 'Hello from payment-service (mock placeholder)', - }) -} +import { paymentsClient } from '@/features/payments/client' export async function getPaymentsHello(): Promise { - // TODO: Replace mock with real endpoint when backend is available. - const data = await mockPaymentsHello() - return `${data.service}: ${data.message}` + const res = await paymentsClient.get('/hello') + return res.data } diff --git a/web-client/src/features/payments/client.ts b/web-client/src/features/payments/client.ts new file mode 100644 index 0000000..29e2d1a --- /dev/null +++ b/web-client/src/features/payments/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const paymentsClient = axios.create({ + baseURL: '/api/v1/finances', +}) diff --git a/web-client/src/features/payments/types.ts b/web-client/src/features/payments/types.ts deleted file mode 100644 index e1abb1a..0000000 --- a/web-client/src/features/payments/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type HelloResponse = { - service: string - message: string -} From 6f3b210e5227ff0a06827821fa1a1eb576cc6628 Mon Sep 17 00:00:00 2001 From: FadyGergesRezk <84906847+FadyGergesRezk@users.noreply.github.com> Date: Mon, 25 May 2026 19:07:16 +0200 Subject: [PATCH 03/15] add organization and feedback service pages --- web-client/src/app/router/AppRouter.tsx | 12 ++++++++++++ web-client/src/features/feedback/api.ts | 6 ++++++ web-client/src/features/feedback/client.ts | 5 +++++ web-client/src/features/organization/api.ts | 6 ++++++ web-client/src/features/organization/client.ts | 5 +++++ 5 files changed, 34 insertions(+) create mode 100644 web-client/src/features/feedback/api.ts create mode 100644 web-client/src/features/feedback/client.ts create mode 100644 web-client/src/features/organization/api.ts create mode 100644 web-client/src/features/organization/client.ts diff --git a/web-client/src/app/router/AppRouter.tsx b/web-client/src/app/router/AppRouter.tsx index dfd26e3..8f4d482 100644 --- a/web-client/src/app/router/AppRouter.tsx +++ b/web-client/src/app/router/AppRouter.tsx @@ -1,8 +1,10 @@ import { NavLink, Navigate, Route, Routes } from 'react-router-dom' import { useEffect, useState } from 'react' import { getEventsHello } from '@/features/events/api' +import { getFeedbackHello } from '@/features/feedback/api' import { getLettersHello } from '@/features/letters/api' import { getMembersHello } from '@/features/members/api' +import { getOrganizationHello } from '@/features/organization/api' import { getPaymentsHello } from '@/features/payments/api' type ServicePlaceholderPageProps = { @@ -70,6 +72,8 @@ export function AppRouter() { Events Payments Letters + Organization + Feedback @@ -93,6 +97,14 @@ export function AppRouter() { path="/letters" element={} /> + } + /> + } + /> diff --git a/web-client/src/features/feedback/api.ts b/web-client/src/features/feedback/api.ts new file mode 100644 index 0000000..80b939f --- /dev/null +++ b/web-client/src/features/feedback/api.ts @@ -0,0 +1,6 @@ +import { feedbackClient } from '@/features/feedback/client' + +export async function getFeedbackHello(): Promise { + const res = await feedbackClient.get('/hello') + return res.data +} diff --git a/web-client/src/features/feedback/client.ts b/web-client/src/features/feedback/client.ts new file mode 100644 index 0000000..4a77acc --- /dev/null +++ b/web-client/src/features/feedback/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const feedbackClient = axios.create({ + baseURL: '/api/v1/feedback', +}) diff --git a/web-client/src/features/organization/api.ts b/web-client/src/features/organization/api.ts new file mode 100644 index 0000000..76f6b0e --- /dev/null +++ b/web-client/src/features/organization/api.ts @@ -0,0 +1,6 @@ +import { organizationClient } from '@/features/organization/client' + +export async function getOrganizationHello(): Promise { + const res = await organizationClient.get('/hello') + return res.data +} diff --git a/web-client/src/features/organization/client.ts b/web-client/src/features/organization/client.ts new file mode 100644 index 0000000..7e8f941 --- /dev/null +++ b/web-client/src/features/organization/client.ts @@ -0,0 +1,5 @@ +import axios from 'axios' + +export const organizationClient = axios.create({ + baseURL: '/api/v1/organization', +}) From d6c479d3134543fc89f9cedd8f5d986e5203ea63 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Sun, 24 May 2026 16:03:12 +0200 Subject: [PATCH 04/15] add basic api definition --- api/openapi.yaml | 2301 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2301 insertions(+) diff --git a/api/openapi.yaml b/api/openapi.yaml index e69de29..919fe34 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -0,0 +1,2301 @@ +openapi: 3.1.0 +info: + title: Club Management System API + description: This is the API definition of the Club Management System. + version: 0.0.0 +servers: + - url: http://example.com/api/v1 + description: "" +paths: + /organization/sports: + get: + operationId: getAllSports + tags: + - organization + summary: Get all sports + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Sport" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + parameters: [] + post: + operationId: createSport + tags: + - organization + summary: Create sport + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Sport" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/SportCreate" + /organization/sports/{sport_name}: + patch: + operationId: updateSport + tags: + - organization + summary: Update sport + parameters: + - $ref: "#/components/parameters/sport_name" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Sport" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/SportPartialUpdate" + security: + - BearerJwt: [] + delete: + operationId: deleteSport + tags: + - organization + summary: Delete sport + parameters: + - $ref: "#/components/parameters/sport_name" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + description: The server cannot find the requested resource. The endpoint may be + invalid or the resource may no longer exist. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + get: + operationId: getSport + tags: + - organization + summary: Get sport + parameters: + - $ref: "#/components/parameters/sport_name" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Sport" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /organization/teams: + get: + operationId: getAllTeams + tags: + - organization + summary: Get all teams + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + post: + operationId: createTeam + tags: + - organization + summary: Create team + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/TeamCreate" + /organization/teams/{team_id}: + get: + operationId: getTeam + tags: + - organization + summary: Get team + parameters: + - $ref: "#/components/parameters/team_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + patch: + operationId: updateTeam + tags: + - organization + summary: Update team + parameters: + - $ref: "#/components/parameters/team_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/TeamPartialUpdate" + delete: + operationId: deleteTeam + tags: + - organization + summary: Delete team + parameters: + - $ref: "#/components/parameters/team_id" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /members: + get: + operationId: getAllMembers + tags: + - members + summary: Get all members + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/MemberSummary" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + post: + operationId: createMember + tags: + - members + summary: Create member + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Member" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/MemberCreate" + /members/{member_id}: + get: + operationId: getMemberDetails + tags: + - members + summary: Get member details + parameters: + - $ref: "#/components/parameters/member_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Member" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + patch: + operationId: updateMemberDetails + tags: + - members + summary: Update member details + parameters: + - $ref: "#/components/parameters/member_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Member" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/MemberPartialUpdate" + delete: + operationId: deleteMember + tags: + - members + summary: Delete member + parameters: + - $ref: "#/components/parameters/member_id" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /events: + get: + operationId: getAllEvents + tags: + - events + summary: Get all events + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/EventSummary" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + post: + operationId: createEvent + tags: + - events + summary: Create event + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Event" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/EventCreate" + /events/{event_id}: + get: + operationId: getEventDetails + tags: + - events + summary: Get event details + parameters: + - $ref: "#/components/parameters/event_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Event" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + patch: + operationId: updateEventDetails + tags: + - events + summary: Update event details + parameters: + - $ref: "#/components/parameters/event_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Event" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/EventPartialUpdate" + delete: + operationId: deleteEvent + tags: + - events + summary: Delete event + parameters: + - $ref: "#/components/parameters/event_id" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /feedback: + get: + operationId: getAllFeedback + tags: + - feedback + summary: Get all feedback + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/FeedbackSummary" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + post: + operationId: createFeedback + tags: + - feedback + summary: Create feedback + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Feedback" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/FeedbackCreate" + /feedback/{feedback_id}: + get: + operationId: getFeedbackDetails + tags: + - feedback + summary: Get feedback details + parameters: + - $ref: "#/components/parameters/feedback_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Feedback" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + delete: + operationId: deleteFeedback + tags: + - feedback + summary: Delete feedback + parameters: + - $ref: "#/components/parameters/feedback_id" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + patch: + operationId: updateFeedbackDetails + tags: + - feedback + summary: Update feedback details + parameters: + - $ref: "#/components/parameters/feedback_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Feedback" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/FeedbackPartialUpdate" + /finance/balances: + get: + operationId: getAllBalances + tags: + - finance + summary: Get all balances + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Balance" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /finance/balances/{member_id}: + get: + operationId: getMemberBalance + tags: + - finance + summary: Get member balance + parameters: + - $ref: "#/components/parameters/member_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Balance" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /finance/transactions: + get: + operationId: getAllTransactions + tags: + - finance + summary: Get all transactions + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Transaction" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + post: + operationId: createTransaction + tags: + - finance + summary: Create transaction + responses: + "201": + description: The request was successful, and a new resource was created. + content: + application/json: + schema: + $ref: "#/components/schemas/Transaction" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "409": + $ref: "#/components/responses/Conflict" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionCreate" + /finance/transactions/{transaction_id}: + get: + operationId: getTransaction + tags: + - finance + summary: Get transaction + parameters: + - $ref: "#/components/parameters/transaction_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Transaction" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + patch: + operationId: updateTransaction + tags: + - finance + summary: Update transaction + parameters: + - $ref: "#/components/parameters/transaction_id" + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/json: + schema: + $ref: "#/components/schemas/Transaction" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionPartialUpdate" + delete: + operationId: deleteTransaction + tags: + - finance + summary: Delete transaction + parameters: + - $ref: "#/components/parameters/transaction_id" + responses: + "204": + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + /letters/mail: + post: + operationId: sendMail + tags: + - letters + summary: Send mail + responses: + "204": + $ref: "#/components/responses/No Content" + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + requestBody: + required: true + description: "" + content: + text/html: + schema: + type: object + parameters: [] + /letters/pdf: + post: + operationId: getPdf + tags: + - letters + summary: Get pdf + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + application/pdf: + schema: + type: object + "400": + $ref: "#/components/responses/BadRequest" + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + security: + - BearerJwt: [] + parameters: [] + requestBody: + required: true + description: "" + content: + text/html: + schema: + type: object + /helper/report/{member_id}: + get: + operationId: generateReport + tags: + - helper + summary: Generate report + responses: + "200": + description: The request was successful, and the server has returned the + requested resource in the response body. + content: + text/plain: + schema: + type: object + "401": + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "403": + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + "500": + $ref: "#/components/responses/InternalServerErrror" + parameters: + - $ref: "#/components/parameters/member_id" + security: + - BearerJwt: [] +components: + responses: + InternalServerErrror: + description: The server encountered an unexpected condition that prevented it + from fulfilling the request. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + NotFound: + description: The server cannot find the requested resource. The endpoint may be + invalid or the resource may no longer exist. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + BadRequest: + description: The server could not understand the request due to invalid syntax. + The client should modify the request and try again. + content: + application/json: + schema: + type: object + properties: + message: + type: string + errors: + type: array + items: + type: object + properties: + message: + type: string + required: + - message + required: + - message + Conflict: + description: The request could not be completed due to a conflict with the + current state of the resource. Resolve the conflict and try again. + content: + application/json: + schema: + type: object + properties: + message: + type: string + required: + - message + No Content: + description: The request was successful, but there is no content to return in + the response. + content: + application/json: + schema: + type: "null" + securitySchemes: + BearerJwt: + type: http + scheme: Bearer + bearerFormat: Json Web Token (JWT) + description: "Jwt Auth: Authenticated requests contain a valid Json Web Token + (JWT) as part of the `Authorization: Bearer ` header." + parameters: + sport_name: + name: sport_name + in: path + required: true + schema: + type: string + team_id: + name: team_id + in: path + required: true + schema: + type: string + member_id: + name: member_id + in: path + required: true + schema: + type: string + event_id: + name: event_id + in: path + required: true + schema: + type: string + feedback_id: + name: feedback_id + in: path + required: true + schema: + type: string + transaction_id: + name: transaction_id + in: path + required: true + schema: + type: string + schemas: + Sport: + type: object + properties: + name: + type: string + description: + type: string + created_at: + type: string + directors: + type: array + items: + type: string + required: + - name + - description + - created_at + - directors + SportCreate: + type: object + properties: + name: + type: string + description: + type: string + directors: + type: array + items: + type: string + required: + - name + description: Data transfer object for creating a new Sport. + x-fiddle-dto-info: + baseSchemaName: Sport + SportPartialUpdate: + type: object + properties: + name: + type: string + description: + type: string + directors: + type: array + items: + type: string + required: [] + description: Data transfer object for partially updating an existing Sport + (PATCH operation). + x-fiddle-dto-info: + baseSchemaName: Sport + Team: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + created_at: + type: string + address: + type: string + sport: + type: string + trainers: + type: array + items: + type: string + trainees: + type: array + items: + type: string + required: + - id + - name + - description + - created_at + - address + - sport + - trainers + - trainees + description: "" + TeamCreate: + type: object + properties: + name: + type: string + description: + type: string + address: + type: string + sport: + type: string + trainers: + type: array + items: + type: string + trainees: + type: array + items: + type: string + required: + - name + - sport + description: Data transfer object for creating a new Team. + x-fiddle-dto-info: + baseSchemaName: Team + TeamPartialUpdate: + type: object + properties: + name: + type: string + description: + type: string + address: + type: string + sport: + type: string + trainers: + type: array + items: + type: string + trainees: + type: array + items: + type: string + required: [] + description: Data transfer object for partially updating an existing Team (PATCH + operation). + x-fiddle-dto-info: + baseSchemaName: Team + Member: + type: object + properties: + id: + type: string + first_name: + type: string + last_name: + type: string + email: + type: string + birthday: + type: string + phone_number: + type: string + address: + type: string + joining_date: + type: string + information: + type: string + required: + - id + - first_name + - last_name + - email + - birthday + - phone_number + - address + - joining_date + - information + description: "" + MemberSummary: + type: object + properties: + id: + type: string + first_name: + type: string + last_name: + type: string + email: + type: string + required: + - id + - first_name + - last_name + - email + description: A simplified representation of a Member, typically used in list views. + x-fiddle-dto-info: + baseSchemaName: Member + MemberPartialUpdate: + type: object + properties: + first_name: + type: string + last_name: + type: string + email: + type: string + birthday: + type: string + phone_number: + type: string + address: + type: string + information: + type: string + required: [] + description: Data transfer object for partially updating an existing Member + (PATCH operation). + x-fiddle-dto-info: + baseSchemaName: Member + MemberCreate: + type: object + properties: + first_name: + type: string + last_name: + type: string + email: + type: string + birthday: + type: string + phone_number: + type: string + address: + type: string + information: + type: string + required: + - first_name + - last_name + description: Data transfer object for creating a new Member. + x-fiddle-dto-info: + baseSchemaName: Member + Event: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + start_time: + type: string + end_time: + type: string + attendees: + type: array + items: + type: string + sports_linked: + type: array + items: + type: string + description: Names of the sports associated with this event. + teams_linked: + type: array + items: + type: string + description: IDs of the teams associated with this event. + creator: + type: string + required: + - id + - name + - description + - start_time + - end_time + - creator + description: "" + EventSummary: + type: object + properties: + id: + type: string + name: + type: string + start_time: + type: string + end_time: + type: string + required: + - id + - name + - start_time + - end_time + description: A simplified representation of a Event, typically used in list views. + x-fiddle-dto-info: + baseSchemaName: Event + EventPartialUpdate: + type: object + properties: + name: + type: string + description: + type: string + start_time: + type: string + end_time: + type: string + attendees: + type: array + items: + type: string + sports_linked: + type: array + items: + type: string + teams_linked: + type: array + items: + type: string + required: [] + description: Data transfer object for partially updating an existing Event + (PATCH operation). + x-fiddle-dto-info: + baseSchemaName: Event + EventCreate: + type: object + properties: + name: + type: string + description: + type: string + start_time: + type: string + end_time: + type: string + attendees: + type: array + items: + type: string + sports_linked: + type: array + items: + type: string + teams_linked: + type: array + items: + type: string + required: + - name + - start_time + - end_time + description: Data transfer object for creating a new Event. + x-fiddle-dto-info: + baseSchemaName: Event + Feedback: + type: object + properties: + id: + type: string + event: + type: string + member: + type: string + creator: + type: string + created_at: + type: string + feedback: + type: string + required: + - id + - event + - member + - creator + - created_at + - feedback + description: "" + FeedbackSummary: + type: object + properties: + id: + type: string + event: + type: string + member: + type: string + creator: + type: string + created_at: + type: string + required: + - id + - event + - member + - creator + - created_at + description: A simplified representation of a Feedback, typically used in list views. + x-fiddle-dto-info: + baseSchemaName: Feedback + FeedbackPartialUpdate: + type: object + properties: + event: + type: string + member: + type: string + feedback: + type: string + required: [] + description: Data transfer object for partially updating an existing Feedback + (PATCH operation). + x-fiddle-dto-info: + baseSchemaName: Feedback + FeedbackCreate: + type: object + properties: + event: + type: string + member: + type: string + feedback: + type: string + required: + - event + - member + - feedback + description: Data transfer object for creating a new Feedback. + x-fiddle-dto-info: + baseSchemaName: Feedback + Transaction: + type: object + properties: + id: + type: string + member: + type: string + creator: + type: string + amount_cents: + type: integer + created_at: + type: string + title: + type: string + description: + type: string + required: + - id + - member + - creator + - amount_cents + - created_at + - title + - description + description: A simplified representation of a Transaction, typically used in + list views. + TransactionPartialUpdate: + type: object + properties: + member: + type: string + amount_cents: + type: integer + title: + type: string + description: + type: string + required: [] + description: Data transfer object for partially updating an existing Transaction + (PATCH operation). + x-fiddle-dto-info: + baseSchemaName: Transaction + TransactionCreate: + type: object + properties: + member: + type: string + amount_cents: + type: integer + title: + type: string + description: + type: string + required: + - member + - amount_cents + - title + description: Data transfer object for creating a new Transaction. + x-fiddle-dto-info: + baseSchemaName: Transaction + Balance: + type: object + properties: + member: + type: string + balance_cents: + type: integer + required: + - member + - balance_cents + description: "" +tags: + - name: organization + - name: members + - name: events + - name: feedback + - name: finance + - name: letters + - name: helper From 0c75e51720f23346c9ec6d9c78ddc211ce604016 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Sun, 24 May 2026 16:40:10 +0200 Subject: [PATCH 05/15] add docker api service --- docker-compose.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index c726b1b..d796356 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -160,6 +160,24 @@ services: - proxy - data + api-docs: + image: swaggerapi/swagger-ui + container_name: api-docs + expose: + - 8080 + environment: + - SWAGGER_JSON=/app/openapi.yaml + - BASE_URL=/docs + volumes: + - ./api/openapi.yaml:/app/openapi.yaml:ro + labels: + - "traefik.enable=true" + - "traefik.http.routers.api-docs.entrypoints=web" + - "traefik.http.routers.api-docs.rule=PathPrefix(`/docs`)" + - "traefik.http.services.api-docs.loadbalancer.server.port=8080" + networks: + - proxy + web-client: build: web-client/ container_name: web-client From 2623bf425351dc173c3663eaf8046d3dab2ea757 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Sun, 24 May 2026 16:43:01 +0200 Subject: [PATCH 06/15] add spectral rules --- .spectral.yaml | 1 + scripts/hooks/sync-pnpm-lock.sh | 0 2 files changed, 1 insertion(+) create mode 100644 .spectral.yaml mode change 100644 => 100755 scripts/hooks/sync-pnpm-lock.sh diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 0000000..d47c47d --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1 @@ +extends: ["spectral:oas"] diff --git a/scripts/hooks/sync-pnpm-lock.sh b/scripts/hooks/sync-pnpm-lock.sh old mode 100644 new mode 100755 From 360f4af6a3e1920280a094b116b7d1c5f53ac8a7 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Sun, 24 May 2026 16:47:28 +0200 Subject: [PATCH 07/15] fix openapi lint issues --- api/openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 919fe34..7e92398 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1556,7 +1556,7 @@ paths: summary: Send mail responses: "204": - $ref: "#/components/responses/No Content" + $ref: "#/components/responses/NoContent" "400": $ref: "#/components/responses/BadRequest" "401": @@ -1750,7 +1750,7 @@ components: type: string required: - message - No Content: + NoContent: description: The request was successful, but there is no content to return in the response. content: From 1cadd1f107ecefd9858a1399e68869b0a9b63e43 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Mon, 25 May 2026 19:45:03 +0200 Subject: [PATCH 08/15] add relative api routing in docs --- api/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 7e92398..4b601c9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -4,7 +4,7 @@ info: description: This is the API definition of the Club Management System. version: 0.0.0 servers: - - url: http://example.com/api/v1 + - url: /api/v1 description: "" paths: /organization/sports: From 4e6a5533e34b2b1da40f6651c4092764e30ea0ba Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Mon, 25 May 2026 22:07:40 +0200 Subject: [PATCH 09/15] add api generator scripts --- .pre-commit-config.yaml | 12 + api/openapi.yaml | 950 ++--------- api/scripts/gen-all.sh | 29 + api/scripts/gen-python-models.sh | 24 + api/scripts/gen-spring.sh | 32 + api/scripts/gen-typescript.sh | 13 + scripts/hooks/run-codegen.sh | 17 + scripts/hooks/sync-pnpm-lock.sh | 24 +- services/py-genai-helper/generated/models.py | 206 +++ services/py-genai-helper/requirements-dev.txt | 1 + services/spring-event/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 7 + .../generated/java/.openapi-generator/VERSION | 1 + .../devoops/eventservice/api/EventsApi.java | 445 +++++ .../model/BadRequestResponse.java | 131 ++ .../eventservice/model/ErrorResponse.java | 94 ++ .../tum/devoops/eventservice/model/Event.java | 322 ++++ .../eventservice/model/EventCreate.java | 271 +++ .../model/EventPartialUpdate.java | 258 +++ .../eventservice/model/EventSummary.java | 170 ++ services/spring-feedback/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 7 + .../generated/java/.openapi-generator/VERSION | 1 + .../feedbackservice/api/FeedbackApi.java | 445 +++++ .../model/BadRequestResponse.java | 131 ++ .../feedbackservice/model/ErrorResponse.java | 94 ++ .../feedbackservice/model/Feedback.java | 220 +++ .../feedbackservice/model/FeedbackCreate.java | 145 ++ .../model/FeedbackPartialUpdate.java | 132 ++ .../model/FeedbackSummary.java | 195 +++ services/spring-finance/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 7 + .../generated/java/.openapi-generator/VERSION | 1 + .../financeservice/api/FinanceApi.java | 591 +++++++ .../model/BadRequestResponse.java | 131 ++ .../devoops/financeservice/model/Balance.java | 120 ++ .../financeservice/model/ErrorResponse.java | 94 ++ .../financeservice/model/Transaction.java | 245 +++ .../model/TransactionCreate.java | 169 ++ .../model/TransactionPartialUpdate.java | 156 ++ services/spring-letter/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 3 + .../generated/java/.openapi-generator/VERSION | 1 + .../devoops/letterservice/api/LettersApi.java | 197 +++ .../model/BadRequestResponse.java | 131 ++ .../letterservice/model/ErrorResponse.java | 94 ++ services/spring-member/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 7 + .../generated/java/.openapi-generator/VERSION | 1 + .../devoops/memberservice/api/MembersApi.java | 445 +++++ .../model/BadRequestResponse.java | 131 ++ .../memberservice/model/ErrorResponse.java | 94 ++ .../devoops/memberservice/model/Member.java | 295 ++++ .../memberservice/model/MemberCreate.java | 240 +++ .../model/MemberPartialUpdate.java | 228 +++ .../memberservice/model/MemberSummary.java | 170 ++ services/spring-organization/build.gradle | 8 + .../generated/java/.openapi-generator/FILES | 9 + .../generated/java/.openapi-generator/VERSION | 1 + .../api/OrganizationApi.java | 842 +++++++++ .../model/BadRequestResponse.java | 131 ++ .../model/ErrorResponse.java | 94 ++ .../organizationservice/model/Sport.java | 181 ++ .../model/SportCreate.java | 155 ++ .../model/SportPartialUpdate.java | 144 ++ .../organizationservice/model/Team.java | 291 ++++ .../organizationservice/model/TeamCreate.java | 237 +++ .../model/TeamPartialUpdate.java | 225 +++ web-client/package.json | 5 +- web-client/pnpm-lock.yaml | 204 ++- web-client/src/api.ts | 1503 +++++++++++++++++ 71 files changed, 11127 insertions(+), 871 deletions(-) create mode 100755 api/scripts/gen-all.sh create mode 100755 api/scripts/gen-python-models.sh create mode 100755 api/scripts/gen-spring.sh create mode 100755 api/scripts/gen-typescript.sh create mode 100755 scripts/hooks/run-codegen.sh create mode 100644 services/py-genai-helper/generated/models.py create mode 100644 services/spring-event/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-event/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/BadRequestResponse.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/ErrorResponse.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java create mode 100644 services/spring-feedback/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-feedback/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/BadRequestResponse.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/ErrorResponse.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackCreate.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackPartialUpdate.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java create mode 100644 services/spring-finance/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-finance/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/BadRequestResponse.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/ErrorResponse.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionCreate.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionPartialUpdate.java create mode 100644 services/spring-letter/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-letter/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java create mode 100644 services/spring-letter/src/generated/java/tum/devoops/letterservice/model/BadRequestResponse.java create mode 100644 services/spring-letter/src/generated/java/tum/devoops/letterservice/model/ErrorResponse.java create mode 100644 services/spring-member/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-member/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/BadRequestResponse.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/ErrorResponse.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java create mode 100644 services/spring-organization/src/generated/java/.openapi-generator/FILES create mode 100644 services/spring-organization/src/generated/java/.openapi-generator/VERSION create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/BadRequestResponse.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/ErrorResponse.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportCreate.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportPartialUpdate.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamCreate.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamPartialUpdate.java create mode 100644 web-client/src/api.ts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f806b9..5569045 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,9 +26,11 @@ repos: # Catches the same class of issue as ruff's W292 # ("no newline at end of file"), but for every text file in # the repo -- not only Python. + exclude: ^services/(py-genai-helper/generated|spring-.*/src/generated)/ - id: trailing-whitespace # Preserve intentional two-space line breaks in markdown. args: [--markdown-linebreak-ext=md] + exclude: ^services/(py-genai-helper/generated|spring-.*/src/generated)/ - id: check-yaml # --allow-multiple-documents is defensive for the planned # Helm charts under infra/; current YAML files are all @@ -54,9 +56,11 @@ repos: name: ruff (lint + autofix) args: [--fix] files: ^services/py-genai-helper/.*\.py$ + exclude: ^services/py-genai-helper/generated/ - id: ruff-format name: ruff-format files: ^services/py-genai-helper/.*\.py$ + exclude: ^services/py-genai-helper/generated/ # ------------------------------------------------------------------ # Local hooks -- delegate to the project's own toolchain (pnpm, @@ -95,3 +99,11 @@ repos: files: ^services/spring-.*/.*\.java$ pass_filenames: false stages: [pre-push] + + - id: openapi-codegen + name: openapi codegen (all services) + language: system + entry: scripts/hooks/run-codegen.sh + files: ^api/openapi\.yaml$ + pass_filenames: false + stages: [pre-commit] diff --git a/api/openapi.yaml b/api/openapi.yaml index 4b601c9..f6b7ba2 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.3 info: title: Club Management System API description: This is the API definition of the Club Management System. @@ -24,29 +24,9 @@ paths: items: $ref: "#/components/schemas/Sport" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -67,29 +47,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -122,29 +82,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -169,46 +109,12 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": - description: The server cannot find the requested resource. The endpoint may be - invalid or the resource may no longer exist. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/NotFound" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -229,29 +135,9 @@ paths: schema: $ref: "#/components/schemas/Sport" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -275,29 +161,9 @@ paths: items: $ref: "#/components/schemas/Team" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -317,29 +183,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -370,29 +216,9 @@ paths: schema: $ref: "#/components/schemas/Team" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -417,29 +243,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -464,34 +270,10 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -515,29 +297,9 @@ paths: items: $ref: "#/components/schemas/MemberSummary" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -557,29 +319,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -610,29 +352,9 @@ paths: schema: $ref: "#/components/schemas/Member" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -657,29 +379,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -704,34 +406,10 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -755,29 +433,9 @@ paths: items: $ref: "#/components/schemas/EventSummary" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -797,29 +455,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -850,29 +488,9 @@ paths: schema: $ref: "#/components/schemas/Event" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -897,29 +515,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -944,34 +542,10 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -995,29 +569,9 @@ paths: items: $ref: "#/components/schemas/FeedbackSummary" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -1037,29 +591,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -1090,29 +624,9 @@ paths: schema: $ref: "#/components/schemas/Feedback" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1130,34 +644,10 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1182,29 +672,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1235,29 +705,9 @@ paths: items: $ref: "#/components/schemas/Balance" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -1279,29 +729,9 @@ paths: schema: $ref: "#/components/schemas/Balance" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1325,29 +755,9 @@ paths: items: $ref: "#/components/schemas/Transaction" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -1367,29 +777,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "409": $ref: "#/components/responses/Conflict" "500": @@ -1420,29 +810,9 @@ paths: schema: $ref: "#/components/schemas/Transaction" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1467,29 +837,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1514,34 +864,10 @@ paths: "204": description: The request was successful, but there is no content to return in the response. - content: - application/json: - schema: - type: "null" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "404": $ref: "#/components/responses/NotFound" "500": @@ -1560,29 +886,9 @@ paths: "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -1608,33 +914,14 @@ paths: content: application/pdf: schema: - type: object + type: string + format: binary "400": $ref: "#/components/responses/BadRequest" "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" security: @@ -1660,31 +947,11 @@ paths: content: text/plain: schema: - type: object + type: string "401": - description: Authentication is required to access the requested resource. The - client must include the appropriate credentials. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Unauthorized" "403": - description: The server understood the request, but refuses to authorize it. - Ensure the client has appropriate permissions. - content: - application/json: - schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/responses/Forbidden" "500": $ref: "#/components/responses/InternalServerErrror" parameters: @@ -1699,64 +966,45 @@ components: content: application/json: schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/schemas/ErrorResponse" NotFound: description: The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. content: application/json: schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/schemas/ErrorResponse" BadRequest: description: The server could not understand the request due to invalid syntax. The client should modify the request and try again. content: application/json: schema: - type: object - properties: - message: - type: string - errors: - type: array - items: - type: object - properties: - message: - type: string - required: - - message - required: - - message + $ref: "#/components/schemas/BadRequestResponse" Conflict: description: The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. content: application/json: schema: - type: object - properties: - message: - type: string - required: - - message + $ref: "#/components/schemas/ErrorResponse" NoContent: description: The request was successful, but there is no content to return in the response. + Unauthorized: + description: Authentication is required to access the requested resource. The + client must include the appropriate credentials. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + Forbidden: + description: The server understood the request, but refuses to authorize it. + Ensure the client has appropriate permissions. content: application/json: schema: - type: "null" + $ref: "#/components/schemas/ErrorResponse" securitySchemes: BearerJwt: type: http @@ -1802,6 +1050,24 @@ components: schema: type: string schemas: + ErrorResponse: + type: object + properties: + message: + type: string + required: + - message + BadRequestResponse: + type: object + properties: + message: + type: string + errors: + type: array + items: + $ref: "#/components/schemas/ErrorResponse" + required: + - message Sport: type: object properties: diff --git a/api/scripts/gen-all.sh b/api/scripts/gen-all.sh new file mode 100755 index 0000000..bde5a12 --- /dev/null +++ b/api/scripts/gen-all.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Run all OpenAPI code generators for every service. +# Called by scripts/hooks/run-codegen.sh (pre-commit) and can be run standalone. +# +# Prerequisites: +# - Docker running (Spring generator) +# - datamodel-code-generator (pip install datamodel-code-generator) +# - openapi-typescript (pnpm devDependency in web-client) +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +echo "Running OpenAPI code generation..." + +# Spring services — each receives only its own tag's API interface + relevant models +"$SCRIPT_DIR/gen-spring.sh" spring-organization organization organizationservice "Sport:SportCreate:SportPartialUpdate:Team:TeamCreate:TeamPartialUpdate:ErrorResponse:BadRequestResponse" +"$SCRIPT_DIR/gen-spring.sh" spring-member members memberservice "Member:MemberSummary:MemberCreate:MemberPartialUpdate:ErrorResponse:BadRequestResponse" +"$SCRIPT_DIR/gen-spring.sh" spring-event events eventservice "Event:EventSummary:EventCreate:EventPartialUpdate:ErrorResponse:BadRequestResponse" +"$SCRIPT_DIR/gen-spring.sh" spring-feedback feedback feedbackservice "Feedback:FeedbackSummary:FeedbackCreate:FeedbackPartialUpdate:ErrorResponse:BadRequestResponse" +"$SCRIPT_DIR/gen-spring.sh" spring-finance finance financeservice "Balance:Transaction:TransactionCreate:TransactionPartialUpdate:ErrorResponse:BadRequestResponse" +"$SCRIPT_DIR/gen-spring.sh" spring-letter letters letterservice "ErrorResponse:BadRequestResponse" + +# Pydantic models for py-genai-helper +"$SCRIPT_DIR/gen-python-models.sh" + +# TypeScript SDK for web-client +"$SCRIPT_DIR/gen-typescript.sh" + +echo "Code generation complete." diff --git a/api/scripts/gen-python-models.sh b/api/scripts/gen-python-models.sh new file mode 100755 index 0000000..10d851f --- /dev/null +++ b/api/scripts/gen-python-models.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Generate Pydantic v2 models for py-genai-helper from the OpenAPI spec. +# Mirrors what the Spring generator produces for Java services: typed +# request/response models derived directly from the spec. +# Requires: datamodel-code-generator (pip install datamodel-code-generator) +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +OUT_FILE="$REPO_ROOT/services/py-genai-helper/generated/models.py" + +echo " Generating Python models (py-genai-helper)..." + +mkdir -p "$(dirname "$OUT_FILE")" + +cd "$REPO_ROOT" +python -m datamodel_code_generator \ + --input api/openapi.yaml \ + --input-file-type openapi \ + --output "$OUT_FILE" \ + --output-model-type pydantic_v2.BaseModel \ + --target-python-version 3.12 \ + --use-annotated \ + --field-constraints \ + --formatters black diff --git a/api/scripts/gen-spring.sh b/api/scripts/gen-spring.sh new file mode 100755 index 0000000..314ed79 --- /dev/null +++ b/api/scripts/gen-spring.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Generate Spring Boot API interfaces and model classes for a single service. +# Usage: gen-spring.sh +# e.g.: gen-spring.sh spring-member members memberservice "Member:MemberSummary:MemberCreate:MemberPartialUpdate" +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +SERVICE="$1" +TAG="$2" +PKG="$3" +MODELS="$4" + +# Capitalise first letter so it matches the generator's API class name (e.g. members → Members) +TAG_CAP="$(echo "${TAG:0:1}" | tr '[:lower:]' '[:upper:]')${TAG:1}" + +OUT_DIR="$REPO_ROOT/services/$SERVICE/src/generated/java" + +echo " Generating Spring stubs: $SERVICE (tag=$TAG)..." + +# Remove previous output so renamed/deleted schemas don't linger +rm -rf "$OUT_DIR" + +docker run --rm \ + --user "$(id -u):$(id -g)" \ + -v "$REPO_ROOT:/local" \ + openapitools/openapi-generator-cli:v7.14.0 generate \ + -i /local/api/openapi.yaml \ + -g spring \ + -o /local/services/"$SERVICE"/src/generated/java \ + --skip-validate-spec \ + --global-property "apis=$TAG_CAP,models=$MODELS,supportingFiles=false" \ + --additional-properties "useSpringBoot3=true,interfaceOnly=true,openApiNullable=false,useTags=true,sourceFolder=,apiPackage=tum.devoops.$PKG.api,modelPackage=tum.devoops.$PKG.model,hideGenerationTimestamp=true" diff --git a/api/scripts/gen-typescript.sh b/api/scripts/gen-typescript.sh new file mode 100755 index 0000000..55c64f9 --- /dev/null +++ b/api/scripts/gen-typescript.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Generate TypeScript types for the web-client SDK using openapi-typescript. +# Requires: openapi-typescript devDependency in web-client/package.json +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" + +echo " Generating TypeScript types..." + +cd "$REPO_ROOT" +pnpm --prefix web-client exec openapi-typescript \ + "$REPO_ROOT/api/openapi.yaml" \ + -o "$REPO_ROOT/web-client/src/api.ts" diff --git a/scripts/hooks/run-codegen.sh b/scripts/hooks/run-codegen.sh new file mode 100755 index 0000000..d51c456 --- /dev/null +++ b/scripts/hooks/run-codegen.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Pre-commit hook: regenerate all service code whenever api/openapi.yaml changes. +# Mirrors the run-spectral.sh pattern; runs gen-all.sh and stages generated output. +set -euo pipefail + +if [ ! -s api/openapi.yaml ]; then + echo "api/openapi.yaml is empty -- skipping codegen." + exit 0 +fi + +./api/scripts/gen-all.sh + +# Stage all generated output so it's included in the commit +git add \ + services/spring-*/src/generated/ \ + services/py-genai-helper/generated/ \ + web-client/src/api.ts diff --git a/scripts/hooks/sync-pnpm-lock.sh b/scripts/hooks/sync-pnpm-lock.sh index dc079b3..e5d8ae3 100755 --- a/scripts/hooks/sync-pnpm-lock.sh +++ b/scripts/hooks/sync-pnpm-lock.sh @@ -4,23 +4,27 @@ # CI by keeping the lockfile in the SAME commit as the manifest. # # Behavior: -# 1. Regenerate pnpm-lock.yaml from package.json (no install, no scripts). -# 2. Stage the (possibly updated) lockfile. -# 3. If the lockfile actually changed, abort the commit so the developer -# can review and re-commit. If it didn't change, allow the commit. +# 1. Capture the currently-staged lockfile content. +# 2. Regenerate pnpm-lock.yaml from package.json (no install, no scripts). +# 3. If the lockfile changed from what was staged, stage the new version +# and abort so the developer can review and re-commit. +# If it didn't change, the lockfile is already correct -- allow the commit. set -euo pipefail -cd web-client +LOCK_FILE="web-client/pnpm-lock.yaml" + +# Snapshot the staged (or committed) lockfile before we touch anything. +before="$(git show ":$LOCK_FILE" 2>/dev/null || cat "$LOCK_FILE" 2>/dev/null || true)" + echo "package.json changed -- regenerating pnpm-lock.yaml..." +cd web-client pnpm install --lockfile-only --ignore-scripts cd .. -git add web-client/pnpm-lock.yaml +after="$(cat "$LOCK_FILE")" -if ! git diff --cached --quiet -- web-client/pnpm-lock.yaml; then - # The lockfile was either newly staged or its staged contents changed - # as a result of this regeneration. Force the developer to re-commit - # so they see the diff that's about to land. +if [ "$before" != "$after" ]; then + git add "$LOCK_FILE" cat <<'EOF' pnpm-lock.yaml was regenerated and staged. diff --git a/services/py-genai-helper/generated/models.py b/services/py-genai-helper/generated/models.py new file mode 100644 index 0000000..712719f --- /dev/null +++ b/services/py-genai-helper/generated/models.py @@ -0,0 +1,206 @@ +# generated by datamodel-codegen: +# filename: openapi.yaml +# timestamp: 2026-05-25T20:08:01+00:00 + +from __future__ import annotations +from pydantic import BaseModel, Field +from typing import Annotated + + +class ErrorResponse(BaseModel): + message: str + + +class BadRequestResponse(BaseModel): + message: str + errors: list[ErrorResponse] | None = None + + +class Sport(BaseModel): + name: str + description: str + created_at: str + directors: list[str] + + +class SportCreate(BaseModel): + name: str + description: str | None = None + directors: list[str] | None = None + + +class SportPartialUpdate(BaseModel): + name: str | None = None + description: str | None = None + directors: list[str] | None = None + + +class Team(BaseModel): + id: str + name: str + description: str + created_at: str + address: str + sport: str + trainers: list[str] + trainees: list[str] + + +class TeamCreate(BaseModel): + name: str + description: str | None = None + address: str | None = None + sport: str + trainers: list[str] | None = None + trainees: list[str] | None = None + + +class TeamPartialUpdate(BaseModel): + name: str | None = None + description: str | None = None + address: str | None = None + sport: str | None = None + trainers: list[str] | None = None + trainees: list[str] | None = None + + +class Member(BaseModel): + id: str + first_name: str + last_name: str + email: str + birthday: str + phone_number: str + address: str + joining_date: str + information: str + + +class MemberSummary(BaseModel): + id: str + first_name: str + last_name: str + email: str + + +class MemberPartialUpdate(BaseModel): + first_name: str | None = None + last_name: str | None = None + email: str | None = None + birthday: str | None = None + phone_number: str | None = None + address: str | None = None + information: str | None = None + + +class MemberCreate(BaseModel): + first_name: str + last_name: str + email: str | None = None + birthday: str | None = None + phone_number: str | None = None + address: str | None = None + information: str | None = None + + +class Event(BaseModel): + id: str + name: str + description: str + start_time: str + end_time: str + attendees: list[str] | None = None + sports_linked: Annotated[ + list[str] | None, + Field(description='Names of the sports associated with this event.'), + ] = None + teams_linked: Annotated[ + list[str] | None, + Field(description='IDs of the teams associated with this event.'), + ] = None + creator: str + + +class EventSummary(BaseModel): + id: str + name: str + start_time: str + end_time: str + + +class EventPartialUpdate(BaseModel): + name: str | None = None + description: str | None = None + start_time: str | None = None + end_time: str | None = None + attendees: list[str] | None = None + sports_linked: list[str] | None = None + teams_linked: list[str] | None = None + + +class EventCreate(BaseModel): + name: str + description: str | None = None + start_time: str + end_time: str + attendees: list[str] | None = None + sports_linked: list[str] | None = None + teams_linked: list[str] | None = None + + +class Feedback(BaseModel): + id: str + event: str + member: str + creator: str + created_at: str + feedback: str + + +class FeedbackSummary(BaseModel): + id: str + event: str + member: str + creator: str + created_at: str + + +class FeedbackPartialUpdate(BaseModel): + event: str | None = None + member: str | None = None + feedback: str | None = None + + +class FeedbackCreate(BaseModel): + event: str + member: str + feedback: str + + +class Transaction(BaseModel): + id: str + member: str + creator: str + amount_cents: int + created_at: str + title: str + description: str + + +class TransactionPartialUpdate(BaseModel): + member: str | None = None + amount_cents: int | None = None + title: str | None = None + description: str | None = None + + +class TransactionCreate(BaseModel): + member: str + amount_cents: int + title: str + description: str | None = None + + +class Balance(BaseModel): + member: str + balance_cents: int diff --git a/services/py-genai-helper/requirements-dev.txt b/services/py-genai-helper/requirements-dev.txt index 57aa3eb..5d45333 100644 --- a/services/py-genai-helper/requirements-dev.txt +++ b/services/py-genai-helper/requirements-dev.txt @@ -1,3 +1,4 @@ # Dev-only tooling: testing and linting. pytest>=8.0 ruff>=0.6 +datamodel-code-generator>=0.25 diff --git a/services/spring-event/build.gradle b/services/spring-event/build.gradle index c501b2e..746ed02 100644 --- a/services/spring-event/build.gradle +++ b/services/spring-event/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-event/src/generated/java/.openapi-generator/FILES b/services/spring-event/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..c08ab17 --- /dev/null +++ b/services/spring-event/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,7 @@ +tum/devoops/eventservice/api/EventsApi.java +tum/devoops/eventservice/model/BadRequestResponse.java +tum/devoops/eventservice/model/ErrorResponse.java +tum/devoops/eventservice/model/Event.java +tum/devoops/eventservice/model/EventCreate.java +tum/devoops/eventservice/model/EventPartialUpdate.java +tum/devoops/eventservice/model/EventSummary.java diff --git a/services/spring-event/src/generated/java/.openapi-generator/VERSION b/services/spring-event/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-event/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java new file mode 100644 index 0000000..6f77af4 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java @@ -0,0 +1,445 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.eventservice.api; + +import tum.devoops.eventservice.model.BadRequestResponse; +import tum.devoops.eventservice.model.ErrorResponse; +import tum.devoops.eventservice.model.Event; +import tum.devoops.eventservice.model.EventCreate; +import tum.devoops.eventservice.model.EventPartialUpdate; +import tum.devoops.eventservice.model.EventSummary; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "events", description = "the events API") +public interface EventsApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /events : Create event + * + * @param eventCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createEvent", + summary = "Create event", + tags = { "events" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Event.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/events", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createEvent( + @Parameter(name = "EventCreate", description = "", required = true) @Valid @RequestBody EventCreate eventCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /events/{event_id} : Delete event + * + * @param eventId (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteEvent", + summary = "Delete event", + tags = { "events" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/events/{event_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteEvent( + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /events : Get all events + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllEvents", + summary = "Get all events", + tags = { "events" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = EventSummary.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/events", + produces = { "application/json" } + ) + + default ResponseEntity> getAllEvents( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"start_time\" : \"start_time\", \"name\" : \"name\", \"end_time\" : \"end_time\", \"id\" : \"id\" }, { \"start_time\" : \"start_time\", \"name\" : \"name\", \"end_time\" : \"end_time\", \"id\" : \"id\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /events/{event_id} : Get event details + * + * @param eventId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getEventDetails", + summary = "Get event details", + tags = { "events" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Event.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/events/{event_id}", + produces = { "application/json" } + ) + + default ResponseEntity getEventDetails( + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /events/{event_id} : Update event details + * + * @param eventId (required) + * @param eventPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateEventDetails", + summary = "Update event details", + tags = { "events" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Event.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/events/{event_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateEventDetails( + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId, + @Parameter(name = "EventPartialUpdate", description = "", required = true) @Valid @RequestBody EventPartialUpdate eventPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/BadRequestResponse.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/BadRequestResponse.java new file mode 100644 index 0000000..89a3218 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.eventservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/ErrorResponse.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/ErrorResponse.java new file mode 100644 index 0000000..7d358dc --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java new file mode 100644 index 0000000..f750440 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java @@ -0,0 +1,322 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * + */ + +@Schema(name = "Event", description = "") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Event { + + private String id; + + private String name; + + private String description; + + private String startTime; + + private String endTime; + + @Valid + private List attendees = new ArrayList<>(); + + @Valid + private List sportsLinked = new ArrayList<>(); + + @Valid + private List teamsLinked = new ArrayList<>(); + + private String creator; + + public Event() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Event(String id, String name, String description, String startTime, String endTime, String creator) { + this.id = id; + this.name = name; + this.description = description; + this.startTime = startTime; + this.endTime = endTime; + this.creator = creator; + } + + public Event id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Event name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Event description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @NotNull + @Schema(name = "description", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Event startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + @NotNull + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("start_time") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public Event endTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + */ + @NotNull + @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("end_time") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Event attendees(List attendees) { + this.attendees = attendees; + return this; + } + + public Event addAttendeesItem(String attendeesItem) { + if (this.attendees == null) { + this.attendees = new ArrayList<>(); + } + this.attendees.add(attendeesItem); + return this; + } + + /** + * Get attendees + * @return attendees + */ + + @Schema(name = "attendees", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attendees") + public List getAttendees() { + return attendees; + } + + public void setAttendees(List attendees) { + this.attendees = attendees; + } + + public Event sportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + return this; + } + + public Event addSportsLinkedItem(String sportsLinkedItem) { + if (this.sportsLinked == null) { + this.sportsLinked = new ArrayList<>(); + } + this.sportsLinked.add(sportsLinkedItem); + return this; + } + + /** + * Names of the sports associated with this event. + * @return sportsLinked + */ + + @Schema(name = "sports_linked", description = "Names of the sports associated with this event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sports_linked") + public List getSportsLinked() { + return sportsLinked; + } + + public void setSportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + } + + public Event teamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + return this; + } + + public Event addTeamsLinkedItem(String teamsLinkedItem) { + if (this.teamsLinked == null) { + this.teamsLinked = new ArrayList<>(); + } + this.teamsLinked.add(teamsLinkedItem); + return this; + } + + /** + * IDs of the teams associated with this event. + * @return teamsLinked + */ + + @Schema(name = "teams_linked", description = "IDs of the teams associated with this event.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("teams_linked") + public List getTeamsLinked() { + return teamsLinked; + } + + public void setTeamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + } + + public Event creator(String creator) { + this.creator = creator; + return this; + } + + /** + * Get creator + * @return creator + */ + @NotNull + @Schema(name = "creator", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("creator") + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Event event = (Event) o; + return Objects.equals(this.id, event.id) && + Objects.equals(this.name, event.name) && + Objects.equals(this.description, event.description) && + Objects.equals(this.startTime, event.startTime) && + Objects.equals(this.endTime, event.endTime) && + Objects.equals(this.attendees, event.attendees) && + Objects.equals(this.sportsLinked, event.sportsLinked) && + Objects.equals(this.teamsLinked, event.teamsLinked) && + Objects.equals(this.creator, event.creator); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, startTime, endTime, attendees, sportsLinked, teamsLinked, creator); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Event {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" attendees: ").append(toIndentedString(attendees)).append("\n"); + sb.append(" sportsLinked: ").append(toIndentedString(sportsLinked)).append("\n"); + sb.append(" teamsLinked: ").append(toIndentedString(teamsLinked)).append("\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java new file mode 100644 index 0000000..a94eb56 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java @@ -0,0 +1,271 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Event. + */ + +@Schema(name = "EventCreate", description = "Data transfer object for creating a new Event.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class EventCreate { + + private String name; + + private @Nullable String description; + + private String startTime; + + private String endTime; + + @Valid + private List attendees = new ArrayList<>(); + + @Valid + private List sportsLinked = new ArrayList<>(); + + @Valid + private List teamsLinked = new ArrayList<>(); + + public EventCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EventCreate(String name, String startTime, String endTime) { + this.name = name; + this.startTime = startTime; + this.endTime = endTime; + } + + public EventCreate name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public EventCreate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public EventCreate startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + @NotNull + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("start_time") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public EventCreate endTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + */ + @NotNull + @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("end_time") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public EventCreate attendees(List attendees) { + this.attendees = attendees; + return this; + } + + public EventCreate addAttendeesItem(String attendeesItem) { + if (this.attendees == null) { + this.attendees = new ArrayList<>(); + } + this.attendees.add(attendeesItem); + return this; + } + + /** + * Get attendees + * @return attendees + */ + + @Schema(name = "attendees", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attendees") + public List getAttendees() { + return attendees; + } + + public void setAttendees(List attendees) { + this.attendees = attendees; + } + + public EventCreate sportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + return this; + } + + public EventCreate addSportsLinkedItem(String sportsLinkedItem) { + if (this.sportsLinked == null) { + this.sportsLinked = new ArrayList<>(); + } + this.sportsLinked.add(sportsLinkedItem); + return this; + } + + /** + * Get sportsLinked + * @return sportsLinked + */ + + @Schema(name = "sports_linked", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sports_linked") + public List getSportsLinked() { + return sportsLinked; + } + + public void setSportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + } + + public EventCreate teamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + return this; + } + + public EventCreate addTeamsLinkedItem(String teamsLinkedItem) { + if (this.teamsLinked == null) { + this.teamsLinked = new ArrayList<>(); + } + this.teamsLinked.add(teamsLinkedItem); + return this; + } + + /** + * Get teamsLinked + * @return teamsLinked + */ + + @Schema(name = "teams_linked", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("teams_linked") + public List getTeamsLinked() { + return teamsLinked; + } + + public void setTeamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventCreate eventCreate = (EventCreate) o; + return Objects.equals(this.name, eventCreate.name) && + Objects.equals(this.description, eventCreate.description) && + Objects.equals(this.startTime, eventCreate.startTime) && + Objects.equals(this.endTime, eventCreate.endTime) && + Objects.equals(this.attendees, eventCreate.attendees) && + Objects.equals(this.sportsLinked, eventCreate.sportsLinked) && + Objects.equals(this.teamsLinked, eventCreate.teamsLinked); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, startTime, endTime, attendees, sportsLinked, teamsLinked); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCreate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" attendees: ").append(toIndentedString(attendees)).append("\n"); + sb.append(" sportsLinked: ").append(toIndentedString(sportsLinked)).append("\n"); + sb.append(" teamsLinked: ").append(toIndentedString(teamsLinked)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java new file mode 100644 index 0000000..e83ffc2 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java @@ -0,0 +1,258 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Event (PATCH operation). + */ + +@Schema(name = "EventPartialUpdate", description = "Data transfer object for partially updating an existing Event (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class EventPartialUpdate { + + private @Nullable String name; + + private @Nullable String description; + + private @Nullable String startTime; + + private @Nullable String endTime; + + @Valid + private List attendees = new ArrayList<>(); + + @Valid + private List sportsLinked = new ArrayList<>(); + + @Valid + private List teamsLinked = new ArrayList<>(); + + public EventPartialUpdate name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + + public EventPartialUpdate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public EventPartialUpdate startTime(@Nullable String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("start_time") + public @Nullable String getStartTime() { + return startTime; + } + + public void setStartTime(@Nullable String startTime) { + this.startTime = startTime; + } + + public EventPartialUpdate endTime(@Nullable String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + */ + + @Schema(name = "end_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("end_time") + public @Nullable String getEndTime() { + return endTime; + } + + public void setEndTime(@Nullable String endTime) { + this.endTime = endTime; + } + + public EventPartialUpdate attendees(List attendees) { + this.attendees = attendees; + return this; + } + + public EventPartialUpdate addAttendeesItem(String attendeesItem) { + if (this.attendees == null) { + this.attendees = new ArrayList<>(); + } + this.attendees.add(attendeesItem); + return this; + } + + /** + * Get attendees + * @return attendees + */ + + @Schema(name = "attendees", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attendees") + public List getAttendees() { + return attendees; + } + + public void setAttendees(List attendees) { + this.attendees = attendees; + } + + public EventPartialUpdate sportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + return this; + } + + public EventPartialUpdate addSportsLinkedItem(String sportsLinkedItem) { + if (this.sportsLinked == null) { + this.sportsLinked = new ArrayList<>(); + } + this.sportsLinked.add(sportsLinkedItem); + return this; + } + + /** + * Get sportsLinked + * @return sportsLinked + */ + + @Schema(name = "sports_linked", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sports_linked") + public List getSportsLinked() { + return sportsLinked; + } + + public void setSportsLinked(List sportsLinked) { + this.sportsLinked = sportsLinked; + } + + public EventPartialUpdate teamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + return this; + } + + public EventPartialUpdate addTeamsLinkedItem(String teamsLinkedItem) { + if (this.teamsLinked == null) { + this.teamsLinked = new ArrayList<>(); + } + this.teamsLinked.add(teamsLinkedItem); + return this; + } + + /** + * Get teamsLinked + * @return teamsLinked + */ + + @Schema(name = "teams_linked", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("teams_linked") + public List getTeamsLinked() { + return teamsLinked; + } + + public void setTeamsLinked(List teamsLinked) { + this.teamsLinked = teamsLinked; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventPartialUpdate eventPartialUpdate = (EventPartialUpdate) o; + return Objects.equals(this.name, eventPartialUpdate.name) && + Objects.equals(this.description, eventPartialUpdate.description) && + Objects.equals(this.startTime, eventPartialUpdate.startTime) && + Objects.equals(this.endTime, eventPartialUpdate.endTime) && + Objects.equals(this.attendees, eventPartialUpdate.attendees) && + Objects.equals(this.sportsLinked, eventPartialUpdate.sportsLinked) && + Objects.equals(this.teamsLinked, eventPartialUpdate.teamsLinked); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, startTime, endTime, attendees, sportsLinked, teamsLinked); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventPartialUpdate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" attendees: ").append(toIndentedString(attendees)).append("\n"); + sb.append(" sportsLinked: ").append(toIndentedString(sportsLinked)).append("\n"); + sb.append(" teamsLinked: ").append(toIndentedString(teamsLinked)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java new file mode 100644 index 0000000..919024c --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java @@ -0,0 +1,170 @@ +package tum.devoops.eventservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * A simplified representation of a Event, typically used in list views. + */ + +@Schema(name = "EventSummary", description = "A simplified representation of a Event, typically used in list views.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class EventSummary { + + private String id; + + private String name; + + private String startTime; + + private String endTime; + + public EventSummary() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EventSummary(String id, String name, String startTime, String endTime) { + this.id = id; + this.name = name; + this.startTime = startTime; + this.endTime = endTime; + } + + public EventSummary id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EventSummary name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public EventSummary startTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + @NotNull + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("start_time") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public EventSummary endTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + */ + @NotNull + @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("end_time") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSummary eventSummary = (EventSummary) o; + return Objects.equals(this.id, eventSummary.id) && + Objects.equals(this.name, eventSummary.name) && + Objects.equals(this.startTime, eventSummary.startTime) && + Objects.equals(this.endTime, eventSummary.endTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, startTime, endTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/build.gradle b/services/spring-feedback/build.gradle index a8fffac..481d3de 100644 --- a/services/spring-feedback/build.gradle +++ b/services/spring-feedback/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-feedback/src/generated/java/.openapi-generator/FILES b/services/spring-feedback/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..93525c7 --- /dev/null +++ b/services/spring-feedback/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,7 @@ +tum/devoops/feedbackservice/api/FeedbackApi.java +tum/devoops/feedbackservice/model/BadRequestResponse.java +tum/devoops/feedbackservice/model/ErrorResponse.java +tum/devoops/feedbackservice/model/Feedback.java +tum/devoops/feedbackservice/model/FeedbackCreate.java +tum/devoops/feedbackservice/model/FeedbackPartialUpdate.java +tum/devoops/feedbackservice/model/FeedbackSummary.java diff --git a/services/spring-feedback/src/generated/java/.openapi-generator/VERSION b/services/spring-feedback/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-feedback/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java new file mode 100644 index 0000000..9407fca --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java @@ -0,0 +1,445 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.feedbackservice.api; + +import tum.devoops.feedbackservice.model.BadRequestResponse; +import tum.devoops.feedbackservice.model.ErrorResponse; +import tum.devoops.feedbackservice.model.Feedback; +import tum.devoops.feedbackservice.model.FeedbackCreate; +import tum.devoops.feedbackservice.model.FeedbackPartialUpdate; +import tum.devoops.feedbackservice.model.FeedbackSummary; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "feedback", description = "the feedback API") +public interface FeedbackApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /feedback : Create feedback + * + * @param feedbackCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createFeedback", + summary = "Create feedback", + tags = { "feedback" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Feedback.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/feedback", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createFeedback( + @Parameter(name = "FeedbackCreate", description = "", required = true) @Valid @RequestBody FeedbackCreate feedbackCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /feedback/{feedback_id} : Delete feedback + * + * @param feedbackId (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteFeedback", + summary = "Delete feedback", + tags = { "feedback" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/feedback/{feedback_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteFeedback( + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /feedback : Get all feedback + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllFeedback", + summary = "Get all feedback", + tags = { "feedback" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = FeedbackSummary.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/feedback", + produces = { "application/json" } + ) + + default ResponseEntity> getAllFeedback( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }, { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /feedback/{feedback_id} : Get feedback details + * + * @param feedbackId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getFeedbackDetails", + summary = "Get feedback details", + tags = { "feedback" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Feedback.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/feedback/{feedback_id}", + produces = { "application/json" } + ) + + default ResponseEntity getFeedbackDetails( + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /feedback/{feedback_id} : Update feedback details + * + * @param feedbackId (required) + * @param feedbackPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateFeedbackDetails", + summary = "Update feedback details", + tags = { "feedback" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Feedback.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/feedback/{feedback_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateFeedbackDetails( + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId, + @Parameter(name = "FeedbackPartialUpdate", description = "", required = true) @Valid @RequestBody FeedbackPartialUpdate feedbackPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/BadRequestResponse.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/BadRequestResponse.java new file mode 100644 index 0000000..4f2c9e6 --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.feedbackservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/ErrorResponse.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/ErrorResponse.java new file mode 100644 index 0000000..781a1cc --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java new file mode 100644 index 0000000..770233e --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java @@ -0,0 +1,220 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * + */ + +@Schema(name = "Feedback", description = "") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Feedback { + + private String id; + + private String event; + + private String member; + + private String creator; + + private String createdAt; + + private String feedback; + + public Feedback() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Feedback(String id, String event, String member, String creator, String createdAt, String feedback) { + this.id = id; + this.event = event; + this.member = member; + this.creator = creator; + this.createdAt = createdAt; + this.feedback = feedback; + } + + public Feedback id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Feedback event(String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @NotNull + @Schema(name = "event", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("event") + public String getEvent() { + return event; + } + + public void setEvent(String event) { + this.event = event; + } + + public Feedback member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public Feedback creator(String creator) { + this.creator = creator; + return this; + } + + /** + * Get creator + * @return creator + */ + @NotNull + @Schema(name = "creator", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("creator") + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public Feedback createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @NotNull + @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Feedback feedback(String feedback) { + this.feedback = feedback; + return this; + } + + /** + * Get feedback + * @return feedback + */ + @NotNull + @Schema(name = "feedback", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("feedback") + public String getFeedback() { + return feedback; + } + + public void setFeedback(String feedback) { + this.feedback = feedback; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Feedback feedback = (Feedback) o; + return Objects.equals(this.id, feedback.id) && + Objects.equals(this.event, feedback.event) && + Objects.equals(this.member, feedback.member) && + Objects.equals(this.creator, feedback.creator) && + Objects.equals(this.createdAt, feedback.createdAt) && + Objects.equals(this.feedback, feedback.feedback); + } + + @Override + public int hashCode() { + return Objects.hash(id, event, member, creator, createdAt, feedback); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Feedback {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" feedback: ").append(toIndentedString(feedback)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackCreate.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackCreate.java new file mode 100644 index 0000000..62118cd --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackCreate.java @@ -0,0 +1,145 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Feedback. + */ + +@Schema(name = "FeedbackCreate", description = "Data transfer object for creating a new Feedback.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class FeedbackCreate { + + private String event; + + private String member; + + private String feedback; + + public FeedbackCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FeedbackCreate(String event, String member, String feedback) { + this.event = event; + this.member = member; + this.feedback = feedback; + } + + public FeedbackCreate event(String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @NotNull + @Schema(name = "event", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("event") + public String getEvent() { + return event; + } + + public void setEvent(String event) { + this.event = event; + } + + public FeedbackCreate member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public FeedbackCreate feedback(String feedback) { + this.feedback = feedback; + return this; + } + + /** + * Get feedback + * @return feedback + */ + @NotNull + @Schema(name = "feedback", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("feedback") + public String getFeedback() { + return feedback; + } + + public void setFeedback(String feedback) { + this.feedback = feedback; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FeedbackCreate feedbackCreate = (FeedbackCreate) o; + return Objects.equals(this.event, feedbackCreate.event) && + Objects.equals(this.member, feedbackCreate.member) && + Objects.equals(this.feedback, feedbackCreate.feedback); + } + + @Override + public int hashCode() { + return Objects.hash(event, member, feedback); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FeedbackCreate {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" feedback: ").append(toIndentedString(feedback)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackPartialUpdate.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackPartialUpdate.java new file mode 100644 index 0000000..9f74f19 --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackPartialUpdate.java @@ -0,0 +1,132 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Feedback (PATCH operation). + */ + +@Schema(name = "FeedbackPartialUpdate", description = "Data transfer object for partially updating an existing Feedback (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class FeedbackPartialUpdate { + + private @Nullable String event; + + private @Nullable String member; + + private @Nullable String feedback; + + public FeedbackPartialUpdate event(@Nullable String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + + @Schema(name = "event", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("event") + public @Nullable String getEvent() { + return event; + } + + public void setEvent(@Nullable String event) { + this.event = event; + } + + public FeedbackPartialUpdate member(@Nullable String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + + @Schema(name = "member", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("member") + public @Nullable String getMember() { + return member; + } + + public void setMember(@Nullable String member) { + this.member = member; + } + + public FeedbackPartialUpdate feedback(@Nullable String feedback) { + this.feedback = feedback; + return this; + } + + /** + * Get feedback + * @return feedback + */ + + @Schema(name = "feedback", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("feedback") + public @Nullable String getFeedback() { + return feedback; + } + + public void setFeedback(@Nullable String feedback) { + this.feedback = feedback; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FeedbackPartialUpdate feedbackPartialUpdate = (FeedbackPartialUpdate) o; + return Objects.equals(this.event, feedbackPartialUpdate.event) && + Objects.equals(this.member, feedbackPartialUpdate.member) && + Objects.equals(this.feedback, feedbackPartialUpdate.feedback); + } + + @Override + public int hashCode() { + return Objects.hash(event, member, feedback); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FeedbackPartialUpdate {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" feedback: ").append(toIndentedString(feedback)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java new file mode 100644 index 0000000..ab7f0e1 --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java @@ -0,0 +1,195 @@ +package tum.devoops.feedbackservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * A simplified representation of a Feedback, typically used in list views. + */ + +@Schema(name = "FeedbackSummary", description = "A simplified representation of a Feedback, typically used in list views.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class FeedbackSummary { + + private String id; + + private String event; + + private String member; + + private String creator; + + private String createdAt; + + public FeedbackSummary() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FeedbackSummary(String id, String event, String member, String creator, String createdAt) { + this.id = id; + this.event = event; + this.member = member; + this.creator = creator; + this.createdAt = createdAt; + } + + public FeedbackSummary id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FeedbackSummary event(String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @NotNull + @Schema(name = "event", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("event") + public String getEvent() { + return event; + } + + public void setEvent(String event) { + this.event = event; + } + + public FeedbackSummary member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public FeedbackSummary creator(String creator) { + this.creator = creator; + return this; + } + + /** + * Get creator + * @return creator + */ + @NotNull + @Schema(name = "creator", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("creator") + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public FeedbackSummary createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @NotNull + @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FeedbackSummary feedbackSummary = (FeedbackSummary) o; + return Objects.equals(this.id, feedbackSummary.id) && + Objects.equals(this.event, feedbackSummary.event) && + Objects.equals(this.member, feedbackSummary.member) && + Objects.equals(this.creator, feedbackSummary.creator) && + Objects.equals(this.createdAt, feedbackSummary.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, event, member, creator, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FeedbackSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/build.gradle b/services/spring-finance/build.gradle index a3d97cf..6cc35d5 100644 --- a/services/spring-finance/build.gradle +++ b/services/spring-finance/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-finance/src/generated/java/.openapi-generator/FILES b/services/spring-finance/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..dd371b6 --- /dev/null +++ b/services/spring-finance/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,7 @@ +tum/devoops/financeservice/api/FinanceApi.java +tum/devoops/financeservice/model/BadRequestResponse.java +tum/devoops/financeservice/model/Balance.java +tum/devoops/financeservice/model/ErrorResponse.java +tum/devoops/financeservice/model/Transaction.java +tum/devoops/financeservice/model/TransactionCreate.java +tum/devoops/financeservice/model/TransactionPartialUpdate.java diff --git a/services/spring-finance/src/generated/java/.openapi-generator/VERSION b/services/spring-finance/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-finance/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java new file mode 100644 index 0000000..389cc05 --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java @@ -0,0 +1,591 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.financeservice.api; + +import tum.devoops.financeservice.model.BadRequestResponse; +import tum.devoops.financeservice.model.Balance; +import tum.devoops.financeservice.model.ErrorResponse; +import tum.devoops.financeservice.model.Transaction; +import tum.devoops.financeservice.model.TransactionCreate; +import tum.devoops.financeservice.model.TransactionPartialUpdate; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "finance", description = "the finance API") +public interface FinanceApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /finance/transactions : Create transaction + * + * @param transactionCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createTransaction", + summary = "Create transaction", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Transaction.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/finance/transactions", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createTransaction( + @Parameter(name = "TransactionCreate", description = "", required = true) @Valid @RequestBody TransactionCreate transactionCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /finance/transactions/{transaction_id} : Delete transaction + * + * @param transactionId (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteTransaction", + summary = "Delete transaction", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/finance/transactions/{transaction_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteTransaction( + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /finance/balances : Get all balances + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllBalances", + summary = "Get all balances", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Balance.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/finance/balances", + produces = { "application/json" } + ) + + default ResponseEntity> getAllBalances( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"member\" : \"member\", \"balance_cents\" : 0 }, { \"member\" : \"member\", \"balance_cents\" : 0 } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /finance/transactions : Get all transactions + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllTransactions", + summary = "Get all transactions", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Transaction.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/finance/transactions", + produces = { "application/json" } + ) + + default ResponseEntity> getAllTransactions( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }, { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /finance/balances/{member_id} : Get member balance + * + * @param memberId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getMemberBalance", + summary = "Get member balance", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Balance.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/finance/balances/{member_id}", + produces = { "application/json" } + ) + + default ResponseEntity getMemberBalance( + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"member\" : \"member\", \"balance_cents\" : 0 }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /finance/transactions/{transaction_id} : Get transaction + * + * @param transactionId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getTransaction", + summary = "Get transaction", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Transaction.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/finance/transactions/{transaction_id}", + produces = { "application/json" } + ) + + default ResponseEntity getTransaction( + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /finance/transactions/{transaction_id} : Update transaction + * + * @param transactionId (required) + * @param transactionPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateTransaction", + summary = "Update transaction", + tags = { "finance" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Transaction.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/finance/transactions/{transaction_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateTransaction( + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId, + @Parameter(name = "TransactionPartialUpdate", description = "", required = true) @Valid @RequestBody TransactionPartialUpdate transactionPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/BadRequestResponse.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/BadRequestResponse.java new file mode 100644 index 0000000..9906f25 --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.financeservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java new file mode 100644 index 0000000..43b20b4 --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java @@ -0,0 +1,120 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * + */ + +@Schema(name = "Balance", description = "") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Balance { + + private String member; + + private Integer balanceCents; + + public Balance() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Balance(String member, Integer balanceCents) { + this.member = member; + this.balanceCents = balanceCents; + } + + public Balance member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public Balance balanceCents(Integer balanceCents) { + this.balanceCents = balanceCents; + return this; + } + + /** + * Get balanceCents + * @return balanceCents + */ + @NotNull + @Schema(name = "balance_cents", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("balance_cents") + public Integer getBalanceCents() { + return balanceCents; + } + + public void setBalanceCents(Integer balanceCents) { + this.balanceCents = balanceCents; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Balance balance = (Balance) o; + return Objects.equals(this.member, balance.member) && + Objects.equals(this.balanceCents, balance.balanceCents); + } + + @Override + public int hashCode() { + return Objects.hash(member, balanceCents); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Balance {\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" balanceCents: ").append(toIndentedString(balanceCents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/ErrorResponse.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/ErrorResponse.java new file mode 100644 index 0000000..1a9599a --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java new file mode 100644 index 0000000..abfb18d --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java @@ -0,0 +1,245 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * A simplified representation of a Transaction, typically used in list views. + */ + +@Schema(name = "Transaction", description = "A simplified representation of a Transaction, typically used in list views.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Transaction { + + private String id; + + private String member; + + private String creator; + + private Integer amountCents; + + private String createdAt; + + private String title; + + private String description; + + public Transaction() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Transaction(String id, String member, String creator, Integer amountCents, String createdAt, String title, String description) { + this.id = id; + this.member = member; + this.creator = creator; + this.amountCents = amountCents; + this.createdAt = createdAt; + this.title = title; + this.description = description; + } + + public Transaction id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transaction member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public Transaction creator(String creator) { + this.creator = creator; + return this; + } + + /** + * Get creator + * @return creator + */ + @NotNull + @Schema(name = "creator", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("creator") + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public Transaction amountCents(Integer amountCents) { + this.amountCents = amountCents; + return this; + } + + /** + * Get amountCents + * @return amountCents + */ + @NotNull + @Schema(name = "amount_cents", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("amount_cents") + public Integer getAmountCents() { + return amountCents; + } + + public void setAmountCents(Integer amountCents) { + this.amountCents = amountCents; + } + + public Transaction createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @NotNull + @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Transaction title(String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @NotNull + @Schema(name = "title", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("title") + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Transaction description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @NotNull + @Schema(name = "description", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transaction transaction = (Transaction) o; + return Objects.equals(this.id, transaction.id) && + Objects.equals(this.member, transaction.member) && + Objects.equals(this.creator, transaction.creator) && + Objects.equals(this.amountCents, transaction.amountCents) && + Objects.equals(this.createdAt, transaction.createdAt) && + Objects.equals(this.title, transaction.title) && + Objects.equals(this.description, transaction.description); + } + + @Override + public int hashCode() { + return Objects.hash(id, member, creator, amountCents, createdAt, title, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transaction {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append(" amountCents: ").append(toIndentedString(amountCents)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionCreate.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionCreate.java new file mode 100644 index 0000000..6c4b2d0 --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionCreate.java @@ -0,0 +1,169 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Transaction. + */ + +@Schema(name = "TransactionCreate", description = "Data transfer object for creating a new Transaction.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class TransactionCreate { + + private String member; + + private Integer amountCents; + + private String title; + + private @Nullable String description; + + public TransactionCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TransactionCreate(String member, Integer amountCents, String title) { + this.member = member; + this.amountCents = amountCents; + this.title = title; + } + + public TransactionCreate member(String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + @NotNull + @Schema(name = "member", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("member") + public String getMember() { + return member; + } + + public void setMember(String member) { + this.member = member; + } + + public TransactionCreate amountCents(Integer amountCents) { + this.amountCents = amountCents; + return this; + } + + /** + * Get amountCents + * @return amountCents + */ + @NotNull + @Schema(name = "amount_cents", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("amount_cents") + public Integer getAmountCents() { + return amountCents; + } + + public void setAmountCents(Integer amountCents) { + this.amountCents = amountCents; + } + + public TransactionCreate title(String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @NotNull + @Schema(name = "title", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("title") + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public TransactionCreate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionCreate transactionCreate = (TransactionCreate) o; + return Objects.equals(this.member, transactionCreate.member) && + Objects.equals(this.amountCents, transactionCreate.amountCents) && + Objects.equals(this.title, transactionCreate.title) && + Objects.equals(this.description, transactionCreate.description); + } + + @Override + public int hashCode() { + return Objects.hash(member, amountCents, title, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionCreate {\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" amountCents: ").append(toIndentedString(amountCents)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionPartialUpdate.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionPartialUpdate.java new file mode 100644 index 0000000..7e6a852 --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/TransactionPartialUpdate.java @@ -0,0 +1,156 @@ +package tum.devoops.financeservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Transaction (PATCH operation). + */ + +@Schema(name = "TransactionPartialUpdate", description = "Data transfer object for partially updating an existing Transaction (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class TransactionPartialUpdate { + + private @Nullable String member; + + private @Nullable Integer amountCents; + + private @Nullable String title; + + private @Nullable String description; + + public TransactionPartialUpdate member(@Nullable String member) { + this.member = member; + return this; + } + + /** + * Get member + * @return member + */ + + @Schema(name = "member", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("member") + public @Nullable String getMember() { + return member; + } + + public void setMember(@Nullable String member) { + this.member = member; + } + + public TransactionPartialUpdate amountCents(@Nullable Integer amountCents) { + this.amountCents = amountCents; + return this; + } + + /** + * Get amountCents + * @return amountCents + */ + + @Schema(name = "amount_cents", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("amount_cents") + public @Nullable Integer getAmountCents() { + return amountCents; + } + + public void setAmountCents(@Nullable Integer amountCents) { + this.amountCents = amountCents; + } + + public TransactionPartialUpdate title(@Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + + @Schema(name = "title", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("title") + public @Nullable String getTitle() { + return title; + } + + public void setTitle(@Nullable String title) { + this.title = title; + } + + public TransactionPartialUpdate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionPartialUpdate transactionPartialUpdate = (TransactionPartialUpdate) o; + return Objects.equals(this.member, transactionPartialUpdate.member) && + Objects.equals(this.amountCents, transactionPartialUpdate.amountCents) && + Objects.equals(this.title, transactionPartialUpdate.title) && + Objects.equals(this.description, transactionPartialUpdate.description); + } + + @Override + public int hashCode() { + return Objects.hash(member, amountCents, title, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionPartialUpdate {\n"); + sb.append(" member: ").append(toIndentedString(member)).append("\n"); + sb.append(" amountCents: ").append(toIndentedString(amountCents)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-letter/build.gradle b/services/spring-letter/build.gradle index c5e9d91..d726154 100644 --- a/services/spring-letter/build.gradle +++ b/services/spring-letter/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-letter/src/generated/java/.openapi-generator/FILES b/services/spring-letter/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..2718309 --- /dev/null +++ b/services/spring-letter/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,3 @@ +tum/devoops/letterservice/api/LettersApi.java +tum/devoops/letterservice/model/BadRequestResponse.java +tum/devoops/letterservice/model/ErrorResponse.java diff --git a/services/spring-letter/src/generated/java/.openapi-generator/VERSION b/services/spring-letter/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-letter/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java new file mode 100644 index 0000000..e001d3b --- /dev/null +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java @@ -0,0 +1,197 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.letterservice.api; + +import tum.devoops.letterservice.model.BadRequestResponse; +import tum.devoops.letterservice.model.ErrorResponse; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "letters", description = "the letters API") +public interface LettersApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /letters/pdf : Get pdf + * + * @param body (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getPdf", + summary = "Get pdf", + tags = { "letters" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/pdf", schema = @Schema(implementation = org.springframework.core.io.Resource.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = org.springframework.core.io.Resource.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/pdf", schema = @Schema(implementation = BadRequestResponse.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/pdf", schema = @Schema(implementation = ErrorResponse.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/pdf", schema = @Schema(implementation = ErrorResponse.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/pdf", schema = @Schema(implementation = ErrorResponse.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/letters/pdf", + produces = { "application/pdf", "application/json" }, + consumes = { "text/html" } + ) + + default ResponseEntity getPdf( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Object body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /letters/mail : Send mail + * + * @param body (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "sendMail", + summary = "Send mail", + tags = { "letters" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/letters/mail", + produces = { "application/json" }, + consumes = { "text/html" } + ) + + default ResponseEntity sendMail( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Object body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/BadRequestResponse.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/BadRequestResponse.java new file mode 100644 index 0000000..ea3038a --- /dev/null +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.letterservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.letterservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/ErrorResponse.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/ErrorResponse.java new file mode 100644 index 0000000..57c6871 --- /dev/null +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.letterservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/build.gradle b/services/spring-member/build.gradle index 8983c7b..cc03527 100644 --- a/services/spring-member/build.gradle +++ b/services/spring-member/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-member/src/generated/java/.openapi-generator/FILES b/services/spring-member/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..e9f0260 --- /dev/null +++ b/services/spring-member/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,7 @@ +tum/devoops/memberservice/api/MembersApi.java +tum/devoops/memberservice/model/BadRequestResponse.java +tum/devoops/memberservice/model/ErrorResponse.java +tum/devoops/memberservice/model/Member.java +tum/devoops/memberservice/model/MemberCreate.java +tum/devoops/memberservice/model/MemberPartialUpdate.java +tum/devoops/memberservice/model/MemberSummary.java diff --git a/services/spring-member/src/generated/java/.openapi-generator/VERSION b/services/spring-member/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-member/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java new file mode 100644 index 0000000..8b120bd --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java @@ -0,0 +1,445 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.memberservice.api; + +import tum.devoops.memberservice.model.BadRequestResponse; +import tum.devoops.memberservice.model.ErrorResponse; +import tum.devoops.memberservice.model.Member; +import tum.devoops.memberservice.model.MemberCreate; +import tum.devoops.memberservice.model.MemberPartialUpdate; +import tum.devoops.memberservice.model.MemberSummary; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "members", description = "the members API") +public interface MembersApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /members : Create member + * + * @param memberCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createMember", + summary = "Create member", + tags = { "members" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Member.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/members", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createMember( + @Parameter(name = "MemberCreate", description = "", required = true) @Valid @RequestBody MemberCreate memberCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /members/{member_id} : Delete member + * + * @param memberId (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteMember", + summary = "Delete member", + tags = { "members" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/members/{member_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteMember( + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /members : Get all members + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllMembers", + summary = "Get all members", + tags = { "members" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = MemberSummary.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/members", + produces = { "application/json" } + ) + + default ResponseEntity> getAllMembers( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"last_name\" : \"last_name\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }, { \"last_name\" : \"last_name\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /members/{member_id} : Get member details + * + * @param memberId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getMemberDetails", + summary = "Get member details", + tags = { "members" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Member.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/members/{member_id}", + produces = { "application/json" } + ) + + default ResponseEntity getMemberDetails( + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /members/{member_id} : Update member details + * + * @param memberId (required) + * @param memberPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateMemberDetails", + summary = "Update member details", + tags = { "members" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Member.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/members/{member_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateMemberDetails( + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId, + @Parameter(name = "MemberPartialUpdate", description = "", required = true) @Valid @RequestBody MemberPartialUpdate memberPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/BadRequestResponse.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/BadRequestResponse.java new file mode 100644 index 0000000..8d4f176 --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.memberservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/ErrorResponse.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/ErrorResponse.java new file mode 100644 index 0000000..3b9a3ae --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java new file mode 100644 index 0000000..7b9772d --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java @@ -0,0 +1,295 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * + */ + +@Schema(name = "Member", description = "") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Member { + + private String id; + + private String firstName; + + private String lastName; + + private String email; + + private String birthday; + + private String phoneNumber; + + private String address; + + private String joiningDate; + + private String information; + + public Member() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Member(String id, String firstName, String lastName, String email, String birthday, String phoneNumber, String address, String joiningDate, String information) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.birthday = birthday; + this.phoneNumber = phoneNumber; + this.address = address; + this.joiningDate = joiningDate; + this.information = information; + } + + public Member id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Member firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @NotNull + @Schema(name = "first_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("first_name") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public Member lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @NotNull + @Schema(name = "last_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("last_name") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Member email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @NotNull + @Schema(name = "email", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Member birthday(String birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + @NotNull + @Schema(name = "birthday", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("birthday") + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public Member phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + @NotNull + @Schema(name = "phone_number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("phone_number") + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public Member address(String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + @NotNull + @Schema(name = "address", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("address") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Member joiningDate(String joiningDate) { + this.joiningDate = joiningDate; + return this; + } + + /** + * Get joiningDate + * @return joiningDate + */ + @NotNull + @Schema(name = "joining_date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("joining_date") + public String getJoiningDate() { + return joiningDate; + } + + public void setJoiningDate(String joiningDate) { + this.joiningDate = joiningDate; + } + + public Member information(String information) { + this.information = information; + return this; + } + + /** + * Get information + * @return information + */ + @NotNull + @Schema(name = "information", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("information") + public String getInformation() { + return information; + } + + public void setInformation(String information) { + this.information = information; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Member member = (Member) o; + return Objects.equals(this.id, member.id) && + Objects.equals(this.firstName, member.firstName) && + Objects.equals(this.lastName, member.lastName) && + Objects.equals(this.email, member.email) && + Objects.equals(this.birthday, member.birthday) && + Objects.equals(this.phoneNumber, member.phoneNumber) && + Objects.equals(this.address, member.address) && + Objects.equals(this.joiningDate, member.joiningDate) && + Objects.equals(this.information, member.information); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, email, birthday, phoneNumber, address, joiningDate, information); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Member {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" joiningDate: ").append(toIndentedString(joiningDate)).append("\n"); + sb.append(" information: ").append(toIndentedString(information)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java new file mode 100644 index 0000000..23c5136 --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java @@ -0,0 +1,240 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Member. + */ + +@Schema(name = "MemberCreate", description = "Data transfer object for creating a new Member.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class MemberCreate { + + private String firstName; + + private String lastName; + + private @Nullable String email; + + private @Nullable String birthday; + + private @Nullable String phoneNumber; + + private @Nullable String address; + + private @Nullable String information; + + public MemberCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public MemberCreate(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } + + public MemberCreate firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @NotNull + @Schema(name = "first_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("first_name") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public MemberCreate lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @NotNull + @Schema(name = "last_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("last_name") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public MemberCreate email(@Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") + public @Nullable String getEmail() { + return email; + } + + public void setEmail(@Nullable String email) { + this.email = email; + } + + public MemberCreate birthday(@Nullable String birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + + @Schema(name = "birthday", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("birthday") + public @Nullable String getBirthday() { + return birthday; + } + + public void setBirthday(@Nullable String birthday) { + this.birthday = birthday; + } + + public MemberCreate phoneNumber(@Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + + @Schema(name = "phone_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone_number") + public @Nullable String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public MemberCreate address(@Nullable String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + + @Schema(name = "address", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("address") + public @Nullable String getAddress() { + return address; + } + + public void setAddress(@Nullable String address) { + this.address = address; + } + + public MemberCreate information(@Nullable String information) { + this.information = information; + return this; + } + + /** + * Get information + * @return information + */ + + @Schema(name = "information", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("information") + public @Nullable String getInformation() { + return information; + } + + public void setInformation(@Nullable String information) { + this.information = information; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemberCreate memberCreate = (MemberCreate) o; + return Objects.equals(this.firstName, memberCreate.firstName) && + Objects.equals(this.lastName, memberCreate.lastName) && + Objects.equals(this.email, memberCreate.email) && + Objects.equals(this.birthday, memberCreate.birthday) && + Objects.equals(this.phoneNumber, memberCreate.phoneNumber) && + Objects.equals(this.address, memberCreate.address) && + Objects.equals(this.information, memberCreate.information); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, email, birthday, phoneNumber, address, information); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemberCreate {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" information: ").append(toIndentedString(information)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java new file mode 100644 index 0000000..fa9ad39 --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java @@ -0,0 +1,228 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Member (PATCH operation). + */ + +@Schema(name = "MemberPartialUpdate", description = "Data transfer object for partially updating an existing Member (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class MemberPartialUpdate { + + private @Nullable String firstName; + + private @Nullable String lastName; + + private @Nullable String email; + + private @Nullable String birthday; + + private @Nullable String phoneNumber; + + private @Nullable String address; + + private @Nullable String information; + + public MemberPartialUpdate firstName(@Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @Schema(name = "first_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("first_name") + public @Nullable String getFirstName() { + return firstName; + } + + public void setFirstName(@Nullable String firstName) { + this.firstName = firstName; + } + + public MemberPartialUpdate lastName(@Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @Schema(name = "last_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("last_name") + public @Nullable String getLastName() { + return lastName; + } + + public void setLastName(@Nullable String lastName) { + this.lastName = lastName; + } + + public MemberPartialUpdate email(@Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") + public @Nullable String getEmail() { + return email; + } + + public void setEmail(@Nullable String email) { + this.email = email; + } + + public MemberPartialUpdate birthday(@Nullable String birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + + @Schema(name = "birthday", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("birthday") + public @Nullable String getBirthday() { + return birthday; + } + + public void setBirthday(@Nullable String birthday) { + this.birthday = birthday; + } + + public MemberPartialUpdate phoneNumber(@Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + + @Schema(name = "phone_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone_number") + public @Nullable String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public MemberPartialUpdate address(@Nullable String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + + @Schema(name = "address", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("address") + public @Nullable String getAddress() { + return address; + } + + public void setAddress(@Nullable String address) { + this.address = address; + } + + public MemberPartialUpdate information(@Nullable String information) { + this.information = information; + return this; + } + + /** + * Get information + * @return information + */ + + @Schema(name = "information", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("information") + public @Nullable String getInformation() { + return information; + } + + public void setInformation(@Nullable String information) { + this.information = information; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemberPartialUpdate memberPartialUpdate = (MemberPartialUpdate) o; + return Objects.equals(this.firstName, memberPartialUpdate.firstName) && + Objects.equals(this.lastName, memberPartialUpdate.lastName) && + Objects.equals(this.email, memberPartialUpdate.email) && + Objects.equals(this.birthday, memberPartialUpdate.birthday) && + Objects.equals(this.phoneNumber, memberPartialUpdate.phoneNumber) && + Objects.equals(this.address, memberPartialUpdate.address) && + Objects.equals(this.information, memberPartialUpdate.information); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, email, birthday, phoneNumber, address, information); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemberPartialUpdate {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" information: ").append(toIndentedString(information)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java new file mode 100644 index 0000000..062b757 --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java @@ -0,0 +1,170 @@ +package tum.devoops.memberservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * A simplified representation of a Member, typically used in list views. + */ + +@Schema(name = "MemberSummary", description = "A simplified representation of a Member, typically used in list views.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class MemberSummary { + + private String id; + + private String firstName; + + private String lastName; + + private String email; + + public MemberSummary() { + super(); + } + + /** + * Constructor with only required parameters + */ + public MemberSummary(String id, String firstName, String lastName, String email) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public MemberSummary id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public MemberSummary firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @NotNull + @Schema(name = "first_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("first_name") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public MemberSummary lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @NotNull + @Schema(name = "last_name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("last_name") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public MemberSummary email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @NotNull + @Schema(name = "email", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemberSummary memberSummary = (MemberSummary) o; + return Objects.equals(this.id, memberSummary.id) && + Objects.equals(this.firstName, memberSummary.firstName) && + Objects.equals(this.lastName, memberSummary.lastName) && + Objects.equals(this.email, memberSummary.email); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemberSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/build.gradle b/services/spring-organization/build.gradle index 2c4e2c8..fdb7d60 100644 --- a/services/spring-organization/build.gradle +++ b/services/spring-organization/build.gradle @@ -29,6 +29,14 @@ java { } } +sourceSets { + main { + java { + srcDirs 'src/main/java', 'src/generated/java' + } + } +} + repositories { mavenCentral() } diff --git a/services/spring-organization/src/generated/java/.openapi-generator/FILES b/services/spring-organization/src/generated/java/.openapi-generator/FILES new file mode 100644 index 0000000..076963a --- /dev/null +++ b/services/spring-organization/src/generated/java/.openapi-generator/FILES @@ -0,0 +1,9 @@ +tum/devoops/organizationservice/api/OrganizationApi.java +tum/devoops/organizationservice/model/BadRequestResponse.java +tum/devoops/organizationservice/model/ErrorResponse.java +tum/devoops/organizationservice/model/Sport.java +tum/devoops/organizationservice/model/SportCreate.java +tum/devoops/organizationservice/model/SportPartialUpdate.java +tum/devoops/organizationservice/model/Team.java +tum/devoops/organizationservice/model/TeamCreate.java +tum/devoops/organizationservice/model/TeamPartialUpdate.java diff --git a/services/spring-organization/src/generated/java/.openapi-generator/VERSION b/services/spring-organization/src/generated/java/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/services/spring-organization/src/generated/java/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java new file mode 100644 index 0000000..d5fb6be --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java @@ -0,0 +1,842 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.14.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package tum.devoops.organizationservice.api; + +import tum.devoops.organizationservice.model.BadRequestResponse; +import tum.devoops.organizationservice.model.ErrorResponse; +import tum.devoops.organizationservice.model.Sport; +import tum.devoops.organizationservice.model.SportCreate; +import tum.devoops.organizationservice.model.SportPartialUpdate; +import tum.devoops.organizationservice.model.Team; +import tum.devoops.organizationservice.model.TeamCreate; +import tum.devoops.organizationservice.model.TeamPartialUpdate; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +@Validated +@Tag(name = "organization", description = "the organization API") +public interface OrganizationApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /organization/sports : Create sport + * + * @param sportCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createSport", + summary = "Create sport", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Sport.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/organization/sports", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createSport( + @Parameter(name = "SportCreate", description = "", required = true) @Valid @RequestBody SportCreate sportCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /organization/teams : Create team + * + * @param teamCreate (required) + * @return The request was successful, and a new resource was created. (status code 201) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. (status code 409) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "createTeam", + summary = "Create team", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Team.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "409", description = "The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/organization/teams", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createTeam( + @Parameter(name = "TeamCreate", description = "", required = true) @Valid @RequestBody TeamCreate teamCreate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /organization/sports/{sport_name} : Delete sport + * + * @param sportName (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteSport", + summary = "Delete sport", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/organization/sports/{sport_name}", + produces = { "application/json" } + ) + + default ResponseEntity deleteSport( + @Parameter(name = "sport_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("sport_name") String sportName + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /organization/teams/{team_id} : Delete team + * + * @param teamId (required) + * @return The request was successful, but there is no content to return in the response. (status code 204) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "deleteTeam", + summary = "Delete team", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "204", description = "The request was successful, but there is no content to return in the response."), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/organization/teams/{team_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteTeam( + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /organization/sports : Get all sports + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllSports", + summary = "Get all sports", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Sport.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/organization/sports", + produces = { "application/json" } + ) + + default ResponseEntity> getAllSports( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }, { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /organization/teams : Get all teams + * + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getAllTeams", + summary = "Get all teams", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Team.class))) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/organization/teams", + produces = { "application/json" } + ) + + default ResponseEntity> getAllTeams( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }, { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /organization/sports/{sport_name} : Get sport + * + * @param sportName (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getSport", + summary = "Get sport", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Sport.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/organization/sports/{sport_name}", + produces = { "application/json" } + ) + + default ResponseEntity getSport( + @Parameter(name = "sport_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("sport_name") String sportName + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /organization/teams/{team_id} : Get team + * + * @param teamId (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "getTeam", + summary = "Get team", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Team.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/organization/teams/{team_id}", + produces = { "application/json" } + ) + + default ResponseEntity getTeam( + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /organization/sports/{sport_name} : Update sport + * + * @param sportName (required) + * @param sportPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateSport", + summary = "Update sport", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Sport.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/organization/sports/{sport_name}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateSport( + @Parameter(name = "sport_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("sport_name") String sportName, + @Parameter(name = "SportPartialUpdate", description = "", required = true) @Valid @RequestBody SportPartialUpdate sportPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PATCH /organization/teams/{team_id} : Update team + * + * @param teamId (required) + * @param teamPartialUpdate (required) + * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) + * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) + * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) + * or The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. (status code 403) + * or The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. (status code 404) + * or The server encountered an unexpected condition that prevented it from fulfilling the request. (status code 500) + */ + @Operation( + operationId = "updateTeam", + summary = "Update team", + tags = { "organization" }, + responses = { + @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Team.class)) + }), + @ApiResponse(responseCode = "400", description = "The server could not understand the request due to invalid syntax. The client should modify the request and try again.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = BadRequestResponse.class)) + }), + @ApiResponse(responseCode = "401", description = "Authentication is required to access the requested resource. The client must include the appropriate credentials.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "403", description = "The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "The server encountered an unexpected condition that prevented it from fulfilling the request.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "BearerJwt") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/organization/teams/{team_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateTeam( + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId, + @Parameter(name = "TeamPartialUpdate", description = "", required = true) @Valid @RequestBody TeamPartialUpdate teamPartialUpdate + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\", \"errors\" : [ { \"message\" : \"message\" }, { \"message\" : \"message\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/BadRequestResponse.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/BadRequestResponse.java new file mode 100644 index 0000000..95d7598 --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/BadRequestResponse.java @@ -0,0 +1,131 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import tum.devoops.organizationservice.model.ErrorResponse; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BadRequestResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class BadRequestResponse { + + private String message; + + @Valid + private List<@Valid ErrorResponse> errors = new ArrayList<>(); + + public BadRequestResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BadRequestResponse(String message) { + this.message = message; + } + + public BadRequestResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BadRequestResponse errors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + return this; + } + + public BadRequestResponse addErrorsItem(ErrorResponse errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @Valid + @Schema(name = "errors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("errors") + public List<@Valid ErrorResponse> getErrors() { + return errors; + } + + public void setErrors(List<@Valid ErrorResponse> errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadRequestResponse badRequestResponse = (BadRequestResponse) o; + return Objects.equals(this.message, badRequestResponse.message) && + Objects.equals(this.errors, badRequestResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(message, errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadRequestResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/ErrorResponse.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/ErrorResponse.java new file mode 100644 index 0000000..e454913 --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/ErrorResponse.java @@ -0,0 +1,94 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ErrorResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class ErrorResponse { + + private String message; + + public ErrorResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ErrorResponse(String message) { + this.message = message; + } + + public ErrorResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @NotNull + @Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java new file mode 100644 index 0000000..b1879ad --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java @@ -0,0 +1,181 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Sport + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Sport { + + private String name; + + private String description; + + private String createdAt; + + @Valid + private List directors = new ArrayList<>(); + + public Sport() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Sport(String name, String description, String createdAt, List directors) { + this.name = name; + this.description = description; + this.createdAt = createdAt; + this.directors = directors; + } + + public Sport name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Sport description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @NotNull + @Schema(name = "description", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Sport createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @NotNull + @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Sport directors(List directors) { + this.directors = directors; + return this; + } + + public Sport addDirectorsItem(String directorsItem) { + if (this.directors == null) { + this.directors = new ArrayList<>(); + } + this.directors.add(directorsItem); + return this; + } + + /** + * Get directors + * @return directors + */ + @NotNull + @Schema(name = "directors", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("directors") + public List getDirectors() { + return directors; + } + + public void setDirectors(List directors) { + this.directors = directors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Sport sport = (Sport) o; + return Objects.equals(this.name, sport.name) && + Objects.equals(this.description, sport.description) && + Objects.equals(this.createdAt, sport.createdAt) && + Objects.equals(this.directors, sport.directors); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, createdAt, directors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Sport {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" directors: ").append(toIndentedString(directors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportCreate.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportCreate.java new file mode 100644 index 0000000..1e1d4c4 --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportCreate.java @@ -0,0 +1,155 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Sport. + */ + +@Schema(name = "SportCreate", description = "Data transfer object for creating a new Sport.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class SportCreate { + + private String name; + + private @Nullable String description; + + @Valid + private List directors = new ArrayList<>(); + + public SportCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public SportCreate(String name) { + this.name = name; + } + + public SportCreate name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SportCreate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public SportCreate directors(List directors) { + this.directors = directors; + return this; + } + + public SportCreate addDirectorsItem(String directorsItem) { + if (this.directors == null) { + this.directors = new ArrayList<>(); + } + this.directors.add(directorsItem); + return this; + } + + /** + * Get directors + * @return directors + */ + + @Schema(name = "directors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("directors") + public List getDirectors() { + return directors; + } + + public void setDirectors(List directors) { + this.directors = directors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SportCreate sportCreate = (SportCreate) o; + return Objects.equals(this.name, sportCreate.name) && + Objects.equals(this.description, sportCreate.description) && + Objects.equals(this.directors, sportCreate.directors); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, directors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SportCreate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" directors: ").append(toIndentedString(directors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportPartialUpdate.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportPartialUpdate.java new file mode 100644 index 0000000..246ce3d --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/SportPartialUpdate.java @@ -0,0 +1,144 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Sport (PATCH operation). + */ + +@Schema(name = "SportPartialUpdate", description = "Data transfer object for partially updating an existing Sport (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class SportPartialUpdate { + + private @Nullable String name; + + private @Nullable String description; + + @Valid + private List directors = new ArrayList<>(); + + public SportPartialUpdate name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + + public SportPartialUpdate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public SportPartialUpdate directors(List directors) { + this.directors = directors; + return this; + } + + public SportPartialUpdate addDirectorsItem(String directorsItem) { + if (this.directors == null) { + this.directors = new ArrayList<>(); + } + this.directors.add(directorsItem); + return this; + } + + /** + * Get directors + * @return directors + */ + + @Schema(name = "directors", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("directors") + public List getDirectors() { + return directors; + } + + public void setDirectors(List directors) { + this.directors = directors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SportPartialUpdate sportPartialUpdate = (SportPartialUpdate) o; + return Objects.equals(this.name, sportPartialUpdate.name) && + Objects.equals(this.description, sportPartialUpdate.description) && + Objects.equals(this.directors, sportPartialUpdate.directors); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, directors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SportPartialUpdate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" directors: ").append(toIndentedString(directors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java new file mode 100644 index 0000000..71ab8aa --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java @@ -0,0 +1,291 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * + */ + +@Schema(name = "Team", description = "") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class Team { + + private String id; + + private String name; + + private String description; + + private String createdAt; + + private String address; + + private String sport; + + @Valid + private List trainers = new ArrayList<>(); + + @Valid + private List trainees = new ArrayList<>(); + + public Team() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Team(String id, String name, String description, String createdAt, String address, String sport, List trainers, List trainees) { + this.id = id; + this.name = name; + this.description = description; + this.createdAt = createdAt; + this.address = address; + this.sport = sport; + this.trainers = trainers; + this.trainees = trainees; + } + + public Team id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @NotNull + @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Team name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Team description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @NotNull + @Schema(name = "description", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Team createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @NotNull + @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Team address(String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + @NotNull + @Schema(name = "address", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("address") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Team sport(String sport) { + this.sport = sport; + return this; + } + + /** + * Get sport + * @return sport + */ + @NotNull + @Schema(name = "sport", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("sport") + public String getSport() { + return sport; + } + + public void setSport(String sport) { + this.sport = sport; + } + + public Team trainers(List trainers) { + this.trainers = trainers; + return this; + } + + public Team addTrainersItem(String trainersItem) { + if (this.trainers == null) { + this.trainers = new ArrayList<>(); + } + this.trainers.add(trainersItem); + return this; + } + + /** + * Get trainers + * @return trainers + */ + @NotNull + @Schema(name = "trainers", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("trainers") + public List getTrainers() { + return trainers; + } + + public void setTrainers(List trainers) { + this.trainers = trainers; + } + + public Team trainees(List trainees) { + this.trainees = trainees; + return this; + } + + public Team addTraineesItem(String traineesItem) { + if (this.trainees == null) { + this.trainees = new ArrayList<>(); + } + this.trainees.add(traineesItem); + return this; + } + + /** + * Get trainees + * @return trainees + */ + @NotNull + @Schema(name = "trainees", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("trainees") + public List getTrainees() { + return trainees; + } + + public void setTrainees(List trainees) { + this.trainees = trainees; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Team team = (Team) o; + return Objects.equals(this.id, team.id) && + Objects.equals(this.name, team.name) && + Objects.equals(this.description, team.description) && + Objects.equals(this.createdAt, team.createdAt) && + Objects.equals(this.address, team.address) && + Objects.equals(this.sport, team.sport) && + Objects.equals(this.trainers, team.trainers) && + Objects.equals(this.trainees, team.trainees); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, createdAt, address, sport, trainers, trainees); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Team {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" sport: ").append(toIndentedString(sport)).append("\n"); + sb.append(" trainers: ").append(toIndentedString(trainers)).append("\n"); + sb.append(" trainees: ").append(toIndentedString(trainees)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamCreate.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamCreate.java new file mode 100644 index 0000000..b517a35 --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamCreate.java @@ -0,0 +1,237 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for creating a new Team. + */ + +@Schema(name = "TeamCreate", description = "Data transfer object for creating a new Team.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class TeamCreate { + + private String name; + + private @Nullable String description; + + private @Nullable String address; + + private String sport; + + @Valid + private List trainers = new ArrayList<>(); + + @Valid + private List trainees = new ArrayList<>(); + + public TeamCreate() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TeamCreate(String name, String sport) { + this.name = name; + this.sport = sport; + } + + public TeamCreate name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TeamCreate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public TeamCreate address(@Nullable String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + + @Schema(name = "address", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("address") + public @Nullable String getAddress() { + return address; + } + + public void setAddress(@Nullable String address) { + this.address = address; + } + + public TeamCreate sport(String sport) { + this.sport = sport; + return this; + } + + /** + * Get sport + * @return sport + */ + @NotNull + @Schema(name = "sport", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("sport") + public String getSport() { + return sport; + } + + public void setSport(String sport) { + this.sport = sport; + } + + public TeamCreate trainers(List trainers) { + this.trainers = trainers; + return this; + } + + public TeamCreate addTrainersItem(String trainersItem) { + if (this.trainers == null) { + this.trainers = new ArrayList<>(); + } + this.trainers.add(trainersItem); + return this; + } + + /** + * Get trainers + * @return trainers + */ + + @Schema(name = "trainers", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("trainers") + public List getTrainers() { + return trainers; + } + + public void setTrainers(List trainers) { + this.trainers = trainers; + } + + public TeamCreate trainees(List trainees) { + this.trainees = trainees; + return this; + } + + public TeamCreate addTraineesItem(String traineesItem) { + if (this.trainees == null) { + this.trainees = new ArrayList<>(); + } + this.trainees.add(traineesItem); + return this; + } + + /** + * Get trainees + * @return trainees + */ + + @Schema(name = "trainees", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("trainees") + public List getTrainees() { + return trainees; + } + + public void setTrainees(List trainees) { + this.trainees = trainees; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreate teamCreate = (TeamCreate) o; + return Objects.equals(this.name, teamCreate.name) && + Objects.equals(this.description, teamCreate.description) && + Objects.equals(this.address, teamCreate.address) && + Objects.equals(this.sport, teamCreate.sport) && + Objects.equals(this.trainers, teamCreate.trainers) && + Objects.equals(this.trainees, teamCreate.trainees); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, address, sport, trainers, trainees); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" sport: ").append(toIndentedString(sport)).append("\n"); + sb.append(" trainers: ").append(toIndentedString(trainers)).append("\n"); + sb.append(" trainees: ").append(toIndentedString(trainees)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamPartialUpdate.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamPartialUpdate.java new file mode 100644 index 0000000..fe880d3 --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/TeamPartialUpdate.java @@ -0,0 +1,225 @@ +package tum.devoops.organizationservice.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Data transfer object for partially updating an existing Team (PATCH operation). + */ + +@Schema(name = "TeamPartialUpdate", description = "Data transfer object for partially updating an existing Team (PATCH operation).") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") +public class TeamPartialUpdate { + + private @Nullable String name; + + private @Nullable String description; + + private @Nullable String address; + + private @Nullable String sport; + + @Valid + private List trainers = new ArrayList<>(); + + @Valid + private List trainees = new ArrayList<>(); + + public TeamPartialUpdate name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + + public TeamPartialUpdate description(@Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public @Nullable String getDescription() { + return description; + } + + public void setDescription(@Nullable String description) { + this.description = description; + } + + public TeamPartialUpdate address(@Nullable String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + */ + + @Schema(name = "address", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("address") + public @Nullable String getAddress() { + return address; + } + + public void setAddress(@Nullable String address) { + this.address = address; + } + + public TeamPartialUpdate sport(@Nullable String sport) { + this.sport = sport; + return this; + } + + /** + * Get sport + * @return sport + */ + + @Schema(name = "sport", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sport") + public @Nullable String getSport() { + return sport; + } + + public void setSport(@Nullable String sport) { + this.sport = sport; + } + + public TeamPartialUpdate trainers(List trainers) { + this.trainers = trainers; + return this; + } + + public TeamPartialUpdate addTrainersItem(String trainersItem) { + if (this.trainers == null) { + this.trainers = new ArrayList<>(); + } + this.trainers.add(trainersItem); + return this; + } + + /** + * Get trainers + * @return trainers + */ + + @Schema(name = "trainers", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("trainers") + public List getTrainers() { + return trainers; + } + + public void setTrainers(List trainers) { + this.trainers = trainers; + } + + public TeamPartialUpdate trainees(List trainees) { + this.trainees = trainees; + return this; + } + + public TeamPartialUpdate addTraineesItem(String traineesItem) { + if (this.trainees == null) { + this.trainees = new ArrayList<>(); + } + this.trainees.add(traineesItem); + return this; + } + + /** + * Get trainees + * @return trainees + */ + + @Schema(name = "trainees", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("trainees") + public List getTrainees() { + return trainees; + } + + public void setTrainees(List trainees) { + this.trainees = trainees; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPartialUpdate teamPartialUpdate = (TeamPartialUpdate) o; + return Objects.equals(this.name, teamPartialUpdate.name) && + Objects.equals(this.description, teamPartialUpdate.description) && + Objects.equals(this.address, teamPartialUpdate.address) && + Objects.equals(this.sport, teamPartialUpdate.sport) && + Objects.equals(this.trainers, teamPartialUpdate.trainers) && + Objects.equals(this.trainees, teamPartialUpdate.trainees); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, address, sport, trainers, trainees); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPartialUpdate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" sport: ").append(toIndentedString(sport)).append("\n"); + sb.append(" trainers: ").append(toIndentedString(trainers)).append("\n"); + sb.append(" trainees: ").append(toIndentedString(trainees)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/web-client/package.json b/web-client/package.json index bf17149..5372315 100644 --- a/web-client/package.json +++ b/web-client/package.json @@ -5,7 +5,7 @@ "type": "module", "packageManager": "pnpm@9.15.9", "engines": { - "node": ">=24 <25" + "node": ">=22 <25" }, "scripts": { "dev": "vite", @@ -42,6 +42,7 @@ "typescript": "~6.0.2", "typescript-eslint": "^8.59.2", "vite": "^8.0.12", - "vitest": "^2.1.9" + "vitest": "^2.1.9", + "openapi-typescript": "^7.8.0" } } diff --git a/web-client/pnpm-lock.yaml b/web-client/pnpm-lock.yaml index 948bde5..ea2b315 100644 --- a/web-client/pnpm-lock.yaml +++ b/web-client/pnpm-lock.yaml @@ -63,6 +63,9 @@ importers: jsdom: specifier: ^25.0.1 version: 25.0.1 + openapi-typescript: + specifier: ^7.8.0 + version: 7.13.0(typescript@6.0.3) typescript: specifier: ~6.0.2 version: 6.0.3 @@ -410,6 +413,16 @@ packages: '@oxc-project/types@0.132.0': resolution: {integrity: sha512-FESMOxil5Se014ui/Eq8fT5uHJo6nIRwH0PfJrZJXs6Gek3ZVFOrpUv3YIZT20m+extU98Hg1Ym72U58rlsxUQ==} + '@redocly/ajv@8.11.2': + resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} + + '@redocly/config@0.22.0': + resolution: {integrity: sha512-gAy93Ddo01Z3bHuVdPWfCwzgfaYgMdaZPcfL7JZ7hWJoK9V0lXDbigTWkhiPFAaLWzbOJ+kbUQG1+XwIm0KRGQ==} + + '@redocly/openapi-core@1.34.15': + resolution: {integrity: sha512-HAwCnNyKcs5XGQqms+9t7OdAPM/5TDstmhF+0i7tdCFato2QKuYIlyWETwkXd8c5zbltr1oB+6y9NTeQLr2d6Q==} + engines: {node: '>=18.17.0', npm: '>=9.5.0'} + '@rolldown/binding-android-arm64@1.0.1': resolution: {integrity: sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -954,6 +967,13 @@ packages: ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -964,6 +984,9 @@ packages: axios@1.16.1: resolution: {integrity: sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==} + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} @@ -973,6 +996,9 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + brace-expansion@2.1.1: + resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} + brace-expansion@5.0.6: resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} engines: {node: 18 || 20 || >=22} @@ -997,10 +1023,16 @@ packages: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} engines: {node: '>=18'} + change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} + check-error@2.1.3: resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} engines: {node: '>= 16'} + colorette@1.4.0: + resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -1292,6 +1324,10 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + index-to-position@1.2.0: + resolution: {integrity: sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==} + engines: {node: '>=18'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1310,9 +1346,17 @@ packages: resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} hasBin: true + js-levenshtein@1.1.6: + resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} + engines: {node: '>=0.10.0'} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + hasBin: true + jsdom@25.0.1: resolution: {integrity: sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==} engines: {node: '>=18'} @@ -1333,6 +1377,9 @@ packages: json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -1450,6 +1497,10 @@ packages: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} + minimatch@5.1.9: + resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} + engines: {node: '>=10'} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1467,6 +1518,12 @@ packages: nwsapi@2.2.23: resolution: {integrity: sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==} + openapi-typescript@7.13.0: + resolution: {integrity: sha512-EFP392gcqXS7ntPvbhBzbF8TyBA+baIYEm791Hy5YkjDYKTnk/Tn5OQeKm5BIZvJihpp8Zzr4hzx0Irde1LNGQ==} + hasBin: true + peerDependencies: + typescript: ^5.x + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -1479,6 +1536,10 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} + parse-json@8.3.0: + resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} + engines: {node: '>=18'} + parse5@7.3.0: resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} @@ -1504,6 +1565,10 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + postcss@8.5.14: resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} engines: {node: ^10 || ^12 || >=14} @@ -1546,6 +1611,10 @@ packages: resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + rolldown@1.0.1: resolution: {integrity: sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1610,6 +1679,10 @@ packages: std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + supports-color@10.2.2: + resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} + engines: {node: '>=18'} + symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -1670,6 +1743,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + typescript-eslint@8.59.3: resolution: {integrity: sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1691,6 +1768,9 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + uri-js-replace@1.0.1: + resolution: {integrity: sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -1855,6 +1935,13 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yaml-ast-parser@0.0.43: + resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -1899,7 +1986,7 @@ snapshots: '@babel/types': 7.29.0 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -1969,7 +2056,7 @@ snapshots: '@babel/parser': 7.29.3 '@babel/template': 7.28.6 '@babel/types': 7.29.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -2093,7 +2180,7 @@ snapshots: '@eslint/config-array@0.23.5': dependencies: '@eslint/object-schema': 3.0.5 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 transitivePeerDependencies: - supports-color @@ -2163,6 +2250,29 @@ snapshots: '@oxc-project/types@0.132.0': {} + '@redocly/ajv@8.11.2': + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js-replace: 1.0.1 + + '@redocly/config@0.22.0': {} + + '@redocly/openapi-core@1.34.15(supports-color@10.2.2)': + dependencies: + '@redocly/ajv': 8.11.2 + '@redocly/config': 0.22.0 + colorette: 1.4.0 + https-proxy-agent: 7.0.6(supports-color@10.2.2) + js-levenshtein: 1.1.6 + js-yaml: 4.1.1 + minimatch: 5.1.9 + pluralize: 8.0.0 + yaml-ast-parser: 0.0.43 + transitivePeerDependencies: + - supports-color + '@rolldown/binding-android-arm64@1.0.1': optional: true @@ -2453,7 +2563,7 @@ snapshots: '@typescript-eslint/types': 8.59.3 '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.59.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.4.0(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: @@ -2463,7 +2573,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.59.3(typescript@6.0.3) '@typescript-eslint/types': 8.59.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -2482,7 +2592,7 @@ snapshots: '@typescript-eslint/types': 8.59.3 '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) '@typescript-eslint/utils': 8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3) - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) eslint: 10.4.0(jiti@2.7.0) ts-api-utils: 2.5.0(typescript@6.0.3) typescript: 6.0.3 @@ -2497,7 +2607,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.59.3(typescript@6.0.3) '@typescript-eslint/types': 8.59.3 '@typescript-eslint/visitor-keys': 8.59.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.5 semver: 7.8.0 tinyglobby: 0.2.16 @@ -2575,7 +2685,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -2588,6 +2698,10 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ansi-colors@4.1.3: {} + + argparse@2.0.1: {} + assertion-error@2.0.1: {} asynckit@0.4.0: {} @@ -2602,10 +2716,16 @@ snapshots: - debug - supports-color + balanced-match@1.0.2: {} + balanced-match@4.0.4: {} baseline-browser-mapping@2.10.29: {} + brace-expansion@2.1.1: + dependencies: + balanced-match: 1.0.2 + brace-expansion@5.0.6: dependencies: balanced-match: 4.0.4 @@ -2635,8 +2755,12 @@ snapshots: loupe: 3.2.1 pathval: 2.0.1 + change-case@5.4.4: {} + check-error@2.1.3: {} + colorette@1.4.0: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 @@ -2663,9 +2787,11 @@ snapshots: whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - debug@4.4.3: + debug@4.4.3(supports-color@10.2.2): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 10.2.2 decimal.js@10.6.0: {} @@ -2779,7 +2905,7 @@ snapshots: '@types/estree': 1.0.9 ajv: 6.15.0 cross-spawn: 7.0.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) escape-string-regexp: 4.0.0 eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 @@ -2920,21 +3046,21 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.6: + https-proxy-agent@7.0.6(supports-color@10.2.2): dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -2948,6 +3074,8 @@ snapshots: imurmurhash@0.1.4: {} + index-to-position@1.2.0: {} + is-extglob@2.1.1: {} is-glob@4.0.3: @@ -2960,8 +3088,14 @@ snapshots: jiti@2.7.0: {} + js-levenshtein@1.1.6: {} + js-tokens@4.0.0: {} + js-yaml@4.1.1: + dependencies: + argparse: 2.0.1 + jsdom@25.0.1: dependencies: cssstyle: 4.6.0 @@ -2970,7 +3104,7 @@ snapshots: form-data: 4.0.5 html-encoding-sniffer: 4.0.0 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 + https-proxy-agent: 7.0.6(supports-color@10.2.2) is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.23 parse5: 7.3.0 @@ -2996,6 +3130,8 @@ snapshots: json-schema-traverse@0.4.1: {} + json-schema-traverse@1.0.0: {} + json-stable-stringify-without-jsonify@1.0.1: {} json5@2.2.3: {} @@ -3086,6 +3222,10 @@ snapshots: dependencies: brace-expansion: 5.0.6 + minimatch@5.1.9: + dependencies: + brace-expansion: 2.1.1 + ms@2.1.3: {} nanoid@3.3.12: {} @@ -3096,6 +3236,16 @@ snapshots: nwsapi@2.2.23: {} + openapi-typescript@7.13.0(typescript@6.0.3): + dependencies: + '@redocly/openapi-core': 1.34.15(supports-color@10.2.2) + ansi-colors: 4.1.3 + change-case: 5.4.4 + parse-json: 8.3.0 + supports-color: 10.2.2 + typescript: 6.0.3 + yargs-parser: 21.1.1 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -3113,6 +3263,12 @@ snapshots: dependencies: p-limit: 3.1.0 + parse-json@8.3.0: + dependencies: + '@babel/code-frame': 7.29.0 + index-to-position: 1.2.0 + type-fest: 4.41.0 + parse5@7.3.0: dependencies: entities: 6.0.1 @@ -3129,6 +3285,8 @@ snapshots: picomatch@4.0.4: {} + pluralize@8.0.0: {} + postcss@8.5.14: dependencies: nanoid: 3.3.12 @@ -3162,6 +3320,8 @@ snapshots: react@19.2.6: {} + require-from-string@2.0.2: {} + rolldown@1.0.1: dependencies: '@oxc-project/types': 0.130.0 @@ -3267,6 +3427,8 @@ snapshots: std-env@3.10.0: {} + supports-color@10.2.2: {} + symbol-tree@3.2.4: {} tailwindcss@4.3.0: {} @@ -3313,6 +3475,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-fest@4.41.0: {} + typescript-eslint@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3): dependencies: '@typescript-eslint/eslint-plugin': 8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3) @@ -3334,6 +3498,8 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + uri-js-replace@1.0.1: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 @@ -3341,7 +3507,7 @@ snapshots: vite-node@2.1.9(@types/node@24.12.4)(lightningcss@1.32.0): dependencies: cac: 6.7.14 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) es-module-lexer: 1.7.0 pathe: 1.1.2 vite: 5.4.21(@types/node@24.12.4)(lightningcss@1.32.0) @@ -3388,7 +3554,7 @@ snapshots: '@vitest/spy': 2.1.9 '@vitest/utils': 2.1.9 chai: 5.3.3 - debug: 4.4.3 + debug: 4.4.3(supports-color@10.2.2) expect-type: 1.3.0 magic-string: 0.30.21 pathe: 1.1.2 @@ -3450,6 +3616,10 @@ snapshots: yallist@3.1.1: {} + yaml-ast-parser@0.0.43: {} + + yargs-parser@21.1.1: {} + yocto-queue@0.1.0: {} zod-validation-error@4.0.2(zod@4.4.3): diff --git a/web-client/src/api.ts b/web-client/src/api.ts new file mode 100644 index 0000000..26fc627 --- /dev/null +++ b/web-client/src/api.ts @@ -0,0 +1,1503 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/organization/sports": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all sports */ + get: operations["getAllSports"]; + put?: never; + /** Create sport */ + post: operations["createSport"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/organization/sports/{sport_name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get sport */ + get: operations["getSport"]; + put?: never; + post?: never; + /** Delete sport */ + delete: operations["deleteSport"]; + options?: never; + head?: never; + /** Update sport */ + patch: operations["updateSport"]; + trace?: never; + }; + "/organization/teams": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all teams */ + get: operations["getAllTeams"]; + put?: never; + /** Create team */ + post: operations["createTeam"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/organization/teams/{team_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get team */ + get: operations["getTeam"]; + put?: never; + post?: never; + /** Delete team */ + delete: operations["deleteTeam"]; + options?: never; + head?: never; + /** Update team */ + patch: operations["updateTeam"]; + trace?: never; + }; + "/members": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all members */ + get: operations["getAllMembers"]; + put?: never; + /** Create member */ + post: operations["createMember"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/members/{member_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get member details */ + get: operations["getMemberDetails"]; + put?: never; + post?: never; + /** Delete member */ + delete: operations["deleteMember"]; + options?: never; + head?: never; + /** Update member details */ + patch: operations["updateMemberDetails"]; + trace?: never; + }; + "/events": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all events */ + get: operations["getAllEvents"]; + put?: never; + /** Create event */ + post: operations["createEvent"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/events/{event_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get event details */ + get: operations["getEventDetails"]; + put?: never; + post?: never; + /** Delete event */ + delete: operations["deleteEvent"]; + options?: never; + head?: never; + /** Update event details */ + patch: operations["updateEventDetails"]; + trace?: never; + }; + "/feedback": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all feedback */ + get: operations["getAllFeedback"]; + put?: never; + /** Create feedback */ + post: operations["createFeedback"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/feedback/{feedback_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get feedback details */ + get: operations["getFeedbackDetails"]; + put?: never; + post?: never; + /** Delete feedback */ + delete: operations["deleteFeedback"]; + options?: never; + head?: never; + /** Update feedback details */ + patch: operations["updateFeedbackDetails"]; + trace?: never; + }; + "/finance/balances": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all balances */ + get: operations["getAllBalances"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/finance/balances/{member_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get member balance */ + get: operations["getMemberBalance"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/finance/transactions": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all transactions */ + get: operations["getAllTransactions"]; + put?: never; + /** Create transaction */ + post: operations["createTransaction"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/finance/transactions/{transaction_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get transaction */ + get: operations["getTransaction"]; + put?: never; + post?: never; + /** Delete transaction */ + delete: operations["deleteTransaction"]; + options?: never; + head?: never; + /** Update transaction */ + patch: operations["updateTransaction"]; + trace?: never; + }; + "/letters/mail": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Send mail */ + post: operations["sendMail"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/letters/pdf": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Get pdf */ + post: operations["getPdf"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/helper/report/{member_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Generate report */ + get: operations["generateReport"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + ErrorResponse: { + message: string; + }; + BadRequestResponse: { + message: string; + errors?: components["schemas"]["ErrorResponse"][]; + }; + Sport: { + name: string; + description: string; + created_at: string; + directors: string[]; + }; + /** @description Data transfer object for creating a new Sport. */ + SportCreate: { + name: string; + description?: string; + directors?: string[]; + }; + /** @description Data transfer object for partially updating an existing Sport (PATCH operation). */ + SportPartialUpdate: { + name?: string; + description?: string; + directors?: string[]; + }; + Team: { + id: string; + name: string; + description: string; + created_at: string; + address: string; + sport: string; + trainers: string[]; + trainees: string[]; + }; + /** @description Data transfer object for creating a new Team. */ + TeamCreate: { + name: string; + description?: string; + address?: string; + sport: string; + trainers?: string[]; + trainees?: string[]; + }; + /** @description Data transfer object for partially updating an existing Team (PATCH operation). */ + TeamPartialUpdate: { + name?: string; + description?: string; + address?: string; + sport?: string; + trainers?: string[]; + trainees?: string[]; + }; + Member: { + id: string; + first_name: string; + last_name: string; + email: string; + birthday: string; + phone_number: string; + address: string; + joining_date: string; + information: string; + }; + /** @description A simplified representation of a Member, typically used in list views. */ + MemberSummary: { + id: string; + first_name: string; + last_name: string; + email: string; + }; + /** @description Data transfer object for partially updating an existing Member (PATCH operation). */ + MemberPartialUpdate: { + first_name?: string; + last_name?: string; + email?: string; + birthday?: string; + phone_number?: string; + address?: string; + information?: string; + }; + /** @description Data transfer object for creating a new Member. */ + MemberCreate: { + first_name: string; + last_name: string; + email?: string; + birthday?: string; + phone_number?: string; + address?: string; + information?: string; + }; + Event: { + id: string; + name: string; + description: string; + start_time: string; + end_time: string; + attendees?: string[]; + /** @description Names of the sports associated with this event. */ + sports_linked?: string[]; + /** @description IDs of the teams associated with this event. */ + teams_linked?: string[]; + creator: string; + }; + /** @description A simplified representation of a Event, typically used in list views. */ + EventSummary: { + id: string; + name: string; + start_time: string; + end_time: string; + }; + /** @description Data transfer object for partially updating an existing Event (PATCH operation). */ + EventPartialUpdate: { + name?: string; + description?: string; + start_time?: string; + end_time?: string; + attendees?: string[]; + sports_linked?: string[]; + teams_linked?: string[]; + }; + /** @description Data transfer object for creating a new Event. */ + EventCreate: { + name: string; + description?: string; + start_time: string; + end_time: string; + attendees?: string[]; + sports_linked?: string[]; + teams_linked?: string[]; + }; + Feedback: { + id: string; + event: string; + member: string; + creator: string; + created_at: string; + feedback: string; + }; + /** @description A simplified representation of a Feedback, typically used in list views. */ + FeedbackSummary: { + id: string; + event: string; + member: string; + creator: string; + created_at: string; + }; + /** @description Data transfer object for partially updating an existing Feedback (PATCH operation). */ + FeedbackPartialUpdate: { + event?: string; + member?: string; + feedback?: string; + }; + /** @description Data transfer object for creating a new Feedback. */ + FeedbackCreate: { + event: string; + member: string; + feedback: string; + }; + /** @description A simplified representation of a Transaction, typically used in list views. */ + Transaction: { + id: string; + member: string; + creator: string; + amount_cents: number; + created_at: string; + title: string; + description: string; + }; + /** @description Data transfer object for partially updating an existing Transaction (PATCH operation). */ + TransactionPartialUpdate: { + member?: string; + amount_cents?: number; + title?: string; + description?: string; + }; + /** @description Data transfer object for creating a new Transaction. */ + TransactionCreate: { + member: string; + amount_cents: number; + title: string; + description?: string; + }; + Balance: { + member: string; + balance_cents: number; + }; + }; + responses: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + InternalServerErrror: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description The server cannot find the requested resource. The endpoint may be invalid or the resource may no longer exist. */ + NotFound: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description The server could not understand the request due to invalid syntax. The client should modify the request and try again. */ + BadRequest: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description The request could not be completed due to a conflict with the current state of the resource. Resolve the conflict and try again. */ + Conflict: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description The request was successful, but there is no content to return in the response. */ + NoContent: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Authentication is required to access the requested resource. The client must include the appropriate credentials. */ + Unauthorized: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions. */ + Forbidden: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + parameters: { + sport_name: string; + team_id: string; + member_id: string; + event_id: string; + feedback_id: string; + transaction_id: string; + }; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + getAllSports: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Sport"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createSport: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["SportCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Sport"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getSport: { + parameters: { + query?: never; + header?: never; + path: { + sport_name: components["parameters"]["sport_name"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Sport"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteSport: { + parameters: { + query?: never; + header?: never; + path: { + sport_name: components["parameters"]["sport_name"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateSport: { + parameters: { + query?: never; + header?: never; + path: { + sport_name: components["parameters"]["sport_name"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["SportPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Sport"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllTeams: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Team"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createTeam: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TeamCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Team"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getTeam: { + parameters: { + query?: never; + header?: never; + path: { + team_id: components["parameters"]["team_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Team"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteTeam: { + parameters: { + query?: never; + header?: never; + path: { + team_id: components["parameters"]["team_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateTeam: { + parameters: { + query?: never; + header?: never; + path: { + team_id: components["parameters"]["team_id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TeamPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Team"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllMembers: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MemberSummary"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createMember: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MemberCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Member"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getMemberDetails: { + parameters: { + query?: never; + header?: never; + path: { + member_id: components["parameters"]["member_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Member"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteMember: { + parameters: { + query?: never; + header?: never; + path: { + member_id: components["parameters"]["member_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateMemberDetails: { + parameters: { + query?: never; + header?: never; + path: { + member_id: components["parameters"]["member_id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MemberPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Member"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllEvents: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["EventSummary"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createEvent: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["EventCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Event"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getEventDetails: { + parameters: { + query?: never; + header?: never; + path: { + event_id: components["parameters"]["event_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Event"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteEvent: { + parameters: { + query?: never; + header?: never; + path: { + event_id: components["parameters"]["event_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateEventDetails: { + parameters: { + query?: never; + header?: never; + path: { + event_id: components["parameters"]["event_id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["EventPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Event"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllFeedback: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FeedbackSummary"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createFeedback: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["FeedbackCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Feedback"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getFeedbackDetails: { + parameters: { + query?: never; + header?: never; + path: { + feedback_id: components["parameters"]["feedback_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Feedback"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteFeedback: { + parameters: { + query?: never; + header?: never; + path: { + feedback_id: components["parameters"]["feedback_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateFeedbackDetails: { + parameters: { + query?: never; + header?: never; + path: { + feedback_id: components["parameters"]["feedback_id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["FeedbackPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Feedback"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllBalances: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Balance"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getMemberBalance: { + parameters: { + query?: never; + header?: never; + path: { + member_id: components["parameters"]["member_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Balance"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getAllTransactions: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Transaction"][]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + createTransaction: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TransactionCreate"]; + }; + }; + responses: { + /** @description The request was successful, and a new resource was created. */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Transaction"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 409: components["responses"]["Conflict"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getTransaction: { + parameters: { + query?: never; + header?: never; + path: { + transaction_id: components["parameters"]["transaction_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Transaction"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + deleteTransaction: { + parameters: { + query?: never; + header?: never; + path: { + transaction_id: components["parameters"]["transaction_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, but there is no content to return in the response. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + updateTransaction: { + parameters: { + query?: never; + header?: never; + path: { + transaction_id: components["parameters"]["transaction_id"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TransactionPartialUpdate"]; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Transaction"]; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + sendMail: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "text/html": Record; + }; + }; + responses: { + 204: components["responses"]["NoContent"]; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + getPdf: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "text/html": Record; + }; + }; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/pdf": string; + }; + }; + 400: components["responses"]["BadRequest"]; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; + generateReport: { + parameters: { + query?: never; + header?: never; + path: { + member_id: components["parameters"]["member_id"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The request was successful, and the server has returned the requested resource in the response body. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + 401: components["responses"]["Unauthorized"]; + 403: components["responses"]["Forbidden"]; + 500: components["responses"]["InternalServerErrror"]; + }; + }; +} From aa4a3934f1526a5c46ee228ee741f41814d5d660 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Mon, 25 May 2026 22:26:13 +0200 Subject: [PATCH 10/15] adjust readme docs and fix finance naming --- README.md | 82 ++++++++++++++++++++++++++++++++-------------- docker-compose.yml | 4 +-- 2 files changed, 60 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f020f2e..07893de 100644 --- a/README.md +++ b/README.md @@ -19,33 +19,66 @@ Club organizers get an all-in-one tool for managing members, automating billing, ``` repo/ ├── api/ # Single source of truth for API contracts -│ ├── openapi.yaml # Versioned OpenAPI spec -│ └── scripts/ # Code-gen helper scripts +│ ├── openapi.yaml # Versioned OpenAPI spec (OpenAPI 3.0.3) +│ └── scripts/ # Code-gen scripts (gen-all.sh, gen-spring.sh, …) ├── docs/ # Project documentation ├── services/ │ ├── spring-*/ # Java 21, Spring Boot 3 microservices -│ └── py-*/ # Python 3.12, Flask + LangChain GenAI service -├── web-client/ # React single-page application +│ │ └── src/generated/ # ⚠ Generated — do not edit by hand +│ └── py-genai-helper/ # Python 3.12, Flask + LangChain GenAI service +│ └── generated/ # ⚠ Generated — do not edit by hand +├── web-client/ # React SPA (Vite, TypeScript) +│ └── src/api.ts # ⚠ Generated — do not edit by hand ├── infra/ # docker-compose, Traefik config, Helm/Terraform └── .github/workflows/ # CI/CD pipelines ``` ## Architecture -All services sit behind a **Traefik** reverse proxy that handles routing and authentication (OAuth2). The Spring Boot services and the GenAI service share **PostgreSQL** databases. The web client communicates with the backend services via REST APIs defined in the OpenAPI spec. The GenAI service can call external LLM APIs (like OpenAI) or use local models to generate personalized feedback based on member data and trainer notes. - -| Service | Port | Stack | +All services run in Docker and are exposed through a single **Traefik** reverse +proxy on port **80**. Traefik routes requests by path prefix and strips the full +prefix before forwarding, so each service receives only the resource path (e.g. +`GET /api/v1/organization/sports` → organization-service receives `GET /sports`). +The Spring Boot services and the GenAI service share a **PostgreSQL** database. + +| Service | External route | Internal port | Stack | +|---|---|---|---| +| Organization Service | `/api/v1/organization/…` | 8080 | Java 21, Spring Boot 3 | +| Member Service | `/api/v1/members/…` | 8080 | Java 21, Spring Boot 3 | +| Event Service | `/api/v1/events/…` | 8080 | Java 21, Spring Boot 3 | +| Feedback Service | `/api/v1/feedback/…` | 8080 | Java 21, Spring Boot 3 | +| Finance Service | `/api/v1/finance/…` | 8080 | Java 21, Spring Boot 3 | +| Letter Service | `/api/v1/letters/…` | 8080 | Java 21, Spring Boot 3 | +| GenAI Service | `/api/v1/helper/…` | 5000 | Python 3.12, Flask, LangChain | +| Web Client | `/` | 8080 | React, Vite | +| Swagger UI | `/docs` | 8080 | swaggerapi/swagger-ui | +| Traefik dashboard | `http://localhost:8080` | — | Traefik v3 | +| PostgreSQL | internal only | 5432 | postgres:15 | + +## Code Generation + +`api/openapi.yaml` is the single source of truth. Three generators derive code +from it that **must never be edited by hand**: + +| Generator | Tool | Output | |---|---|---| -| Organization Service | 8001 | Java 21, Spring Boot 3 | -| Member Service | 8002 | Java 21, Spring Boot 3 | -| Event Service | 8003 | Java 21, Spring Boot 3 | -| Feedback Service | 8004 | Java 21, Spring Boot 3 | -| Finance Service | 8005 | Java 21, Spring Boot 3 | -| Letter Service | 8006 | Java 21, Spring Boot 3 | -| GenAI Service | 5000 | Python 3.12, Flask, LangChain | -| Web Client | 3000 | React, Vite | -| PostgreSQL | 5432 | — | -| Traefik | 80/443 | — | +| Spring Boot API interfaces + models | `openapitools/openapi-generator-cli:v7.14.0` (Docker) | `services/spring-*/src/generated/java/` | +| Pydantic v2 models | `datamodel-code-generator` (pip) | `services/py-genai-helper/generated/models.py` | +| TypeScript types | `openapi-typescript` (pnpm devDep) | `web-client/src/api.ts` | + +Run all generators at once: + +```bash +./api/scripts/gen-all.sh +``` + +The `openapi-codegen` pre-commit hook runs this automatically whenever +`api/openapi.yaml` is staged. If any generated file changes, the hook re-stages +the output and aborts so you can review the diff before re-committing. + +Prerequisites: **Docker** (Spring generator), **`datamodel-code-generator`** +(`pip install datamodel-code-generator`), **`pnpm`** (already a devDependency +in `web-client/`). ## Developer Setup @@ -54,21 +87,22 @@ checks locally that CI gates on (ruff, eslint, end-of-file fixer, pnpm lockfile sync, etc.). One-time setup per developer: ```bash -pip install pre-commit # or: pipx install pre-commit -pre-commit install # installs the pre-commit git hook -pre-commit install --hook-type pre-push # installs the pre-push hook -pre-commit run --all-files # optional one-time clean-up pass +pip install pre-commit datamodel-code-generator # or: pipx install pre-commit +pre-commit install # installs the pre-commit git hook +pre-commit install --hook-type pre-push # installs the pre-push hook +pre-commit run --all-files # optional one-time clean-up pass ``` What runs when: | Stage | Hooks | |---|---| -| `pre-commit` (every commit) | end-of-file-fixer, trailing-whitespace, check-yaml/json, merge-conflict guard, large-file guard, **ruff** (lint + format, py-genai-helper), **eslint --fix** (web-client), **pnpm-lock-sync** (regenerates `web-client/pnpm-lock.yaml` when `package.json` changes) | +| `pre-commit` (every commit) | end-of-file-fixer, trailing-whitespace, check-yaml/json, merge-conflict guard, large-file guard, **ruff** (lint + format, py-genai-helper), **eslint --fix** (web-client), **pnpm-lock-sync** (regenerates `web-client/pnpm-lock.yaml` when `package.json` changes), **openapi-codegen** (regenerates all generated sources when `api/openapi.yaml` changes) | | `pre-push` (only on push) | **Spectral** lint of `api/openapi.yaml` (if changed), **Checkstyle** for all Spring services (if Java sources changed) | -Auto-fixing hooks (ruff, eslint, npm-lock-sync, end-of-file-fixer, etc.) will -modify files and **abort the commit** so you can re-stage and re-commit. +Auto-fixing hooks (ruff, eslint, pnpm-lock-sync, openapi-codegen, +end-of-file-fixer, etc.) will modify files and **abort the commit** so you can +re-stage and re-commit. Bypass (emergencies only -- CI will still gate): diff --git a/docker-compose.yml b/docker-compose.yml index d796356..1ed0c34 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -128,8 +128,8 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.finance-service.entrypoints=web" - - "traefik.http.routers.finance-service.rule=PathPrefix(`/api/v1/finances`)" - - "traefik.http.middlewares.finance-stripprefix.stripprefix.prefixes=/api/v1/finances" + - "traefik.http.routers.finance-service.rule=PathPrefix(`/api/v1/finance`)" + - "traefik.http.middlewares.finance-stripprefix.stripprefix.prefixes=/api/v1/finance" - "traefik.http.routers.finance-service.middlewares=finance-stripprefix" - "traefik.http.services.finance-service.loadbalancer.server.port=8080" networks: From 4e004061ed1e6d077fafc8f34d4e1c885f42d965 Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Mon, 25 May 2026 22:31:36 +0200 Subject: [PATCH 11/15] fix linting issues --- api/openapi.yaml | 8 ++------ scripts/hooks/run-spectral.sh | 2 +- services/py-genai-helper/generated/models.py | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index f6b7ba2..90926cb 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -3,6 +3,8 @@ info: title: Club Management System API description: This is the API definition of the Club Management System. version: 0.0.0 + contact: + name: team-devoops servers: - url: /api/v1 description: "" @@ -1113,7 +1115,6 @@ components: type: array items: type: string - required: [] description: Data transfer object for partially updating an existing Sport (PATCH operation). x-fiddle-dto-info: @@ -1195,7 +1196,6 @@ components: type: array items: type: string - required: [] description: Data transfer object for partially updating an existing Team (PATCH operation). x-fiddle-dto-info: @@ -1268,7 +1268,6 @@ components: type: string information: type: string - required: [] description: Data transfer object for partially updating an existing Member (PATCH operation). x-fiddle-dto-info: @@ -1375,7 +1374,6 @@ components: type: array items: type: string - required: [] description: Data transfer object for partially updating an existing Event (PATCH operation). x-fiddle-dto-info: @@ -1464,7 +1462,6 @@ components: type: string feedback: type: string - required: [] description: Data transfer object for partially updating an existing Feedback (PATCH operation). x-fiddle-dto-info: @@ -1523,7 +1520,6 @@ components: type: string description: type: string - required: [] description: Data transfer object for partially updating an existing Transaction (PATCH operation). x-fiddle-dto-info: diff --git a/scripts/hooks/run-spectral.sh b/scripts/hooks/run-spectral.sh index c3c53e6..4e8bff0 100755 --- a/scripts/hooks/run-spectral.sh +++ b/scripts/hooks/run-spectral.sh @@ -8,4 +8,4 @@ if [ ! -s api/openapi.yaml ]; then exit 0 fi -exec npx --yes @stoplight/spectral-cli lint api/openapi.yaml +exec npx --yes @stoplight/spectral-cli lint api/openapi.yaml --fail-severity error diff --git a/services/py-genai-helper/generated/models.py b/services/py-genai-helper/generated/models.py index 712719f..88fa44d 100644 --- a/services/py-genai-helper/generated/models.py +++ b/services/py-genai-helper/generated/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2026-05-25T20:08:01+00:00 +# timestamp: 2026-05-25T20:31:48+00:00 from __future__ import annotations from pydantic import BaseModel, Field From 025cddf7205458301de213a3586a90ef7428b9fc Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Mon, 25 May 2026 22:54:46 +0200 Subject: [PATCH 12/15] fix checkstyle issues --- api/scripts/gen-spring.sh | 2 +- services/py-genai-helper/generated/models.py | 2 +- services/spring-event/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../tum/devoops/eventservice/api/ApiUtil.java | 19 +++++++++++++++++++ services/spring-feedback/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../devoops/feedbackservice/api/ApiUtil.java | 19 +++++++++++++++++++ services/spring-finance/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../devoops/financeservice/api/ApiUtil.java | 19 +++++++++++++++++++ services/spring-letter/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../devoops/letterservice/api/ApiUtil.java | 19 +++++++++++++++++++ services/spring-member/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../devoops/memberservice/api/ApiUtil.java | 19 +++++++++++++++++++ services/spring-organization/build.gradle | 2 ++ .../config/checkstyle/checkstyle.xml | 5 +++++ .../generated/java/.openapi-generator/FILES | 1 + .../organizationservice/api/ApiUtil.java | 19 +++++++++++++++++++ 26 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 services/spring-event/src/generated/java/tum/devoops/eventservice/api/ApiUtil.java create mode 100644 services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/ApiUtil.java create mode 100644 services/spring-finance/src/generated/java/tum/devoops/financeservice/api/ApiUtil.java create mode 100644 services/spring-letter/src/generated/java/tum/devoops/letterservice/api/ApiUtil.java create mode 100644 services/spring-member/src/generated/java/tum/devoops/memberservice/api/ApiUtil.java create mode 100644 services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/ApiUtil.java diff --git a/api/scripts/gen-spring.sh b/api/scripts/gen-spring.sh index 314ed79..74b4c11 100755 --- a/api/scripts/gen-spring.sh +++ b/api/scripts/gen-spring.sh @@ -28,5 +28,5 @@ docker run --rm \ -g spring \ -o /local/services/"$SERVICE"/src/generated/java \ --skip-validate-spec \ - --global-property "apis=$TAG_CAP,models=$MODELS,supportingFiles=false" \ + --global-property "apis=$TAG_CAP,models=$MODELS,supportingFiles=ApiUtil.java" \ --additional-properties "useSpringBoot3=true,interfaceOnly=true,openApiNullable=false,useTags=true,sourceFolder=,apiPackage=tum.devoops.$PKG.api,modelPackage=tum.devoops.$PKG.model,hideGenerationTimestamp=true" diff --git a/services/py-genai-helper/generated/models.py b/services/py-genai-helper/generated/models.py index 88fa44d..c6fac42 100644 --- a/services/py-genai-helper/generated/models.py +++ b/services/py-genai-helper/generated/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2026-05-25T20:31:48+00:00 +# timestamp: 2026-05-25T20:54:20+00:00 from __future__ import annotations from pydantic import BaseModel, Field diff --git a/services/spring-event/build.gradle b/services/spring-event/build.gradle index 746ed02..1e34f4b 100644 --- a/services/spring-event/build.gradle +++ b/services/spring-event/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-event/config/checkstyle/checkstyle.xml b/services/spring-event/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-event/config/checkstyle/checkstyle.xml +++ b/services/spring-event/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-event/src/generated/java/.openapi-generator/FILES b/services/spring-event/src/generated/java/.openapi-generator/FILES index c08ab17..799d838 100644 --- a/services/spring-event/src/generated/java/.openapi-generator/FILES +++ b/services/spring-event/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/eventservice/api/ApiUtil.java tum/devoops/eventservice/api/EventsApi.java tum/devoops/eventservice/model/BadRequestResponse.java tum/devoops/eventservice/model/ErrorResponse.java diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/ApiUtil.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/ApiUtil.java new file mode 100644 index 0000000..3cd1356 --- /dev/null +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.eventservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/spring-feedback/build.gradle b/services/spring-feedback/build.gradle index 481d3de..41f642c 100644 --- a/services/spring-feedback/build.gradle +++ b/services/spring-feedback/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-feedback/config/checkstyle/checkstyle.xml b/services/spring-feedback/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-feedback/config/checkstyle/checkstyle.xml +++ b/services/spring-feedback/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-feedback/src/generated/java/.openapi-generator/FILES b/services/spring-feedback/src/generated/java/.openapi-generator/FILES index 93525c7..7dd59c2 100644 --- a/services/spring-feedback/src/generated/java/.openapi-generator/FILES +++ b/services/spring-feedback/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/feedbackservice/api/ApiUtil.java tum/devoops/feedbackservice/api/FeedbackApi.java tum/devoops/feedbackservice/model/BadRequestResponse.java tum/devoops/feedbackservice/model/ErrorResponse.java diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/ApiUtil.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/ApiUtil.java new file mode 100644 index 0000000..7fb8b07 --- /dev/null +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.feedbackservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/spring-finance/build.gradle b/services/spring-finance/build.gradle index 6cc35d5..b46afe9 100644 --- a/services/spring-finance/build.gradle +++ b/services/spring-finance/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-finance/config/checkstyle/checkstyle.xml b/services/spring-finance/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-finance/config/checkstyle/checkstyle.xml +++ b/services/spring-finance/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-finance/src/generated/java/.openapi-generator/FILES b/services/spring-finance/src/generated/java/.openapi-generator/FILES index dd371b6..5e5593a 100644 --- a/services/spring-finance/src/generated/java/.openapi-generator/FILES +++ b/services/spring-finance/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/financeservice/api/ApiUtil.java tum/devoops/financeservice/api/FinanceApi.java tum/devoops/financeservice/model/BadRequestResponse.java tum/devoops/financeservice/model/Balance.java diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/ApiUtil.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/ApiUtil.java new file mode 100644 index 0000000..a217bae --- /dev/null +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.financeservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/spring-letter/build.gradle b/services/spring-letter/build.gradle index d726154..80acb3d 100644 --- a/services/spring-letter/build.gradle +++ b/services/spring-letter/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-letter/config/checkstyle/checkstyle.xml b/services/spring-letter/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-letter/config/checkstyle/checkstyle.xml +++ b/services/spring-letter/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-letter/src/generated/java/.openapi-generator/FILES b/services/spring-letter/src/generated/java/.openapi-generator/FILES index 2718309..6518e73 100644 --- a/services/spring-letter/src/generated/java/.openapi-generator/FILES +++ b/services/spring-letter/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/letterservice/api/ApiUtil.java tum/devoops/letterservice/api/LettersApi.java tum/devoops/letterservice/model/BadRequestResponse.java tum/devoops/letterservice/model/ErrorResponse.java diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/ApiUtil.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/ApiUtil.java new file mode 100644 index 0000000..9e7bf42 --- /dev/null +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.letterservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/spring-member/build.gradle b/services/spring-member/build.gradle index cc03527..aa47b71 100644 --- a/services/spring-member/build.gradle +++ b/services/spring-member/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-member/config/checkstyle/checkstyle.xml b/services/spring-member/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-member/config/checkstyle/checkstyle.xml +++ b/services/spring-member/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-member/src/generated/java/.openapi-generator/FILES b/services/spring-member/src/generated/java/.openapi-generator/FILES index e9f0260..1e3a676 100644 --- a/services/spring-member/src/generated/java/.openapi-generator/FILES +++ b/services/spring-member/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/memberservice/api/ApiUtil.java tum/devoops/memberservice/api/MembersApi.java tum/devoops/memberservice/model/BadRequestResponse.java tum/devoops/memberservice/model/ErrorResponse.java diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/ApiUtil.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/ApiUtil.java new file mode 100644 index 0000000..227748e --- /dev/null +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.memberservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/spring-organization/build.gradle b/services/spring-organization/build.gradle index fdb7d60..437e4c8 100644 --- a/services/spring-organization/build.gradle +++ b/services/spring-organization/build.gradle @@ -44,7 +44,9 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' runtimeOnly 'org.postgresql:postgresql' diff --git a/services/spring-organization/config/checkstyle/checkstyle.xml b/services/spring-organization/config/checkstyle/checkstyle.xml index 5cc515b..580dda9 100644 --- a/services/spring-organization/config/checkstyle/checkstyle.xml +++ b/services/spring-organization/config/checkstyle/checkstyle.xml @@ -10,6 +10,11 @@ --> + + + + + diff --git a/services/spring-organization/src/generated/java/.openapi-generator/FILES b/services/spring-organization/src/generated/java/.openapi-generator/FILES index 076963a..25bf6c3 100644 --- a/services/spring-organization/src/generated/java/.openapi-generator/FILES +++ b/services/spring-organization/src/generated/java/.openapi-generator/FILES @@ -1,3 +1,4 @@ +tum/devoops/organizationservice/api/ApiUtil.java tum/devoops/organizationservice/api/OrganizationApi.java tum/devoops/organizationservice/model/BadRequestResponse.java tum/devoops/organizationservice/model/ErrorResponse.java diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/ApiUtil.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/ApiUtil.java new file mode 100644 index 0000000..e41faed --- /dev/null +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/ApiUtil.java @@ -0,0 +1,19 @@ +package tum.devoops.organizationservice.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} From c610fae702d32950144f99e958a569445b7e469f Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Tue, 26 May 2026 19:04:11 +0200 Subject: [PATCH 13/15] ignore generated files in ci pipeline --- services/py-genai-helper/ruff.toml | 1 + web-client/eslint.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/services/py-genai-helper/ruff.toml b/services/py-genai-helper/ruff.toml index 0873f2f..4ab4bb9 100644 --- a/services/py-genai-helper/ruff.toml +++ b/services/py-genai-helper/ruff.toml @@ -7,6 +7,7 @@ extend-exclude = [ ".venv", "build", "dist", + "generated", ] [lint] diff --git a/web-client/eslint.config.js b/web-client/eslint.config.js index ef614d2..198223d 100644 --- a/web-client/eslint.config.js +++ b/web-client/eslint.config.js @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(['dist', 'src/api.ts']), { files: ['**/*.{ts,tsx}'], extends: [ From 7c1d8e084065f209eafd6ec2b96d1e404d7afe3a Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Tue, 26 May 2026 19:25:47 +0200 Subject: [PATCH 14/15] improve api types/formats --- api/openapi.yaml | 136 +++++++++--------- services/py-genai-helper/generated/models.py | 56 ++++---- .../devoops/eventservice/api/EventsApi.java | 15 +- .../tum/devoops/eventservice/model/Event.java | 37 ++--- .../eventservice/model/EventCreate.java | 26 ++-- .../model/EventPartialUpdate.java | 24 ++-- .../eventservice/model/EventSummary.java | 37 ++--- .../feedbackservice/api/FeedbackApi.java | 15 +- .../feedbackservice/model/Feedback.java | 26 ++-- .../model/FeedbackSummary.java | 26 ++-- .../financeservice/api/FinanceApi.java | 17 +-- .../financeservice/model/Transaction.java | 26 ++-- .../devoops/letterservice/api/LettersApi.java | 4 +- .../devoops/memberservice/api/MembersApi.java | 15 +- .../devoops/memberservice/model/Member.java | 37 ++--- .../memberservice/model/MemberCreate.java | 13 +- .../model/MemberPartialUpdate.java | 13 +- .../memberservice/model/MemberSummary.java | 13 +- .../api/OrganizationApi.java | 23 +-- .../organizationservice/model/Sport.java | 15 +- .../organizationservice/model/Team.java | 26 ++-- web-client/src/api.ts | 101 ++++++++----- 22 files changed, 391 insertions(+), 310 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 90926cb..dd5d510 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -30,7 +30,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] parameters: [] @@ -55,7 +55,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -90,7 +90,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" requestBody: required: true description: "" @@ -118,7 +118,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] get: @@ -143,7 +143,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /organization/teams: @@ -167,7 +167,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] post: @@ -191,7 +191,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -224,7 +224,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] patch: @@ -251,7 +251,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -279,7 +279,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /members: @@ -303,7 +303,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] post: @@ -327,7 +327,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -360,7 +360,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] patch: @@ -387,7 +387,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -415,7 +415,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /events: @@ -439,7 +439,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] post: @@ -463,7 +463,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -496,7 +496,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] patch: @@ -523,7 +523,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -551,7 +551,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /feedback: @@ -575,7 +575,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] post: @@ -599,7 +599,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -632,7 +632,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] delete: @@ -653,7 +653,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] patch: @@ -680,7 +680,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -711,7 +711,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /finance/balances/{member_id}: @@ -737,7 +737,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /finance/transactions: @@ -761,7 +761,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] post: @@ -785,7 +785,7 @@ paths: "409": $ref: "#/components/responses/Conflict" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -818,7 +818,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] patch: @@ -845,7 +845,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -873,7 +873,7 @@ paths: "404": $ref: "#/components/responses/NotFound" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] /letters/mail: @@ -892,7 +892,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] requestBody: @@ -901,7 +901,7 @@ paths: content: text/html: schema: - type: object + type: string parameters: [] /letters/pdf: post: @@ -925,7 +925,7 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" security: - BearerJwt: [] parameters: [] @@ -935,7 +935,7 @@ paths: content: text/html: schema: - type: object + type: string /helper/report/{member_id}: get: operationId: generateReport @@ -955,14 +955,14 @@ paths: "403": $ref: "#/components/responses/Forbidden" "500": - $ref: "#/components/responses/InternalServerErrror" + $ref: "#/components/responses/InternalServerError" parameters: - $ref: "#/components/parameters/member_id" security: - BearerJwt: [] components: responses: - InternalServerErrror: + InternalServerError: description: The server encountered an unexpected condition that prevented it from fulfilling the request. content: @@ -1027,30 +1027,35 @@ components: required: true schema: type: string + format: uuid member_id: name: member_id in: path required: true schema: type: string + format: uuid event_id: name: event_id in: path required: true schema: type: string + format: uuid feedback_id: name: feedback_id in: path required: true schema: type: string + format: uuid transaction_id: name: transaction_id in: path required: true schema: type: string + format: uuid schemas: ErrorResponse: type: object @@ -1079,6 +1084,7 @@ components: type: string created_at: type: string + format: date directors: type: array items: @@ -1102,8 +1108,6 @@ components: required: - name description: Data transfer object for creating a new Sport. - x-fiddle-dto-info: - baseSchemaName: Sport SportPartialUpdate: type: object properties: @@ -1117,19 +1121,19 @@ components: type: string description: Data transfer object for partially updating an existing Sport (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Sport Team: type: object properties: id: type: string + format: uuid name: type: string description: type: string created_at: type: string + format: date address: type: string sport: @@ -1175,8 +1179,6 @@ components: - name - sport description: Data transfer object for creating a new Team. - x-fiddle-dto-info: - baseSchemaName: Team TeamPartialUpdate: type: object properties: @@ -1198,13 +1200,12 @@ components: type: string description: Data transfer object for partially updating an existing Team (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Team Member: type: object properties: id: type: string + format: uuid first_name: type: string last_name: @@ -1213,12 +1214,14 @@ components: type: string birthday: type: string + format: date phone_number: type: string address: type: string joining_date: type: string + format: date information: type: string required: @@ -1237,6 +1240,7 @@ components: properties: id: type: string + format: uuid first_name: type: string last_name: @@ -1249,8 +1253,6 @@ components: - last_name - email description: A simplified representation of a Member, typically used in list views. - x-fiddle-dto-info: - baseSchemaName: Member MemberPartialUpdate: type: object properties: @@ -1262,6 +1264,7 @@ components: type: string birthday: type: string + format: date phone_number: type: string address: @@ -1270,8 +1273,6 @@ components: type: string description: Data transfer object for partially updating an existing Member (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Member MemberCreate: type: object properties: @@ -1283,6 +1284,7 @@ components: type: string birthday: type: string + format: date phone_number: type: string address: @@ -1293,21 +1295,22 @@ components: - first_name - last_name description: Data transfer object for creating a new Member. - x-fiddle-dto-info: - baseSchemaName: Member Event: type: object properties: id: type: string + format: uuid name: type: string description: type: string start_time: type: string + format: date-time end_time: type: string + format: date-time attendees: type: array items: @@ -1337,20 +1340,21 @@ components: properties: id: type: string + format: uuid name: type: string start_time: type: string + format: date-time end_time: type: string + format: date-time required: - id - name - start_time - end_time description: A simplified representation of a Event, typically used in list views. - x-fiddle-dto-info: - baseSchemaName: Event EventPartialUpdate: type: object properties: @@ -1360,8 +1364,10 @@ components: type: string start_time: type: string + format: date-time end_time: type: string + format: date-time attendees: type: array items: @@ -1376,8 +1382,6 @@ components: type: string description: Data transfer object for partially updating an existing Event (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Event EventCreate: type: object properties: @@ -1387,8 +1391,10 @@ components: type: string start_time: type: string + format: date-time end_time: type: string + format: date-time attendees: type: array items: @@ -1406,13 +1412,12 @@ components: - start_time - end_time description: Data transfer object for creating a new Event. - x-fiddle-dto-info: - baseSchemaName: Event Feedback: type: object properties: id: type: string + format: uuid event: type: string member: @@ -1421,6 +1426,7 @@ components: type: string created_at: type: string + format: date-time feedback: type: string required: @@ -1436,6 +1442,7 @@ components: properties: id: type: string + format: uuid event: type: string member: @@ -1444,6 +1451,7 @@ components: type: string created_at: type: string + format: date-time required: - id - event @@ -1451,8 +1459,6 @@ components: - creator - created_at description: A simplified representation of a Feedback, typically used in list views. - x-fiddle-dto-info: - baseSchemaName: Feedback FeedbackPartialUpdate: type: object properties: @@ -1464,8 +1470,6 @@ components: type: string description: Data transfer object for partially updating an existing Feedback (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Feedback FeedbackCreate: type: object properties: @@ -1480,13 +1484,12 @@ components: - member - feedback description: Data transfer object for creating a new Feedback. - x-fiddle-dto-info: - baseSchemaName: Feedback Transaction: type: object properties: id: type: string + format: uuid member: type: string creator: @@ -1495,6 +1498,7 @@ components: type: integer created_at: type: string + format: date-time title: type: string description: @@ -1522,8 +1526,6 @@ components: type: string description: Data transfer object for partially updating an existing Transaction (PATCH operation). - x-fiddle-dto-info: - baseSchemaName: Transaction TransactionCreate: type: object properties: @@ -1540,8 +1542,6 @@ components: - amount_cents - title description: Data transfer object for creating a new Transaction. - x-fiddle-dto-info: - baseSchemaName: Transaction Balance: type: object properties: diff --git a/services/py-genai-helper/generated/models.py b/services/py-genai-helper/generated/models.py index c6fac42..a86f0bd 100644 --- a/services/py-genai-helper/generated/models.py +++ b/services/py-genai-helper/generated/models.py @@ -1,9 +1,11 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2026-05-25T20:54:20+00:00 +# timestamp: 2026-05-26T17:26:18+00:00 from __future__ import annotations -from pydantic import BaseModel, Field +from pydantic import AwareDatetime, BaseModel, Field +from datetime import date +from uuid import UUID from typing import Annotated @@ -19,7 +21,7 @@ class BadRequestResponse(BaseModel): class Sport(BaseModel): name: str description: str - created_at: str + created_at: date directors: list[str] @@ -36,10 +38,10 @@ class SportPartialUpdate(BaseModel): class Team(BaseModel): - id: str + id: UUID name: str description: str - created_at: str + created_at: date address: str sport: str trainers: list[str] @@ -65,19 +67,19 @@ class TeamPartialUpdate(BaseModel): class Member(BaseModel): - id: str + id: UUID first_name: str last_name: str email: str - birthday: str + birthday: date phone_number: str address: str - joining_date: str + joining_date: date information: str class MemberSummary(BaseModel): - id: str + id: UUID first_name: str last_name: str email: str @@ -87,7 +89,7 @@ class MemberPartialUpdate(BaseModel): first_name: str | None = None last_name: str | None = None email: str | None = None - birthday: str | None = None + birthday: date | None = None phone_number: str | None = None address: str | None = None information: str | None = None @@ -97,18 +99,18 @@ class MemberCreate(BaseModel): first_name: str last_name: str email: str | None = None - birthday: str | None = None + birthday: date | None = None phone_number: str | None = None address: str | None = None information: str | None = None class Event(BaseModel): - id: str + id: UUID name: str description: str - start_time: str - end_time: str + start_time: AwareDatetime + end_time: AwareDatetime attendees: list[str] | None = None sports_linked: Annotated[ list[str] | None, @@ -122,17 +124,17 @@ class Event(BaseModel): class EventSummary(BaseModel): - id: str + id: UUID name: str - start_time: str - end_time: str + start_time: AwareDatetime + end_time: AwareDatetime class EventPartialUpdate(BaseModel): name: str | None = None description: str | None = None - start_time: str | None = None - end_time: str | None = None + start_time: AwareDatetime | None = None + end_time: AwareDatetime | None = None attendees: list[str] | None = None sports_linked: list[str] | None = None teams_linked: list[str] | None = None @@ -141,28 +143,28 @@ class EventPartialUpdate(BaseModel): class EventCreate(BaseModel): name: str description: str | None = None - start_time: str - end_time: str + start_time: AwareDatetime + end_time: AwareDatetime attendees: list[str] | None = None sports_linked: list[str] | None = None teams_linked: list[str] | None = None class Feedback(BaseModel): - id: str + id: UUID event: str member: str creator: str - created_at: str + created_at: AwareDatetime feedback: str class FeedbackSummary(BaseModel): - id: str + id: UUID event: str member: str creator: str - created_at: str + created_at: AwareDatetime class FeedbackPartialUpdate(BaseModel): @@ -178,11 +180,11 @@ class FeedbackCreate(BaseModel): class Transaction(BaseModel): - id: str + id: UUID member: str creator: str amount_cents: int - created_at: str + created_at: AwareDatetime title: str description: str diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java index 6f77af4..1118ea6 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java @@ -11,6 +11,7 @@ import tum.devoops.eventservice.model.EventCreate; import tum.devoops.eventservice.model.EventPartialUpdate; import tum.devoops.eventservice.model.EventSummary; +import java.util.UUID; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -100,7 +101,7 @@ default ResponseEntity createEvent( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + String exampleString = "{ \"start_time\" : \"2000-01-23T04:56:07.000+00:00\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -176,7 +177,7 @@ default ResponseEntity createEvent( ) default ResponseEntity deleteEvent( - @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") UUID eventId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -249,7 +250,7 @@ default ResponseEntity> getAllEvents( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"start_time\" : \"start_time\", \"name\" : \"name\", \"end_time\" : \"end_time\", \"id\" : \"id\" }, { \"start_time\" : \"start_time\", \"name\" : \"name\", \"end_time\" : \"end_time\", \"id\" : \"id\" } ]"; + String exampleString = "[ { \"start_time\" : \"2000-01-23T04:56:07.000+00:00\", \"name\" : \"name\", \"end_time\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\" }, { \"start_time\" : \"2000-01-23T04:56:07.000+00:00\", \"name\" : \"name\", \"end_time\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -317,12 +318,12 @@ default ResponseEntity> getAllEvents( ) default ResponseEntity getEventDetails( - @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") UUID eventId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + String exampleString = "{ \"start_time\" : \"2000-01-23T04:56:07.000+00:00\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -401,13 +402,13 @@ default ResponseEntity getEventDetails( ) default ResponseEntity updateEventDetails( - @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") String eventId, + @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") UUID eventId, @Parameter(name = "EventPartialUpdate", description = "", required = true) @Valid @RequestBody EventPartialUpdate eventPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"start_time\" : \"start_time\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"end_time\", \"description\" : \"description\", \"id\" : \"id\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; + String exampleString = "{ \"start_time\" : \"2000-01-23T04:56:07.000+00:00\", \"creator\" : \"creator\", \"attendees\" : [ \"attendees\", \"attendees\" ], \"name\" : \"name\", \"end_time\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sports_linked\" : [ \"sports_linked\", \"sports_linked\" ], \"teams_linked\" : [ \"teams_linked\", \"teams_linked\" ] }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java index f750440..e04f661 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java @@ -4,9 +4,12 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -25,15 +28,17 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Event { - private String id; + private UUID id; private String name; private String description; - private String startTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime startTime; - private String endTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime endTime; @Valid private List attendees = new ArrayList<>(); @@ -53,7 +58,7 @@ public Event() { /** * Constructor with only required parameters */ - public Event(String id, String name, String description, String startTime, String endTime, String creator) { + public Event(UUID id, String name, String description, OffsetDateTime startTime, OffsetDateTime endTime, String creator) { this.id = id; this.name = name; this.description = description; @@ -62,7 +67,7 @@ public Event(String id, String name, String description, String startTime, Strin this.creator = creator; } - public Event id(String id) { + public Event id(UUID id) { this.id = id; return this; } @@ -71,14 +76,14 @@ public Event id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -122,7 +127,7 @@ public void setDescription(String description) { this.description = description; } - public Event startTime(String startTime) { + public Event startTime(OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -131,18 +136,18 @@ public Event startTime(String startTime) { * Get startTime * @return startTime */ - @NotNull + @NotNull @Valid @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("start_time") - public String getStartTime() { + public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(String startTime) { + public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } - public Event endTime(String endTime) { + public Event endTime(OffsetDateTime endTime) { this.endTime = endTime; return this; } @@ -151,14 +156,14 @@ public Event endTime(String endTime) { * Get endTime * @return endTime */ - @NotNull + @NotNull @Valid @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("end_time") - public String getEndTime() { + public OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(String endTime) { + public void setEndTime(OffsetDateTime endTime) { this.endTime = endTime; } diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java index a94eb56..d15ce42 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventCreate.java @@ -4,9 +4,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -29,9 +31,11 @@ public class EventCreate { private @Nullable String description; - private String startTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime startTime; - private String endTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime endTime; @Valid private List attendees = new ArrayList<>(); @@ -49,7 +53,7 @@ public EventCreate() { /** * Constructor with only required parameters */ - public EventCreate(String name, String startTime, String endTime) { + public EventCreate(String name, OffsetDateTime startTime, OffsetDateTime endTime) { this.name = name; this.startTime = startTime; this.endTime = endTime; @@ -95,7 +99,7 @@ public void setDescription(@Nullable String description) { this.description = description; } - public EventCreate startTime(String startTime) { + public EventCreate startTime(OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -104,18 +108,18 @@ public EventCreate startTime(String startTime) { * Get startTime * @return startTime */ - @NotNull + @NotNull @Valid @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("start_time") - public String getStartTime() { + public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(String startTime) { + public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } - public EventCreate endTime(String endTime) { + public EventCreate endTime(OffsetDateTime endTime) { this.endTime = endTime; return this; } @@ -124,14 +128,14 @@ public EventCreate endTime(String endTime) { * Get endTime * @return endTime */ - @NotNull + @NotNull @Valid @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("end_time") - public String getEndTime() { + public OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(String endTime) { + public void setEndTime(OffsetDateTime endTime) { this.endTime = endTime; } diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java index e83ffc2..1546b4e 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventPartialUpdate.java @@ -4,9 +4,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -29,9 +31,11 @@ public class EventPartialUpdate { private @Nullable String description; - private @Nullable String startTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime startTime; - private @Nullable String endTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime endTime; @Valid private List attendees = new ArrayList<>(); @@ -82,7 +86,7 @@ public void setDescription(@Nullable String description) { this.description = description; } - public EventPartialUpdate startTime(@Nullable String startTime) { + public EventPartialUpdate startTime(@Nullable OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -91,18 +95,18 @@ public EventPartialUpdate startTime(@Nullable String startTime) { * Get startTime * @return startTime */ - + @Valid @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("start_time") - public @Nullable String getStartTime() { + public @Nullable OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(@Nullable String startTime) { + public void setStartTime(@Nullable OffsetDateTime startTime) { this.startTime = startTime; } - public EventPartialUpdate endTime(@Nullable String endTime) { + public EventPartialUpdate endTime(@Nullable OffsetDateTime endTime) { this.endTime = endTime; return this; } @@ -111,14 +115,14 @@ public EventPartialUpdate endTime(@Nullable String endTime) { * Get endTime * @return endTime */ - + @Valid @Schema(name = "end_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("end_time") - public @Nullable String getEndTime() { + public @Nullable OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(@Nullable String endTime) { + public void setEndTime(@Nullable OffsetDateTime endTime) { this.endTime = endTime; } diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java index 919024c..e8c205b 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/EventSummary.java @@ -4,6 +4,9 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,13 +25,15 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class EventSummary { - private String id; + private UUID id; private String name; - private String startTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime startTime; - private String endTime; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime endTime; public EventSummary() { super(); @@ -37,14 +42,14 @@ public EventSummary() { /** * Constructor with only required parameters */ - public EventSummary(String id, String name, String startTime, String endTime) { + public EventSummary(UUID id, String name, OffsetDateTime startTime, OffsetDateTime endTime) { this.id = id; this.name = name; this.startTime = startTime; this.endTime = endTime; } - public EventSummary id(String id) { + public EventSummary id(UUID id) { this.id = id; return this; } @@ -53,14 +58,14 @@ public EventSummary id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -84,7 +89,7 @@ public void setName(String name) { this.name = name; } - public EventSummary startTime(String startTime) { + public EventSummary startTime(OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -93,18 +98,18 @@ public EventSummary startTime(String startTime) { * Get startTime * @return startTime */ - @NotNull + @NotNull @Valid @Schema(name = "start_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("start_time") - public String getStartTime() { + public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(String startTime) { + public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } - public EventSummary endTime(String endTime) { + public EventSummary endTime(OffsetDateTime endTime) { this.endTime = endTime; return this; } @@ -113,14 +118,14 @@ public EventSummary endTime(String endTime) { * Get endTime * @return endTime */ - @NotNull + @NotNull @Valid @Schema(name = "end_time", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("end_time") - public String getEndTime() { + public OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(String endTime) { + public void setEndTime(OffsetDateTime endTime) { this.endTime = endTime; } diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java index 9407fca..a0e54b0 100644 --- a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java @@ -11,6 +11,7 @@ import tum.devoops.feedbackservice.model.FeedbackCreate; import tum.devoops.feedbackservice.model.FeedbackPartialUpdate; import tum.devoops.feedbackservice.model.FeedbackSummary; +import java.util.UUID; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -100,7 +101,7 @@ default ResponseEntity createFeedback( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"event\" : \"event\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -176,7 +177,7 @@ default ResponseEntity createFeedback( ) default ResponseEntity deleteFeedback( - @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") UUID feedbackId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -249,7 +250,7 @@ default ResponseEntity> getAllFeedback( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }, { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" } ]"; + String exampleString = "[ { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"event\" : \"event\" }, { \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"event\" : \"event\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -317,12 +318,12 @@ default ResponseEntity> getAllFeedback( ) default ResponseEntity getFeedbackDetails( - @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") UUID feedbackId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"event\" : \"event\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -401,13 +402,13 @@ default ResponseEntity getFeedbackDetails( ) default ResponseEntity updateFeedbackDetails( - @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") String feedbackId, + @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") UUID feedbackId, @Parameter(name = "FeedbackPartialUpdate", description = "", required = true) @Valid @RequestBody FeedbackPartialUpdate feedbackPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"event\" : \"event\" }"; + String exampleString = "{ \"feedback\" : \"feedback\", \"creator\" : \"creator\", \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"event\" : \"event\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java index 770233e..757994a 100644 --- a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java @@ -4,6 +4,9 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Feedback { - private String id; + private UUID id; private String event; @@ -30,7 +33,8 @@ public class Feedback { private String creator; - private String createdAt; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime createdAt; private String feedback; @@ -41,7 +45,7 @@ public Feedback() { /** * Constructor with only required parameters */ - public Feedback(String id, String event, String member, String creator, String createdAt, String feedback) { + public Feedback(UUID id, String event, String member, String creator, OffsetDateTime createdAt, String feedback) { this.id = id; this.event = event; this.member = member; @@ -50,7 +54,7 @@ public Feedback(String id, String event, String member, String creator, String c this.feedback = feedback; } - public Feedback id(String id) { + public Feedback id(UUID id) { this.id = id; return this; } @@ -59,14 +63,14 @@ public Feedback id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -130,7 +134,7 @@ public void setCreator(String creator) { this.creator = creator; } - public Feedback createdAt(String createdAt) { + public Feedback createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } @@ -139,14 +143,14 @@ public Feedback createdAt(String createdAt) { * Get createdAt * @return createdAt */ - @NotNull + @NotNull @Valid @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("created_at") - public String getCreatedAt() { + public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(String createdAt) { + public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java index ab7f0e1..ab658d4 100644 --- a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/FeedbackSummary.java @@ -4,6 +4,9 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class FeedbackSummary { - private String id; + private UUID id; private String event; @@ -30,7 +33,8 @@ public class FeedbackSummary { private String creator; - private String createdAt; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime createdAt; public FeedbackSummary() { super(); @@ -39,7 +43,7 @@ public FeedbackSummary() { /** * Constructor with only required parameters */ - public FeedbackSummary(String id, String event, String member, String creator, String createdAt) { + public FeedbackSummary(UUID id, String event, String member, String creator, OffsetDateTime createdAt) { this.id = id; this.event = event; this.member = member; @@ -47,7 +51,7 @@ public FeedbackSummary(String id, String event, String member, String creator, S this.createdAt = createdAt; } - public FeedbackSummary id(String id) { + public FeedbackSummary id(UUID id) { this.id = id; return this; } @@ -56,14 +60,14 @@ public FeedbackSummary id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -127,7 +131,7 @@ public void setCreator(String creator) { this.creator = creator; } - public FeedbackSummary createdAt(String createdAt) { + public FeedbackSummary createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } @@ -136,14 +140,14 @@ public FeedbackSummary createdAt(String createdAt) { * Get createdAt * @return createdAt */ - @NotNull + @NotNull @Valid @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("created_at") - public String getCreatedAt() { + public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(String createdAt) { + public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java index 389cc05..b6bf853 100644 --- a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java @@ -11,6 +11,7 @@ import tum.devoops.financeservice.model.Transaction; import tum.devoops.financeservice.model.TransactionCreate; import tum.devoops.financeservice.model.TransactionPartialUpdate; +import java.util.UUID; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -100,7 +101,7 @@ default ResponseEntity createTransaction( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"title\" : \"title\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -176,7 +177,7 @@ default ResponseEntity createTransaction( ) default ResponseEntity deleteTransaction( - @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") UUID transactionId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -317,7 +318,7 @@ default ResponseEntity> getAllTransactions( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }, { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" } ]"; + String exampleString = "[ { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"title\" : \"title\" }, { \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"title\" : \"title\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -385,7 +386,7 @@ default ResponseEntity> getAllTransactions( ) default ResponseEntity getMemberBalance( - @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") UUID memberId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -463,12 +464,12 @@ default ResponseEntity getMemberBalance( ) default ResponseEntity getTransaction( - @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") UUID transactionId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"title\" : \"title\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -547,13 +548,13 @@ default ResponseEntity getTransaction( ) default ResponseEntity updateTransaction( - @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") String transactionId, + @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") UUID transactionId, @Parameter(name = "TransactionPartialUpdate", description = "", required = true) @Valid @RequestBody TransactionPartialUpdate transactionPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"created_at\", \"description\" : \"description\", \"id\" : \"id\", \"title\" : \"title\" }"; + String exampleString = "{ \"creator\" : \"creator\", \"amount_cents\" : 0, \"member\" : \"member\", \"created_at\" : \"2000-01-23T04:56:07.000+00:00\", \"description\" : \"description\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"title\" : \"title\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java index abfb18d..949ef9b 100644 --- a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java @@ -4,6 +4,9 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Transaction { - private String id; + private UUID id; private String member; @@ -30,7 +33,8 @@ public class Transaction { private Integer amountCents; - private String createdAt; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime createdAt; private String title; @@ -43,7 +47,7 @@ public Transaction() { /** * Constructor with only required parameters */ - public Transaction(String id, String member, String creator, Integer amountCents, String createdAt, String title, String description) { + public Transaction(UUID id, String member, String creator, Integer amountCents, OffsetDateTime createdAt, String title, String description) { this.id = id; this.member = member; this.creator = creator; @@ -53,7 +57,7 @@ public Transaction(String id, String member, String creator, Integer amountCents this.description = description; } - public Transaction id(String id) { + public Transaction id(UUID id) { this.id = id; return this; } @@ -62,14 +66,14 @@ public Transaction id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -133,7 +137,7 @@ public void setAmountCents(Integer amountCents) { this.amountCents = amountCents; } - public Transaction createdAt(String createdAt) { + public Transaction createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } @@ -142,14 +146,14 @@ public Transaction createdAt(String createdAt) { * Get createdAt * @return createdAt */ - @NotNull + @NotNull @Valid @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("created_at") - public String getCreatedAt() { + public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(String createdAt) { + public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java index e001d3b..0600714 100644 --- a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java @@ -92,7 +92,7 @@ default Optional getRequest() { ) default ResponseEntity getPdf( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Object body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody String body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -164,7 +164,7 @@ default ResponseEntity getPdf( ) default ResponseEntity sendMail( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Object body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody String body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java index 8b120bd..4b18e16 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java @@ -11,6 +11,7 @@ import tum.devoops.memberservice.model.MemberCreate; import tum.devoops.memberservice.model.MemberPartialUpdate; import tum.devoops.memberservice.model.MemberSummary; +import java.util.UUID; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -100,7 +101,7 @@ default ResponseEntity createMember( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + String exampleString = "{ \"birthday\" : \"2000-01-23\", \"joining_date\" : \"2000-01-23\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -176,7 +177,7 @@ default ResponseEntity createMember( ) default ResponseEntity deleteMember( - @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") UUID memberId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -249,7 +250,7 @@ default ResponseEntity> getAllMembers( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"last_name\" : \"last_name\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }, { \"last_name\" : \"last_name\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" } ]"; + String exampleString = "[ { \"last_name\" : \"last_name\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"first_name\" : \"first_name\", \"email\" : \"email\" }, { \"last_name\" : \"last_name\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"first_name\" : \"first_name\", \"email\" : \"email\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -317,12 +318,12 @@ default ResponseEntity> getAllMembers( ) default ResponseEntity getMemberDetails( - @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") UUID memberId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + String exampleString = "{ \"birthday\" : \"2000-01-23\", \"joining_date\" : \"2000-01-23\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -401,13 +402,13 @@ default ResponseEntity getMemberDetails( ) default ResponseEntity updateMemberDetails( - @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") String memberId, + @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") UUID memberId, @Parameter(name = "MemberPartialUpdate", description = "", required = true) @Valid @RequestBody MemberPartialUpdate memberPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"birthday\" : \"birthday\", \"joining_date\" : \"joining_date\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"id\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; + String exampleString = "{ \"birthday\" : \"2000-01-23\", \"joining_date\" : \"2000-01-23\", \"address\" : \"address\", \"last_name\" : \"last_name\", \"phone_number\" : \"phone_number\", \"information\" : \"information\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"first_name\" : \"first_name\", \"email\" : \"email\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java index 7b9772d..1b04513 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java @@ -4,6 +4,9 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.LocalDate; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Member { - private String id; + private UUID id; private String firstName; @@ -30,13 +33,15 @@ public class Member { private String email; - private String birthday; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate birthday; private String phoneNumber; private String address; - private String joiningDate; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate joiningDate; private String information; @@ -47,7 +52,7 @@ public Member() { /** * Constructor with only required parameters */ - public Member(String id, String firstName, String lastName, String email, String birthday, String phoneNumber, String address, String joiningDate, String information) { + public Member(UUID id, String firstName, String lastName, String email, LocalDate birthday, String phoneNumber, String address, LocalDate joiningDate, String information) { this.id = id; this.firstName = firstName; this.lastName = lastName; @@ -59,7 +64,7 @@ public Member(String id, String firstName, String lastName, String email, String this.information = information; } - public Member id(String id) { + public Member id(UUID id) { this.id = id; return this; } @@ -68,14 +73,14 @@ public Member id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -139,7 +144,7 @@ public void setEmail(String email) { this.email = email; } - public Member birthday(String birthday) { + public Member birthday(LocalDate birthday) { this.birthday = birthday; return this; } @@ -148,14 +153,14 @@ public Member birthday(String birthday) { * Get birthday * @return birthday */ - @NotNull + @NotNull @Valid @Schema(name = "birthday", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("birthday") - public String getBirthday() { + public LocalDate getBirthday() { return birthday; } - public void setBirthday(String birthday) { + public void setBirthday(LocalDate birthday) { this.birthday = birthday; } @@ -199,7 +204,7 @@ public void setAddress(String address) { this.address = address; } - public Member joiningDate(String joiningDate) { + public Member joiningDate(LocalDate joiningDate) { this.joiningDate = joiningDate; return this; } @@ -208,14 +213,14 @@ public Member joiningDate(String joiningDate) { * Get joiningDate * @return joiningDate */ - @NotNull + @NotNull @Valid @Schema(name = "joining_date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("joining_date") - public String getJoiningDate() { + public LocalDate getJoiningDate() { return joiningDate; } - public void setJoiningDate(String joiningDate) { + public void setJoiningDate(LocalDate joiningDate) { this.joiningDate = joiningDate; } diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java index 23c5136..3504d27 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberCreate.java @@ -4,6 +4,8 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.LocalDate; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -28,7 +30,8 @@ public class MemberCreate { private @Nullable String email; - private @Nullable String birthday; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private @Nullable LocalDate birthday; private @Nullable String phoneNumber; @@ -108,7 +111,7 @@ public void setEmail(@Nullable String email) { this.email = email; } - public MemberCreate birthday(@Nullable String birthday) { + public MemberCreate birthday(@Nullable LocalDate birthday) { this.birthday = birthday; return this; } @@ -117,14 +120,14 @@ public MemberCreate birthday(@Nullable String birthday) { * Get birthday * @return birthday */ - + @Valid @Schema(name = "birthday", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("birthday") - public @Nullable String getBirthday() { + public @Nullable LocalDate getBirthday() { return birthday; } - public void setBirthday(@Nullable String birthday) { + public void setBirthday(@Nullable LocalDate birthday) { this.birthday = birthday; } diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java index fa9ad39..e1caa67 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberPartialUpdate.java @@ -4,6 +4,8 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.LocalDate; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -28,7 +30,8 @@ public class MemberPartialUpdate { private @Nullable String email; - private @Nullable String birthday; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private @Nullable LocalDate birthday; private @Nullable String phoneNumber; @@ -96,7 +99,7 @@ public void setEmail(@Nullable String email) { this.email = email; } - public MemberPartialUpdate birthday(@Nullable String birthday) { + public MemberPartialUpdate birthday(@Nullable LocalDate birthday) { this.birthday = birthday; return this; } @@ -105,14 +108,14 @@ public MemberPartialUpdate birthday(@Nullable String birthday) { * Get birthday * @return birthday */ - + @Valid @Schema(name = "birthday", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("birthday") - public @Nullable String getBirthday() { + public @Nullable LocalDate getBirthday() { return birthday; } - public void setBirthday(@Nullable String birthday) { + public void setBirthday(@Nullable LocalDate birthday) { this.birthday = birthday; } diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java index 062b757..36c13c0 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/MemberSummary.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.UUID; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -22,7 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class MemberSummary { - private String id; + private UUID id; private String firstName; @@ -37,14 +38,14 @@ public MemberSummary() { /** * Constructor with only required parameters */ - public MemberSummary(String id, String firstName, String lastName, String email) { + public MemberSummary(UUID id, String firstName, String lastName, String email) { this.id = id; this.firstName = firstName; this.lastName = lastName; this.email = email; } - public MemberSummary id(String id) { + public MemberSummary id(UUID id) { this.id = id; return this; } @@ -53,14 +54,14 @@ public MemberSummary id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java index d5fb6be..e3f551a 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java @@ -13,6 +13,7 @@ import tum.devoops.organizationservice.model.Team; import tum.devoops.organizationservice.model.TeamCreate; import tum.devoops.organizationservice.model.TeamPartialUpdate; +import java.util.UUID; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -102,7 +103,7 @@ default ResponseEntity createSport( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -190,7 +191,7 @@ default ResponseEntity createTeam( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sport\" : \"sport\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -337,7 +338,7 @@ default ResponseEntity deleteSport( ) default ResponseEntity deleteTeam( - @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") UUID teamId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -410,7 +411,7 @@ default ResponseEntity> getAllSports( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }, { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" } ]"; + String exampleString = "[ { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\" }, { \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -478,7 +479,7 @@ default ResponseEntity> getAllTeams( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }, { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" } ]"; + String exampleString = "[ { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sport\" : \"sport\" }, { \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sport\" : \"sport\" } ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -551,7 +552,7 @@ default ResponseEntity getSport( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -624,12 +625,12 @@ default ResponseEntity getSport( ) default ResponseEntity getTeam( - @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") UUID teamId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sport\" : \"sport\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -714,7 +715,7 @@ default ResponseEntity updateSport( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\" }"; + String exampleString = "{ \"directors\" : [ \"directors\", \"directors\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -798,13 +799,13 @@ default ResponseEntity updateSport( ) default ResponseEntity updateTeam( - @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") String teamId, + @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") UUID teamId, @Parameter(name = "TeamPartialUpdate", description = "", required = true) @Valid @RequestBody TeamPartialUpdate teamPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"created_at\", \"id\" : \"id\", \"sport\" : \"sport\" }"; + String exampleString = "{ \"trainers\" : [ \"trainers\", \"trainers\" ], \"address\" : \"address\", \"trainees\" : [ \"trainees\", \"trainees\" ], \"name\" : \"name\", \"description\" : \"description\", \"created_at\" : \"2000-01-23\", \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"sport\" : \"sport\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java index b1879ad..b1d5c89 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java @@ -4,9 +4,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -28,7 +30,8 @@ public class Sport { private String description; - private String createdAt; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate createdAt; @Valid private List directors = new ArrayList<>(); @@ -40,7 +43,7 @@ public Sport() { /** * Constructor with only required parameters */ - public Sport(String name, String description, String createdAt, List directors) { + public Sport(String name, String description, LocalDate createdAt, List directors) { this.name = name; this.description = description; this.createdAt = createdAt; @@ -87,7 +90,7 @@ public void setDescription(String description) { this.description = description; } - public Sport createdAt(String createdAt) { + public Sport createdAt(LocalDate createdAt) { this.createdAt = createdAt; return this; } @@ -96,14 +99,14 @@ public Sport createdAt(String createdAt) { * Get createdAt * @return createdAt */ - @NotNull + @NotNull @Valid @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("created_at") - public String getCreatedAt() { + public LocalDate getCreatedAt() { return createdAt; } - public void setCreatedAt(String createdAt) { + public void setCreatedAt(LocalDate createdAt) { this.createdAt = createdAt; } diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java index 71ab8aa..f445637 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java @@ -4,9 +4,12 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import jakarta.validation.Valid; @@ -25,13 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Team { - private String id; + private UUID id; private String name; private String description; - private String createdAt; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate createdAt; private String address; @@ -50,7 +54,7 @@ public Team() { /** * Constructor with only required parameters */ - public Team(String id, String name, String description, String createdAt, String address, String sport, List trainers, List trainees) { + public Team(UUID id, String name, String description, LocalDate createdAt, String address, String sport, List trainers, List trainees) { this.id = id; this.name = name; this.description = description; @@ -61,7 +65,7 @@ public Team(String id, String name, String description, String createdAt, String this.trainees = trainees; } - public Team id(String id) { + public Team id(UUID id) { this.id = id; return this; } @@ -70,14 +74,14 @@ public Team id(String id) { * Get id * @return id */ - @NotNull + @NotNull @Valid @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") - public String getId() { + public UUID getId() { return id; } - public void setId(String id) { + public void setId(UUID id) { this.id = id; } @@ -121,7 +125,7 @@ public void setDescription(String description) { this.description = description; } - public Team createdAt(String createdAt) { + public Team createdAt(LocalDate createdAt) { this.createdAt = createdAt; return this; } @@ -130,14 +134,14 @@ public Team createdAt(String createdAt) { * Get createdAt * @return createdAt */ - @NotNull + @NotNull @Valid @Schema(name = "created_at", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("created_at") - public String getCreatedAt() { + public LocalDate getCreatedAt() { return createdAt; } - public void setCreatedAt(String createdAt) { + public void setCreatedAt(LocalDate createdAt) { this.createdAt = createdAt; } diff --git a/web-client/src/api.ts b/web-client/src/api.ts index 26fc627..30846a3 100644 --- a/web-client/src/api.ts +++ b/web-client/src/api.ts @@ -325,6 +325,7 @@ export interface components { Sport: { name: string; description: string; + /** Format: date */ created_at: string; directors: string[]; }; @@ -341,9 +342,11 @@ export interface components { directors?: string[]; }; Team: { + /** Format: uuid */ id: string; name: string; description: string; + /** Format: date */ created_at: string; address: string; sport: string; @@ -369,18 +372,22 @@ export interface components { trainees?: string[]; }; Member: { + /** Format: uuid */ id: string; first_name: string; last_name: string; email: string; + /** Format: date */ birthday: string; phone_number: string; address: string; + /** Format: date */ joining_date: string; information: string; }; /** @description A simplified representation of a Member, typically used in list views. */ MemberSummary: { + /** Format: uuid */ id: string; first_name: string; last_name: string; @@ -391,6 +398,7 @@ export interface components { first_name?: string; last_name?: string; email?: string; + /** Format: date */ birthday?: string; phone_number?: string; address?: string; @@ -401,16 +409,20 @@ export interface components { first_name: string; last_name: string; email?: string; + /** Format: date */ birthday?: string; phone_number?: string; address?: string; information?: string; }; Event: { + /** Format: uuid */ id: string; name: string; description: string; + /** Format: date-time */ start_time: string; + /** Format: date-time */ end_time: string; attendees?: string[]; /** @description Names of the sports associated with this event. */ @@ -421,16 +433,21 @@ export interface components { }; /** @description A simplified representation of a Event, typically used in list views. */ EventSummary: { + /** Format: uuid */ id: string; name: string; + /** Format: date-time */ start_time: string; + /** Format: date-time */ end_time: string; }; /** @description Data transfer object for partially updating an existing Event (PATCH operation). */ EventPartialUpdate: { name?: string; description?: string; + /** Format: date-time */ start_time?: string; + /** Format: date-time */ end_time?: string; attendees?: string[]; sports_linked?: string[]; @@ -440,26 +457,32 @@ export interface components { EventCreate: { name: string; description?: string; + /** Format: date-time */ start_time: string; + /** Format: date-time */ end_time: string; attendees?: string[]; sports_linked?: string[]; teams_linked?: string[]; }; Feedback: { + /** Format: uuid */ id: string; event: string; member: string; creator: string; + /** Format: date-time */ created_at: string; feedback: string; }; /** @description A simplified representation of a Feedback, typically used in list views. */ FeedbackSummary: { + /** Format: uuid */ id: string; event: string; member: string; creator: string; + /** Format: date-time */ created_at: string; }; /** @description Data transfer object for partially updating an existing Feedback (PATCH operation). */ @@ -476,10 +499,12 @@ export interface components { }; /** @description A simplified representation of a Transaction, typically used in list views. */ Transaction: { + /** Format: uuid */ id: string; member: string; creator: string; amount_cents: number; + /** Format: date-time */ created_at: string; title: string; description: string; @@ -505,7 +530,7 @@ export interface components { }; responses: { /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ - InternalServerErrror: { + InternalServerError: { headers: { [name: string]: unknown; }; @@ -600,7 +625,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createSport: { @@ -629,7 +654,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getSport: { @@ -655,7 +680,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteSport: { @@ -679,7 +704,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateSport: { @@ -710,7 +735,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllTeams: { @@ -733,7 +758,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createTeam: { @@ -762,7 +787,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getTeam: { @@ -788,7 +813,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteTeam: { @@ -812,7 +837,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateTeam: { @@ -843,7 +868,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllMembers: { @@ -866,7 +891,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createMember: { @@ -895,7 +920,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getMemberDetails: { @@ -921,7 +946,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteMember: { @@ -945,7 +970,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateMemberDetails: { @@ -976,7 +1001,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllEvents: { @@ -999,7 +1024,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createEvent: { @@ -1028,7 +1053,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getEventDetails: { @@ -1054,7 +1079,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteEvent: { @@ -1078,7 +1103,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateEventDetails: { @@ -1109,7 +1134,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllFeedback: { @@ -1132,7 +1157,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createFeedback: { @@ -1161,7 +1186,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getFeedbackDetails: { @@ -1187,7 +1212,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteFeedback: { @@ -1211,7 +1236,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateFeedbackDetails: { @@ -1242,7 +1267,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllBalances: { @@ -1265,7 +1290,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getMemberBalance: { @@ -1291,7 +1316,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getAllTransactions: { @@ -1314,7 +1339,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; createTransaction: { @@ -1343,7 +1368,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 409: components["responses"]["Conflict"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getTransaction: { @@ -1369,7 +1394,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; deleteTransaction: { @@ -1393,7 +1418,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; updateTransaction: { @@ -1424,7 +1449,7 @@ export interface operations { 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; 404: components["responses"]["NotFound"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; sendMail: { @@ -1436,7 +1461,7 @@ export interface operations { }; requestBody: { content: { - "text/html": Record; + "text/html": string; }; }; responses: { @@ -1444,7 +1469,7 @@ export interface operations { 400: components["responses"]["BadRequest"]; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; getPdf: { @@ -1456,7 +1481,7 @@ export interface operations { }; requestBody: { content: { - "text/html": Record; + "text/html": string; }; }; responses: { @@ -1472,7 +1497,7 @@ export interface operations { 400: components["responses"]["BadRequest"]; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; generateReport: { @@ -1497,7 +1522,7 @@ export interface operations { }; 401: components["responses"]["Unauthorized"]; 403: components["responses"]["Forbidden"]; - 500: components["responses"]["InternalServerErrror"]; + 500: components["responses"]["InternalServerError"]; }; }; } From c94fdb2eee8a8d46464775dd50aae70c9c2e7aad Mon Sep 17 00:00:00 2001 From: Raphael Frank <04.raphael.frank@gmail.com> Date: Tue, 26 May 2026 20:07:55 +0200 Subject: [PATCH 15/15] add some api descriptions, leaving operations open --- api/openapi.yaml | 58 +++++++++++-------- services/py-genai-helper/generated/models.py | 2 +- .../devoops/eventservice/api/EventsApi.java | 10 ++-- .../tum/devoops/eventservice/model/Event.java | 4 +- .../feedbackservice/api/FeedbackApi.java | 10 ++-- .../feedbackservice/model/Feedback.java | 4 +- .../financeservice/api/FinanceApi.java | 10 ++-- .../devoops/financeservice/model/Balance.java | 4 +- .../financeservice/model/Transaction.java | 4 +- .../devoops/letterservice/api/LettersApi.java | 10 ++-- .../devoops/memberservice/api/MembersApi.java | 10 ++-- .../devoops/memberservice/model/Member.java | 4 +- .../api/OrganizationApi.java | 22 ++++--- .../organizationservice/model/Sport.java | 3 +- .../organizationservice/model/Team.java | 4 +- web-client/src/api.ts | 32 +++++++++- 16 files changed, 115 insertions(+), 76 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index dd5d510..eace1e7 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -7,7 +7,7 @@ info: name: team-devoops servers: - url: /api/v1 - description: "" + description: Base URL for all API endpoints paths: /organization/sports: get: @@ -15,10 +15,10 @@ paths: tags: - organization summary: Get all sports + description: Returns a list of all sports registered in the organization. If the caller is not an admin, only sports that the caller is a member of will be returned. responses: "200": - description: The request was successful, and the server has returned the - requested resource in the response body. + description: The request was successful, and the server has returned the requested resource in the response body. content: application/json: schema: @@ -39,6 +39,7 @@ paths: tags: - organization summary: Create sport + description: Creates a new sport in the organization. Only admins are allowed to create new sports. responses: "201": description: The request was successful, and a new resource was created. @@ -60,7 +61,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating a new sport. content: application/json: schema: @@ -93,7 +94,7 @@ paths: $ref: "#/components/responses/InternalServerError" requestBody: required: true - description: "" + description: The request body for partially updating a sport. content: application/json: schema: @@ -196,7 +197,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating a new team. content: application/json: schema: @@ -256,7 +257,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for partially updating a team. content: application/json: schema: @@ -332,7 +333,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating a new member. content: application/json: schema: @@ -392,7 +393,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for partially updating a member. content: application/json: schema: @@ -468,7 +469,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating a new event. content: application/json: schema: @@ -528,7 +529,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for partially updating an event. content: application/json: schema: @@ -604,7 +605,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating new feedback. content: application/json: schema: @@ -685,7 +686,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for partially updating a specific feedback. content: application/json: schema: @@ -790,7 +791,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for creating a new transaction. content: application/json: schema: @@ -850,7 +851,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for partially updating a transaction. content: application/json: schema: @@ -897,7 +898,7 @@ paths: - BearerJwt: [] requestBody: required: true - description: "" + description: The request body for sending mail. It will be used in the email content. It must be a valid HTML string using the template format with placeholders for dynamic content. content: text/html: schema: @@ -931,7 +932,7 @@ paths: parameters: [] requestBody: required: true - description: "" + description: The request body for generating a pdf from a template. It must be a valid HTML string using the template format with placeholders for dynamic content. content: text/html: schema: @@ -1010,7 +1011,7 @@ components: securitySchemes: BearerJwt: type: http - scheme: Bearer + scheme: bearer bearerFormat: Json Web Token (JWT) description: "Jwt Auth: Authenticated requests contain a valid Json Web Token (JWT) as part of the `Authorization: Bearer ` header." @@ -1094,6 +1095,7 @@ components: - description - created_at - directors + description: The object representation of a Sport within the organization. SportCreate: type: object properties: @@ -1155,7 +1157,7 @@ components: - sport - trainers - trainees - description: "" + description: The object representation of a Team that belongs to a specific Sport. TeamCreate: type: object properties: @@ -1234,7 +1236,7 @@ components: - address - joining_date - information - description: "" + description: The object representation of a Member. All users are represented as a member. MemberSummary: type: object properties: @@ -1334,7 +1336,7 @@ components: - start_time - end_time - creator - description: "" + description: The object representation of an Event (e.g., a training session or a match). EventSummary: type: object properties: @@ -1436,7 +1438,7 @@ components: - creator - created_at - feedback - description: "" + description: The object representation of Feedback, which is associated with a specific Event and Member. FeedbackSummary: type: object properties: @@ -1511,8 +1513,7 @@ components: - created_at - title - description - description: A simplified representation of a Transaction, typically used in - list views. + description: The object representation of a Transaction, which includes details such as the member, creator, amount, and timestamps. TransactionPartialUpdate: type: object properties: @@ -1552,12 +1553,19 @@ components: required: - member - balance_cents - description: "" + description: The object representation of a Member's Balance, which includes the total balance in cents. tags: - name: organization + description: Endpoints related to managing the overall organization, including sports and teams. - name: members + description: Endpoints related to managing members of the organization (which represent all users). - name: events + description: Endpoints related to managing events such as training sessions and matches. - name: feedback + description: Endpoints related to managing feedback provided by trainers to members for events. - name: finance + description: Endpoints related to managing financial transactions and balances for members. - name: letters + description: Endpoints related to generating and sending letters from templates, such as emails and PDFs. - name: helper + description: Endpoints related to the genai helper functions, such as generating reports based on member data. diff --git a/services/py-genai-helper/generated/models.py b/services/py-genai-helper/generated/models.py index a86f0bd..78490bb 100644 --- a/services/py-genai-helper/generated/models.py +++ b/services/py-genai-helper/generated/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2026-05-26T17:26:18+00:00 +# timestamp: 2026-05-26T18:08:16+00:00 from __future__ import annotations from pydantic import AwareDatetime, BaseModel, Field diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java index 1118ea6..ed7d69c 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/api/EventsApi.java @@ -42,7 +42,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "events", description = "the events API") +@Tag(name = "events", description = "Endpoints related to managing events such as training sessions and matches.") public interface EventsApi { default Optional getRequest() { @@ -52,7 +52,7 @@ default Optional getRequest() { /** * POST /events : Create event * - * @param eventCreate (required) + * @param eventCreate The request body for creating a new event. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -96,7 +96,7 @@ default Optional getRequest() { ) default ResponseEntity createEvent( - @Parameter(name = "EventCreate", description = "", required = true) @Valid @RequestBody EventCreate eventCreate + @Parameter(name = "EventCreate", description = "The request body for creating a new event.", required = true) @Valid @RequestBody EventCreate eventCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -358,7 +358,7 @@ default ResponseEntity getEventDetails( * PATCH /events/{event_id} : Update event details * * @param eventId (required) - * @param eventPartialUpdate (required) + * @param eventPartialUpdate The request body for partially updating an event. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -403,7 +403,7 @@ default ResponseEntity getEventDetails( default ResponseEntity updateEventDetails( @Parameter(name = "event_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("event_id") UUID eventId, - @Parameter(name = "EventPartialUpdate", description = "", required = true) @Valid @RequestBody EventPartialUpdate eventPartialUpdate + @Parameter(name = "EventPartialUpdate", description = "The request body for partially updating an event.", required = true) @Valid @RequestBody EventPartialUpdate eventPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java index e04f661..dea140e 100644 --- a/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java +++ b/services/spring-event/src/generated/java/tum/devoops/eventservice/model/Event.java @@ -21,10 +21,10 @@ import jakarta.annotation.Generated; /** - * + * The object representation of an Event (e.g., a training session or a match). */ -@Schema(name = "Event", description = "") +@Schema(name = "Event", description = "The object representation of an Event (e.g., a training session or a match).") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Event { diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java index a0e54b0..8b87aef 100644 --- a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/api/FeedbackApi.java @@ -42,7 +42,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "feedback", description = "the feedback API") +@Tag(name = "feedback", description = "Endpoints related to managing feedback provided by trainers to members for events.") public interface FeedbackApi { default Optional getRequest() { @@ -52,7 +52,7 @@ default Optional getRequest() { /** * POST /feedback : Create feedback * - * @param feedbackCreate (required) + * @param feedbackCreate The request body for creating new feedback. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -96,7 +96,7 @@ default Optional getRequest() { ) default ResponseEntity createFeedback( - @Parameter(name = "FeedbackCreate", description = "", required = true) @Valid @RequestBody FeedbackCreate feedbackCreate + @Parameter(name = "FeedbackCreate", description = "The request body for creating new feedback.", required = true) @Valid @RequestBody FeedbackCreate feedbackCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -358,7 +358,7 @@ default ResponseEntity getFeedbackDetails( * PATCH /feedback/{feedback_id} : Update feedback details * * @param feedbackId (required) - * @param feedbackPartialUpdate (required) + * @param feedbackPartialUpdate The request body for partially updating a specific feedback. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -403,7 +403,7 @@ default ResponseEntity getFeedbackDetails( default ResponseEntity updateFeedbackDetails( @Parameter(name = "feedback_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("feedback_id") UUID feedbackId, - @Parameter(name = "FeedbackPartialUpdate", description = "", required = true) @Valid @RequestBody FeedbackPartialUpdate feedbackPartialUpdate + @Parameter(name = "FeedbackPartialUpdate", description = "The request body for partially updating a specific feedback.", required = true) @Valid @RequestBody FeedbackPartialUpdate feedbackPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java index 757994a..455b7a1 100644 --- a/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java +++ b/services/spring-feedback/src/generated/java/tum/devoops/feedbackservice/model/Feedback.java @@ -18,10 +18,10 @@ import jakarta.annotation.Generated; /** - * + * The object representation of Feedback, which is associated with a specific Event and Member. */ -@Schema(name = "Feedback", description = "") +@Schema(name = "Feedback", description = "The object representation of Feedback, which is associated with a specific Event and Member.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Feedback { diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java index b6bf853..14c0dda 100644 --- a/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/api/FinanceApi.java @@ -42,7 +42,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "finance", description = "the finance API") +@Tag(name = "finance", description = "Endpoints related to managing financial transactions and balances for members.") public interface FinanceApi { default Optional getRequest() { @@ -52,7 +52,7 @@ default Optional getRequest() { /** * POST /finance/transactions : Create transaction * - * @param transactionCreate (required) + * @param transactionCreate The request body for creating a new transaction. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -96,7 +96,7 @@ default Optional getRequest() { ) default ResponseEntity createTransaction( - @Parameter(name = "TransactionCreate", description = "", required = true) @Valid @RequestBody TransactionCreate transactionCreate + @Parameter(name = "TransactionCreate", description = "The request body for creating a new transaction.", required = true) @Valid @RequestBody TransactionCreate transactionCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -504,7 +504,7 @@ default ResponseEntity getTransaction( * PATCH /finance/transactions/{transaction_id} : Update transaction * * @param transactionId (required) - * @param transactionPartialUpdate (required) + * @param transactionPartialUpdate The request body for partially updating a transaction. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -549,7 +549,7 @@ default ResponseEntity getTransaction( default ResponseEntity updateTransaction( @Parameter(name = "transaction_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("transaction_id") UUID transactionId, - @Parameter(name = "TransactionPartialUpdate", description = "", required = true) @Valid @RequestBody TransactionPartialUpdate transactionPartialUpdate + @Parameter(name = "TransactionPartialUpdate", description = "The request body for partially updating a transaction.", required = true) @Valid @RequestBody TransactionPartialUpdate transactionPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java index 43b20b4..453416d 100644 --- a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Balance.java @@ -15,10 +15,10 @@ import jakarta.annotation.Generated; /** - * + * The object representation of a Member's Balance, which includes the total balance in cents. */ -@Schema(name = "Balance", description = "") +@Schema(name = "Balance", description = "The object representation of a Member's Balance, which includes the total balance in cents.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Balance { diff --git a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java index 949ef9b..23af174 100644 --- a/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java +++ b/services/spring-finance/src/generated/java/tum/devoops/financeservice/model/Transaction.java @@ -18,10 +18,10 @@ import jakarta.annotation.Generated; /** - * A simplified representation of a Transaction, typically used in list views. + * The object representation of a Transaction, which includes details such as the member, creator, amount, and timestamps. */ -@Schema(name = "Transaction", description = "A simplified representation of a Transaction, typically used in list views.") +@Schema(name = "Transaction", description = "The object representation of a Transaction, which includes details such as the member, creator, amount, and timestamps.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Transaction { diff --git a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java index 0600714..44886ba 100644 --- a/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java +++ b/services/spring-letter/src/generated/java/tum/devoops/letterservice/api/LettersApi.java @@ -37,7 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "letters", description = "the letters API") +@Tag(name = "letters", description = "Endpoints related to generating and sending letters from templates, such as emails and PDFs.") public interface LettersApi { default Optional getRequest() { @@ -47,7 +47,7 @@ default Optional getRequest() { /** * POST /letters/pdf : Get pdf * - * @param body (required) + * @param body The request body for generating a pdf from a template. It must be a valid HTML string using the template format with placeholders for dynamic content. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -92,7 +92,7 @@ default Optional getRequest() { ) default ResponseEntity getPdf( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody String body + @Parameter(name = "body", description = "The request body for generating a pdf from a template. It must be a valid HTML string using the template format with placeholders for dynamic content.", required = true) @Valid @RequestBody String body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -126,7 +126,7 @@ default ResponseEntity getPdf( /** * POST /letters/mail : Send mail * - * @param body (required) + * @param body The request body for sending mail. It will be used in the email content. It must be a valid HTML string using the template format with placeholders for dynamic content. (required) * @return The request was successful, but there is no content to return in the response. (status code 204) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -164,7 +164,7 @@ default ResponseEntity getPdf( ) default ResponseEntity sendMail( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody String body + @Parameter(name = "body", description = "The request body for sending mail. It will be used in the email content. It must be a valid HTML string using the template format with placeholders for dynamic content.", required = true) @Valid @RequestBody String body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java index 4b18e16..cebbf57 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/api/MembersApi.java @@ -42,7 +42,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "members", description = "the members API") +@Tag(name = "members", description = "Endpoints related to managing members of the organization (which represent all users).") public interface MembersApi { default Optional getRequest() { @@ -52,7 +52,7 @@ default Optional getRequest() { /** * POST /members : Create member * - * @param memberCreate (required) + * @param memberCreate The request body for creating a new member. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -96,7 +96,7 @@ default Optional getRequest() { ) default ResponseEntity createMember( - @Parameter(name = "MemberCreate", description = "", required = true) @Valid @RequestBody MemberCreate memberCreate + @Parameter(name = "MemberCreate", description = "The request body for creating a new member.", required = true) @Valid @RequestBody MemberCreate memberCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -358,7 +358,7 @@ default ResponseEntity getMemberDetails( * PATCH /members/{member_id} : Update member details * * @param memberId (required) - * @param memberPartialUpdate (required) + * @param memberPartialUpdate The request body for partially updating a member. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -403,7 +403,7 @@ default ResponseEntity getMemberDetails( default ResponseEntity updateMemberDetails( @Parameter(name = "member_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("member_id") UUID memberId, - @Parameter(name = "MemberPartialUpdate", description = "", required = true) @Valid @RequestBody MemberPartialUpdate memberPartialUpdate + @Parameter(name = "MemberPartialUpdate", description = "The request body for partially updating a member.", required = true) @Valid @RequestBody MemberPartialUpdate memberPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java index 1b04513..1045c46 100644 --- a/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java +++ b/services/spring-member/src/generated/java/tum/devoops/memberservice/model/Member.java @@ -18,10 +18,10 @@ import jakarta.annotation.Generated; /** - * + * The object representation of a Member. All users are represented as a member. */ -@Schema(name = "Member", description = "") +@Schema(name = "Member", description = "The object representation of a Member. All users are represented as a member.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Member { diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java index e3f551a..f1e864b 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/api/OrganizationApi.java @@ -44,7 +44,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") @Validated -@Tag(name = "organization", description = "the organization API") +@Tag(name = "organization", description = "Endpoints related to managing the overall organization, including sports and teams.") public interface OrganizationApi { default Optional getRequest() { @@ -53,8 +53,9 @@ default Optional getRequest() { /** * POST /organization/sports : Create sport + * Creates a new sport in the organization. Only admins are allowed to create new sports. * - * @param sportCreate (required) + * @param sportCreate The request body for creating a new sport. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -65,6 +66,7 @@ default Optional getRequest() { @Operation( operationId = "createSport", summary = "Create sport", + description = "Creates a new sport in the organization. Only admins are allowed to create new sports.", tags = { "organization" }, responses = { @ApiResponse(responseCode = "201", description = "The request was successful, and a new resource was created.", content = { @@ -98,7 +100,7 @@ default Optional getRequest() { ) default ResponseEntity createSport( - @Parameter(name = "SportCreate", description = "", required = true) @Valid @RequestBody SportCreate sportCreate + @Parameter(name = "SportCreate", description = "The request body for creating a new sport.", required = true) @Valid @RequestBody SportCreate sportCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -142,7 +144,7 @@ default ResponseEntity createSport( /** * POST /organization/teams : Create team * - * @param teamCreate (required) + * @param teamCreate The request body for creating a new team. (required) * @return The request was successful, and a new resource was created. (status code 201) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -186,7 +188,7 @@ default ResponseEntity createSport( ) default ResponseEntity createTeam( - @Parameter(name = "TeamCreate", description = "", required = true) @Valid @RequestBody TeamCreate teamCreate + @Parameter(name = "TeamCreate", description = "The request body for creating a new team.", required = true) @Valid @RequestBody TeamCreate teamCreate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -371,6 +373,7 @@ default ResponseEntity deleteTeam( /** * GET /organization/sports : Get all sports + * Returns a list of all sports registered in the organization. If the caller is not an admin, only sports that the caller is a member of will be returned. * * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -380,6 +383,7 @@ default ResponseEntity deleteTeam( @Operation( operationId = "getAllSports", summary = "Get all sports", + description = "Returns a list of all sports registered in the organization. If the caller is not an admin, only sports that the caller is a member of will be returned.", tags = { "organization" }, responses = { @ApiResponse(responseCode = "200", description = "The request was successful, and the server has returned the requested resource in the response body.", content = { @@ -665,7 +669,7 @@ default ResponseEntity getTeam( * PATCH /organization/sports/{sport_name} : Update sport * * @param sportName (required) - * @param sportPartialUpdate (required) + * @param sportPartialUpdate The request body for partially updating a sport. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -710,7 +714,7 @@ default ResponseEntity getTeam( default ResponseEntity updateSport( @Parameter(name = "sport_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("sport_name") String sportName, - @Parameter(name = "SportPartialUpdate", description = "", required = true) @Valid @RequestBody SportPartialUpdate sportPartialUpdate + @Parameter(name = "SportPartialUpdate", description = "The request body for partially updating a sport.", required = true) @Valid @RequestBody SportPartialUpdate sportPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -755,7 +759,7 @@ default ResponseEntity updateSport( * PATCH /organization/teams/{team_id} : Update team * * @param teamId (required) - * @param teamPartialUpdate (required) + * @param teamPartialUpdate The request body for partially updating a team. (required) * @return The request was successful, and the server has returned the requested resource in the response body. (status code 200) * or The server could not understand the request due to invalid syntax. The client should modify the request and try again. (status code 400) * or Authentication is required to access the requested resource. The client must include the appropriate credentials. (status code 401) @@ -800,7 +804,7 @@ default ResponseEntity updateSport( default ResponseEntity updateTeam( @Parameter(name = "team_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("team_id") UUID teamId, - @Parameter(name = "TeamPartialUpdate", description = "", required = true) @Valid @RequestBody TeamPartialUpdate teamPartialUpdate + @Parameter(name = "TeamPartialUpdate", description = "The request body for partially updating a team.", required = true) @Valid @RequestBody TeamPartialUpdate teamPartialUpdate ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java index b1d5c89..248a6ef 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Sport.java @@ -20,9 +20,10 @@ import jakarta.annotation.Generated; /** - * Sport + * The object representation of a Sport within the organization. */ +@Schema(name = "Sport", description = "The object representation of a Sport within the organization.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Sport { diff --git a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java index f445637..c0c6033 100644 --- a/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java +++ b/services/spring-organization/src/generated/java/tum/devoops/organizationservice/model/Team.java @@ -21,10 +21,10 @@ import jakarta.annotation.Generated; /** - * + * The object representation of a Team that belongs to a specific Sport. */ -@Schema(name = "Team", description = "") +@Schema(name = "Team", description = "The object representation of a Team that belongs to a specific Sport.") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.14.0") public class Team { diff --git a/web-client/src/api.ts b/web-client/src/api.ts index 30846a3..878ff91 100644 --- a/web-client/src/api.ts +++ b/web-client/src/api.ts @@ -11,10 +11,16 @@ export interface paths { path?: never; cookie?: never; }; - /** Get all sports */ + /** + * Get all sports + * @description Returns a list of all sports registered in the organization. If the caller is not an admin, only sports that the caller is a member of will be returned. + */ get: operations["getAllSports"]; put?: never; - /** Create sport */ + /** + * Create sport + * @description Creates a new sport in the organization. Only admins are allowed to create new sports. + */ post: operations["createSport"]; delete?: never; options?: never; @@ -322,6 +328,7 @@ export interface components { message: string; errors?: components["schemas"]["ErrorResponse"][]; }; + /** @description The object representation of a Sport within the organization. */ Sport: { name: string; description: string; @@ -341,6 +348,7 @@ export interface components { description?: string; directors?: string[]; }; + /** @description The object representation of a Team that belongs to a specific Sport. */ Team: { /** Format: uuid */ id: string; @@ -371,6 +379,7 @@ export interface components { trainers?: string[]; trainees?: string[]; }; + /** @description The object representation of a Member. All users are represented as a member. */ Member: { /** Format: uuid */ id: string; @@ -415,6 +424,7 @@ export interface components { address?: string; information?: string; }; + /** @description The object representation of an Event (e.g., a training session or a match). */ Event: { /** Format: uuid */ id: string; @@ -465,6 +475,7 @@ export interface components { sports_linked?: string[]; teams_linked?: string[]; }; + /** @description The object representation of Feedback, which is associated with a specific Event and Member. */ Feedback: { /** Format: uuid */ id: string; @@ -497,7 +508,7 @@ export interface components { member: string; feedback: string; }; - /** @description A simplified representation of a Transaction, typically used in list views. */ + /** @description The object representation of a Transaction, which includes details such as the member, creator, amount, and timestamps. */ Transaction: { /** Format: uuid */ id: string; @@ -523,6 +534,7 @@ export interface components { title: string; description?: string; }; + /** @description The object representation of a Member's Balance, which includes the total balance in cents. */ Balance: { member: string; balance_cents: number; @@ -635,6 +647,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating a new sport. */ requestBody: { content: { "application/json": components["schemas"]["SportCreate"]; @@ -716,6 +729,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating a sport. */ requestBody: { content: { "application/json": components["schemas"]["SportPartialUpdate"]; @@ -768,6 +782,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating a new team. */ requestBody: { content: { "application/json": components["schemas"]["TeamCreate"]; @@ -849,6 +864,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating a team. */ requestBody: { content: { "application/json": components["schemas"]["TeamPartialUpdate"]; @@ -901,6 +917,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating a new member. */ requestBody: { content: { "application/json": components["schemas"]["MemberCreate"]; @@ -982,6 +999,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating a member. */ requestBody: { content: { "application/json": components["schemas"]["MemberPartialUpdate"]; @@ -1034,6 +1052,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating a new event. */ requestBody: { content: { "application/json": components["schemas"]["EventCreate"]; @@ -1115,6 +1134,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating an event. */ requestBody: { content: { "application/json": components["schemas"]["EventPartialUpdate"]; @@ -1167,6 +1187,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating new feedback. */ requestBody: { content: { "application/json": components["schemas"]["FeedbackCreate"]; @@ -1248,6 +1269,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating a specific feedback. */ requestBody: { content: { "application/json": components["schemas"]["FeedbackPartialUpdate"]; @@ -1349,6 +1371,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for creating a new transaction. */ requestBody: { content: { "application/json": components["schemas"]["TransactionCreate"]; @@ -1430,6 +1453,7 @@ export interface operations { }; cookie?: never; }; + /** @description The request body for partially updating a transaction. */ requestBody: { content: { "application/json": components["schemas"]["TransactionPartialUpdate"]; @@ -1459,6 +1483,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for sending mail. It will be used in the email content. It must be a valid HTML string using the template format with placeholders for dynamic content. */ requestBody: { content: { "text/html": string; @@ -1479,6 +1504,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description The request body for generating a pdf from a template. It must be a valid HTML string using the template format with placeholders for dynamic content. */ requestBody: { content: { "text/html": string;