<?php

namespace Modules\Canteen\Resources\Api;

use Illuminate\Http\Resources\Json\JsonResource;

class CanteenResource extends JsonResource
{

    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => (int) $this->id,
            'code' => (int) $this->code,
            'name' => $this->currentDescription->title ?? "",
            'account_name' => $this->account_name,
            'account_number' => $this->account_number,
            'bank_name' => $this->bank_name,
            'iban' => $this->iban,
            'active' => $this->active,
        ];
    }

}
