Files
ladill-care/routes/web.php
T
isaaccladandCursor 5a1d47b9cc
Deploy Ladill Care / deploy (push) Successful in 51s
Add specialty module and GP service pricing settings.
Admin dashboard module cards open per-module settings with editable service prices; GP consultation and clinic fees live under Settings → GP pricing (inventory drugs unchanged).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 17:19:18 +00:00

312 lines
30 KiB
PHP

<?php
use App\Http\Controllers\Auth\SsoLoginController;
use App\Http\Controllers\Care\AiController;
use App\Http\Controllers\Care\AppointmentController;
use App\Http\Controllers\Care\AppointmentMeetController;
use App\Http\Controllers\Care\AssessmentController;
use App\Http\Controllers\Care\AuditLogController;
use App\Http\Controllers\Care\BillController;
use App\Http\Controllers\Care\BranchController;
use App\Http\Controllers\Care\ConsultationController;
use App\Http\Controllers\Care\DashboardController;
use App\Http\Controllers\Care\DepartmentController;
use App\Http\Controllers\Care\DeviceController;
use App\Http\Controllers\Care\DisplayPublicController;
use App\Http\Controllers\Care\DisplayScreenController;
use App\Http\Controllers\Care\DrugController;
use App\Http\Controllers\Care\FinancialObligationController;
use App\Http\Controllers\Care\IntegrationsController;
use App\Http\Controllers\Care\InvestigationController;
use App\Http\Controllers\Care\InvestigationTypeController;
use App\Http\Controllers\Care\IssueReportController;
use App\Http\Controllers\Care\MemberController;
use App\Http\Controllers\Care\OnboardingController;
use App\Http\Controllers\Care\OutcomeController;
use App\Http\Controllers\Care\PathwayController;
use App\Http\Controllers\Care\PatientController;
use App\Http\Controllers\Care\PatientMessageController;
use App\Http\Controllers\Care\PractitionerController;
use App\Http\Controllers\Care\PrescriptionController;
use App\Http\Controllers\Care\ProController;
use App\Http\Controllers\Care\QueueController;
use App\Http\Controllers\Care\ReportController;
use App\Http\Controllers\Care\ServiceQueueController;
use App\Http\Controllers\Care\SettingsController;
use App\Http\Controllers\Care\SettingsGpPricingController;
use App\Http\Controllers\Care\SettingsModulesController;
use App\Http\Controllers\Care\DentistryWorkspaceController;
use App\Http\Controllers\Care\SpecialtyModuleController;
use App\Http\Controllers\Care\VisitWorkflowController;
use App\Http\Controllers\NotificationController;
use Illuminate\Support\Facades\Route;
Route::get('/', fn () => auth()->check()
? redirect()->route('care.dashboard')
: redirect()->route('sso.connect'))->name('care.root');
Route::get('/login', [SsoLoginController::class, 'connect'])->name('login');
Route::get('/sso/connect', [SsoLoginController::class, 'connect'])->name('sso.connect');
Route::get('/sso/callback', [SsoLoginController::class, 'callback'])->name('sso.callback');
Route::get('/sso/error', [SsoLoginController::class, 'failed'])->name('sso.failed');
Route::post('/logout', [SsoLoginController::class, 'logout'])->name('logout');
Route::get('/sso/logout-bridge', [SsoLoginController::class, 'logoutBridge'])->name('sso.logout-bridge');
Route::get('/sso/logout-frontchannel', [SsoLoginController::class, 'frontchannelLogout'])->name('sso.logout-frontchannel');
Route::get('/sso/platform-signed-out', [SsoLoginController::class, 'platformSignedOut'])->name('sso.platform-signed-out');
Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('care.dashboard') : view('auth.signed-out'))->name('care.signed-out');
Route::get('/display/{token}', [DisplayPublicController::class, 'show'])->name('care.display.public');
Route::get('/display/{token}/data', [DisplayPublicController::class, 'data'])->name('care.display.data');
Route::post('/display/{token}/announcements/{announcement}/played', [DisplayPublicController::class, 'played'])
->name('care.display.announcement.played');
Route::middleware(['auth', 'platform.session'])->group(function () {
Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.index');
Route::get('/notifications/unread', [NotificationController::class, 'unread'])->name('notifications.unread');
Route::post('/notifications/{id}/read', [NotificationController::class, 'markAsRead'])->name('notifications.mark-read');
Route::post('/notifications/mark-all-read', [NotificationController::class, 'markAllAsRead'])->name('notifications.mark-all-read');
Route::get('/onboarding', [OnboardingController::class, 'show'])->name('care.onboarding.show');
Route::post('/onboarding', [OnboardingController::class, 'store'])->name('care.onboarding.store');
Route::middleware(['care.setup'])->group(function () {
Route::post('/ai/chat', [AiController::class, 'chat'])->middleware('throttle:30,1')->name('care.ai.chat');
Route::get('/dashboard', [DashboardController::class, 'index'])->name('care.dashboard');
Route::get('/patients', [PatientController::class, 'index'])->name('care.patients.index');
Route::get('/patients/scan', [PatientController::class, 'scanLookup'])->name('care.patients.scan');
Route::get('/patients/create', [PatientController::class, 'create'])->name('care.patients.create');
Route::post('/patients', [PatientController::class, 'store'])->name('care.patients.store');
Route::get('/patients/{patient}', [PatientController::class, 'show'])->name('care.patients.show');
Route::get('/patients/{patient}/label', [PatientController::class, 'label'])->name('care.patients.label');
Route::post('/patients/{patient}/email', [PatientMessageController::class, 'sendEmail'])->name('care.patients.email');
Route::post('/patients/{patient}/sms', [PatientMessageController::class, 'sendSms'])->name('care.patients.sms');
Route::get('/patients/{patient}/edit', [PatientController::class, 'edit'])->name('care.patients.edit');
Route::put('/patients/{patient}', [PatientController::class, 'update'])->name('care.patients.update');
Route::delete('/patients/{patient}', [PatientController::class, 'destroy'])->name('care.patients.destroy');
Route::get('/appointments', [AppointmentController::class, 'index'])->name('care.appointments.index');
Route::get('/appointments/create', [AppointmentController::class, 'create'])->name('care.appointments.create');
Route::post('/appointments', [AppointmentController::class, 'store'])->name('care.appointments.store');
Route::get('/appointments/walk-in', [AppointmentController::class, 'walkInCreate'])->name('care.appointments.walk-in.create');
Route::post('/appointments/walk-in', [AppointmentController::class, 'walkInStore'])->name('care.appointments.walk-in.store');
Route::get('/appointments/{appointment}', [AppointmentController::class, 'show'])->name('care.appointments.show');
Route::post('/appointments/{appointment}/check-in', [AppointmentController::class, 'checkIn'])->name('care.appointments.check-in');
Route::post('/appointments/{appointment}/cancel', [AppointmentController::class, 'cancel'])->name('care.appointments.cancel');
Route::post('/appointments/{appointment}/no-show', [AppointmentController::class, 'noShow'])->name('care.appointments.no-show');
Route::post('/appointments/{appointment}/schedule-meet', [AppointmentMeetController::class, 'schedule'])->name('care.appointments.schedule-meet');
Route::post('/appointments/{appointment}/start-meet', [AppointmentMeetController::class, 'start'])->name('care.appointments.start-meet');
Route::get('/queue', [QueueController::class, 'index'])->name('care.queue.index');
Route::post('/queue/call-next', [QueueController::class, 'callNext'])->name('care.queue.call-next');
Route::post('/queue/{appointment}/start', [QueueController::class, 'start'])->name('care.queue.start');
Route::post('/queue/{appointment}/recall', [QueueController::class, 'recall'])->name('care.queue.recall');
Route::post('/queue/{appointment}/complete-ticket', [QueueController::class, 'completeTicket'])->name('care.queue.complete-ticket');
Route::post('/visits/{visit}/workflow/advance', [VisitWorkflowController::class, 'advance'])->name('care.visits.workflow.advance');
Route::middleware('care.paid')->group(function () {
Route::get('/service-queues', [ServiceQueueController::class, 'index'])->name('care.service-queues.index');
Route::get('/service-queues/console/{counterUuid}', [ServiceQueueController::class, 'console'])->name('care.service-queues.console');
Route::post('/service-queues/console/{counterUuid}/action', [ServiceQueueController::class, 'action'])->name('care.service-queues.action');
Route::get('/specialty/{module}/visits', [SpecialtyModuleController::class, 'visits'])->name('care.specialty.visits');
Route::get('/specialty/{module}/history', [SpecialtyModuleController::class, 'history'])->name('care.specialty.history');
Route::get('/specialty/{module}/billing', [SpecialtyModuleController::class, 'billing'])->name('care.specialty.billing');
Route::get('/specialty/dentistry/reports', [DentistryWorkspaceController::class, 'reports'])->name('care.specialty.dentistry.reports');
Route::get('/specialty/{module}/workspace/{visit?}', [SpecialtyModuleController::class, 'workspace'])->name('care.specialty.workspace');
Route::post('/specialty/{module}/workspace/{visit}/clinical', [SpecialtyModuleController::class, 'saveClinical'])->name('care.specialty.clinical.save');
Route::post('/specialty/{module}/workspace/{visit}/documents', [SpecialtyModuleController::class, 'uploadDocument'])->name('care.specialty.documents.upload');
Route::post('/specialty/{module}/workspace/{visit}/services', [SpecialtyModuleController::class, 'addService'])->name('care.specialty.services.add');
Route::post('/specialty/{module}/workspace/{visit}/start-consultation', [SpecialtyModuleController::class, 'startConsultation'])->name('care.specialty.consultation.start');
Route::post('/specialty/dentistry/workspace/{visit}/tooth', [DentistryWorkspaceController::class, 'updateTooth'])->name('care.specialty.dentistry.tooth');
Route::post('/specialty/dentistry/workspace/{visit}/dentition', [DentistryWorkspaceController::class, 'setDentition'])->name('care.specialty.dentistry.dentition');
Route::post('/specialty/dentistry/workspace/{visit}/plan-items', [DentistryWorkspaceController::class, 'addPlanItem'])->name('care.specialty.dentistry.plan-items');
Route::post('/specialty/dentistry/workspace/{visit}/plan-items/{item}', [DentistryWorkspaceController::class, 'updatePlanItem'])->name('care.specialty.dentistry.plan-items.update');
Route::post('/specialty/dentistry/workspace/{visit}/plan-items/{item}/cancel', [DentistryWorkspaceController::class, 'cancelPlanItem'])->name('care.specialty.dentistry.plan-items.cancel');
Route::post('/specialty/dentistry/workspace/{visit}/plan/accept', [DentistryWorkspaceController::class, 'acceptPlan'])->name('care.specialty.dentistry.plan.accept');
Route::post('/specialty/dentistry/workspace/{visit}/plan/reject', [DentistryWorkspaceController::class, 'rejectPlan'])->name('care.specialty.dentistry.plan.reject');
Route::post('/specialty/dentistry/workspace/{visit}/plan/cancel', [DentistryWorkspaceController::class, 'cancelPlan'])->name('care.specialty.dentistry.plan.cancel');
Route::post('/specialty/dentistry/workspace/{visit}/procedures', [DentistryWorkspaceController::class, 'completeProcedure'])->name('care.specialty.dentistry.procedures');
Route::post('/specialty/dentistry/workspace/{visit}/notes', [DentistryWorkspaceController::class, 'saveNotes'])->name('care.specialty.dentistry.notes');
Route::post('/specialty/dentistry/workspace/{visit}/images', [DentistryWorkspaceController::class, 'uploadImage'])->name('care.specialty.dentistry.images');
Route::post('/specialty/dentistry/workspace/{visit}/images/{image}/void', [DentistryWorkspaceController::class, 'voidImage'])->name('care.specialty.dentistry.images.void');
Route::post('/specialty/dentistry/workspace/{visit}/stage', [DentistryWorkspaceController::class, 'setStage'])->name('care.specialty.dentistry.stage');
Route::post('/specialty/dentistry/workspace/{visit}/perio', [DentistryWorkspaceController::class, 'savePerio'])->name('care.specialty.dentistry.perio');
Route::post('/specialty/dentistry/workspace/{visit}/lab-cases', [DentistryWorkspaceController::class, 'createLabCase'])->name('care.specialty.dentistry.lab-cases');
Route::post('/specialty/dentistry/workspace/{visit}/lab-cases/{labCase}/status', [DentistryWorkspaceController::class, 'transitionLabCase'])->name('care.specialty.dentistry.lab-cases.status');
Route::post('/specialty/dentistry/workspace/{visit}/recalls', [DentistryWorkspaceController::class, 'scheduleRecall'])->name('care.specialty.dentistry.recalls');
Route::post('/specialty/dentistry/workspace/{visit}/recalls/{recall}/complete', [DentistryWorkspaceController::class, 'completeRecall'])->name('care.specialty.dentistry.recalls.complete');
Route::post('/specialty/dentistry/workspace/{visit}/recalls/{recall}/cancel', [DentistryWorkspaceController::class, 'cancelRecall'])->name('care.specialty.dentistry.recalls.cancel');
Route::get('/specialty/dentistry/workspace/{visit}/print', [DentistryWorkspaceController::class, 'printChart'])->name('care.specialty.dentistry.print');
Route::get('/specialty/{module}', [SpecialtyModuleController::class, 'show'])->name('care.specialty.show');
Route::post('/specialty/{module}/call-next', [SpecialtyModuleController::class, 'callNext'])->name('care.specialty.call-next');
Route::get('/lab/requests', [InvestigationController::class, 'index'])->name('care.lab.requests.index');
Route::get('/lab/queue', [InvestigationController::class, 'queue'])->name('care.lab.queue.index');
Route::post('/lab/queue/call-next', [InvestigationController::class, 'callNext'])->name('care.lab.queue.call-next');
Route::post('/lab/queue/{investigation}/serve', [InvestigationController::class, 'serve'])->name('care.lab.queue.serve');
Route::get('/lab/requests/{investigation}', [InvestigationController::class, 'show'])->name('care.lab.requests.show');
Route::post('/consultations/{consultation}/investigations', [InvestigationController::class, 'requestFromConsultation'])->name('care.lab.requests.store');
Route::post('/lab/requests/{investigation}/collect-sample', [InvestigationController::class, 'collectSample'])->name('care.lab.requests.collect-sample');
Route::post('/lab/requests/{investigation}/start', [InvestigationController::class, 'startProcessing'])->name('care.lab.requests.start');
Route::post('/lab/requests/{investigation}/results', [InvestigationController::class, 'enterResults'])->name('care.lab.requests.results');
Route::post('/lab/requests/{investigation}/approve', [InvestigationController::class, 'approve'])->name('care.lab.requests.approve');
Route::post('/lab/requests/{investigation}/deliver', [InvestigationController::class, 'deliver'])->name('care.lab.requests.deliver');
Route::post('/lab/requests/{investigation}/cancel', [InvestigationController::class, 'cancel'])->name('care.lab.requests.cancel');
Route::get('/lab/catalog', [InvestigationTypeController::class, 'index'])->name('care.lab.catalog.index');
Route::get('/lab/catalog/create', [InvestigationTypeController::class, 'create'])->name('care.lab.catalog.create');
Route::post('/lab/catalog', [InvestigationTypeController::class, 'store'])->name('care.lab.catalog.store');
Route::get('/lab/catalog/{investigationType}/edit', [InvestigationTypeController::class, 'edit'])->name('care.lab.catalog.edit');
Route::put('/lab/catalog/{investigationType}', [InvestigationTypeController::class, 'update'])->name('care.lab.catalog.update');
Route::get('/prescriptions', [PrescriptionController::class, 'index'])->name('care.prescriptions.index');
Route::get('/prescriptions/queue', [PrescriptionController::class, 'queue'])->name('care.prescriptions.queue');
Route::post('/prescriptions/queue/call-next', [PrescriptionController::class, 'callNext'])->name('care.prescriptions.call-next');
Route::post('/prescriptions/{prescription}/serve', [PrescriptionController::class, 'serve'])->name('care.prescriptions.serve');
Route::get('/consultations/{consultation}/prescriptions/create', [PrescriptionController::class, 'create'])->name('care.prescriptions.create');
Route::post('/consultations/{consultation}/prescriptions', [PrescriptionController::class, 'store'])->name('care.prescriptions.store');
Route::get('/prescriptions/{prescription}', [PrescriptionController::class, 'show'])->name('care.prescriptions.show');
Route::post('/prescriptions/{prescription}/activate', [PrescriptionController::class, 'activate'])->name('care.prescriptions.activate');
Route::post('/prescriptions/{prescription}/dispense', [PrescriptionController::class, 'dispense'])->name('care.prescriptions.dispense');
Route::post('/prescriptions/{prescription}/cancel', [PrescriptionController::class, 'cancel'])->name('care.prescriptions.cancel');
Route::get('/bills', [BillController::class, 'index'])->name('care.bills.index');
Route::post('/bills/call-next', [BillController::class, 'callNext'])->name('care.bills.call-next');
Route::post('/bills/{bill}/serve', [BillController::class, 'serve'])->name('care.bills.serve');
Route::post('/visits/{visit}/bill', [BillController::class, 'generate'])->name('care.bills.generate');
Route::get('/bills/payments/callback', [BillController::class, 'paymentCallback'])->name('care.bills.payments.callback');
Route::get('/bills/{bill}', [BillController::class, 'show'])->name('care.bills.show');
Route::get('/bills/{bill}/print', [BillController::class, 'print'])->name('care.bills.print');
Route::post('/bills/{bill}/line-items', [BillController::class, 'addLineItem'])->name('care.bills.line-items.store');
Route::post('/bills/{bill}/adjustments', [BillController::class, 'applyAdjustments'])->name('care.bills.adjustments');
Route::post('/bills/{bill}/payments', [BillController::class, 'recordPayment'])->name('care.bills.payments.store');
Route::post('/bills/{bill}/payments/gateway', [BillController::class, 'startGatewayPayment'])->name('care.bills.payments.gateway');
Route::post('/bills/{bill}/void', [BillController::class, 'void'])->name('care.bills.void');
Route::get('/financial-obligations', [FinancialObligationController::class, 'index'])->name('care.obligations.index');
Route::post('/financial-obligations/{financialObligation}/clear', [FinancialObligationController::class, 'clear'])->name('care.obligations.clear');
Route::get('/pharmacy/drugs', [DrugController::class, 'index'])->name('care.pharmacy.drugs.index');
Route::get('/pharmacy/drugs/create', [DrugController::class, 'create'])->name('care.pharmacy.drugs.create');
Route::post('/pharmacy/drugs', [DrugController::class, 'store'])->name('care.pharmacy.drugs.store');
Route::get('/pharmacy/drugs/{drug}', [DrugController::class, 'show'])->name('care.pharmacy.drugs.show');
Route::get('/pharmacy/drugs/{drug}/edit', [DrugController::class, 'edit'])->name('care.pharmacy.drugs.edit');
Route::put('/pharmacy/drugs/{drug}', [DrugController::class, 'update'])->name('care.pharmacy.drugs.update');
Route::post('/pharmacy/drugs/{drug}/batches', [DrugController::class, 'receiveBatch'])->name('care.pharmacy.drugs.batches.store');
Route::get('/reports', [ReportController::class, 'index'])->name('care.reports.index');
Route::get('/reports/{type}', [ReportController::class, 'show'])->name('care.reports.show');
Route::get('/reports/{type}/export', [ReportController::class, 'export'])->name('care.reports.export');
});
Route::get('/consultations/{consultation}', [ConsultationController::class, 'show'])->name('care.consultations.show');
Route::put('/consultations/{consultation}', [ConsultationController::class, 'update'])->name('care.consultations.update');
Route::post('/consultations/{consultation}/complete', [ConsultationController::class, 'complete'])->name('care.consultations.complete');
// Clinical assessments (gated by CareFeatures::assessments_engine)
Route::get('/patients/{patient}/assessments', [AssessmentController::class, 'index'])->name('care.assessments.index');
Route::get('/patients/{patient}/assessments/create', [AssessmentController::class, 'create'])->name('care.assessments.create');
Route::post('/patients/{patient}/assessments', [AssessmentController::class, 'store'])->name('care.assessments.store');
Route::post('/consultations/{consultation}/assessments', [AssessmentController::class, 'storeForConsultation'])->name('care.consultations.assessments.store');
Route::get('/assessments/{assessment}', [AssessmentController::class, 'show'])->name('care.assessments.show');
Route::put('/assessments/{assessment}', [AssessmentController::class, 'update'])->name('care.assessments.update');
Route::post('/assessments/{assessment}/complete', [AssessmentController::class, 'complete'])->name('care.assessments.complete');
Route::post('/assessments/{assessment}/cancel', [AssessmentController::class, 'cancel'])->name('care.assessments.cancel');
Route::get('/assessments/{assessment}/fhir', [AssessmentController::class, 'fhirExport'])->name('care.assessments.fhir');
// Clinical pathways (Layer 2)
Route::get('/patients/{patient}/pathways', [PathwayController::class, 'index'])->name('care.pathways.index');
Route::post('/patients/{patient}/pathways', [PathwayController::class, 'store'])->name('care.pathways.store');
Route::post('/patients/{patient}/pathways/{patientPathway}/deactivate', [PathwayController::class, 'deactivate'])->name('care.pathways.deactivate');
Route::get('/consultations/{consultation}/pathway-suggestions', [PathwayController::class, 'suggestions'])->name('care.consultations.pathway-suggestions');
// Layer 4 — outcomes & patient trends (free per-patient; org analytics Enterprise)
Route::get('/patients/{patient}/outcomes', [OutcomeController::class, 'index'])->name('care.outcomes.index');
Route::post('/patients/{patient}/outcomes', [OutcomeController::class, 'store'])->name('care.outcomes.store');
Route::get('/settings', [SettingsController::class, 'edit'])->name('care.settings');
Route::put('/settings', [SettingsController::class, 'update'])->name('care.settings.update');
Route::get('/settings/gp-pricing', [SettingsGpPricingController::class, 'edit'])->name('care.settings.gp-pricing');
Route::put('/settings/gp-pricing', [SettingsGpPricingController::class, 'update'])->name('care.settings.gp-pricing.update');
Route::get('/settings/modules', [SettingsModulesController::class, 'edit'])->name('care.settings.modules');
Route::put('/settings/modules', [SettingsModulesController::class, 'update'])->name('care.settings.modules.update');
Route::get('/settings/modules/{module}', [SettingsModulesController::class, 'show'])->name('care.settings.modules.show');
Route::put('/settings/modules/{module}/services', [SettingsModulesController::class, 'updateServices'])->name('care.settings.modules.services.update');
Route::get('/integrations', [IntegrationsController::class, 'edit'])->name('care.integrations');
Route::post('/integrations/sms', [IntegrationsController::class, 'saveSms'])->name('care.integrations.sms.save');
Route::post('/integrations/sms/disconnect', [IntegrationsController::class, 'disconnectSms'])->name('care.integrations.sms.disconnect');
Route::post('/integrations/bird', [IntegrationsController::class, 'saveBird'])->name('care.integrations.bird.save');
Route::post('/integrations/bird/disconnect', [IntegrationsController::class, 'disconnectBird'])->name('care.integrations.bird.disconnect');
Route::post('/integrations/sms/senders', [IntegrationsController::class, 'previewSenders'])->name('care.integrations.sms.senders');
Route::post('/integrations/gateway', [IntegrationsController::class, 'saveGateway'])->name('care.integrations.gateway.save');
Route::post('/integrations/gateway/disconnect', [IntegrationsController::class, 'disconnectGateway'])->name('care.integrations.gateway.disconnect');
Route::get('/pro', [ProController::class, 'index'])->name('care.pro.index');
Route::post('/pro/subscribe', [ProController::class, 'subscribe'])->name('care.pro.subscribe');
Route::post('/pro/subscribe-enterprise', [ProController::class, 'subscribeEnterprise'])->name('care.pro.subscribe-enterprise');
Route::post('/pro/subscribe-prepaid', [ProController::class, 'subscribePrepaid'])->name('care.pro.subscribe-prepaid');
Route::get('/pro/paystack/callback', [ProController::class, 'paystackCallback'])->name('care.pro.paystack.callback');
Route::get('/report-issue', [IssueReportController::class, 'create'])->name('care.issues.create');
Route::post('/report-issue', [IssueReportController::class, 'store'])->name('care.issues.store');
Route::get('/settings/branches', [BranchController::class, 'index'])->name('care.branches.index');
Route::get('/settings/branches/create', [BranchController::class, 'create'])->name('care.branches.create');
Route::post('/settings/branches', [BranchController::class, 'store'])->name('care.branches.store');
Route::get('/settings/branches/{branch}/edit', [BranchController::class, 'edit'])->name('care.branches.edit');
Route::put('/settings/branches/{branch}', [BranchController::class, 'update'])->name('care.branches.update');
Route::get('/settings/devices', [DeviceController::class, 'index'])->name('care.devices.index');
Route::get('/settings/devices/create', [DeviceController::class, 'create'])->name('care.devices.create');
Route::post('/settings/devices', [DeviceController::class, 'store'])->name('care.devices.store');
Route::get('/settings/devices/{device}/edit', [DeviceController::class, 'edit'])->name('care.devices.edit');
Route::put('/settings/devices/{device}', [DeviceController::class, 'update'])->name('care.devices.update');
Route::delete('/settings/devices/{device}', [DeviceController::class, 'destroy'])->name('care.devices.destroy');
Route::post('/settings/devices/{device}/token', [DeviceController::class, 'regenerateToken'])->name('care.devices.token.regenerate');
Route::delete('/settings/devices/{device}/token', [DeviceController::class, 'revokeToken'])->name('care.devices.token.revoke');
Route::middleware('care.paid')->group(function () {
Route::get('/settings/displays', [DisplayScreenController::class, 'index'])->name('care.displays.index');
Route::get('/settings/displays/create', [DisplayScreenController::class, 'create'])->name('care.displays.create');
Route::post('/settings/displays', [DisplayScreenController::class, 'store'])->name('care.displays.store');
Route::get('/settings/displays/{display}', [DisplayScreenController::class, 'show'])->name('care.displays.show');
Route::get('/settings/displays/{display}/edit', [DisplayScreenController::class, 'edit'])->name('care.displays.edit');
Route::put('/settings/displays/{display}', [DisplayScreenController::class, 'update'])->name('care.displays.update');
});
Route::redirect('/branches', '/settings/branches');
Route::redirect('/branches/create', '/settings/branches/create');
Route::get('/departments', [DepartmentController::class, 'index'])->name('care.departments.index');
Route::get('/departments/create', [DepartmentController::class, 'create'])->name('care.departments.create');
Route::post('/departments', [DepartmentController::class, 'store'])->name('care.departments.store');
Route::get('/departments/{department}/edit', [DepartmentController::class, 'edit'])->name('care.departments.edit');
Route::put('/departments/{department}', [DepartmentController::class, 'update'])->name('care.departments.update');
Route::delete('/departments/{department}', [DepartmentController::class, 'destroy'])->name('care.departments.destroy');
Route::get('/practitioners', [PractitionerController::class, 'index'])->name('care.practitioners.index');
Route::get('/practitioners/create', [PractitionerController::class, 'create'])->name('care.practitioners.create');
Route::post('/practitioners', [PractitionerController::class, 'store'])->name('care.practitioners.store');
Route::get('/practitioners/{practitioner}/edit', [PractitionerController::class, 'edit'])->name('care.practitioners.edit');
Route::put('/practitioners/{practitioner}', [PractitionerController::class, 'update'])->name('care.practitioners.update');
Route::delete('/practitioners/{practitioner}', [PractitionerController::class, 'destroy'])->name('care.practitioners.destroy');
Route::get('/settings/team', [MemberController::class, 'index'])->name('care.members.index');
Route::get('/settings/team/create', [MemberController::class, 'create'])->name('care.members.create');
Route::post('/settings/team', [MemberController::class, 'store'])->name('care.members.store');
Route::delete('/settings/team/{member}', [MemberController::class, 'destroy'])->name('care.members.destroy');
Route::redirect('/members', '/settings/team');
Route::redirect('/members/create', '/settings/team/create');
Route::get('/audit-logs', [AuditLogController::class, 'index'])->name('care.audit.index');
Route::get('/audit-logs/export', [AuditLogController::class, 'export'])->name('care.audit.export');
Route::get('/wallet', fn () => redirect()->away(ladill_account_url('/wallet')))->name('care.wallet');
Route::get('/team', fn () => redirect()->away(ladill_account_url('/account/team')))->name('care.team');
});
});