<?php

/**
 * Invitation Module — Route Definitions
 *
 * Registers routes for Invitation editing and previewing.
 * Injected into the /app/couple group prefix within routes/couple.php.
 *
 * GET  /app/couple/invitation/edit    -> InvitationController@edit (Form)
 * POST /app/couple/invitation/edit    -> InvitationController@update (Validate/Save)
 * GET  /app/couple/invitation/preview -> InvitationController@preview (Theme Preview)
 *
 * Available variable: $router (App\Core\Router instance)
 *
 * @package Inveetaire
 * @ref     PILOT-001
 */

// ── GET /app/couple/invitation/edit — Show configuration form ────────────────
$router->get('/invitation/edit', 'App\\Modules\\Invitation\\InvitationController@edit');

// ── POST /app/couple/invitation/edit — Save changes ──────────────────────────
$router->post('/invitation/edit', 'App\\Modules\\Invitation\\InvitationController@update', [
    'App\\Middleware\\CsrfMiddleware',
]);

// ── GET /app/couple/invitation/preview — Preview Shell (device simulator) ────
$router->get('/invitation/preview', 'App\\Modules\\Invitation\\InvitationController@preview');

// ── GET /app/couple/invitation/design — Theme design page ────────────────────
$router->get('/invitation/design', 'App\\Modules\\Invitation\\InvitationController@design');

// ─▶ Wedding Gift Routes ────────────────────
$router->get('/invitation/gift', 'App\\Modules\\Invitation\\GiftController@index');
$router->post('/invitation/gift', 'App\\Modules\\Invitation\\GiftController@updateSettings', ['App\\Middleware\\CsrfMiddleware']);
$router->post('/invitation/gift/account', 'App\\Modules\\Invitation\\GiftController@saveAccount', ['App\\Middleware\\CsrfMiddleware']);
$router->post('/invitation/gift/account/delete', 'App\\Modules\\Invitation\\GiftController@deleteAccount', ['App\\Middleware\\CsrfMiddleware']);

// ── Media Engine routes (G004) ────────────────────────────────────────────────
require ROOT_PATH . '/app/modules/Media/routes.php';
