Eldorado : Added the minimum stock threshold
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

It now look at all of the offers of the first page and select the one matching the criterias
This commit is contained in:
2025-12-20 16:20:07 +01:00
parent 48fdc2f6f0
commit 5e6164016c
5 changed files with 223 additions and 48 deletions

View File

@@ -10,21 +10,25 @@ use App\Notification\Stringifiable\StringifiableSimpleText;
class EldoradoRobuxPriceNotification extends Notification {
private float $price;
private float $threshold;
private float $priceThreshold;
private string $link;
private int $stock;
private int|null $stockThreshold;
public function __construct(int $jobId, float $price, float $threshold, string $link) {
public function __construct(int $jobId, float $price, float $priceThreshold, int $stock, int|null $stockThreshold, string $link) {
parent::__construct($jobId);
$this->price = $price;
$this->threshold = $threshold;
$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->threshold, $this->link);
return new EldoradoRobuxPriceNotificationBody($this->price, $this->priceThreshold, $this->stock, $this->stockThreshold, $this->link);
}
public function getTitle(): Stringifiable {