<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Organisation extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'owner_user_id',
        'name',
        'type',
        'email',
        'phone',
        'address',
        'city',
        'country',
        'kra_pin',
        'is_verified',
    ];

    protected $casts = [
        'is_verified' => 'boolean',
    ];

    // ============================================================
    // Relationships
    // ============================================================
    public function owner()
    {
        return $this->belongsTo(User::class, 'owner_user_id');
    }

    public function mediaOwners()
    {
        return $this->hasMany(MediaOwner::class);
    }
}