<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Models\Booking;

Route::get('/get-bookings', function () {
    $bookings = Booking::all();

    $events = $bookings->map(function ($booking) {
        return [
            'title' => $booking->produk . " - " . $booking->paket,
            'start' => $booking->tanggal_pemotretan,
            'color' => $booking->status == 'confirmed' ? '#28a745' : ($booking->status == 'pending' ? '#ffc107' : '#dc3545'),
        ];
    });

    return response()->json($events);
});


Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

use App\Http\Controllers\BookingController;

Route::get('/get-bookings/{customer_id}', [BookingController::class, 'getBookings']);