'boolean', 'direction' => 'integer', 'trigger_price' => 'integer', 'amount' => 'float', 'number' => 'float', 'fee_charged' => 'integer', 'triggered_price' => 'integer', 'expires_at' => 'datetime', 'executed_at' => 'datetime', ]; public function customer() { return $this->belongsTo(Customer::class); } public function product() { return $this->belongsTo(Product::class); } public function order() { return $this->belongsTo(Order::class); } public function isPending(): bool { return $this->status === self::STATUS_PENDING; } public function conditionMet(int $currentPrice): bool { if ($currentPrice <= 0) { return false; } $target = (int) $this->trigger_price; return match ($this->price_condition) { self::CONDITION_GTE => $currentPrice >= $target, self::CONDITION_LTE => $currentPrice <= $target, default => false, }; } }