<?php

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

Route::prefix('tenants/{tenant:codigo}')->middleware(['auth:sanctum', \App\Domains\Cart\Middleware\MergeGuestCartMiddleware::class])->group(function (): void {
    Route::apiResource('compras', PurchaseController::class)->only(['index', 'store', 'show']);
    Route::post('compras/{compra}/payment-intent', [PurchaseController::class, 'paymentIntent']);
    Route::post('compras/{compra}/complete', [PurchaseController::class, 'complete']);
});
