Notification Eldorado
All checks were successful
Push image to registry / build-image (push) Successful in 4m2s

This commit is contained in:
2025-11-02 19:17:05 +01:00
parent c36d83e8b6
commit ea22c19d2b
3 changed files with 85 additions and 5 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Browser\Jobs\EldoradoRobuxPriceSentry;
use App\Browser\Jobs\HellcaseBattles\EldoradoRobuxPriceNotificationBody;
use App\Models\Job;
use App\Notification\Notification;
use App\Notification\Stringifiable;
use App\Notification\Stringifiable\StringifiableSimpleText;
class EldoradoRobuxPriceNotification extends Notification {
private float $price;
private float $threshold;
private string $link;
public function __construct(int $jobId, int $price, string $link) {
parent::__construct($jobId);
$this->price = $price;
$this->threshold = Job::find($jobId)->jobInfosTable()->get('eldorado_robux_price_threshold');
$this->link = $link;
$this->setBody($this->generateBody());
}
private function generateBody() {
return new EldoradoRobuxPriceNotificationBody($this->price, $this->threshold, $this->link);
}
public function getTitle(): Stringifiable {
return new StringifiableSimpleText("Alerte Robux Eldorado 🤑");
}
/**
* @inheritDoc
*/
public function getImageProjectPath(): string|null {
return null;
}
/**
* @inheritDoc
*/
public function getLinkURL(): string|null {
return $this->link;
}
}