Proje: Okul Platform · Hub: Okul Platform — Domain

SchoolCommentPolicy B2B Metodları

viewAnyCustomer

  • isCustomerWithPaidSchool() — Ücretli okulu olan müşteri
  • checkContentAccess() — O okula içerik erişimi var mı

replyCustomer

Cevap verme kuralları:

  1. isCustomerWithPaidSchool() → Ücretli okul zorunlu
  2. Yorum onaylı olmalı (parentComment.status = true)
  3. Sadece ana yoruma cevap (replied_id = null) — İç içe yanıt yok (tek seviye)
  4. Content accesscheckContentAccess(school_id)

B2B Yorum Görüntüleme Akışı

GET /customer/school-comments
→ Gate::authorize('viewAnyCustomer')
→ Sadece erişilen okullara ait onaylı yorumlar

Tek Seviyeli Cevap (Single-Level Reply)

if ($parentComment->replied_id !== null) {
    return false;  // Cevaba cevap verilemez
}

B2B vs Admin Yorum İzinleri

AdminB2B
GörüntüleVIEW_COMMENT permissionÜcretli okul + content access
CevaplaYok (B2B-only)isCustomerWithPaidSchool + content access
OnaylamaAPPROVE_COMMENTYok