<?php

/**
 * Guest Module — Route Definitions
 *
 * Registers routes for Guest List Management, manual CRUD, and Excel Import validation.
 * Loaded within routes/couple.php.
 *
 * @package Inveetaire
 * @ref     RC-012
 */

// ── Guest List Workspace ─────────────────────────────────────────────────────
$router->get('/guests', 'App\\Modules\\Guest\\GuestController@index');
$router->get('/guests/qr/{id}', 'App\\Modules\\Guest\\GuestController@downloadQr');

// ── Manual CRUD ─────────────────────────────────────────────────────────────
$router->get('/guests/create', 'App\\Modules\\Guest\\GuestController@create');
$router->post('/guests/create', 'App\\Modules\\Guest\\GuestController@store', [
    'App\\Middleware\\CsrfMiddleware'
]);

$router->get('/guests/edit/{id}', 'App\\Modules\\Guest\\GuestController@edit');
$router->post('/guests/edit/{id}', 'App\\Modules\\Guest\\GuestController@update', [
    'App\\Middleware\\CsrfMiddleware'
]);

$router->post('/guests/delete/{id}', 'App\\Modules\\Guest\\GuestController@delete', [
    'App\\Middleware\\CsrfMiddleware'
]);

// ── Excel/CSV Bulk Import ─────────────────────────────────────────────────────
$router->get('/guests/import', 'App\\Modules\\Guest\\GuestController@showImport');
$router->post('/guests/import/preview', 'App\\Modules\\Guest\\GuestController@processImport', [
    'App\\Middleware\\CsrfMiddleware'
]);
$router->post('/guests/import/confirm', 'App\\Modules\\Guest\\GuestController@confirmImport', [
    'App\\Middleware\\CsrfMiddleware'
]);

// ── Excel Template Download ──────────────────────────────────────────────────
$router->get('/guests/template', 'App\\Modules\\Guest\\GuestController@downloadTemplate');
