Deploy: 2026-05-22 02:09:48
This commit is contained in:
@@ -68,6 +68,38 @@ $router->get('/api/chatbot/rules', [\App\Controllers\ChatbotController::class, '
|
||||
$router->post('/api/chatbot/rules',[\App\Controllers\ChatbotController::class, 'store'], [\App\Middlewares\AuthMiddleware::class]);
|
||||
$router->post('/api/chatbot/generate-prompt-from-audio', [\App\Controllers\ChatbotController::class, 'generatePromptFromAudio'], [\App\Middlewares\AuthMiddleware::class]);
|
||||
|
||||
// Custom Integration Endpoints Routes (Phase 5)
|
||||
$router->get('/api/endpoints', [\App\Controllers\EndpointController::class, 'index'], [\App\Middlewares\AuthMiddleware::class]);
|
||||
$router->post('/api/endpoints', [\App\Controllers\EndpointController::class, 'store'], [\App\Middlewares\AuthMiddleware::class]);
|
||||
$router->delete('/api/endpoints', [\App\Controllers\EndpointController::class, 'delete'], [\App\Middlewares\AuthMiddleware::class]);
|
||||
|
||||
// Mock External API for Entaleq Driver Info (Used to fetch real-time driver data)
|
||||
$router->post('/api/external/driver-info', function ($request, $response) {
|
||||
$body = $request->getBody();
|
||||
$phone = $body['phone'] ?? '';
|
||||
|
||||
if (empty($phone)) {
|
||||
$response->status(400)->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Missing phone number'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$response->json([
|
||||
'status' => 'success',
|
||||
'data' => [
|
||||
'name' => 'أحمد الشريف',
|
||||
'phone' => $phone,
|
||||
'role' => 'سائق',
|
||||
'status' => 'نشط',
|
||||
'balance' => 75.25,
|
||||
'vehicle' => 'تويوتا كامري 2023',
|
||||
'trips_count' => 1420
|
||||
]
|
||||
]);
|
||||
});
|
||||
|
||||
// Mock External API for Entaleq Payment Verification (Used to demo automated slip validation)
|
||||
$router->post('/api/external/verify-payment', function ($request, $response) {
|
||||
$body = $request->getBody();
|
||||
@@ -107,5 +139,6 @@ $router->post('/api/external/verify-payment', function ($request, $response) {
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
// 4. Dispatch the request
|
||||
$router->dispatch($request, $response);
|
||||
|
||||
Reference in New Issue
Block a user