<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\RequestController;
use App\Http\Controllers\UserAuthController;
use App\Http\Controllers\MarkListController;
use App\Http\Controllers\User\UserOrderController;
use App\Http\Controllers\User\UserProfileController;


//user send request
Route::post('/signup-request', [RequestController::class, 'usersignup']);

//login / logout
Route::post('/user/login', [UserAuthController::class, 'login']);


Route::middleware(['auth:api'])->group(function () {

    Route::post('/user/logout', [UserAuthController::class, 'logout']);

    // Marklist
    Route::get('/show-mark-list', [MarkListController::class, 'showmarklist']);
    Route::post('/add-mark-no', [MarkListController::class, 'addmarkno']);

    // Orders
    Route::get('/user/order-summary', [UserOrderController::class, 'orderSummary']);
    Route::get('/user/orders', [UserOrderController::class, 'allOrders']);
    Route::get('/user/order/{order_id}/details', [UserOrderController::class, 'orderDetails']);
    Route::get('/user/order/{order_id}/shipment', [UserOrderController::class, 'orderShipment']);
    Route::get('/user/order/{order_id}/invoice', [UserOrderController::class, 'orderInvoice']);
    Route::get('/user/order/{order_id}/track', [UserOrderController::class, 'trackOrder']);
    Route::get('/user/invoice/{invoice_id}/details', [UserOrderController::class, 'invoiceDetails']);

    // Invoice List
    Route::get('/user/invoices', [UserOrderController::class, 'allInvoices']);
    Route::get('/user/invoice/{invoice_id}/installments', [UserOrderController::class, 'invoiceInstallmentsById']);

    // Profile
    Route::get('/user/profile', [UserProfileController::class, 'profile']);
    Route::post('/user/profile/update', [UserProfileController::class, 'updateProfile']);
});
