<?php

namespace App\Services;

use App\Models\ShippingSetting;

class ShippingService
{
    public function calculateCost(?string $governorate = null): float
    {
        $settings = ShippingSetting::current();

        return $settings->calculateShippingCost($governorate);
    }

    public function getShippingType(): string
    {
        return ShippingSetting::current()->shipping_type;
    }

    public function requiresGovernorate(): bool
    {
        return $this->getShippingType() === 'per_governorate';
    }
}
