Files
DatBrowser/app/Browser/Jobs/EldoradoRobuxPriceSentry/EldoradoRobuxPriceNotification.php
Matthias Guillitte 5e6164016c
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 3m25s
Test, build and push image to registry / build-image (push) Successful in 2m59s
Eldorado : Added the minimum stock threshold
It now look at all of the offers of the first page and select the one matching the criterias
2025-12-20 16:20:07 +01:00

52 lines
1.4 KiB
PHP

<?php
namespace App\Browser\Jobs\EldoradoRobuxPriceSentry;
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 $priceThreshold;
private string $link;
private int $stock;
private int|null $stockThreshold;
public function __construct(int $jobId, float $price, float $priceThreshold, int $stock, int|null $stockThreshold, string $link) {
parent::__construct($jobId);
$this->price = $price;
$this->priceThreshold = $priceThreshold;
$this->stock = $stock;
$this->stockThreshold = $stockThreshold;
$this->link = $link;
$this->setBody($this->generateBody());
}
private function generateBody() {
return new EldoradoRobuxPriceNotificationBody($this->price, $this->priceThreshold, $this->stock, $this->stockThreshold, $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;
}
}