<?php

namespace App\Factory;

use App\Entity\Trace;
use App\Repository\TraceRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory;
use Zenstruck\Foundry\Persistence\Proxy;
use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator;

/**
 * @extends PersistentProxyObjectFactory<Trace>
 */
final class TraceFactory extends ModelFactory
{
    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
     *
     * @todo inject services if required
     */
    public function __construct()
    {
        parent::__construct();
    }

    public static function getClass(): string
    {
        return Trace::class;
    }

    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
     *
     * @todo add your default values here
     */
    protected function getDefaults(): array
    {
        return [
            'client' => ClientFactory::new(),
            'command' => CommandFactory::new(),
            'createdAt' => self::faker()->dateTime(),
            'executedAt' => self::faker()->dateTime(),
            'status' => self::faker()->text(255),
            'updatedAt' => self::faker()->dateTime()
        ];
    }

    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
     */
    protected function initialize(): static
    {
        return $this
            // ->afterInstantiate(function(Trace $trace): void {})
        ;
    }
}
