<?php

namespace App\Datatables\Admin\Shop;

use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\DeliveryTypeCalculation;
use Yajra\DataTables\Html\Column;

class DeliveryTypeCalculationsDataTable extends DataTable
{
    public $model_name = 'delivery_type_calculations';

    public function query(DeliveryTypeCalculation $model)
    {
        $model = $model->with('delivery_type');

        return $this->buildQuery($model);
    }

    protected function getColumns()
    {
        return [
            Column::make('delivery_type.name')->title('Nom'),
            Column::make('weight')->title('Poids en g')->addClass('text-right'),
            Column::make('price')->title('Prix')->addClass('text-right'),
            $this->makeColumnButtons(),
        ];
    }
}
