migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\RestaurantDelivery\Enums;
|
||||
|
||||
enum RiderStatus: string
|
||||
{
|
||||
case PENDING = 'pending';
|
||||
case ACTIVE = 'active';
|
||||
case SUSPENDED = 'suspended';
|
||||
case INACTIVE = 'inactive';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PENDING => 'Pending Verification',
|
||||
self::ACTIVE => 'Active',
|
||||
self::SUSPENDED => 'Suspended',
|
||||
self::INACTIVE => 'Inactive',
|
||||
};
|
||||
}
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PENDING => '#F59E0B',
|
||||
self::ACTIVE => '#10B981',
|
||||
self::SUSPENDED => '#EF4444',
|
||||
self::INACTIVE => '#6B7280',
|
||||
};
|
||||
}
|
||||
|
||||
public function canAcceptOrders(): bool
|
||||
{
|
||||
return $this === self::ACTIVE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user