<?php
/**
 * JSON:API Request Class
 *
 * @todo        Prüfen warum die generierte Fassung von diesem Stand abweicht.
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 1.0.0
 * @generated   2025-05-20 19:22:20
 * @package     bplan-base/globals
 * @subpackage  Requests
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */

namespace BplanBase\Globals\JsonApi\Terminal\Users;


use LaravelJsonApi\Laravel\Http\Requests\ResourceRequest;
use LaravelJsonApi\Validation\Rule as JsonApiRule;


/**
 * JSON:API Request Class
 *
 * @version     1.0.0 / 2025-05-20
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
class UserRequest extends ResourceRequest
{


/* +++ TRAITS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ CLASS CONSTANTS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ OBJECT MEMBERS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ CLASS MEMBERS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ OBJECT METHODS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     * Get the validation rules for the resource.
     *
     * @return      array
     *
     * @version     1.0.0 / 2025-05-20
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function rules(): array
    {
        return [
            'accessLevel'      => ['sometimes', 'required', 'string'],
            'active'           => JsonApiRule::boolean(),
            'currentTeamId'    => ['nullable', 'integer'],
            'email'            => ['required', 'email', 'max:255'],
            'emailVerifiedAt'  => ['nullable', 'date'],
            'internal'         => JsonApiRule::boolean(),
            'name'             => ['required', 'string', 'max:255'],
            'password'         => ['required', 'string', 'max:255'],
            'profilePhotoPath' => ['nullable', 'string', 'max:2048'],
            'restricted'       => JsonApiRule::boolean(),
            'uuid'             => ['required'],                         // Wahrscheinlich überflüssig > guarded

            'tenant'           => JsonApiRule::toOne(),                 // Wahrscheinlich überflüssig

        ];
    } // rules()


/* +++ CLASS METHODS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


} // class UserRequest extends ResourceRequest {}
