<?php

declare(strict_types=1);

namespace apexl\Io\modules\product\EntityFactory;

use apexl\Io\factories\EntityFactory;
use apexl\Io\modules\product\Entity\Product;

/**
 * @method Product create(array $attrs = [], bool $store = true)
 */
final readonly class ProductEntityFactory extends EntityFactory
{
    protected function definition(array $attrs): array
    {
        return [
            'code'               => 'PRD' . random_int(1000, 999999),
            'name'               => 'Product',
            'description'        => null,
            'kind'               => 'service',
            'unit_price'         => 0,
            'unit_cost'          => null,
            'currency'           => 'GBP',
            'default_markup_pct' => null,
            'is_sold'            => 1,
            'is_purchased'       => 0,
            'is_active'          => 1,
            'parent_id'          => null,
            'sort_order'         => 0,
            'created'            => time(),
            'created_by'         => null,
            'modified'           => time(),
            'modified_by'        => null,
        ];
    }
}
