<?php

namespace App\Processes;

use Illuminate\Support\Facades\Pipeline;

abstract class BaseProcess
{
    /**
     * @var array<class-string>
     *
     */
    protected array $tasks = [];

    public function run(mixed $payload): mixed
    {
        return Pipeline::send(
            passable: $payload,
        )->through(
            pipes: $this->tasks,
        )->thenReturn();
    }
}
