<?php

namespace App\Browser\Jobs\HellcaseBattles;

use App\Models\HellcaseBattle;
use App\Notification\Notification;
use App\Notification\Stringifiable;
use App\Notification\Stringifiable\StringifiableSimpleText;

class HellcaseBattlesNofication extends Notification {

    private HellcaseBattle $battle;

    public function __construct(int $jobId, HellcaseBattle $battle) {
        parent::__construct($jobId);

        $this->battle = $battle;

        $this->setBody($this->generateBody());
    }

    private function generateBody() {
        return new HellcaseBattlesNotificationBody($this->battle);
    }

    public function getTitle(): Stringifiable {
        return new StringifiableSimpleText("Nouvelle bataille de caisses Hellcase");
    }

    /**
     * @inheritDoc
     */
    public function getImageProjectPath(): string|null {
        return HellcaseBattleScreenshot::getImgFileProjectPath();
    }

    /**
     * @inheritDoc
     */
    public function getLinkURL(): string|null {
        return $this->battle->getUrl();
    }
}
