From 97d6532f71d3c6fc96d3f2e744f6a8f764415601 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sun, 5 May 2024 16:24:02 +0200 Subject: [PATCH] feat(api): add routes to get only upcoming training dates per training and general --- api/v1/openapi.yaml | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/api/v1/openapi.yaml b/api/v1/openapi.yaml index 47ea051..b2749fb 100644 --- a/api/v1/openapi.yaml +++ b/api/v1/openapi.yaml @@ -232,6 +232,46 @@ paths: "500": $ref: "#/components/responses/InternalError" + /v1/trainings/{trainingID}/upcoming-dates: + get: + summary: List upcoming dates of a training + operationId: listTrainingUpcomingDates + tags: + - Trainings + parameters: + - $ref: "#/components/parameters/TrainingID" + responses: + "200": + description: List of training dates + content: + application/json: + schema: + $ref: "#/components/schemas/ListTrainingUpcomingDatesResponse" + "404": + $ref: "#/components/responses/NotFoundError" + + "500": + $ref: "#/components/responses/InternalError" + + /v1/trainings/upcoming-dates: + get: + summary: List all dates of a training + operationId: listAllUpcomingTrainingDates + tags: + - Trainings + responses: + "200": + description: List of training upcoming dates + content: + application/json: + schema: + $ref: "#/components/schemas/ListAllUpcomingTrainingDatesResponse" + "404": + $ref: "#/components/responses/NotFoundError" + + "500": + $ref: "#/components/responses/InternalError" + components: parameters: TrainingID: @@ -357,6 +397,16 @@ components: UpdateTrainingDateResponse: $ref: "#/components/schemas/TrainingDate" + ListAllUpcomingTrainingDatesResponse: + type: array + items: + $ref: "#/components/schemas/TrainingDate" + + ListTrainingUpcomingDatesResponse: + type: array + items: + $ref: "#/components/schemas/TrainingDate" + NewTrainingDate: type: object properties: