Proje: OkulUp API · Hub: OkulUp API — Domain
OkulUp API — Bildirim Sistemi
Mimarı
- NotificationService: DB’ye bildirim yazar, kullanıcı tercihlerine göre filtreler
- PushNotificationService: Firebase/APNs push gönderir
- Queue Jobs: Bildirim gönderimi kuyruk üzerinden asenkron
NotificationType Enum (19 Tür)
announcement_published
message_received
assignment_published, assignment_submitted, assignment_reviewed, assignment_parent_submitted
payment_due, payment_overdue, payment_reminder
event_reminder
appointment_created, appointment_updated
attendance_alert
note_reminder
document_request_created, document_request_approved, document_request_rejected,
document_request_uploaded, document_request_completed
9 Mobil Kategori (Badge Grupları)
NotificationType::category() her türü şu gruplara eşler:
announcement | message | assignment | payment | event | appointment | attendance | note | document_request
NotificationService::getUnreadCount() → { total: int, by_type: { kategori: count } } formatı döner.
Bildirim Tercihleri
Her kullanıcı notification_preferences tablosu üzerinden:
- Tür bazlı açık/kapalı
- Sessiz saat (quiet time) — bu saatte bildirim gönderilmez
NotificationService::shouldNotify() her bildirimden önce kontrol eder.
Unread Count Cache
- Cache key:
user:{userId}:unread_notifications - TTL: 30 saniye
- Yeni bildirim oluşturulduğunda veya okunduğunda invalidate edilir
Queue Jobs
| Job | Tetikleyici |
|---|---|
| SendAssignmentNotificationJob | publish, submit, review |
| SendAttendanceNotificationJob | devamsızlık kaydı |
| SendMessageNotificationJob | yeni mesaj |
| SendPaymentReminderJob | scheduled reminder |
| SendEnrollmentNotificationJob | kayıt talebi onay/ret |
| SendDocumentRequestNotificationJob | doküman talebi durum değişikliği |
| SendNoteReminderJob | note.reminder_at geldiğinde |
| SendPushNotificationJob | genel push |
| CheckNotificationReceiptsJob | push delivery kontrolü |
Related
- odev-akisi — assignment notification tetikleyicisi
- mesajlasma-sistemi — MessageReceived bildirimi
- veritabani-sema — notifications, devices tabloları