![]() |
Urlaubsplan
|


Öffentliche Attribute | |
| path | : "/api/urlaub-department/{year}/{month}" |
| HTTP-spezifischer Kontext. | |
| path | tags: ["Urlaub Department"] |
| path | summary: "Retrieve holiday and leave data for a user's department in a specific month and year" |
| path | parameters: [ new OA\Parameter( name: "year" |
| path | in: "path" |
| path | required: true |
| path | description: "Year of the query" |
| path | schema: new OA\Schema(type: "integer" |
| path | example: 2024) ) |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | responses: [ new OA\Response( response: 200 |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | description: "Department holiday and leave data retrieved successfully" |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | content: new OA\JsonContent( properties: [ new OA\Property(property: "users" |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | type: "array" |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | items: new OA\Items( properties: [ new OA\Property(property: "first_name" |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] | example: "John") |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] new OA Property(property:"last_name", type:"string", example:"Doe") new OA Property(property:"events", type:"array", items:new OA\Items(properties:[new OA\Property(property:"start_date", type:"string", example:"2024-05-01"), new OA\Property(property:"end_date", type:"string", example:"2024-05-03"), new OA\Property(property:"type", type:"string", example:"vacation"), new OA\Property(property:"status", type:"string", example:"approved")]))])) new OA Property(property:"holidays", type:"array", items:new OA\Items(properties:[new OA\Property(property:"date", type:"string", example:"2024-05-01"), new OA\Property(property:"name", type:"string", example:"Labor Day")]))])) new OA Response(response:404, description:"User not found or no data available", content:new OA\JsonContent(properties:[new OA\Property(property:"status", type:"string", example:"error"), new OA\Property(property:"message", type:"string", example:"Benutzer nicht gefunden oder keine Daten verfügbar.")]))])] public function index($year | $month |
| $userModel = new User() | |
| $holidayModel = new HolidayModel() | |
| $userId = session()->get('user_id') | |
| if(! $userId) | $currentUser = $userModel->where('user_id', $userId)->select('department_id')->first() |
| if(! $currentUser) | $departmentID = $currentUser['department_id'] |
| $events = $urlaubModel->getUrlaubByMonthDepartments($year, $month, $departmentID) | |
| $users = $userModel->where('department_id', $departmentID)->findAll() | |
| $holidays = $holidayModel->getHolidays() | |
Controller zur Verwaltung von Urlaubs- und Feiertagsinformationen für Abteilungen.
| if (! $userId) App::Controllers::Api::UrlaubDepartmentController::$currentUser = $userModel->where('user_id', $userId)->select('department_id')->first() |
| if (! $currentUser) App::Controllers::Api::UrlaubDepartmentController::$departmentID = $currentUser['department_id'] |
| App::Controllers::Api::UrlaubDepartmentController::$events = $urlaubModel->getUrlaubByMonthDepartments($year, $month, $departmentID) |
| App::Controllers::Api::UrlaubDepartmentController::$holidayModel = new HolidayModel() |
| App::Controllers::Api::UrlaubDepartmentController::$holidays = $holidayModel->getHolidays() |
| path new OA Parameter(name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] new OA Property(property:"last_name", type:"string", example:"Doe") new OA Property(property:"events", type:"array", items:new OA\Items(properties:[new OA\Property(property:"start_date", type:"string", example:"2024-05-01"), new OA\Property(property:"end_date", type:"string", example:"2024-05-03"), new OA\Property(property:"type", type:"string", example:"vacation"), new OA\Property(property:"status", type:"string", example:"approved")]))])) new OA Property(property:"holidays", type:"array", items:new OA\Items(properties:[new OA\Property(property:"date", type:"string", example:"2024-05-01"), new OA\Property(property:"name", type:"string", example:"Labor Day")]))])) new OA Response (response:404, description:"User not found or no data available", content:new OA\JsonContent( properties:[ new OA\Property(property:"status", type:"string", example:"error"), new OA\Property(property:"message", type:"string", example:"Benutzer nicht gefunden oder keine Daten verfügbar.")]))])] public function index( $year App::Controllers::Api::UrlaubDepartmentController::$month |
| App::Controllers::Api::UrlaubDepartmentController::$userId = session()->get('user_id') |
| App::Controllers::Api::UrlaubDepartmentController::$userModel = new User() |
| App::Controllers::Api::UrlaubDepartmentController::$users = $userModel->where('department_id', $departmentID)->findAll() |
| path App::Controllers::Api::UrlaubDepartmentController::__pad0__ |
HTTP-spezifischer Kontext.
Gibt Urlaubs- und Feiertagsinformationen für die Abteilung des angemeldeten Benutzers zurück.
| int | $year | Das Jahr der Abfrage |
| int | $month | Der Monat der Abfrage |
API-Endpunkt {get} /api/urlaub-department/:year/:month Urlaubsdaten der Abteilung abrufen
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::content |
| path App::Controllers::Api::UrlaubDepartmentController::description |
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::description |
| path App::Controllers::Api::UrlaubDepartmentController::example |
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::example |
| path App::Controllers::Api::UrlaubDepartmentController::in |
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::items |
| path App::Controllers::Api::UrlaubDepartmentController::parameters |
| path App::Controllers::Api::UrlaubDepartmentController::required |
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::responses |
| path App::Controllers::Api::UrlaubDepartmentController::schema |
| path App::Controllers::Api::UrlaubDepartmentController::summary |
| path App::Controllers::Api::UrlaubDepartmentController::tags |
| path new OA Parameter (name:"month", in:"path", required:true, description:"Month of the query", schema:new OA\Schema(type:"integer", example:5))] App::Controllers::Api::UrlaubDepartmentController::type |