
<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\Auth\AuthController;
use App\Http\Controllers\DocsController;
use App\Http\Controllers\Api\UserController;
use App\Http\Controllers\Api\Administrator\AdministratorEnrollmentController;
use App\Http\Controllers\Api\Administrator\AdministratorAbsenceController;
use App\Http\Controllers\Api\Administrator\AdministratorDashboardController;
use App\Http\Controllers\Api\Administrator\AdministratorNotificationController;
use App\Http\Controllers\Api\Administrator\AdministratorTeacherSubmissionController;
use App\Http\Controllers\Api\Badges\BadgeController;
use App\Http\Controllers\Api\Students\StudentController;
use App\Http\Controllers\Api\Attendance\AttendanceController;
use App\Http\Controllers\Api\Finance\InvoiceController;
use App\Http\Controllers\Api\Assignment\AssignmentApiController;
use App\Http\Controllers\Api\Parents\AuthorizedUsersController;
use App\Http\Controllers\Api\AttendanceTracking\AttendanceTrackingController;
use App\Http\Controllers\Api\Email\BroadcastEmailController;
use App\Http\Controllers\Api\Settings\ConfigurationController;
use App\Http\Controllers\Api\Staff\ContactController;
use App\Http\Controllers\Api\ClassPreparation\ClassPreparationController;
use App\Http\Controllers\Api\ClassPrep\ClassPrepController;
use App\Http\Controllers\Api\Email\EmailController;
use App\Http\Controllers\Api\Email\EmailExtractorController;
use App\Http\Controllers\Api\Communication\CommunicationController;
use App\Http\Controllers\Api\CompetitionScores\CompetitionScoresController;
use App\Http\Controllers\Api\Discounts\DiscountController;
use App\Http\Controllers\Api\Expenses\ExpenseController;
use App\Http\Controllers\Api\ExtraCharges\ExtraChargesController;
use App\Http\Controllers\Api\Parents\EmergencyContactController;
use App\Http\Controllers\Api\Settings\EventController;
use App\Http\Controllers\Api\Family\FamilyAdminController;
use App\Http\Controllers\Api\Family\FamilyController;
use App\Http\Controllers\Api\Reports\FilesController;
use App\Http\Controllers\Api\Scores\FinalController;
use App\Http\Controllers\Api\Finance\FinancialController;
use App\Http\Controllers\Api\System\FlagController;
use App\Http\Controllers\Api\Scores\GradingController;
use App\Http\Controllers\Api\System\HealthController;
use App\Http\Controllers\Api\System\SemesterRangeController;
use App\Http\Controllers\Api\Scores\HomeworkController;
use App\Http\Controllers\Api\Frontend\InfoIconController;
use App\Http\Controllers\Api\Inventory\InventoryController;
use App\Http\Controllers\Api\Auth\IpBanController;
use App\Http\Controllers\Api\Frontend\LandingPageController;
use App\Http\Controllers\Api\Attendance\LateSlipLogsController;
use App\Http\Controllers\Api\Messaging\MessagesController;
use App\Http\Controllers\Api\Incidents\IncidentController as IncidentApiController;
use App\Http\Controllers\Api\Scores\MidtermController;
use App\Http\Controllers\Api\System\NavBuilderController;
use App\Http\Controllers\Api\Notifications\NotificationManagementController;
use App\Http\Controllers\Api\Frontend\PageController;
use App\Http\Controllers\Api\Scores\ParticipationController;
use App\Http\Controllers\Api\Settings\PolicyController;
use App\Http\Controllers\Api\Reports\PrintablesReportsController;
use App\Http\Controllers\Api\Scores\ProjectController;
use App\Http\Controllers\Api\Scores\QuizController;
use App\Http\Controllers\Api\Finance\PaymentController;
use App\Http\Controllers\Api\Finance\PaymentNotificationController;
use App\Http\Controllers\Api\Finance\PaymentTransactionController;
use App\Http\Controllers\Api\Finance\PaypalTransactionsController;
use App\Http\Controllers\Api\Finance\PurchaseOrderController;
use App\Http\Controllers\Api\Finance\ReimbursementController;
use App\Http\Controllers\Api\Finance\FeeCalculationController;
use App\Http\Controllers\Api\Finance\PaymentEventChargesController;
use App\Http\Controllers\Api\Finance\PaymentManualController;
use App\Http\Controllers\Api\Finance\PaypalPaymentController;
use App\Http\Controllers\Api\Auth\RegisterController;
use App\Http\Controllers\Api\RolePermissionController;
use App\Http\Controllers\Api\RoleSwitcherController;
use App\Http\Controllers\Api\Settings\SchoolCalendarController;
use App\Http\Controllers\Api\Scores\ScoreCommentController;
use App\Http\Controllers\Api\Scores\ScoreController;
use App\Http\Controllers\Api\Scores\ScorePredictorController;
use App\Http\Controllers\Api\Auth\SessionTimeoutController;
use App\Http\Controllers\Api\Reports\SlipPrinterController;
use App\Http\Controllers\Api\Staff\StaffController;
use App\Http\Controllers\Api\Inventory\SupplierController;
use App\Http\Controllers\Api\Staff\TeacherController;
use App\Http\Controllers\Api\StatsController;
use App\Http\Controllers\Api\Frontend\UiController;
use App\Http\Controllers\Api\Scores\ProjectController as ProjectScoreController;
use App\Http\Controllers\Api\Scores\MidtermController as MidtermScoreController;
use App\Http\Controllers\Api\Scores\FinalController as FinalScoreController;
use App\Http\Controllers\Api\Scores\QuizController as QuizScoreController;
use App\Http\Controllers\Api\Scores\HomeworkController as HomeworkScoreController;
use App\Http\Controllers\Api\Scores\ParticipationController as ParticipationScoreController;
use App\Http\Controllers\Api\Scores\ScoreController as ScoreDashboardController;
use App\Http\Controllers\Api\Grading\GradingController as GradingApiController;
use App\Http\Controllers\Api\Grading\HomeworkTrackingController;
use App\Http\Controllers\Api\Scores\ScoreCommentController as ScoreCommentApiController;
use App\Http\Controllers\Api\Messaging\WhatsappController;

