Urlaubsplan
Lade ...
Suche ...
Keine Treffer
App::Controllers::Api::UrlaubDepartmentController Klassenreferenz
Klassendiagramm für App::Controllers::Api::UrlaubDepartmentController:
Zusammengehörigkeiten von App::Controllers::Api::UrlaubDepartmentController:

Ö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()
 

Ausführliche Beschreibung

UrlaubDepartmentController

Controller zur Verwaltung von Urlaubs- und Feiertagsinformationen für Abteilungen.

Dokumentation der Datenelemente

◆ $currentUser

if (! $userId) App::Controllers::Api::UrlaubDepartmentController::$currentUser = $userModel->where('user_id', $userId)->select('department_id')->first()

◆ $departmentID

if (! $currentUser) App::Controllers::Api::UrlaubDepartmentController::$departmentID = $currentUser['department_id']

◆ $events

App::Controllers::Api::UrlaubDepartmentController::$events = $urlaubModel->getUrlaubByMonthDepartments($year, $month, $departmentID)

◆ $holidayModel

App::Controllers::Api::UrlaubDepartmentController::$holidayModel = new HolidayModel()

◆ $holidays

App::Controllers::Api::UrlaubDepartmentController::$holidays = $holidayModel->getHolidays()

◆ $month

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
Initialisierung:
{
$urlaubModel = new UrlaubModel()

◆ $userId

App::Controllers::Api::UrlaubDepartmentController::$userId = session()->get('user_id')

◆ $userModel

App::Controllers::Api::UrlaubDepartmentController::$userModel = new User()

◆ $users

App::Controllers::Api::UrlaubDepartmentController::$users = $userModel->where('department_id', $departmentID)->findAll()

◆ __pad0__

path App::Controllers::Api::UrlaubDepartmentController::__pad0__

HTTP-spezifischer Kontext.

Gibt Urlaubs- und Feiertagsinformationen für die Abteilung des angemeldeten Benutzers zurück.

Parameter
int$yearDas Jahr der Abfrage
int$monthDer Monat der Abfrage
Rückgabe
Namespace: CodeIgniter
JSON-Antwort mit Benutzerdaten, Events und Feiertagen

API-Endpunkt {get} /api/urlaub-department/:year/:month Urlaubsdaten der Abteilung abrufen

API Name: \1 GetDepartmentMonthlyUrlaub
API Group: \1 Urlaub
API Parameter: \1 {Number} year Das Jahr, für das die Daten abgerufen werden sollen
API Parameter: \1 {Number} month Der Monat, für den die Daten abgerufen werden sollen
API Success: \1 {Object[]} users Liste der Benutzer und ihre Urlaube in der Abteilung
API Success: \1 {Object[]} holidays Liste der Feiertage im angegebenen Monat
API Error: \1 404 Keine Daten gefunden oder Benutzer nicht gefunden

◆ content

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

◆ description [1/2]

path App::Controllers::Api::UrlaubDepartmentController::description

◆ description [2/2]

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

◆ example [1/2]

path App::Controllers::Api::UrlaubDepartmentController::example

◆ example [2/2]

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

◆ in

path App::Controllers::Api::UrlaubDepartmentController::in

◆ items

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

◆ parameters

path App::Controllers::Api::UrlaubDepartmentController::parameters

◆ required

path App::Controllers::Api::UrlaubDepartmentController::required

◆ responses

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

◆ schema

path App::Controllers::Api::UrlaubDepartmentController::schema

◆ summary

path App::Controllers::Api::UrlaubDepartmentController::summary

◆ tags

path App::Controllers::Api::UrlaubDepartmentController::tags

◆ type

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

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: