<?php

declare(strict_types=1);

use App\Controllers\HomeController;
use App\Controllers\AuthController;
use App\Controllers\DashboardController;
use App\Controllers\AdminUserController;
use App\Controllers\PublicCourseController;
use App\Controllers\CourseManageController;
use App\Controllers\AdminCourseController;
use App\Controllers\CourseContentController;
use App\Controllers\LearningController;
use App\Controllers\PaymentController;
use App\Controllers\AdminPaymentController;
use App\Controllers\FinanceController;
use App\Controllers\CertificateController;
use App\Controllers\ReviewController;
use App\Controllers\CommunicationController;
use App\Controllers\PromotionController;
use App\Controllers\AssessmentController;
use App\Controllers\CartController;
use App\Controllers\AdminSettingsController;
use App\Controllers\AdminReportController;
use App\Controllers\SupportController;

$router = app()->router();

$router->get('/', [HomeController::class, 'index']);
$router->get('/health', [HomeController::class, 'health']);
$router->get('/courses', [PublicCourseController::class, 'index']);
$router->get('/courses/show', [PublicCourseController::class, 'show']);
$router->post('/courses/enroll', [LearningController::class, 'enroll']);
$router->get('/cart', [CartController::class, 'index']);
$router->post('/cart/add', [CartController::class, 'add']);
$router->post('/cart/remove', [CartController::class, 'remove']);
$router->post('/cart/update', [CartController::class, 'update']);
$router->post('/cart/clear', [CartController::class, 'clear']);
$router->post('/cart/checkout', [CartController::class, 'checkout']);

$router->get('/register', [AuthController::class, 'register']);
$router->post('/register', [AuthController::class, 'store']);
$router->get('/login', [AuthController::class, 'login']);
$router->post('/login', [AuthController::class, 'authenticate']);
$router->post('/logout', [AuthController::class, 'logout']);
$router->get('/forgot-password', [AuthController::class, 'forgotPassword']);
$router->post('/forgot-password', [AuthController::class, 'sendReset']);
$router->get('/reset-password', [AuthController::class, 'resetPassword']);
$router->post('/reset-password', [AuthController::class, 'updatePassword']);

$router->get('/dashboard', [DashboardController::class, 'index']);
$router->get('/profile', [DashboardController::class, 'profile']);
$router->post('/profile', [DashboardController::class, 'updateProfile']);
$router->get('/student/courses', [LearningController::class, 'myCourses']);
$router->get('/learn/course', [LearningController::class, 'course']);
$router->get('/learn/lesson', [LearningController::class, 'lesson']);
$router->post('/learn/complete', [LearningController::class, 'complete']);
$router->post('/learn/progress', [LearningController::class, 'progress']);
$router->get('/learn/quiz', [AssessmentController::class, 'take']);
$router->post('/learn/quiz/submit', [AssessmentController::class, 'submit']);
$router->post('/checkout', [PaymentController::class, 'checkout']);
$router->get('/payments', [PaymentController::class, 'history']);
$router->get('/payments/show', [PaymentController::class, 'show']);
$router->post('/payments/proof', [PaymentController::class, 'uploadProof']);
$router->get('/invoices', [FinanceController::class, 'studentInvoices']);
$router->get('/invoices/show', [FinanceController::class, 'invoice']);
$router->get('/earnings', [FinanceController::class, 'earnings']);
$router->post('/withdrawals/request', [FinanceController::class, 'requestWithdrawal']);
$router->get('/certificates', [CertificateController::class, 'studentCertificates']);
$router->post('/certificates/issue', [CertificateController::class, 'issue']);
$router->get('/certificates/show', [CertificateController::class, 'show']);
$router->get('/certificates/pdf', [CertificateController::class, 'pdf']);
$router->get('/certificates/validate', [CertificateController::class, 'validate']);
$router->post('/reviews/store', [ReviewController::class, 'store']);
$router->post('/communication/questions/ask', [CommunicationController::class, 'ask']);
$router->get('/communication/questions', [CommunicationController::class, 'questions']);
$router->post('/communication/questions/answer', [CommunicationController::class, 'answer']);
$router->get('/notifications', [CommunicationController::class, 'notifications']);
$router->post('/notifications/read', [CommunicationController::class, 'markNotificationRead']);
$router->post('/notifications/read-all', [CommunicationController::class, 'markAllRead']);
$router->get('/support', [SupportController::class, 'index']);
$router->get('/support/create', [SupportController::class, 'create']);
$router->post('/support/store', [SupportController::class, 'store']);
$router->get('/support/show', [SupportController::class, 'show']);
$router->post('/support/reply', [SupportController::class, 'reply']);
$router->get('/support/attachment', [SupportController::class, 'attachment']);