use App\Http\Controllers\Api\Attendance\AdminAttendanceApiController;
use App\Http\Controllers\Api\Attendance\AttendanceCommentTemplateController;
use App\Http\Controllers\Api\Attendance\TeacherAttendanceApiController;
use App\Http\Controllers\Api\Attendance\StaffAttendanceApiController;

Route::prefix('v1')->group(function () {
    Route::prefix('auth')->group(function () {
        Route::get('register/captcha', [RegisterController::class, 'captcha']);
        Route::post('register', [RegisterController::class, 'store']);
    });

    Route::middleware('auth:sanctum')->prefix('administrator')->group(function () {
        Route::get('absence', [AdministratorAbsenceController::class, 'index']);
        Route::post('absence', [AdministratorAbsenceController::class, 'store']);

        Route::get('dashboard/metrics', [AdministratorDashboardController::class, 'metrics']);
        Route::get('dashboard/user-search', [AdministratorDashboardController::class, 'userSearch']);

        Route::get('teacher-submissions', [AdministratorTeacherSubmissionController::class, 'index']);
        Route::post('teacher-submissions/notify', [AdministratorTeacherSubmissionController::class, 'notify']);

        Route::get('notifications/alerts', [AdministratorNotificationController::class, 'alerts']);
        Route::post('notifications/alerts', [AdministratorNotificationController::class, 'saveAlerts']);
        Route::get('notifications/print-recipients', [AdministratorNotificationController::class, 'printRecipients']);
        Route::post('notifications/print-recipients', [AdministratorNotificationController::class, 'savePrintRecipients']);

        Route::get('enrollment-withdrawal', [AdministratorEnrollmentController::class, 'index']);
        Route::get('enrollment-withdrawal/new-students', [AdministratorEnrollmentController::class, 'newStudents']);
        Route::post('enrollment-withdrawal/update-statuses', [AdministratorEnrollmentController::class, 'updateStatuses']);
    });

    Route::middleware('auth:sanctum')->prefix('attendance')->group(function () {
        // Teacher
        Route::get('/teacher/grid', [TeacherAttendanceApiController::class, 'grid']);
        Route::get('/teacher/form', [TeacherAttendanceApiController::class, 'form']);
        Route::post('/teacher/submit', [TeacherAttendanceApiController::class, 'submit']);

        // Admin daily/student attendance
        Route::get('/admin/daily', [AdminAttendanceApiController::class, 'dailyData']);
        Route::post('/admin/update', [AdminAttendanceApiController::class, 'updateManagement']);
        Route::post('/admin/add-entry', [AdminAttendanceApiController::class, 'addEntry']);

        // Staff/admin monthly/admin attendance
        Route::get('/staff/month', [StaffAttendanceApiController::class, 'monthData']);
        Route::get('/staff/admins', [StaffAttendanceApiController::class, 'admins']);
        Route::post('/staff/admins/save', [StaffAttendanceApiController::class, 'saveAdmins']);
        Route::post('/staff/cell', [StaffAttendanceApiController::class, 'saveCell']);
        Route::get('/staff/month-csv', [StaffAttendanceApiController::class, 'monthCsv']);
    });

    Route::prefix('attendance-tracking')->group(function () {
        Route::get('/pending-violations', [AttendanceTrackingController::class, 'pendingViolations']);
        Route::get('/notified-violations', [AttendanceTrackingController::class, 'notifiedViolations']);
        Route::get('/student-case/{studentId}', [AttendanceTrackingController::class, 'studentCase']);
        Route::post('/record', [AttendanceTrackingController::class, 'record']);
        Route::post('/send-auto-emails', [AttendanceTrackingController::class, 'sendAutoEmails']);
        Route::get('/compose', [AttendanceTrackingController::class, 'compose']);
        Route::post('/send-manual-email', [AttendanceTrackingController::class, 'sendManualEmail']);
        Route::get('/parents-info', [AttendanceTrackingController::class, 'parentsInfo']);
        Route::post('/save-notification-note', [AttendanceTrackingController::class, 'saveNotificationNote']);
    });

    Route::prefix('assignments')->group(function () {
        Route::get('/', [AssignmentApiController::class, 'index']);
        Route::post('/', [AssignmentApiController::class, 'store']);
        Route::get('/class-assignment-data', [AssignmentApiController::class, 'classAssignmentData']);
    });

    Route::middleware('auth:sanctum')->group(function () {
        Route::get('stats', [StatsController::class, 'index']);

        Route::prefix('users')->group(function () {
            Route::get('/', [UserController::class, 'index']);
            Route::post('/', [UserController::class, 'store']);
            Route::get('login-activity', [UserController::class, 'loginActivity']);
            Route::put('{userId}', [UserController::class, 'update']);
            Route::delete('{userId}', [UserController::class, 'destroy']);
        });

        Route::prefix('broadcast-email')->group(function () {
            Route::get('options', [BroadcastEmailController::class, 'options']);
            Route::post('send', [BroadcastEmailController::class, 'send']);
            Route::post('upload-image', [BroadcastEmailController::class, 'uploadImage']);
        });

        Route::prefix('email')->group(function () {
            Route::get('senders', [EmailController::class, 'senders']);
            Route::post('send', [EmailController::class, 'send']);
        });

        Route::prefix('email-extractor')->group(function () {
            Route::get('emails', [EmailExtractorController::class, 'emails']);
            Route::post('compare', [EmailExtractorController::class, 'compare']);
        });

        Route::prefix('communications')->group(function () {
            Route::get('options', [CommunicationController::class, 'options']);
            Route::get('students/{studentId}/families', [CommunicationController::class, 'families']);
            Route::get('families/{familyId}/guardians', [CommunicationController::class, 'guardians']);
            Route::post('preview', [CommunicationController::class, 'preview']);
            Route::post('send', [CommunicationController::class, 'send']);
        });

        Route::prefix('competition-scores')->group(function () {
            Route::get('/', [CompetitionScoresController::class, 'index']);
            Route::get('{id}', [CompetitionScoresController::class, 'edit']);
            Route::post('{id}', [CompetitionScoresController::class, 'save']);
        });

        Route::prefix('discounts')->group(function () {
            Route::get('options', [DiscountController::class, 'options']);
            Route::post('apply', [DiscountController::class, 'apply']);
            Route::get('vouchers', [DiscountController::class, 'listVouchers']);
            Route::get('vouchers/{id}', [DiscountController::class, 'showVoucher']);
            Route::post('vouchers', [DiscountController::class, 'storeVoucher']);
            Route::put('vouchers/{id}', [DiscountController::class, 'updateVoucher']);
            Route::delete('vouchers/{id}', [DiscountController::class, 'deleteVoucher']);
        });

        Route::prefix('expenses')->group(function () {
            Route::get('/', [ExpenseController::class, 'index']);
            Route::get('options', [ExpenseController::class, 'options']);
            Route::get('{id}', [ExpenseController::class, 'show']);
            Route::post('/', [ExpenseController::class, 'store']);
            Route::put('{id}', [ExpenseController::class, 'update']);
            Route::post('{id}/status', [ExpenseController::class, 'updateStatus']);
        });

        Route::prefix('finance')->group(function () {
            Route::get('financial-report', [FinancialController::class, 'report']);
            Route::get('financial-summary', [FinancialController::class, 'summary']);
            Route::get('financial-report/csv', [FinancialController::class, 'downloadCsv']);
            Route::get('financial-report/pdf', [FinancialController::class, 'downloadPdf']);
            Route::get('unpaid-parents', [FinancialController::class, 'unpaidParents']);
            Route::post('fees/refund', [FeeCalculationController::class, 'refund']);
            Route::post('fees/tuition-total', [FeeCalculationController::class, 'tuitionTotal']);

            Route::prefix('reimbursements')->group(function () {
                Route::get('under-processing', [ReimbursementController::class, 'underProcessing']);
                Route::post('mark-donation', [ReimbursementController::class, 'markDonation']);
                Route::post('batches', [ReimbursementController::class, 'createBatch']);
                Route::post('batches/assign', [ReimbursementController::class, 'updateBatchAssignment']);
                Route::post('batches/lock', [ReimbursementController::class, 'lockBatch']);
                Route::post('batches/admin-files', [ReimbursementController::class, 'uploadBatchAdminFile']);
                Route::get('batches/admin-files/{name}/{mode?}', [ReimbursementController::class, 'serveAdminCheckFile']);
                Route::post('batches/email', [ReimbursementController::class, 'sendBatchEmail']);
                Route::get('export', [ReimbursementController::class, 'export']);
                Route::get('batches/export', [ReimbursementController::class, 'exportBatch']);
                Route::get('reimbursed-expenses', [ReimbursementController::class, 'reimbursedExpenses']);
                Route::get('/', [ReimbursementController::class, 'index']);
                Route::post('/', [ReimbursementController::class, 'store']);
                Route::post('process', [ReimbursementController::class, 'process']);
                Route::put('{id}', [ReimbursementController::class, 'update']);
            });

            Route::prefix('purchase-orders')->group(function () {
                Route::get('/', [PurchaseOrderController::class, 'index']);
                Route::get('options', [PurchaseOrderController::class, 'options']);
                Route::get('{id}', [PurchaseOrderController::class, 'show']);
                Route::post('/', [PurchaseOrderController::class, 'store']);
                Route::post('{id}/receive', [PurchaseOrderController::class, 'receive']);
                Route::post('{id}/cancel', [PurchaseOrderController::class, 'cancel']);
            });

            Route::prefix('invoices')->group(function () {
                Route::get('management', [InvoiceController::class, 'management']);
                Route::post('generate', [InvoiceController::class, 'generate']);
                Route::get('parent/{parentId}', [InvoiceController::class, 'byParent']);
                Route::get('parent-payment', [InvoiceController::class, 'parentPayment']);
                Route::post('{invoiceId}/status', [InvoiceController::class, 'updateStatus']);
                Route::get('unpaid', [InvoiceController::class, 'unpaid']);
                Route::get('{invoiceId}/pdf', [InvoiceController::class, 'pdf']);
            });

            Route::prefix('payments')->group(function () {
                Route::post('/', [PaymentController::class, 'store']);
                Route::get('parent/{parentId}', [PaymentController::class, 'byParent']);
                Route::post('{paymentId}/balance', [PaymentController::class, 'updateBalance']);
            });

            Route::prefix('manual-pay')->group(function () {
                Route::get('search', [PaymentManualController::class, 'search']);
                Route::get('suggest', [PaymentManualController::class, 'suggest']);
                Route::post('invoices/{invoiceId}/payments', [PaymentManualController::class, 'record']);
                Route::put('payments/{paymentId}', [PaymentManualController::class, 'edit']);
                Route::get('files/{filename}', [PaymentManualController::class, 'file']);
            });

            Route::prefix('event-charges')->group(function () {
                Route::get('/', [PaymentEventChargesController::class, 'index']);
                Route::post('/', [PaymentEventChargesController::class, 'store']);
                Route::get('parents/{parentId}/students', [PaymentEventChargesController::class, 'enrolledStudents']);
            });

            Route::prefix('payment-notifications')->group(function () {
                Route::get('/', [PaymentNotificationController::class, 'index']);
                Route::post('send', [PaymentNotificationController::class, 'send']);
            });

            Route::prefix('payment-transactions')->group(function () {
                Route::post('/', [PaymentTransactionController::class, 'store']);
                Route::get('payment/{paymentId}', [PaymentTransactionController::class, 'byPayment']);
                Route::post('{transactionId}/status', [PaymentTransactionController::class, 'updateStatus']);
            });

            Route::prefix('paypal-transactions')->group(function () {
                Route::get('/', [PaypalTransactionsController::class, 'index']);
                Route::get('csv', [PaypalTransactionsController::class, 'downloadCsv']);
            });

            Route::prefix('paypal')->group(function () {
                Route::get('redirect', [PaypalPaymentController::class, 'redirect']);
                Route::post('payments/{paymentId}/create', [PaypalPaymentController::class, 'create']);
                Route::post('execute', [PaypalPaymentController::class, 'execute']);
                Route::get('cancel', [PaypalPaymentController::class, 'cancel']);
            });
        });

        Route::prefix('files')->group(function () {
            Route::get('receipts/{name}', [FilesController::class, 'receipt']);
            Route::get('reimbursements/{name}', [FilesController::class, 'reimb']);
            Route::get('early-dismissal/{name}', [FilesController::class, 'earlyDismissalSignature']);
            Route::get('exams/teacher/{name}', [FilesController::class, 'examDraftTeacher']);
            Route::get('exams/final/{name}', [FilesController::class, 'examDraftFinal']);
        });

        Route::prefix('system')->group(function () {
            Route::get('semester-range/school-year', [SemesterRangeController::class, 'schoolYearRange']);
            Route::get('semester-range/semester', [SemesterRangeController::class, 'semesterRange']);
            Route::get('semester-range/normalize', [SemesterRangeController::class, 'normalize']);
            Route::get('semester-range/resolve', [SemesterRangeController::class, 'resolve']);
        });

        Route::prefix('incidents')->group(function () {
            Route::get('current', [IncidentApiController::class, 'current']);
            Route::get('history', [IncidentApiController::class, 'history']);
            Route::get('processed', [IncidentApiController::class, 'processed']);
            Route::get('analysis', [IncidentApiController::class, 'analysis']);
            Route::get('grades/{gradeId}/students', [IncidentApiController::class, 'studentsByGrade']);
            Route::post('/', [IncidentApiController::class, 'store']);
            Route::post('{incidentId}/state', [IncidentApiController::class, 'updateState']);
            Route::post('{incidentId}/close', [IncidentApiController::class, 'close']);
            Route::post('{incidentId}/cancel', [IncidentApiController::class, 'cancel']);
        });

        Route::prefix('scores')->group(function () {
            Route::get('overview', [ScoreDashboardController::class, 'overview']);
            Route::post('lock', [ScoreDashboardController::class, 'lock']);
            Route::get('student-scores', [ScoreDashboardController::class, 'studentScores']);

            Route::prefix('projects')->group(function () {
                Route::get('/', [ProjectScoreController::class, 'index']);
                Route::post('/', [ProjectScoreController::class, 'update']);
                Route::post('columns', [ProjectScoreController::class, 'addColumn']);
            });

            Route::prefix('quizzes')->group(function () {
                Route::get('/', [QuizScoreController::class, 'index']);
                Route::post('/', [QuizScoreController::class, 'update']);
                Route::post('columns', [QuizScoreController::class, 'addColumn']);
            });

            Route::prefix('homework')->group(function () {
                Route::get('/', [HomeworkScoreController::class, 'index']);
                Route::post('/', [HomeworkScoreController::class, 'update']);
                Route::post('columns', [HomeworkScoreController::class, 'addColumn']);
            });

            Route::prefix('midterm')->group(function () {
                Route::get('/', [MidtermScoreController::class, 'index']);
                Route::post('/', [MidtermScoreController::class, 'update']);
            });

            Route::prefix('final')->group(function () {
                Route::get('/', [FinalScoreController::class, 'index']);
                Route::post('/', [FinalScoreController::class, 'update']);
            });

            Route::prefix('participation')->group(function () {
                Route::get('/', [ParticipationScoreController::class, 'index']);
                Route::post('/', [ParticipationScoreController::class, 'update']);
            });

            Route::get('predictor', [ScorePredictorController::class, 'index']);

            Route::prefix('comments')->group(function () {
                Route::get('/', [ScoreCommentApiController::class, 'index']);
                Route::post('/', [ScoreCommentApiController::class, 'store']);
                Route::put('/', [ScoreCommentApiController::class, 'update']);
            });
        });

        Route::prefix('grading')->group(function () {
            Route::get('overview', [GradingApiController::class, 'overview']);
            Route::get('scores/{type}/{classSectionId}/{studentId}', [GradingApiController::class, 'show']);
            Route::put('scores', [GradingApiController::class, 'update']);

            Route::post('locks/toggle', [GradingApiController::class, 'toggleLock']);
            Route::post('locks/all', [GradingApiController::class, 'lockAll']);
            Route::post('refresh', [GradingApiController::class, 'refresh']);

            Route::get('placement', [GradingApiController::class, 'placement']);
            Route::post('placement/level', [GradingApiController::class, 'updatePlacementLevel']);
            Route::post('placement/levels', [GradingApiController::class, 'updatePlacementLevels']);
            Route::post('placement/batch', [GradingApiController::class, 'createPlacementBatch']);
            Route::get('placement/batch/{batchId}', [GradingApiController::class, 'showPlacementBatch']);
            Route::put('placement/batch/{batchId}', [GradingApiController::class, 'updatePlacementBatch']);

            Route::get('below-sixty', [GradingApiController::class, 'belowSixty']);
            Route::get('below-sixty/email', [GradingApiController::class, 'belowSixtyEmail']);
            Route::post('below-sixty/email', [GradingApiController::class, 'sendBelowSixtyEmail']);
            Route::post('below-sixty/status', [GradingApiController::class, 'updateBelowSixtyStatus']);
            Route::get('below-sixty/meeting', [GradingApiController::class, 'belowSixtyMeeting']);
            Route::post('below-sixty/meeting', [GradingApiController::class, 'saveBelowSixtyMeeting']);

            Route::get('homework-tracking', [HomeworkTrackingController::class, 'index']);
        });

        Route::prefix('extra-charges')->group(function () {
            Route::get('/', [ExtraChargesController::class, 'list']);
            Route::get('options', [ExtraChargesController::class, 'options']);
            Route::get('parents', [ExtraChargesController::class, 'parentOptions']);
            Route::get('invoices', [ExtraChargesController::class, 'invoicesForParent']);
            Route::post('/', [ExtraChargesController::class, 'store']);
            Route::put('{id}', [ExtraChargesController::class, 'update']);
            Route::post('{id}/void', [ExtraChargesController::class, 'void']);
            Route::post('{id}/reverse', [ExtraChargesController::class, 'reverse']);
        });

        Route::prefix('class-prep')->group(function () {
            Route::get('/', [ClassPreparationController::class, 'index']);
            Route::post('mark-printed', [ClassPreparationController::class, 'markPrinted']);
            Route::get('sticker-counts', [ClassPrepController::class, 'stickerCounts']);
            Route::get('classes/{classSectionId}/students', [ClassPrepController::class, 'studentsByClass']);
        });

        Route::prefix('badges')->group(function () {
            Route::get('form-data', [BadgeController::class, 'formData']);
            Route::post('pdf', [BadgeController::class, 'generatePdf']);
            Route::get('print-status', [BadgeController::class, 'printStatus']);
            Route::post('log-print', [BadgeController::class, 'logPrint']);
        });
    });
});

