<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Product;

class ProductSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $products = [
            [
                'name' => 'bracelet',
                'dimensions' => [
                    'small' => ['width' => 400, 'height' => 100, 'textZone' => ['x' => 50, 'y' => 40, 'maxWidth' => 300]],
                    'medium' => ['width' => 450, 'height' => 120, 'textZone' => ['x' => 60, 'y' => 50, 'maxWidth' => 330]],
                    'large' => ['width' => 500, 'height' => 140, 'textZone' => ['x' => 70, 'y' => 60, 'maxWidth' => 360]]
                ]
            ],
            [
                'name' => 'keychain',
                'dimensions' => [
                    'default' => ['width' => 200, 'height' => 160, 'textZone' => ['x' => 30, 'y' => 60, 'maxWidth' => 140]]
                ]
            ],
            [
                'name' => 'bookmark',
                'dimensions' => [
                    'default' => ['width' => 150, 'height' => 320, 'textZone' => ['x' => 20, 'y' => 100, 'maxWidth' => 110]]
                ]
            ]
        ];

        foreach ($products as $product) {
            Product::create($product);
        }
    }
}
