<?php

namespace Database\Seeders\Tenant;

use App\Facades\Settings;
use Illuminate\Database\Seeder;

class RemoveReservationSettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        collect($this->data())
            ->each(fn ($setting) => Settings::make($setting));
    }

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Sales',
                'group' => 'General',
                'name' => 'Automatically Remove Expired Reservations',
                'config_key' => 'sales-reservation-remove-expired',
                'type' => 'boolean',
                'value' => false,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Sales',
                'group' => 'General',
                'name' => 'Reservations Removal Age In Days',
                'config_key' => 'sales-reservation-expiry-days',
                'type' => 'int',
                'value' => 2,
                'description' => 'Reservations will be removed after this number of days',
                'validation_rules' => [
                    "integer",
                    "min:1",
                ]
            ],
        ];
    }
}
