diff --git a/.github/workflows/pta.yml b/.github/workflows/pta.yml new file mode 100644 index 0000000..6e89b63 --- /dev/null +++ b/.github/workflows/pta.yml @@ -0,0 +1,31 @@ +name: Build Booking + +on: + push: + branches: [ "main" ] + paths: + - 'pom.xml' + pull_request: + branches: [ "main" ] + paths: + - 'pom.xml' + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/doc/openapi.json b/doc/openapi.json deleted file mode 100644 index 4025211..0000000 --- a/doc/openapi.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "openapi" : "3.0.3", - "info" : { - "title" : "v API (test)", - "description" : "Booking API", - "termsOfService" : "Your terms here", - "contact" : { - "name" : "Example API Support", - "url" : "https://ptagency.ch/contact", - "email" : "techsupport@ptagency.ch" - }, - "license" : { - "name" : "Apache 2.0", - "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version" : "1.0.0" - }, - "servers" : [ { - "url" : "http://localhost:8080", - "description" : "Auto generated value" - }, { - "url" : "http://0.0.0.0:8080", - "description" : "Auto generated value" - } ], - "paths" : { - "/sessions" : { - "get" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "from", - "in" : "query", - "schema" : { - "$ref" : "#/components/schemas/LocalDate" - } - }, { - "name" : "to", - "in" : "query", - "schema" : { - "$ref" : "#/components/schemas/LocalDate" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SessionDto" - } - } - } - } - } - } - } - }, - "/sessions/{id}" : { - "get" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/SessionDto" - } - } - } - } - } - }, - "put" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } - } - } - } - }, - "post" : { - "tags" : [ "Session Resource" ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } - } - } - } - }, - "delete" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - } - } - } - }, - "/sessions/{id}/bookings" : { - "get" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BookingDto" - } - } - } - } - } - } - } - }, - "/sessions/{id}/bookings/{participant}" : { - "post" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - }, { - "name" : "participant", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/ParticipantId" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/BookingId" - } - } - } - } - } - }, - "delete" : { - "tags" : [ "Session Resource" ], - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SessionId" - } - }, { - "name" : "participant", - "in" : "path", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/ParticipantId" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - } - } - } - } - }, - "components" : { - "schemas" : { - "BookingDto" : { - "type" : "object", - "properties" : { - "session" : { - "$ref" : "#/components/schemas/SessionId" - }, - "participant" : { - "$ref" : "#/components/schemas/ParticipantId" - } - } - }, - "BookingId" : { - "type" : "object", - "properties" : { - "session" : { - "$ref" : "#/components/schemas/SessionId" - }, - "participant" : { - "$ref" : "#/components/schemas/ParticipantId" - } - } - }, - "LocalDate" : { - "format" : "date", - "type" : "string", - "example" : "2022-03-10" - }, - "ParticipantId" : { - "type" : "object", - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UUID" - } - } - }, - "SessionDto" : { - "type" : "object", - "properties" : { - "id" : { - "$ref" : "#/components/schemas/SessionId" - } - } - }, - "SessionId" : { - "type" : "object", - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UUID" - } - } - }, - "UUID" : { - "format" : "uuid", - "pattern" : "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", - "type" : "string" - } - } - } -} \ No newline at end of file diff --git a/doc/openapi.yaml b/doc/openapi.yaml deleted file mode 100644 index 32c8c46..0000000 --- a/doc/openapi.yaml +++ /dev/null @@ -1,194 +0,0 @@ ---- -openapi: 3.0.3 -info: - title: v API (test) - description: Booking API - termsOfService: Your terms here - contact: - name: Example API Support - url: https://ptagency.ch/contact - email: techsupport@ptagency.ch - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - version: 1.0.0 -servers: -- url: http://localhost:8080 - description: Auto generated value -- url: http://0.0.0.0:8080 - description: Auto generated value -paths: - /sessions: - get: - tags: - - Session Resource - parameters: - - name: from - in: query - schema: - $ref: "#/components/schemas/LocalDate" - - name: to - in: query - schema: - $ref: "#/components/schemas/LocalDate" - responses: - "200": - description: OK - content: - application/problem+json: - schema: - type: array - items: - $ref: "#/components/schemas/SessionDto" - /sessions/{id}: - get: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - responses: - "200": - description: OK - content: - application/problem+json: - schema: - $ref: "#/components/schemas/SessionDto" - put: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - responses: - "200": - description: OK - content: - application/problem+json: - schema: - $ref: "#/components/schemas/SessionId" - post: - tags: - - Session Resource - responses: - "200": - description: OK - content: - application/problem+json: - schema: - $ref: "#/components/schemas/SessionId" - delete: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - responses: - "204": - description: No Content - /sessions/{id}/bookings: - get: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - responses: - "200": - description: OK - content: - application/problem+json: - schema: - type: array - items: - $ref: "#/components/schemas/BookingDto" - /sessions/{id}/bookings/{participant}: - post: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - - name: participant - in: path - required: true - schema: - $ref: "#/components/schemas/ParticipantId" - responses: - "200": - description: OK - content: - application/problem+json: - schema: - $ref: "#/components/schemas/BookingId" - delete: - tags: - - Session Resource - parameters: - - name: id - in: path - required: true - schema: - $ref: "#/components/schemas/SessionId" - - name: participant - in: path - required: true - schema: - $ref: "#/components/schemas/ParticipantId" - responses: - "204": - description: No Content -components: - schemas: - BookingDto: - type: object - properties: - session: - $ref: "#/components/schemas/SessionId" - participant: - $ref: "#/components/schemas/ParticipantId" - BookingId: - type: object - properties: - session: - $ref: "#/components/schemas/SessionId" - participant: - $ref: "#/components/schemas/ParticipantId" - LocalDate: - format: date - type: string - example: 2022-03-10 - ParticipantId: - type: object - properties: - id: - $ref: "#/components/schemas/UUID" - SessionDto: - type: object - properties: - id: - $ref: "#/components/schemas/SessionId" - SessionId: - type: object - properties: - id: - $ref: "#/components/schemas/UUID" - UUID: - format: uuid - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - type: string