<?php

namespace App\Domain\Questions;

use Illuminate\Pipeline\Pipeline;

class QuestionPipeline
{
    public function __construct(private readonly Pipeline $pipeline)
    {
    }

    public function run(array $payload): array
    {
        return $this->pipeline
            ->send($payload)
            ->through([
                \App\Domain\Questions\Stages\NormalizeQuestion::class,
                \App\Domain\Questions\Stages\ClassifyQuestion::class,
                \App\Domain\Questions\Stages\EstimateDifficulty::class,
            ])
            ->thenReturn();
    }
}
