Proje: Okul Platform · Hub: Okul Platform — Domain
Genel Ayrım
| B2C | B2B | |
|---|---|---|
| Kim? | Veli / öğrenci | Okul sahibi firma |
| Model | User (user_group_type=user) | CustomerUser + Customer |
| Auth | Sanctum token | Sanctum token (ayrı) |
| Route prefix | /api/ general | /api/customer/ |
| CustomerIO | B2CService | B2BService |
| OneSignal | Veliye bildirim | Okula bildirim |
| Lead almak | Form gönderir | Lead görüntüler |
B2C (Veliler/Öğrenciler)
User modeli:
user_group_type = 'user'user_type_id→ UserType (veli/öğrenci/stajyer vs.)- Favori okul kaydedebilir (
UserFavorite) - Okul yorum yapabilir (
SchoolComment) - Makale yorum yapabilir (
ArticleComment) - Lead formu gönderebilir
CustomerIO B2CService:
importUser()— Kullanıcıyı CIO’ya gönderbatchImportUsers()— Toplu gönderdispatchDeleteUser()— Siler
B2B (Okul Sahipleri/Müşteriler)
Customer modeli: Firma bilgileri (fatura, adres, sözleşme)
CustomerUser modeli: Firma adına paneli kullanan kişiler
- Bir Customer’ın birden fazla CustomerUser’ı olabilir
- Her CustomerUser birden fazla okula erişebilir (
CustomerUserSchool)
CustomerUserSchool pivot: Her kullanıcı-okul kombinasyonunda:
has_lead_access— Lead’leri görebilir mican_receive_leads_sms— Lead gelince SMS alır mıcan_receive_leads_mail— Lead gelince mail alır mı
CustomerIO B2BService:
importSchool()— Okulu CIO’ya gönder (object olarak)importSchool(school, importUsers: true)— Okul + kullanıcıları toplu- B2B tarafında CIO “object” kullanıyor (school = object, kullanıcı = person + relationship)
Lead Bildirimi Akışı (B2B)
- Veli form gönderir → Lead oluşur
School::leadNotificationUsers()ilişkisi üzerinden has_lead_access=true kullanıcılar bulunurSchool::notifyEmails()/notifyGsmNumbers()— SchoolContact’tan bildirim adresleri- Bildirim gönderilir (SMS + mail)
Related
- api-domain-model — Customer, User, Lead modelleri
- api-role-permission-system — B2B kullanıcı yetkilendirmesi
- api-key-integrations — CustomerIO B2B/B2C servis detayları