<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\ShoppingUserController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::post('login', [App\Http\Controllers\API\UserController::class, 'login']);
//Route::post('register', [App\Http\Controllers\API\UserController::class, 'register']);

//Route::post('login', [App\Http\Controllers\Api\APIController::class, 'login']);

//Route::get('/payment/status', [App\Http\Controllers\Api\PayoneController::class, 'paymentStatus'])->name('api.payment_status');
//Route::post('/payment/status', [App\Http\Controllers\Api\PayoneController::class, 'paymentStatus'])->name('api.payment_status');
//Route::post('login', [App\Http\Controllers\Api\AuthController::class, 'login']);

Route::group([
    'prefix' => 'auth'
], function () {
    Route::post('login', [AuthController::class, 'login']);
    //Route::post('signup', [AuthController::class, 'signup']);
    Route::get('test', [AuthController::class, 'test']);
   
   Route::group([
        'middleware' => 'auth:api'
    ], function() {
        Route::post('logout', [AuthController::class, 'logout']);
        Route::post('checked', [AuthController::class, 'checked']);
    });
});

Route::group([
    'prefix' => 'wp'
], function () {
    Route::group([
        'middleware' => 'auth:api'
    ], function() {
        Route::post('show', [ShoppingUserController::class, 'show']);
        Route::post('store', [ShoppingUserController::class, 'store']);
        Route::post('update', [ShoppingUserController::class, 'update']);
        Route::post('order', [ShoppingUserController::class, 'order']);
        Route::post('status', [ShoppingUserController::class, 'status']);
        Route::post('delete', [ShoppingUserController::class, 'delete']);
        Route::post('cancel', [ShoppingUserController::class, 'cancel']);
        Route::post('open', [ShoppingUserController::class, 'open']);
    });
});