Proje: OkulUp API · Hub: OkulUp API — Decisions
Conversation — Generic Participants Migrasyonu
Karar
Direct konuşmalar başlangıçta parent_id + teacher_id şekliydi (sadece parent-teacher). 2026-03-13 migration ile conversation_participants tablosu eklenerek generik katılımcı desteği getirildi.
Migration
2026_03_13_075649_update_direct_conversations_for_generic_participants.php
Neden
- Admin-öğretmen, admin-veli gibi kombinasyonlar da direct konuşma açabilmeli
- Mevcut
parent_id+teacher_idsadece iki taraf → diğer kombiler kapsanmıyor conversation_participantstablosu grup + broadcast’te zaten var
Geriye Uyumluluk
parent_id ve teacher_id kolonları korundu (backward compat). isMember() metodu hem eski hem yeni yöntemi kontrol eder:
public function isMember(User $user): bool
{
if ($this->isDirect()) {
return $this->parent_id === $user->id || $this->teacher_id === $user->id;
}
return $this->teacher_id === $user->id || $this->participants()->...;
}Related
- mesajlasma-sistemi — conversation türleri