<?php

use App\Http\Controllers\User\GiveawayController;
use Illuminate\Support\Facades\Route;

// Public routes — browse giveaways (no auth required)
Route::prefix('giveaways')->group(function () {
    Route::get('/', [GiveawayController::class, 'index'])->name('giveaways.index');
    Route::get('/{giveaway}', [GiveawayController::class, 'show'])->name('giveaways.show');
});

// Authenticated user routes — enter giveaways + view entries
Route::middleware(['auth:sanctum', 'verified', 'complete.kyc'])->prefix('dashboard')->group(function () {
    Route::post('/giveaways/{giveaway}/enter', [GiveawayController::class, 'enter'])->name('giveaways.enter');
    Route::get('/my-giveaway-entries', [GiveawayController::class, 'myEntries'])->name('giveaways.my-entries');
});
