<?php

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

use Illuminate\Http\Resources\Json\JsonResource;
use Modules\Mall\Http\Resources\Api\Goods\SkuResource;

class OrderItemResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'item_id'            => $this->id,
            'qty'                => $this->qty,
            'price'              => $this->price,
            'total'              => $this->total,
            'can'                => [
                'refund' => $this->canRefund(),
            ],
            'sku'                => $this->source,
            'refund_status_text' => $this->refund_status_text,
        ];
    }

}