<?php

// database/seeders/PaymentStuffSeeder.php
namespace Database\Seeders;

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

class PaymentStuffSeeder extends Seeder {
    public function run(): void {
        // Methods
        PaymentMethod::updateOrCreate(
            ['key'=>'nagad'],
            [
                'label'=>'Nagad',
                'agent_number'=>env('NAGAD_AGENT','01806038247'),
                'logo_path'=>asset('img/methods/nogod.jpeg'),
                // ইউজ করা গাইড ইমেজ (আপনার দেওয়া ফাইল পাথ):
                'instruction_img'=>'/mnt/data/06091a98-93ee-4f67-8d3f-7f072a6dde73.png',
                'sort'=>1,'is_active'=>1
            ]
        );
        PaymentMethod::updateOrCreate(
            ['key'=>'bkash'],
            [
                'label'=>'bKash',
                'agent_number'=>env('BKASH_AGENT','01XXXXXXXXX'),
                'logo_path'=>asset('img/methods/bkash.png'),
                'instruction_img'=>'/mnt/data/06091a98-93ee-4f67-8d3f-7f072a6dde73.png',
                'sort'=>2,'is_active'=>1
            ]
        );
        PaymentMethod::updateOrCreate(
            ['key'=>'rocket'],
            [
                'label'=>'Rocket',
                'agent_number'=>env('ROCKET_AGENT','01XXXXXXXXX'),
                'logo_path'=>asset('img/methods/roket.png'),
                'instruction_img'=>'/mnt/data/06091a98-93ee-4f67-8d3f-7f072a6dde73.png',
                'sort'=>3,'is_active'=>1
            ]
        );

        // Deposit rules (উদাহরণ)
        // 0–10,000 => flat 500
        DepositRule::updateOrCreate(
            ['min_amount'=>0, 'max_amount'=>10000],
            ['calc_type'=>'flat','value'=>500,'is_active'=>1]
        );
        // 10,001–50,000 => 5%
        DepositRule::updateOrCreate(
            ['min_amount'=>10001, 'max_amount'=>50000],
            ['calc_type'=>'percent','value'=>5,'is_active'=>1]
        );
        // 50,001+ => 3%
        DepositRule::updateOrCreate(
            ['min_amount'=>50001, 'max_amount'=>null],
            ['calc_type'=>'percent','value'=>3,'is_active'=>1]
        );
    }
}
