diff --git a/backend/ride/pricing/get.php b/backend/ride/pricing/get.php index fd001311..9eccd3e2 100644 --- a/backend/ride/pricing/get.php +++ b/backend/ride/pricing/get.php @@ -44,14 +44,17 @@ $hour = (int)$currentTime->format('H'); switch ($country) { case 'Syria': - $minFare = 150.0; + case 'SY': + $minFare = 14500.0; $promoMaxDiscount = 30.0; break; case 'Egypt': + case 'EG': $minFare = 20.0; $promoMaxDiscount = 25.0; break; case 'Jordan': + case 'JO': $minFare = 1.0; $promoMaxDiscount = 0.30; break; @@ -215,9 +218,24 @@ function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanR $totalMinutes = floor($duration / 60); - $airportCtx = (stripos($startNameAddress, 'airport') !== false || stripos($startNameAddress, 'مطار') !== false || stripos($endNameAddress, 'airport') !== false || stripos($endNameAddress, 'مطار') !== false); + // === Queen Alia Airport (Amman) Bounding Box === + $ammNorthLat = 31.745; + $ammSouthLat = 31.700; + $ammEastLng = 36.015; + $ammWestLng = 35.970; + + $airportCtx = false; $clubCtx = (stripos($startNameAddress, 'club') !== false || stripos($startNameAddress, 'ديسكو') !== false || stripos($endNameAddress, 'club') !== false || stripos($endNameAddress, 'ديسكو') !== false); - + + if ($isJordan) { + if (($destLat <= $ammNorthLat && $destLat >= $ammSouthLat && $destLng <= $ammEastLng && $destLng >= $ammWestLng) || + ($passengerLat <= $ammNorthLat && $passengerLat >= $ammSouthLat && $passengerLng <= $ammEastLng && $passengerLng >= $ammWestLng)) { + $airportCtx = true; + } + } else if ($isEgypt) { + $airportCtx = (stripos($startNameAddress, 'airport') !== false || stripos($startNameAddress, 'مطار') !== false || stripos($endNameAddress, 'airport') !== false || stripos($endNameAddress, 'مطار') !== false); + } + $northLat = 33.415313; $southLat = 33.400265; $eastLng = 36.531505;