PHP Rebuild
CI / ci (push) Canceled after 0s

Initial PHP rebuild of the app
This commit is contained in:
Stefan Lazic committed 2026-09-05 08:21:33 +01:00
1 parent 8a2b211069
commit 2ef3654841
690 files changed
+33944 -12046

No files matched your search

@@ -0,0 +1,19 @@
<?php
namespace App\Services\Notifications;
use App\Enums\{NotificationChannel, NotificationType};
use App\Models\{Business, Notification};
class NotificationService
{
public function create(Business $business, NotificationType $type, string $body, string $idempotencyKey, ?string $userId = null, ?string $customerId = null, ?string $appointmentId = null, ?string $deepLinkPath = null, ?string $subject = null): Notification
{
$notification = Notification::query()->firstOrCreate(
['idempotencyKey' => $idempotencyKey],
['businessId' => $business->id, 'recipientUserId' => $userId, 'recipientCustomerId' => $customerId, 'type' => $type, 'appointmentId' => $appointmentId, 'subject' => $subject, 'bodyText' => $body, 'deepLinkPath' => $deepLinkPath],
);
if ($userId) $notification->deliveries()->firstOrCreate(['channel' => NotificationChannel::InApp], ['status' => 'SENT', 'sentAt' => now()]);
return $notification;
}
}