<?php #CodeGenerator V3 Δ b7ca8a6d2df25bca2adeae31d3e8904c Δ DYNAMICALLY GENERATED FILE - Do not modify this line! Remove it completely to protect the file from changes.
/**
 * Model Class
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 1.5.0
 * @generated   2026-03-31 12:56:20
 * @package     bplan-base/globals
 * @subpackage  Models
 * @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\Models;


use BplanBase\Globals\Models\EntityType;
use BplanBase\Globals\Models\User;
use BplanBase\Globals\Observers\IndividualObserver;
use BplanBase\Globals\Traits\HasActiveScope;
use BplanBase\Globals\Traits\HasOrderedScope;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;


/**
 * Model Class
 *
 * @version     1.0.0 / 2026-03-31
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
#[ObservedBy([IndividualObserver::class])]
class Individual extends Model
{


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


    use HasActiveScope;
    use HasOrderedScope;
    use SoftDeletes;


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


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


    /**
     * The accessors to append to the model's array form.
     *
     * @var         array<int, string> $appends
     *
     * @version     1.0.0 / 2026-03-31
     */
    protected $appends = [];


    /**
     * @var         array<string, string> $casts
     *
     * @version     1.0.0 / 2026-03-31
     */
    protected $casts = [
        'active'            => 'boolean',
        'contact'           => 'boolean',
        'created_at'        => 'datetime',
        'date_of_birth'     => 'date',
        'date_of_entry'     => 'date',
        'deleted_at'        => 'datetime',
        'emergency_contact' => 'boolean',
        'global_contact'    => 'boolean',
        'updated_at'        => 'datetime',
    ];


    /**
     * The attributes that are mass assignable.
     *
     * @var         array<int, string> $fillable
     *
     * @version     1.0.0 / 2026-03-31
     */
    protected $fillable = [
        'active',
        'company',
        'contact',
        'contact_group',
        'cost_center',
        'date_of_birth',
        'date_of_entry',
        'department',
        'email',
        'emergency_contact',
        'entity_type_id',
        'first_name',
        'form_of_address',
        'function',
        'gender',
        'global_contact',
        'id_number',
        'job_title',
        'last_name',
        'mobile_phone_number',
        'mobile_phone_number_country_code',
        'mobile_phone_number_full',
        'organizational_unit',
        'personnel_number',
        'phone_number',
        'phone_number_country_code',
        'phone_number_full',
    ];


    /**
     * The attributes that aren't mass assignable.
     *
     * @var         array<int, string> $guarded
     *
     * @version     1.0.0 / 2026-03-31
     */
    protected $guarded = [
        'created_at',
        'deleted_at',
        'updated_at',
        'user_id',
        'uuid',
    ];


    /**
     * The attributes that should be hidden for serialization.
     *
     * @var         array<int, string> $hidden
     *
     * @version     1.0.0 / 2026-03-31
     */
    protected $hidden = [];


    /**
     * The table associated with the model.
     *
     * @var         string $table
     */
    protected $table = 'individuals';


    /**
     * Indicates if the model should be timestamped.
     *
     * @var         bool $timestamps
     */
    public $timestamps = true;


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


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


    /**
     *
     * @return      BelongsTo
     *
     * @version     1.0.0 / 2026-03-31
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function entityType(): BelongsTo
    {
        return $this->belongsTo(EntityType::class, 'entity_type_id');

    } // entityType()


    /**
     *
     * @return      BelongsTo
     *
     * @version     1.0.0 / 2026-03-31
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class, 'user_id');

    } // user()


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


} // class Individual extends Model {}
