fix: add Notifiable trait to Supplier and Customer, add null guards to notification messages

This commit is contained in:
ghassan committed 2026-05-19 13:29:28 +03:00
1 parent 2d54c670de
commit add011790c
6 files changed
+8 -6

No files matched your search

@@ -23,7 +23,7 @@ class GoodsReceiptConfirmedNotification extends Notification implements ShouldQu
public function toUltraMessage(mixed $notifiable): UltraMessageMessage
{
return UltraMessageMessage::text(
"GRN *#{$this->grn->grn_number}* has been confirmed and goods received.\n\nPO Reference: {$this->grn->purchaseOrder->po_number}\nDate: {$this->grn->received_date->format('d M Y')}"
"GRN *#{$this->grn->grn_number}* has been confirmed and goods received.\n\nPO Reference: {$this->grn->purchaseOrder?->po_number ?? 'N/A'}\nDate: {$this->grn->received_date->format('d M Y')}"
);
}
}
@@ -23,7 +23,7 @@ class PurchaseOrderConfirmedNotification extends Notification implements ShouldQ
public function toUltraMessage(mixed $notifiable): UltraMessageMessage
{
return UltraMessageMessage::text(
"Dear {$notifiable->name},\n\nPurchase Order *#{$this->order->po_number}* has been confirmed.\n\nTotal Amount: {$this->order->total_amount}\nExpected Delivery: {$this->order->expected_delivery_date}\n\nThank you."
"Dear {$notifiable->name},\n\nPurchase Order *#{$this->order->po_number}* has been placed.\n\nTotal Amount: {$this->order->total_amount}\nExpected Delivery: {$this->order->expected_delivery_date}\n\nThank you."
);
}
}