<?php

namespace App\Entities;

use CodeIgniter\Entity\Entity;

/**
 * @property int    $id
 * @property string $company_name
 * @property string $slug
 * @property string $verification_status
 * @property string $status
 */
class Agency extends Entity
{
    protected $attributes = [
        'id'                  => null,
        'company_name'        => null,
        'slug'                => null,
        'logo_path'           => null,
        'cover_image_path'    => null,
        'website'             => null,
        'email'               => null,
        'phone'               => null,
        'industry'            => null,
        'company_size'        => null,
        'description'         => null,
        'services'            => null,
        'social_links'        => null,
        'registration_number' => null,
        'tax_number'          => null,
        'address'             => null,
        'verification_status' => 'pending',
        'status'              => 'active',
        'owner_user_id'       => null,
        'timezone'            => 'Asia/Karachi',
    ];

    protected $casts = [
        'id'            => 'integer',
        'owner_user_id' => '?integer',
        'social_links'  => 'json-array',
    ];

    protected $dates = ['created_at', 'updated_at', 'deleted_at'];

    public function isVerified(): bool
    {
        return $this->verification_status === 'verified';
    }

    public function isActive(): bool
    {
        return $this->status === 'active';
    }
}
