File: /home/xedaptot/ai.naniguide.com/app/Notifications/Admin/RenewOrdersBatch.php
<?php
namespace App\Notifications\Admin;
use App\Notifications\AppNotification;
/**
* Aggregate notification: N renewal orders were created in a single cron run.
* Shared with admins so they have visibility into auto-renew throughput
* without flooding the inbox with one row per renew order.
*
* Group key carries the cron tick stamp so each hour's batch produces its
* own row (no collapse across runs).
*/
class RenewOrdersBatch extends AppNotification
{
public function __construct(public int $count, public string $stamp) {}
public function audience(): string { return self::AUDIENCE_ADMINS; }
public function category(): string { return self::CATEGORY_INFO; }
public function severity(): string { return self::SEVERITY_INFO; }
public function groupKey(): string
{
return 'renew-orders-batch:' . $this->stamp;
}
public function toArray(object $notifiable = null): array
{
return [
'title' => trans('refactor/notifications.renew_orders_batch.title'),
'body' => trans('refactor/notifications.renew_orders_batch.body', [
'count' => $this->count,
]),
'action' => [
'label' => trans('refactor/notifications.renew_orders_batch.cta'),
'route' => 'refactor.admin.subscriptions.index',
'params' => [],
],
];
}
}