<?php

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

// Public routes — browse VIP cards (no auth required)
Route::prefix('vip-cards')->group(function () {
    Route::get('/', [VipCardController::class, 'index'])->name('vip-cards.index');
    Route::get('/{vipCard}', [VipCardController::class, 'show'])->name('vip-cards.show');
});

// Authenticated user routes — purchase flow + memberships
Route::middleware(['auth:sanctum', 'verified'])->prefix('dashboard/vip-cards')->group(function () {
    Route::get('/{vipCard}/purchase', [VipCardController::class, 'purchase'])->name('vip-cards.purchase');
    Route::post('/{vipCard}/place-order', [VipCardController::class, 'placeOrder'])->name('vip-cards.place-order');
    Route::get('/order/{order}/payment', [VipCardController::class, 'payment'])->name('vip-cards.payment');
    Route::post('/order/{order}/save-proof', [VipCardController::class, 'savePaymentProof'])->name('vip-cards.save-proof');
    Route::get('/my-memberships', [VipCardController::class, 'myMemberships'])->name('vip-cards.my-memberships');
    Route::get('/membership/{order}', [VipCardController::class, 'membershipDetails'])->name('vip-cards.membership-details');
});
