<?php

namespace App\Models;

use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class CorporateEmployee extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'company_id',
        'corporate_employee_code',
        'full_name',
        'name_en',
        'first_name',
        'nationality',
        'dob',
        'gender',
        'mobile',
        'email',
        'passport_number',
        'emirates_id',
        'uid',
        'labour_number',
        'work_permit_number',
        'visa_file_number',
        'designation',
        'status',
    ];

    protected $casts = [
        'dob' => 'date',
    ];

    public function company()
    {
        return $this->belongsTo(CorporateCompany::class, 'company_id');
    }

    public function documents()
    {
        return $this->hasMany(CorporateEmployeeDocument::class, 'corporate_employee_id');
    }
}
