fix(price-trigger): restrict notifications to SMS only

Remove email/in-app paths and enforce sms action on create/update so
price alerts match the product requirement for SMS-only delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 19:02:46 +03:30
co-authored by Cursor
parent 832a7683fb
commit 5b2ed2e5fc
3 changed files with 10 additions and 8 deletions
@@ -31,6 +31,7 @@ class PriceTriggerController extends Controller
$trigger = PriceTrigger::create([
...$data,
'action' => 'sms',
'is_active' => $data['is_active'] ?? true,
]);
@@ -46,6 +47,7 @@ class PriceTriggerController extends Controller
{
$trigger = PriceTrigger::findOrFail($id);
$data = $this->validatedPayload($request, true);
$data['action'] = 'sms';
$trigger->update($data);
@@ -82,7 +84,7 @@ class PriceTriggerController extends Controller
'product_id' => ($partial ? 'sometimes|' : '') . 'required|integer|exists:products,id',
'target_price' => ($partial ? 'sometimes|' : '') . 'required|numeric|min:1',
'price_condition' => ($partial ? 'sometimes|' : '') . 'required|in:>,<',
'action' => ($partial ? 'sometimes|' : '') . 'required|in:sms,email',
'action' => ($partial ? 'sometimes|' : '') . 'required|in:sms',
'is_active' => 'sometimes|boolean',
];