<?php

namespace App\Domains\Tenant\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

/**
 * @mixin \App\Domains\Tenant\Models\Tenant
 */
class TenantResource extends JsonResource
{
    /**
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'codigo' => $this->codigo,
            'nombre' => $this->nombre,
            'dominio' => $this->dominio,
            'primary_color' => $this->primary_color,
            'secondary_color' => $this->secondary_color,
            'danger_color' => $this->danger_color,
            'header_footer_bg_color' => $this->header_footer_bg_color,
            // 1 day
            'header_logo' => $this->headerLogo?->getTemporaryUrl(1440),
            'footer_logo' => $this->footerLogo?->getTemporaryUrl(1440 ),
        ];
    }
}
