feat(settings): enable_automation gate; reject stale montzar quote jumps
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Automation;
|
||||
use App\Models\AutomationDelayedJob;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Product;
|
||||
use App\Services\ConfigService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -19,12 +20,18 @@ class AutomationEngine
|
||||
|
||||
public function runDue(): void
|
||||
{
|
||||
if (! app(ConfigService::class)->isAutomationEnabled()) {
|
||||
return;
|
||||
}
|
||||
$this->runSchedule();
|
||||
$this->processDelayedJobs();
|
||||
}
|
||||
|
||||
public function onCustomerEvent(string $event, int $customerId): void
|
||||
{
|
||||
if (! app(ConfigService::class)->isAutomationEnabled()) {
|
||||
return;
|
||||
}
|
||||
$customer = Customer::query()->find($customerId);
|
||||
if (! $customer || (int) $customer->type !== 2 || $customer->is_archive) {
|
||||
return;
|
||||
@@ -52,6 +59,9 @@ class AutomationEngine
|
||||
|
||||
public function evaluatePriceMove(array $payload = []): void
|
||||
{
|
||||
if (! app(ConfigService::class)->isAutomationEnabled()) {
|
||||
return;
|
||||
}
|
||||
$rows = Automation::query()
|
||||
->where('is_active', true)
|
||||
->where('trigger_type', AutomationCatalog::TRIGGER_PRICE)
|
||||
|
||||
Reference in New Issue
Block a user