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
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user