<?php

/**
 * Workspace Module — Route Definitions
 *
 * Registers routes for Workspace provisioning (RC-016B).
 * Injected into the /app/admin group prefix within routes/admin.php.
 */

// Step 1: Create Workspace
$router->get('/workspaces/create', 'App\\Modules\\Workspace\\WorkspaceController@create');
$router->post('/workspaces/create', 'App\\Modules\\Workspace\\WorkspaceController@store', [
    'App\\Middleware\\CsrfMiddleware',
]);

// Step 1.5: Workspace Created Confirmation
$router->get('/workspaces/created', 'App\\Modules\\Workspace\\WorkspaceController@created');

// Step 2: Create Couple Account
$router->get('/workspaces/create-owner', 'App\\Modules\\Workspace\\WorkspaceController@assignOwner');
$router->post('/workspaces/create-owner', 'App\\Modules\\Workspace\\WorkspaceController@saveOwner', [
    'App\\Middleware\\CsrfMiddleware',
]);

// Step 3: Assign Crew (Optional)
$router->get('/workspaces/assign-crew', 'App\\Modules\\Workspace\\WorkspaceController@assignCrew');
$router->post('/workspaces/assign-crew', 'App\\Modules\\Workspace\\WorkspaceController@saveCrew', [
    'App\\Middleware\\CsrfMiddleware',
]);

// Step 4: Finish (Final review & transaction execution)
$router->get('/workspaces/finish', 'App\\Modules\\Workspace\\WorkspaceController@finish');
$router->post('/workspaces/finish', 'App\\Modules\\Workspace\\WorkspaceController@saveWorkspace', [
    'App\\Middleware\\CsrfMiddleware',
]);

// Success screen
$router->get('/workspaces/success', 'App\\Modules\\Workspace\\WorkspaceController@success');
