<?php

declare(strict_types=1);

namespace App\DTOs\Import;

readonly class ImportResultDto
{
    /**
     * @param  array<int, string>  $errors
     */
    public function __construct(
        public int $total,
        public int $imported,
        public int $skipped,
        public int $failed,
        public array $errors = [],
    ) {}

    /**
     * @return array<string, mixed>
     */
    public function toArray(): array
    {
        return [
            'total' => $this->total,
            'imported' => $this->imported,
            'skipped' => $this->skipped,
            'failed' => $this->failed,
            'errors' => $this->errors,
        ];
    }
}
