<?php

namespace Database\Seeders;

use App\Models\ShippingMethod;
use Illuminate\Database\Seeder;

class ShippingMethodSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $methods = [
            [
                'name' => 'Pick-up',
                'code' => 'pickup',
                'description' => 'Pick up your order directly from our store.',
                'fixed_fee' => 0.00,
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Delivery',
                'code' => 'delivery',
                'description' => 'Standard home delivery service.',
                'fixed_fee' => 2.00,
                'is_active' => true,
                'sort_order' => 2,
            ],
        ];

        foreach ($methods as $method) {
            ShippingMethod::updateOrCreate(
                ['code' => $method['code']],
                $method
            );
        }
    }
}
