<?php

namespace App\Provisioning\Contracts;

/**
 * A polymorphic run subject (Host, Order …) that reacts when its run fails,
 * so the runner can update domain state without knowing the concrete model.
 */
interface ProvisioningSubject
{
    public function onProvisioningFailed(): void;

    /**
     * The pipeline that BUILDS this subject, as opposed to one that maintains
     * it afterwards.
     *
     * The failure hook writes the whole thing off — an order is marked failed
     * and its instance released with it — which is the right answer when the
     * machine was never finished and entirely the wrong one when a live
     * customer's address re-apply could not reach their VM for ten minutes. So
     * the runner asks which pipeline this subject exists to be built by, and
     * only that one is allowed to condemn it.
     */
    public function provisioningPipeline(): string;
}
