<?php

declare(strict_types=1);

namespace App\Services\Install\Contracts;

/**
 * Web 安装分阶段单步执行（供 {@see WebInstallStepRunner} 按 HTTP 步骤调用）。
 */
interface WebInstallStagedPhaseExecutor
{
    /**
     * @param  array{reinstall_reset?: bool}  $payload
     */
    public function executeCheckingDatabasePhase(array $payload): void;

    /**
     * @param  array{system_url: string, timezone: string}  $payload
     */
    public function executeWritingEnvPhase(array $payload): void;

    public function executeMigratingPhase(): void;

    /**
     * @param  array{
     *     admin_name: string,
     *     login_account: string,
     *     admin_email?: string|null,
     *     password: string,
     * }  $payload
     */
    public function executeCreatingAdminPhase(array $payload): void;

    public function executeUpdatingSystemProfilePhase(): void;

    /**
     * @param  array{system_url: string, timezone: string}  $payload
     */
    public function executeWritingInstallMarkersPhase(array $payload): void;

    /**
     * @return list<string>
     */
    public function executeOptionalFinalizersPhase(): array;

    /**
     * @param  list<string>  $finalizationWarnings
     */
    public function executeCompletedPhase(array $finalizationWarnings = []): void;
}
