<?php

namespace Database\Seeders;

use App\Models\Faq;
use Illuminate\Database\Seeder;
use Illuminate\Support\Collection;

class FaqSeed extends Seeder
{
    public function run(): void
    {
        $this->records()->each(function ($record) {
            echo 'Processing: '.$record['question'].PHP_EOL;
            Faq::updateOrCreate([
                'question' => $record['question'],
            ], $record);
        });
    }

    private function records(): Collection
    {
        return collect([
            [
                'question' => 'How much does it cost?',
                'answer' => 'There is different pricing for how often you want to train. If you just want to train once a week, or participate in all the classes, there will be a pricing structure for you. If you have any questions please contact us.',
                'link_text' => 'Pricing',
                'link' => Route('Pricing'),
            ],
            [
                'question' => 'What do I need to start?',
                'answer' => 'You can train in whatever clothes you like. We suggest clothes that do not have zips to avoid scratches. We also recommend a water bottle so you can stay hydrated.',
            ],
            [
                'question' => 'Do I need to book?',
                'answer' => 'We recommend sending us a message through email or social media first so we know to keep an eye open for you, but you are welcome to turn up to any class that suits you.',
                'link_text' => 'Message us here',
                'link' => 'mailto:'.config('app.contact_email'),
            ],
            [
                'question' => 'Where are we located?',
                'answer' => 'We are located on the first floor of Spartan Strength & Fitness.<br> 1, Waymills Industrial Estate, Whitchurch, SY13 1TT.',
                'link_text' => 'Maps link',
                'link' => 'https://www.google.com/maps/place/Spartan+Strength+%26+Fitness/@52.9642652,-2.7514057,12z/data=!4m6!3m5!1s0x487a93dcaa4eb781:0x673cf89d62424a3d!8m2!3d52.9642938!4d-2.668835!16s%2Fg%2F11j8hxz75h?entry=ttu&g_ep=EgoyMDI1MDkxNi4wIKXMDSoASAFQAw%3D%3D',
            ],
            [
                'question' => 'What classes do you offer?',
                'answer' => 'We offer beginner and more advanced grappling classes including wrestling for adults. Beginner classes tend to be more focused on fundamentals, but all are welcome to advanced classes.',
                'link_text' => 'Classes',
                'link' => Route('Contact us'),
            ],
            [
                'question' => 'Do I need experience or a level of fitness to join?',
                'answer' => 'No experience is needed and any level of fitness is welcome. Jiu Jitsu and grappling can be full on but we\'re there to help you get started and enjoy the experience.',
            ],
            [
                'question' => 'Do you offer classes for children?',
                'answer' => 'Currently we do not offer classes for children under 18 years old. We plan to offer them in the future. If you\'d like to be notified when we do, please contact us.',
                'link_text' => 'Contact us',
                'link' => Route('Contact us'),
            ],
        ]);
    }
}
