<?php

declare(strict_types=1);

namespace ImovelZapAi\Organizations\Infrastructure\Persistence\Eloquent;

use Database\Factories\OrganizationSettingsFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use ImovelZapAi\Shared\Infrastructure\Persistence\Concerns\HasUuidPrimaryKey;
use ImovelZapAi\Tenancy\Infrastructure\Persistence\Eloquent\TenantModel;

class OrganizationSettingsModel extends Model
{
    /** @use HasFactory<OrganizationSettingsFactory> */
    use HasFactory;
    use HasUuidPrimaryKey;

    protected $table = 'organization_settings';

    /** @var list<string> */
    protected $fillable = [
        'tenant_id',
        'trade_name',
        'legal_name',
        'document',
        'creci',
        'email',
        'phone',
        'whatsapp',
        'website',
        'cep',
        'street',
        'number',
        'complement',
        'district',
        'city',
        'state',
        'timezone',
        'locale',
        'currency',
        'about',
    ];

    public function tenant(): BelongsTo
    {
        return $this->belongsTo(TenantModel::class, 'tenant_id');
    }

    protected static function newFactory(): OrganizationSettingsFactory
    {
        return OrganizationSettingsFactory::new();
    }
}
