<?php

declare(strict_types=1);

switch ($path) {
    case '/search':
        SearchController::index();
        break;
    case '/search.json':
        SearchController::json();
        break;
    case '/accounting':
        AccountingController::dashboard();
        break;
    case '/accounting/export.csv':
        AccountingController::exportFilteredCsv();
        break;
    case '/accounting/edit':
        AccountingController::edit();
        break;
    case '/accounting/edit-by-reference':
        AccountingController::editByReference();
        break;
    case '/accounting/save':
        AccountingController::save();
        break;
    case '/accounting/update':
        AccountingController::update();
        break;
    case '/accounting/delete':
        AccountingController::delete();
        break;
    case '/accounting/document':
        AccountingController::document();
        break;
    case '/agenda':
        AgendaController::index();
        break;
    case '/agenda/save':
        AgendaController::save();
        break;
    case '/agenda/status':
        AgendaController::status();
        break;
    case '/agenda/export.ics':
        AgendaController::export();
        break;
    case '/':
        DashboardController::index();
        break;
    case '/animals':
        AnimalsController::index();
        break;
    case '/animals/archived':
        AnimalsController::inactiveList('archived');
        break;
    case '/animals/trash':
        AnimalsController::inactiveList('trash');
        break;
    case '/animal':
        AnimalsController::show();
        break;

    case '/animal/add-medical':
        AnimalsController::addMedical();
        break;
    case '/animal/prescription/save':
        MedicalDocumentsController::savePrescription();
        break;
    case '/animal/lab-report/save':
        MedicalDocumentsController::saveLabReport();
        break;
    case '/animal/medical-document':
        MedicalDocumentsController::download();
        break;
    case '/private-media':
        PrivateMediaService::send();
        break;

    case '/animal/medical-status':
        AnimalsController::updateMedicalStatus();
        break;

    case '/animal/add-treatment':
        AnimalsController::addTreatment();
        break;

    case '/animal/add-deworming':
        DewormingController::save();
        break;

    case '/animal/add-vaccine':
        AnimalsController::addVaccine();
        break;
    case '/animal/add-expense':
        AnimalsController::addExpense();
        break;
    case '/animal/surgery/new':
        SurgeriesController::form();
        break;
    case '/animal/surgery/save':
        SurgeriesController::save();
        break;

    case '/dev/backfill-weights':
        DevController::backfillWeights();
        break;

    case '/animal/upload-photos':
        AnimalsController::uploadPhotos();
        break;

    case '/animal/set-primary-photo':
        AnimalsController::setPrimaryPhoto();
        break;

    case '/dev/backup':
        DevController::backup();
        break;

    case '/dev/backfill-movements':
        DevController::backfillMovements();
        break;

    case '/animal/pdf':
        AnimalsController::pdf();
        break;

    case '/dashboard':
        DashboardController::index();
        break;
    case '/statistics':
        StatisticsController::index();
        break;
    case '/evolutions':
        ProjectController::evolutions();
        break;
    case '/directory':
        DirectoryController::index();
        break;
    case '/directory/view':
        DirectoryController::show();
        break;
    case '/directory/new':
    case '/directory/edit':
        DirectoryController::form();
        break;
    case '/directory/save':
        DirectoryController::save();
        break;
    case '/care-round':
        CareRoundsController::index();
        break;
    case '/care-round/save':
        CareRoundsController::saveObservation();
        break;
    case '/care-round/save-room':
        CareRoundsController::saveRoom();
        break;
    case '/care-round/setup':
        CareRoundsController::setup();
        break;
    case '/care-round/setup/save':
        CareRoundsController::saveSetup();
        break;
    case '/care-round/treatment-schedule':
        CareRoundsController::saveTreatmentSchedule();
        break;

    case '/animal/new':
        AnimalsController::form();
        break;
    case '/animal/edit':
        AnimalsController::form();
        break;
    case '/animal/save':
        AnimalsController::save();
        break;
    case '/animal/death':
        DeathController::form();
        break;
    case '/animal/death/save':
        DeathController::save();
        break;

    case '/litter/new':
        AnimalsController::litterForm();
        break;
    case '/litter/save':
        AnimalsController::saveLitter();
        break;
    case '/litter/add-existing':
        AnimalsController::litterAddExistingForm();
        break;
    case '/litter/add-existing/save':
        AnimalsController::saveExistingLitterKittens();
        break;
    case '/bonded/new':
        AnimalsController::bondedForm();
        break;
    case '/bonded/save':
        AnimalsController::saveBondedGroup();
        break;
    case '/bonded/dissolve':
        AnimalsController::dissolveBondedGroup();
        break;

    case '/animal/history':
        AnimalsController::history();
        break;

    case '/animal/delete':
        AnimalsController::delete();
        break;
    case '/animal/archive':
        AnimalsController::archive();
        break;
    case '/animal/restore':
        AnimalsController::restore();
        break;

    case '/animal/photos/upload':
        AnimalsController::uploadPhotos();
        break;

    case '/animal/photos/primary':
        AnimalsController::setPrimaryPhoto();
        break;

    case '/animal/photos/delete':
        AnimalsController::deletePhoto();
        break;

    case '/animal/photos/toggle':
        AnimalsController::togglePhotoVisibility();
        break;

    case '/animal/icad':
        AnimalsController::icad();
        break;

    case '/animal/geocode':
        AnimalsController::geocode();
        break;

    case '/animal/adopt':
        AdoptionsController::store();
        break;
    case '/animal/placement/save':
        PlacementsController::save();
        break;

    //===== ADMIN
    case '/admin/register':
        AdminController::register();
        break;

    case '/admin/register/pdf':
        AdminController::registerPdf();
        break;
    case '/admin/exports':
        AdminController::exports();
        break;
    case '/admin/exports/download':
        AdminController::downloadExport();
        break;
    case '/admin/grants':
        GrantsController::index();
        break;
    case '/admin/grants/save':
        GrantsController::saveAnnual();
        break;
    case '/admin/grants/application':
        GrantsController::saveApplication();
        break;
    case '/admin/grants/document':
        if (($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'POST') {
            GrantsController::upload();
        } else {
            GrantsController::download();
        }
        break;
    case '/admin/grants/print':
        GrantsController::print();
        break;
    case '/documents/adoption/blank':
        DocumentsController::blankAdoption();
        break;
    case '/documents/blank':
        DocumentsController::blank();
        break;
    case '/animal/documents/adoption':
        DocumentsController::adoption();
        break;
    case '/animal/documents/abandon':
        DocumentsController::abandon();
        break;
    case '/directory/documents':
        DocumentsController::contact();
        break;
    case '/settings':
    case '/settings/general':
        SettingsController::general();
        break;
    case '/settings/association-logo':
        SettingsController::associationLogo();
        break;
    case '/settings/users':
        SettingsController::users();
        break;
    case '/settings/permissions':
        SettingsController::permissions();
        break;
    case '/settings/species':
        SettingsController::species();
        break;
    case '/settings/species/save':
        SettingsController::saveSpecies();
        break;
    case '/settings/rooms':
        SettingsController::rooms();
        break;
    case '/settings/rooms/save':
        SettingsController::saveRooms();
        break;
    case '/settings/pricing':
        SettingsController::pricing();
        break;
    case '/settings/pricing/tariff':
        SettingsController::saveTariff();
        break;
    case '/settings/pricing/discount':
        SettingsController::saveDiscount();
        break;
    case '/settings/pricing/adoption':
        SettingsController::saveAdoptionFees();
        break;
    case '/settings/lab-references':
        SettingsController::labReferences();
        break;
    case '/settings/lab-references/save':
        SettingsController::saveLabReferences();
        break;
    case '/settings/public-site':
        SettingsController::publicSite();
        break;
    case '/settings/public-site/save':
        SettingsController::savePublicSite();
        break;
    case '/settings/privacy':
        PrivacyController::index();
        break;
    case '/settings/privacy/save':
        PrivacyController::save();
        break;
    case '/settings/privacy/export':
        PrivacyController::export();
        break;
    case '/settings/privacy/anonymize':
        PrivacyController::anonymize();
        break;
    case '/settings/inventory':
        InventoryController::index();
        break;
    case '/settings/inventory/product':
        InventoryController::product();
        break;
    case '/settings/inventory/receive':
        InventoryController::receive();
        break;
    case '/settings/inventory/move':
        InventoryController::move();
        break;
    case '/settings/health':
        SettingsController::health();
        break;
    case '/settings/notifications':
        SettingsController::notifications();
        break;
    case '/settings/notifications/save':
        SettingsController::saveNotifications();
        break;
    case '/settings/notifications/send':
        SettingsController::sendNotifications();
        break;
    case '/settings/general/save':
        SettingsController::saveGeneral();
        break;
    case '/settings/users/save':
        SettingsController::saveUser();
        break;
    case '/settings/permissions/save':
        SettingsController::savePermissions();
        break;
    case '/settings/audit':
        SettingsController::audit();
        break;
    case '/settings/data':
        SettingsController::dataTools();
        break;
    case '/settings/data/reset':
        SettingsController::resetData();
        break;
    case '/settings/data/demo':
        SettingsController::loadDemoData();
        break;
    case '/settings/backups':
        SettingsController::backups();
        break;
    case '/settings/backups/create':
        SettingsController::createBackup();
        break;
    case '/settings/backups/schedule':
        SettingsController::saveBackupSchedule();
        break;
    case '/settings/backups/verify':
        SettingsController::verifyBackup();
        break;
    case '/settings/backups/download':
        SettingsController::downloadBackup();
        break;
    case '/settings/backups/delete':
        SettingsController::deleteBackup();
        break;
    case '/settings/backups/restore':
        SettingsController::restoreBackup();
        break;
    case '/settings/asm3':
        Asm3ImportController::index();
        break;
    case '/settings/asm3/upload':
        Asm3ImportController::upload();
        break;
    case '/settings/asm3/apply':
        Asm3ImportController::apply();
        break;

    default:
        http_response_code(404);
        echo '404';
}
