Chore: Updates to Notifications

This commit is contained in:
2026-09-28 23:54:24 +03:00
parent 76b807d672
commit 57d7a716bc
11 changed files with 75 additions and 0 deletions
@@ -5,6 +5,8 @@ namespace Modules\Core\Store\Services;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Event;
use Lunar\Models\Language;
use Lunar\Models\Order;
use Modules\Core\Order\Services\OrderStatusFlow;
use Modules\Core\Store\Events\StoreDetailsUpdated;
use Modules\Core\Store\Models\StoreDetails;
@@ -35,6 +37,24 @@ class StoreDetailsService
);
}
/**
* Null for any non-bank-transfer order — the confirmation email only
* shows this block when there's actually a wire to send (see
* BankTransferPaymentDriver's own docblock for why a bank transfer
* order stays at 'awaiting_payment' until staff confirm the wire
* arrived). Null also when the store hasn't filled the field in for
* $locale, so the caller's own @if($bankTransferInstructions) guard
* covers both cases identically.
*/
public function bankTransferInstructionsFor(Order $order, string $locale): ?string
{
if (! app(OrderStatusFlow::class)->isBankTransfer($order)) {
return null;
}
return $this->current()->translate('bank_transfer_instructions', $locale) ?: null;
}
public function update(array $attributes): StoreDetails
{
$storeDetails = $this->firstOrCreate();