<?php

namespace Database\Seeders;

use App\Models\SettingManagement\PaymentTransactionStatus;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

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

        $statuses = [

            [
                "id" => PaymentTransactionStatus::UNDER_PROCESS,
                "name" => "Under process",
                "position" => 3,
                "color" => "#ffcf22",
                "icon" => "warning",
                "style" => [
                    "label" => [
                        "color" => "#000 !important;",
                        "background-color" => "#ffcf22 !important;",
                    ]
                ],
            ],
            [
                "id" => PaymentTransactionStatus::UNPROCESSED,
                "name" => "New order",
                "position" => 1,
                "color" => "#3490dc",
                "icon" => "primary",
                "style" => [
                    "label" => [
                        "color" => "#fff !important;",
                        "background-color" => "#3490dc !important;",
                    ]
                ],
            ],
            [
                "id" => PaymentTransactionStatus::FAILED,
                "name" => "Rejected",
                "position" => 5 ,
                "color" => "#e3342f",
                "icon" => "danger",
                "style" => [
                    "label" => [
                        "color" => "#fff !important;",
                        "background-color" => "#e3342f !important;",
                    ]
                ],
            ],
            [
                "id" => PaymentTransactionStatus::APPROVED,
                "name" => "Approved",
                "position" => 4 ,
                "color" => "#38c172",
                "icon" => "success",
                "style" => [
                    "label" => [
                        "color" => "#fff !important;",
                        "background-color" => "#38c172 !important;",
                    ]
                ],

            ],
        ];

        foreach($statuses as $status) {
            if (!PaymentTransactionStatus::where('name',$status['name'])->first()){
                PaymentTransactionStatus::create($status);
                $this->command->info(__(":name ajouté!",["name" => $status['name']]));
            }
        }
    }
}
