<?php

namespace Database\Seeders;

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

class PaymentMethodSeeder extends Seeder
{
    public function run(): void
    {
        $methods = [
            [
                'name_ar' => 'نقداً',
                'name_en' => 'Cash',
                'payment_type' => 'cash',
                'is_active' => true,
            ],
            [
                'name_ar' => 'بطاقة ائتمان',
                'name_en' => 'Card',
                'payment_type' => 'card',
                'is_active' => true,
            ],
            [
                'name_ar' => 'محفظة إلكترونية',
                'name_en' => 'Wallet',
                'payment_type' => 'wallet',
                'is_active' => true,
            ],
            [
                'name_ar' => 'تحويل بنكي',
                'name_en' => 'Bank Transfer',
                'payment_type' => 'bank',
                'is_active' => true,
            ],
        ];

        foreach ($methods as $method) {
            PaymentMethod::updateOrCreate(
                [
                    'name_ar' => $method['name_ar'],
                    'name_en' => $method['name_en'],
                ],
                $method
            );
        }
    }
}