$router->get('/manage/courses', [CourseManageController::class, 'index']);
$router->get('/manage/courses/create', [CourseManageController::class, 'create']);
$router->post('/manage/courses/store', [CourseManageController::class, 'store']);
$router->get('/manage/courses/edit', [CourseManageController::class, 'edit']);
$router->post('/manage/courses/update', [CourseManageController::class, 'update']);
$router->post('/manage/courses/submit', [CourseManageController::class, 'submit']);
$router->get('/manage/courses/assessment', [AssessmentController::class, 'manage']);
$router->post('/manage/courses/assessment/questions/store', [AssessmentController::class, 'storeQuestion']);
$router->post('/manage/courses/assessment/questions/delete', [AssessmentController::class, 'deleteQuestion']);
$router->get('/manage/courses/content', [CourseContentController::class, 'index']);
$router->post('/manage/courses/content/sections/store', [CourseContentController::class, 'storeSection']);
$router->post('/manage/courses/content/sections/update', [CourseContentController::class, 'updateSection']);
$router->post('/manage/courses/content/sections/delete', [CourseContentController::class, 'deleteSection']);
$router->post('/manage/courses/content/sections/move', [CourseContentController::class, 'moveSection']);
$router->post('/manage/courses/content/lessons/store', [CourseContentController::class, 'storeLesson']);
$router->post('/manage/courses/content/lessons/update', [CourseContentController::class, 'updateLesson']);
$router->post('/manage/courses/content/lessons/delete', [CourseContentController::class, 'deleteLesson']);
$router->post('/manage/courses/content/lessons/move', [CourseContentController::class, 'moveLesson']);
$router->get('/learn/preview', [CourseContentController::class, 'preview']);
$router->get('/secure/video', [CourseContentController::class, 'video']);
$router->get('/secure/lesson-file', [CourseContentController::class, 'lessonFile']);
$router->get('/secure/material', [CourseContentController::class, 'material']);

$router->get('/admin/users', [AdminUserController::class, 'index']);
$router->get('/admin/users/show', [AdminUserController::class, 'show']);
$router->post('/admin/users/approve', [AdminUserController::class, 'approve']);
$router->post('/admin/users/reject', [AdminUserController::class, 'reject']);
$router->post('/admin/users/suspend', [AdminUserController::class, 'suspend']);
$router->post('/admin/users/activate', [AdminUserController::class, 'activate']);

$router->get('/admin/courses', [AdminCourseController::class, 'index']);
$router->post('/admin/courses/approve', [AdminCourseController::class, 'approve']);
$router->post('/admin/courses/reject', [AdminCourseController::class, 'reject']);
$router->post('/admin/courses/suspend', [AdminCourseController::class, 'suspend']);
$router->get('/admin/categories', [AdminCourseController::class, 'categories']);
$router->post('/admin/categories/store', [AdminCourseController::class, 'storeCategory']);
$router->get('/admin/payments', [AdminPaymentController::class, 'index']);
$router->post('/admin/payments/approve', [AdminPaymentController::class, 'approve']);
$router->post('/admin/payments/reject', [AdminPaymentController::class, 'reject']);
$router->get('/admin/payments/proof', [AdminPaymentController::class, 'proof']);
$router->get('/admin/invoices', [FinanceController::class, 'adminInvoices']);
$router->get('/admin/commissions', [FinanceController::class, 'adminCommissions']);
$router->get('/admin/withdrawals', [FinanceController::class, 'adminWithdrawals']);
$router->post('/admin/withdrawals/status', [FinanceController::class, 'updateWithdrawal']);
$router->get('/admin/certificates', [CertificateController::class, 'adminCertificates']);
$router->post('/admin/certificates/reissue', [CertificateController::class, 'reissue']);
$router->get('/admin/reviews', [ReviewController::class, 'adminIndex']);
$router->post('/admin/reviews/hide', [ReviewController::class, 'hide']);
$router->post('/admin/reviews/activate', [ReviewController::class, 'activate']);
$router->get('/admin/promotions', [PromotionController::class, 'index']);
$router->post('/admin/promotions/coupons/store', [PromotionController::class, 'storeCoupon']);
$router->post('/admin/promotions/campaigns/store', [PromotionController::class, 'storeCampaign']);
$router->post('/admin/promotions/affiliates/store', [PromotionController::class, 'storeAffiliate']);
$router->get('/admin/reports', [AdminReportController::class, 'index']);
$router->get('/admin/reports/export', [AdminReportController::class, 'export']);
$router->get('/admin/support', [SupportController::class, 'index']);
$router->get('/admin/support/show', [SupportController::class, 'show']);
$router->post('/admin/support/reply', [SupportController::class, 'reply']);
$router->post('/admin/support/status', [SupportController::class, 'status']);
$router->get('/admin/settings/payments', [AdminSettingsController::class, 'payments']);
$router->post('/admin/settings/payments', [AdminSettingsController::class, 'updatePayments']);
