<?php

namespace App\Modules\HR\Employees\Models\Concerns;

use App\Modules\HR\Employees\Models\EmployeeEmploymentHistory;
use App\Modules\HR\Organization\Models\Branch;
use App\Modules\HR\Organization\Models\CostCenter;
use App\Modules\HR\Organization\Models\JobGrade;
use App\Modules\HR\Organization\Models\Section;
use App\Modules\HR\Organization\Models\Team;
use App\Modules\HR\Organization\Models\WorkLocation;
use App\Modules\HR\Payroll\Models\SalaryStructure;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

trait HasOrganizationRelations
{
    public function branch(): BelongsTo
    {
        return $this->belongsTo(Branch::class);
    }

    public function section(): BelongsTo
    {
        return $this->belongsTo(Section::class);
    }

    public function team(): BelongsTo
    {
        return $this->belongsTo(Team::class);
    }

    public function jobGrade(): BelongsTo
    {
        return $this->belongsTo(JobGrade::class);
    }

    public function workLocation(): BelongsTo
    {
        return $this->belongsTo(WorkLocation::class);
    }

    public function costCenter(): BelongsTo
    {
        return $this->belongsTo(CostCenter::class);
    }

    public function employmentHistories(): HasMany
    {
        return $this->hasMany(EmployeeEmploymentHistory::class);
    }

    public function salaryStructure(): BelongsTo
    {
        return $this->belongsTo(SalaryStructure::class);
    }
}
