<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Organization extends Model
{
    protected $fillable = [
        'client_id', 'location_id', 'company_name', 'nif', 'rc',
        'creation_date', 'head_office', 'legal_form', 'member_count',
        'women_count', 'men_count', 'youth_count'
    ];

    public function client()
    {
        return $this->belongsTo(Client::class);
    }

    public function representatives()
    {
        return $this->hasMany(Representative::class, 'organization_id', 'id');
    }

    public function location()
    {
        return $this->belongsTo(Location::class, 'location_id', 'id');
    }
}
