Proje: Okul Platform · Hub: Okul Platform — Architecture

SchoolOffer Akış Mimarisi

Temel Alan Semantiği

AlanAçıklamaÖrnek değer
refHangi form/akış olduğunu belirtirprofiling-multiple, lead-pool
refererref ile aynı değeri alır (semantik kopya); bazı akışlarda HTTP Referer URL’iprofiling-multiple, lead-pool
typeOffer tipi — set edilmezse normal offerscholarship, lgs, pending-scholarship
approved_typetype’a göre service tarafında set edilirnull (normal), scholarship, lgs
source_actionHangi cihaz/akıştan geldiği — API tarafında kullanılıroffer-desktop, offer-mobile, whatsapp-form-desktop

source_action

  • API reposunda 2026_04_02 tarihli migration ile eklendi (school_offers + leads tablolarına).
  • Okul reposunda SchoolOffer::$fillable’a 2026-04-27 tarihinde eklendi.
  • SourceActionType enum değerleri (API reposunda):
    • offer-desktop / offer-mobile
    • okulcomtr_scholarship-desktop / okulcomtr_scholarship-mobile
    • whatsapp-form-desktop / whatsapp-form-mobile
  • Device tespiti: Jenssegers\Agent ile isMobile() kontrolü.

referer Set Etme Paterni

Her akışın kendi referer değeri var:

  • submitOfferForm (okul profil sayfası): HTML form hidden field’dan request('referer')
  • LeadPoolFormService: hardcoded 'lead-pool'
  • ProfilingController::submitMultipleOffers: hardcoded 'profiling-multiple'

Offer Akışları

1. Okul Profil Sayfası (standard)

  • Controller: Ajax/SchoolProfileController::submitOfferForm
  • 24h kontrolü: User::userOffersByTimeSchoolIds() ile
  • request()->all() direkt service’e gider

2. Lead Pool Formu

  • Service: LeadPoolFormService
  • referer = 'lead-pool', type form’dan gelir, approved_type = type
  • source_action set edilmez

3. Profiling Multi-Offer

  • Controller: Front/ProfilingController::submitMultipleOffers
  • Route: POST /egitim-yaklasimi-testi/cok-okula-basvur
  • ref = 'profiling-multiple', referer = 'profiling-multiple'
  • source_action: Jenssegers\Agent ile device detection → offer-desktop / offer-mobile
  • 24h kontrolü: listing’de whereNotIn + submit’te hasRecentOffer()

PHP → JS User Data Köprüsü (Profiling)

Giriş yapmış kullanıcının form prefill akışı:

  1. ProfilingController::getLoggedInUserData()$data['profilingUser']
  2. Blade: window.profilingUserData = @json($profilingUser) (page_vars section’ında)
  3. Alpine component init()_prefillUser() → form.name/email/phone dolar, terms işaretlenir