<?php

namespace Database\Seeders;

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

class PaymentMethodSeeder extends Seeder{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(){

        $methods = [
            [
                'name'                    => 'PayPal',
                'code'                    => 'paypal-rest',
                'active'                  => true,
                'is_momo'                 => false,
                'logo_file_name'          => "paypal-rest.jpg",
            ],

            [
                'name'                    => 'Mada',
                'code'                    => 'mada',
                'active'                  => false,
                'is_momo'                 => false,
                'logo_file_name'          => null,
            ],

            [
                'name'                    => 'MTN Mobile Money',
                'code'                    => 'mtn-momo-cmr',
                'active'                  => false,
                'is_momo'                 => true,
                'logo_file_name'          => "mtn-momo-cmr.jpg",
            ],

            [
                'name'                    => 'Orange Mobile Money',
                'code'                    => 'orange-momo-cmr',
                'active'                  => true,
                'is_momo'                 => true,
                'logo_file_name'          => "orange-momo-cmr.jpg",
            ],
            [
                'name'                    => 'Cash Payment',
                'code'                    => 'cash',
                'active'                  => true,
                'is_momo'                 => true,
                'logo_file_name'          => "autres.png",
            ]

        ];

        if(filled($methods)){
            PaymentMethod::upsert($methods ,["code"]);
            echo ("All Payment methods created.\n\n");
        }
    }
}
