<?php

use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
});

Route::middleware('auth')->group(function () {
    Route::get('/dashboard', [\App\Http\Controllers\TaskController::class, 'index'])->name('dashboard');
    Route::get('/tasks', [\App\Http\Controllers\TaskController::class, 'index'])->name('tasks.index');
    Route::get('/calendar', [\App\Http\Controllers\TaskController::class, 'index'])->name('calendar');
    Route::patch('/tasks/reorder', [\App\Http\Controllers\TaskController::class, 'reorder'])->name('tasks.reorder');
    Route::resource('tasks', \App\Http\Controllers\TaskController::class)->except(['index']);
    
    Route::resource('projects', \App\Http\Controllers\ProjectController::class);
    Route::resource('workspaces', \App\Http\Controllers\WorkspaceController::class);
    
    Route::patch('/kanban-columns/reorder', [\App\Http\Controllers\KanbanColumnController::class, 'reorder'])->name('kanban-columns.reorder');
    Route::resource('kanban-columns', \App\Http\Controllers\KanbanColumnController::class);

    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});

require __DIR__.'/auth.php';
