<?php

namespace Database\Seeders;

use App\Enums\IsShow;
use App\Models\Testimonial;
use App\Models\User;
use Illuminate\Database\Seeder;

class TestimonialSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $testimonials = [
            [
                'content' => 'Parfumnya wangi banget, tahan lama seharian! Recommended banget pokoknya.',
                'rating' => 5,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Pengiriman cepat, packing aman. Wanginya juga sesuai ekspektasi. Terima kasih!',
                'rating' => 5,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Wanginya enak, tapi sayang kurang tahan lama di luar ruangan yg panas. Tapi worth it lah harga segini.',
                'rating' => 4,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Suka banget sama varian vanilla-nya. Manis tapi nggak bikin pusing. Bakal repeat order sih ini.',
                'rating' => 5,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Botolnya pecah dikit pas nyampe, mungkin dari ekspedisinya. Tapi parfumnya masih oke.',
                'rating' => 3,
                'is_show' => IsShow::HIDDEN,
            ],
            [
                'content' => 'Pelayanan ramah, admin fast respon. Parfumnya juga original. Top marketop!',
                'rating' => 5,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Aromanya mewah, cocok buat kondangan. Temen-temen pada nanyain pake parfum apa.',
                'rating' => 5,
                'is_show' => IsShow::SHOW,
            ],
            [
                'content' => 'Lumayan lah buat sehari-hari. Gak terlalu menyengat.',
                'rating' => 4,
                'is_show' => IsShow::SHOW,
            ],
        ];

        foreach ($testimonials as $testimonial) {
            Testimonial::create([
                'user_id' => User::whereHas('customer')->inRandomOrder()->first()->id,
                'content' => $testimonial['content'],
                'rating' => $testimonial['rating'],
                'is_show' => $testimonial['is_show'],
            ]);
        }
    }
}
