Proje: Okul Platform · Hub: Okul Platform — Domain
Checkout Nedir?
Admin (satış ekibi) tarafından oluşturulan ürün paketi satış teklifi. Bir müşteriye birden fazla okul için ürün paketi önerilir.
Checkout Status
draft— Taslak (henüz gönderilmedi)sent— Müşteriye gönderildi (ödeme linki)completed— Ödeme alındı, onaylandıcancelled— İptal edildi
Önemli Field’lar (Checkout modeli)
customer_id— Hangi müşteri (firma)items(JSON) — Ürün listesi (product + school + quantity)initial_amount— İlk hesaplanan tutartotal_discount— Uygulanan indirimfinal_amount— Son tutarremaining_final_amount— Kalan tutardiscount_code_id→ SalesCampaign (indirim kodu)campaign_id→ SalesCampaign (kampanya)is_cash_payment— Nakit mi?discounted_months— Kaç ay indirimlipayment_approved_at / payment_rejected_at— Onay/red tarihleri
İş Akışı
POST /api/admin/checkouts/calculate— Tutar hesapla (commit yok)POST /api/admin/checkouts— Checkout oluştur (draft)POST /api/admin/checkouts/{id}/send-payment-link— Müşteriye link gönder (sent)POST /api/admin/checkouts/{id}/approve— Ödeme onayla (completed)POST /api/admin/checkouts/{id}/reject— Reddet (cancelled)
Servisler
app/Services/Admin/Checkout/:
CheckoutService— CRUD ve onay/red işlemleriCheckoutCalculationService— Fiyat hesaplama mantığıDiscount/— İndirim hesaplama
Custom Exceptions
CheckoutAlreadyCompletedExceptionCheckoutAlreadyCancelledExceptionCheckoutCannotBeModifiedExceptionCheckoutCannotBeRejectedExceptionCustomerPhoneNotFoundException
Ürün Yapısı (items JSON)
Her item: productPriceId, schoolId, schoolName, quantity
ProductPrice → okul tipi + şehir + fiyat kombinasyonu. Bir okul için birden fazla ürün seçilebilir.
Related
- api-domain-model — Checkout, Product modelleri
- api-customer-agreement — Sözleşme akışı (checkout’tan sonra gelen adım)
- api-b2b-vs-b2c — B2B satış süreci