{ "openapi": "3.0.3", "info": { "title": "Zeiterfassung App", "contact": { "name": "Torsten Lücke", "url": "https://torsten-hettstedt.de", "email": "arbeit@torsten-hettstedt.de" }, "license": { "name": "GPL-2.0-or-later" }, "version": "1.0.0" }, "paths": { "/working-hours": { "get": { "tags": [ "Eintragungen Arbeitszeiten" ], "description": "Liefert eine Liste der Einträge. Kann gefiltert werden und dadurch eine leere Liste zurückgeben", "parameters": [ { "$ref": "#/components/parameters/start-date" }, { "$ref": "#/components/parameters/end-date" } ], "responses": { "200": { "$ref": "#/components/responses/ListEntities" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "500": { "$ref": "#/components/responses/ServerException" } } }, "post": { "tags": [ "Eintragungen Arbeitszeiten" ], "requestBody": { "$ref": "#/components/requestBodies/WorkingHours" }, "responses": { "201": { "$ref": "#/components/responses/ReadEntity" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "409": { "$ref": "#/components/responses/RecordAlreadyExistsException" }, "500": { "$ref": "#/components/responses/ServerException" } } } }, "/working-hours/{date}" : { "get": { "tags": [ "Eintragungen Arbeitszeiten" ], "parameters": [ { "$ref": "#/components/parameters/date" } ], "responses": { "200": { "$ref": "#/components/responses/ListEntities" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "404": { "$ref": "#/components/responses/RecordNotFoundException" }, "500": { "$ref": "#/components/responses/ServerException" } } }, "put": { "tags": [ "Eintragungen Arbeitszeiten" ], "description": "Angabe des Datum im Request-Body werden ignoriert", "parameters": [ { "$ref": "#/components/parameters/date" } ], "requestBody": { "$ref": "#/components/requestBodies/WorkingHours" }, "responses": { "200": { "$ref": "#/components/responses/ReadEntity" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "404": { "$ref": "#/components/responses/RecordNotFoundException" }, "500": { "$ref": "#/components/responses/ServerException" } } } }, "/views/working-hours/weekly": { "get": { "tags": [ "Ansichten Arbeitszeiten" ], "responses": { "200": { "$ref": "#/components/responses/ListEntitiesView" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "500": { "$ref": "#/components/responses/ServerException" } } } }, "/views/working-hours/monthly": { "get": { "tags": [ "Ansichten Arbeitszeiten" ], "responses": { "200": { "$ref": "#/components/responses/ListEntitiesView" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "500": { "$ref": "#/components/responses/ServerException" } } } }, "/views/working-hours/yearly": { "get": { "tags": [ "Ansichten Arbeitszeiten" ], "responses": { "200": { "$ref": "#/components/responses/ListEntitiesView" }, "400": { "$ref": "#/components/responses/DatabaseException" }, "500": { "$ref": "#/components/responses/ServerException" } } } } }, "components": { "schemas": { "WorkingHours": { "description": "Eintrag der Arbeitszeit für einen Tag", "type": "object", "properties": { "workingDay": { "description": "Datum eines Arbeitstages", "type": "string", "format": "date", "required": false }, "workingTime": { "description": "Arbeitszeit des Tages", "type": "string", "pattern": "[0-5]\\d:[0-5]\\d:[0-5]\\d", "example": "08:01:00" }, "isHomeOffice": { "description": "Wurde an diesem Tag zuhause gearbeitet?", "type": "boolean" } } }, "WorkingHoursView": { "type": "object", "readOnly": true, "properties": { "period": { "description": "Angabe des angegebenen Zeitraumes", "type": "string" }, "periodDesignation": { "description": "Bezeichnung des Zeitraumes", "type": "string", "enum": [ "weekly", "monthly", "yearly" ] }, "totalHours": { "description": "Gesamte Arbeitszeit im Zeitraum", "type": "string", "format": "time" }, "workingDays": { "description": "Arbeitstage im Zeitraum", "type": "integer" }, "homeOfficeDays": { "description": "Anzahl der Tage, an denen zuhause gearbeitet wurde.", "type": "number" }, "overtime": { "description": "Überstunden im Zeitraum", "type": "string", "format": "time" } } }, "ErrorObject": { "type": "object", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "status":{ "type": "integer" }, "error": { "type": "string" }, "message":{ "type": "string" }, "path":{ "type": "string", "format": "path" } } } }, "requestBodies": { "WorkingHours": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkingHours" } } } } }, "parameters": { "date" : { "description": "Datum eines Eintrages", "name": "date", "in" : "path", "required": true, "schema": { "type": "string", "format": "date" } }, "start-date" : { "description": "Filtert Liste ab Datum", "name": "start-date", "in" : "query", "required": false, "schema": { "type": "string", "format": "date" } }, "end-date" : { "description": "Filtert Liste bis Datum", "name": "end-date", "in" : "query", "required": false, "schema": { "type": "string", "format": "date" } } }, "responses": { "ListEntities": { "description": "Liste der Einträge", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WorkingHours" } } } } }, "ReadEntity": { "description": "Der Eintrag", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkingHours" } } } }, "ListEntitiesView": { "description": "Liste der Einträge", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WorkingHoursView" } } } } }, "RecordNotFoundException": { "description": "Der Eintrag wurde nicht gefunden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" } } } }, "RecordAlreadyExistsException": { "description": "Für das Datum wurde schon eine Arbeitszeit definiert", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" } } } }, "DatabaseException": { "description": "Fehler in der Datenbank-Abfrage", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" } } } }, "ServerException": { "description": "Fehler des Webservers", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" } } } } } } }