65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\RestaurantDelivery\Contracts;
|
|
|
|
use Modules\RestaurantDelivery\Models\Delivery;
|
|
use Modules\RestaurantDelivery\Models\Rider;
|
|
|
|
interface TrackingServiceInterface
|
|
{
|
|
/**
|
|
* Update rider's live location.
|
|
*/
|
|
public function updateRiderLocation(
|
|
Rider $rider,
|
|
float $latitude,
|
|
float $longitude,
|
|
?float $speed = null,
|
|
?float $bearing = null,
|
|
?float $accuracy = null
|
|
): array;
|
|
|
|
/**
|
|
* Get last known rider location.
|
|
*/
|
|
public function getLastRiderLocation(int|string $riderId): ?array;
|
|
|
|
/**
|
|
* Check if rider has valid location.
|
|
*/
|
|
public function hasValidLocation(Rider $rider): bool;
|
|
|
|
/**
|
|
* Initialize tracking for a new delivery.
|
|
*/
|
|
public function initializeDeliveryTracking(Delivery $delivery): bool;
|
|
|
|
/**
|
|
* Update delivery tracking with new rider location.
|
|
*/
|
|
public function updateDeliveryTracking(
|
|
Delivery $delivery,
|
|
float $latitude,
|
|
float $longitude,
|
|
?float $speed = null,
|
|
?float $bearing = null
|
|
): void;
|
|
|
|
/**
|
|
* Update delivery status in tracking.
|
|
*/
|
|
public function updateDeliveryStatus(Delivery $delivery, ?array $metadata = null): void;
|
|
|
|
/**
|
|
* Get current tracking data for a delivery.
|
|
*/
|
|
public function getDeliveryTracking(Delivery $delivery): ?array;
|
|
|
|
/**
|
|
* End tracking for completed/cancelled delivery.
|
|
*/
|
|
public function endDeliveryTracking(Delivery $delivery): void;
|
|
}
|