Route::prefix('attendance-comment-templates')->group(function () {
    Route::get('/', [AttendanceCommentTemplateController::class, 'index']);
    Route::get('list-data', [AttendanceCommentTemplateController::class, 'listData']);
    Route::get('{id}', [AttendanceCommentTemplateController::class, 'show']);
    Route::post('/', [AttendanceCommentTemplateController::class, 'store']);
    Route::put('{id}', [AttendanceCommentTemplateController::class, 'update']);
    Route::delete('{id}', [AttendanceCommentTemplateController::class, 'destroy']);
});

Route::prefix('attendance-tracking')->group(function () {
    Route::get('pending-violations', [AttendanceTrackingController::class, 'pendingViolations']);
    Route::get('notified-violations', [AttendanceTrackingController::class, 'notifiedViolations']);
    Route::get('student-case/{studentId}', [AttendanceTrackingController::class, 'studentCase']);
    Route::post('record', [AttendanceTrackingController::class, 'record']);
    Route::post('send-auto-emails', [AttendanceTrackingController::class, 'sendAutoEmails']);
    Route::get('compose', [AttendanceTrackingController::class, 'compose']);
    Route::post('send-manual-email', [AttendanceTrackingController::class, 'sendManualEmail']);
    Route::get('parents-info', [AttendanceTrackingController::class, 'parentsInfo']);
    Route::post('save-notification-note', [AttendanceTrackingController::class, 'saveNotificationNote']);
});

Route::middleware('auth:sanctum')->group(function () {
    Route::prefix('assignments')->group(function () {
        Route::get('/', [AssignmentApiController::class, 'index']);
        Route::post('/', [AssignmentApiController::class, 'store']);
        Route::get('class-assignment-data', [AssignmentApiController::class, 'classAssignmentData']);
    });

    Route::prefix('badges')->group(function () {
        Route::get('form-data', [BadgeController::class, 'formData']);
        Route::post('pdf', [BadgeController::class, 'generatePdf']);
        Route::get('print-status', [BadgeController::class, 'printStatus']);
        Route::post('log-print', [BadgeController::class, 'logPrint']);
    });

    Route::prefix('class-prep')->group(function () {
        Route::get('/', [ClassPreparationController::class, 'index']);
        Route::post('mark-printed', [ClassPreparationController::class, 'markPrinted']);
        Route::get('sticker-counts', [ClassPrepController::class, 'stickerCounts']);
        Route::get('classes/{classSectionId}/students', [ClassPrepController::class, 'studentsByClass']);
    });
});
