<?php

namespace App\Notification\NotificationBody;

use App\Models\Job;
use App\Notification\NotificationBody;
use App\Notification\Stringifiable;

class JobErrorNotificationBody extends NotificationBody {

    private Job $job;
    private string $error;

    public function __construct(Job $job, $error) {
        $this->job = $job;
        $this->error = $error;
    }
    /**
     * @inheritDoc
     */
    public function toMarkdownString(): string {
        return "Le job \"{$this->job->name}\" a échoué avec l'erreur :\n ```" . $this->error . "``` \nScreenshot : ";
    }

    /**
     * @inheritDoc
     */
    public function toString(): string {
        return "Le job \"{$this->job->name}\" a échoué avec l'erreur :\n " . $this->error;
    }
}
