<?php

use App\Domains\Purchase\Controllers\PurchaseController;
use Illuminate\Support\Facades\Route;

Route::prefix('tenants/{tenant:codigo}')->middleware('auth:sanctum')->group(function (): void {
    Route::get('compras', [PurchaseController::class, 'index']);
    Route::post('compras/start-checkout', [PurchaseController::class, 'startCheckout']);
    Route::get('compras/{compra}', [PurchaseController::class, 'show']);
    Route::patch('compras/{compra}/customer-data', [PurchaseController::class, 'updateCustomerData']);
    Route::post('compras/{compra}/payment-intent', [PurchaseController::class, 'paymentIntent']);
    Route::post('compras/{compra}/review', [PurchaseController::class, 'submitForReview']);
    Route::post('compras/{compra}/cancel', [PurchaseController::class, 'cancel']);
});
