<?php

namespace App\Repositories\Shop;

use App\Models\Shop\DeliveryTypeCalculation;
use App\Traits\Model\Basic;

class DeliveryTypeCalculations
{
    use Basic;

    public static function getPriceByDeliveryType($deliveryTypeId, $weight)
    {
        $price = DeliveryTypeCalculation::byDeliveryType($deliveryTypeId)->byWeight($weight)->first();

        return $price ? (float) $price->price : false;
    }

    public static function getModel()
    {
        return DeliveryTypeCalculation::query();
    }
}
