<?php

namespace Modules\Mall\Http\Resources\Api\Order;

use Illuminate\Http\Resources\Json\JsonResource;

class RefundItemsResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'refund_item_id' => $this->id,
            'price'          => $this->price,
            'goods_id'       => $this->source ? $this->source['goods_id'] : '',
            'cover'          => $this->source ? $this->source['cover'] : '',
            'goods_name'     => $this->source ? $this->source['goods_name'] : '',
            'qty'            => $this->qty,
        ];
    }

}
