💈 Salon API

دليل تفاعلي مفصّل — كل دور يقدر يشوف ايه ويعمل ايه

Base URL
https://salon.k-tests.com/api
Laravel 12 Sanctum Auth 6 أدوار آخر تحديث: 30 مايو 2026
✨ أحدث التغييرات في الـ API
  • ●is_shop = نوع المحل — true = محل حلاقه، false = بيوتي سنتر. مطلوب وقت إنشاء المحل. الفروع بترّث من المحل الأب تلقائياً. GET /branches/nearest?is_shop=true بيفلتر النتائج.
  • ●Per-branch bundles — GET /customer/shops/{shop} دلوقتي كل فرع شايل services/offers/barbers/gallery/stories/business_hours بتاعته. (الـ top-level arrays لسه موجوده لـ backward compat.)
  • ●duration_minutes مطلوبه على العرض — لو ما تحطّش مدّه عند الإنشاء، الحجز كان بيتحجز slot واحد بس. required|integer|min:1|max:1440 على Admin/Shop/Branch-Manager.
  • ●Public branch discovery — GET /branches/nearest?lat=&lng= بترجّع الفروع مرتّبه بالـ Haversine + distance_km + is_open لليوم. GET /branches/{id} نفس payload الـ /barber/branch.
  • ●is_open + date filter — ?date=YYYY-MM-DD اختياري على /branches/nearest. لو اليوم نفسه بيفحص الساعه الحاليه، لو يوم تاني بيفحص ساعات العمل.
  • ●الحلاق له branch + stats — GET /barber/branch بيرجّع كل تفاصيل فرعه، و GET /barber/stats?from=&to= فيه إجمالي + per-day breakdown + commission_percentage.
  • ●Walk-in booking للستاف — POST /barber/bookings و POST /branch-manager/bookings. بيقبل تواريخ ماضيه عشان back-fill بعد ما الزبون يخرج.
  • ●Unified profile update — PUT /auth/profile شغّاله لأي دور (admin/shop/branch/customer/barber) من نفس الـ URL. الـ /customer/profile برضو فُتح لكل الأدوار.
  • ●الزبون يلغي حجزه — PATCH /customer/bookings/{id}/cancel. مسموح بس وهو waiting أو in_progress.
  • ●Slot interval = range_time — الـ availability بقت تستخدم range_time بتاع الشوب/الفرع كستيب (مش 30 دقيقه ثابته). حجز ساعه على ربع ساعه = 4 slots مشغوله.
  • ●Soft delete + restore — أي مستخدم يمسح حسابه (DELETE /auth/account). الأدمن يشوف الـ trashed list و يـ restore أي حساب.
  • ●OneSignal broadcast — POST /admin/notifications/test-broadcast بيبعت لكل المشتركين على الموبايل.
  • ●422 موحّد — { errors:[{error:"..."}] } من أي مصدر (validator أو business rule).
✅ تم النسخ