openapi: "3.1.0" info: version: 1.3.0 title: Backoffice API license: name: Proprietary contact: name: Vojtěch Mareš email: iam@vojtechmares.com url: https://www.vojtechmares.com servers: - url: http://localhost:8080/v1 description: Local development server - url: https://api.backoffice.staging.mareshq.com/v1 description: Staging server - url: https://api.backoffice.mareshq.com/v1 description: Production server paths: /trainings: get: summary: List all trainings operationId: listTrainings tags: - trainings responses: "200": description: A list of trainings content: application/json: schema: type: array items: $ref: "#/components/schemas/Training" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" post: summary: Create a new training operationId: createTraining tags: - trainings requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/NewTraining" responses: "201": description: Training created content: application/json: schema: $ref: "#/components/schemas/Training" "400": description: Invalid input content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}: get: summary: Get a training by ID operationId: getTraining tags: - trainings parameters: - name: trainingID in: path required: true schema: type: string format: uuid responses: "200": description: A training content: application/json: schema: $ref: "#/components/schemas/Training" "404": description: Training not found content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" put: summary: Update a training by ID operationId: updateTraining tags: - trainings parameters: - name: trainingID in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/NewTraining" responses: "200": description: Training updated content: application/json: schema: $ref: "#/components/schemas/Training" "404": description: Training not found content: application/json: schema: $ref: "#/components/schemas/Error" "400": description: Invalid input content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete a training by ID operationId: deleteTraining tags: - trainings parameters: - name: trainingID in: path required: true schema: type: string format: uuid responses: "204": description: Training deleted "404": description: Training not found content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates: get: summary: List all dates of a training operationId: listTrainingDates tags: - training dates parameters: - name: trainingID in: path required: true schema: type: string format: uuid responses: "200": description: A list of dates content: application/json: schema: type: array items: $ref: "#/components/schemas/TrainingDate" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" post: summary: Create a new date for a training operationId: createTrainingDate tags: - training dates parameters: - name: trainingID in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/NewTrainingDate" responses: "201": description: Date created content: application/json: schema: $ref: "#/components/schemas/TrainingDate" "409": description: Date already exists content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates/{dateID}: delete: summary: Delete a date of a training operationId: deleteTrainingDate tags: - training dates parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid responses: "204": description: Date deleted "404": description: Date not found content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates/{dateID}/attendees: get: summary: List all attendees of a date of a training operationId: listTrainingDateAttendees tags: - training dates attendees parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid responses: "200": description: A list of attendees content: application/json: schema: type: array items: $ref: "#/components/schemas/TrainingDateAttendee" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" post: summary: Add an attendee to a date of a training operationId: createTrainingDateAttendee tags: - training dates attendees parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/NewTrainingDateAttendee" responses: "201": description: Attendee created content: application/json: schema: $ref: "#/components/schemas/TrainingDateAttendee" "409": description: Attendee already exists (attendee already registered for this date) content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}: delete: summary: Delete an attendee of a date of a training operationId: deleteTrainingDateAttendee tags: - training dates attendees parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid - name: attendeeID in: path required: true schema: type: string format: uuid responses: "204": description: Attendee deleted "404": description: Attendee not found content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}/feedback: post: summary: Submit feedback for an attendee of a date of a training operationId: createTrainingDateAttendeeFeedback tags: - training attendee feedback parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid - name: attendeeID in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/NewTrainingFeedback" responses: "201": description: Feedback created content: application/json: schema: $ref: "#/components/schemas/TrainingFeedback" "409": description: Feedback already submitted content: application/json: schema: $ref: "#/components/schemas/Error" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/dates/{dateID}/feedback: get: summary: List all feedback of a date of a training operationId: listTrainingDateFeedback tags: - training attendee feedback parameters: - name: trainingID in: path required: true schema: type: string format: uuid - name: dateID in: path required: true schema: type: string format: uuid responses: "200": description: A list of feedback content: application/json: schema: type: array items: $ref: "#/components/schemas/TrainingFeedback" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/{trainingID}/feedback: get: summary: List all feedback of a training operationId: listTrainingFeedback tags: - training attendee feedback parameters: - name: trainingID in: path required: true schema: type: string format: uuid responses: "200": description: A list of feedback content: application/json: schema: type: array items: $ref: "#/components/schemas/TrainingFeedback" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" /trainings/upcoming-dates: get: summary: List all upcoming dates of all trainings operationId: listUpcomingTrainingDates tags: - training dates parameters: - name: from in: query required: false schema: type: string format: date - name: to in: query required: false schema: type: string format: date - name: limit in: query required: false schema: type: string format: date default: 10 responses: "200": description: A list of dates content: application/json: schema: type: array items: type: object properties: training: $ref: "#/components/schemas/Training" date: $ref: "#/components/schemas/TrainingDate" default: description: Unexpected error content: application/json: schema: $ref: "#/components/schemas/Error" components: schemas: NewTraining: type: object properties: name: type: string duration: type: integer format: int32 price: type: object properties: open: $ref: "#/components/schemas/Price" corporate: $ref: "#/components/schemas/Price" length: type: integer format: int32 required: - name - duration - price Training: allOf: - $ref: "#/components/schemas/Training" - type: object properties: id: type: string format: uuid required: - id NewTrainingDate: type: object properties: date: type: string format: date capacity: type: integer format: int32 days: type: integer format: int32 location: type: string price: $ref: "#/components/schemas/Price" required: - date - capacity - price - days - location TrainingDate: allOf: - $ref: "#/components/schemas/NewTrainingDate" - type: object properties: id: type: string format: uuid address: type: string required: - id NewTrainingDateAttendee: type: object properties: name: type: string email: type: string required: - name - email TrainingDateAttendee: allOf: - $ref: "#/components/schemas/NewTrainingDateAttendee" - type: object properties: id: type: string format: uuid company: type: string required: - id NewTrainingFeedback: type: object properties: rating: type: integer format: int32 minimum: 0 maximum: 10 comment: type: string anonymous: type: boolean default: false isSharingAllowed: type: boolean default: false required: - rating - comment TrainingFeedback: allOf: - $ref: "#/components/schemas/NewTrainingFeedback" - type: object properties: id: type: string format: uuid required: - id Price: type: object properties: currency: type: string enum: [CZK, EUR, USD] amount: type: number format: float minimum: 0 Error: type: object properties: code: type: string message: type: string required: - code - message