<?php

namespace Database\Seeders;

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

class PaymentMethodSeeder extends Seeder
{
    public function run(): void
    {
        foreach ([
            ['name' => 'ABA PayWay', 'code' => 'aba', 'description' => 'Secure online payment through ABA PayWay.', 'instructions' => 'Complete payment in the ABA checkout window.', 'sort_order' => 1],
            ['name' => 'Cash on Delivery', 'code' => 'cod', 'description' => 'Pay when your order is delivered.', 'instructions' => 'Prepare the exact amount when the courier arrives.', 'sort_order' => 2],
        ] as $method) {
            PaymentMethod::updateOrCreate(['code' => $method['code']], $method + ['is_active' => true]);
        }
    }
}
