<?php

declare(strict_types=1);

namespace Maestro\Core\Modules\Customers\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use Maestro\Core\Modules\Customers\Models\Address;

/** @mixin Address */
class AddressResource extends JsonResource
{
    /**
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'customer_id' => $this->customer_id,
            'type' => $this->type,
            'street' => $this->street,
            'house_number' => $this->house_number,
            'house_number_addition' => $this->house_number_addition,
            'postal_code' => $this->postal_code,
            'city' => $this->city,
            'country' => $this->country,
            'is_primary' => $this->is_primary,
            'full_address' => $this->full_address,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ];
    }
}
