<?php
namespace AdminBundle\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* DriverHistory
*/
#[ORM\Table(name: 'driver_history')]
#[ORM\Entity(repositoryClass: \AdminBundle\Repository\DriverHistoryRepository::class)]
class DriverHistory
{
const TYPE_DRIVER = 0;
const TYPE_BOOKING = 1;
const ACTION_LOGGEED_IN = 'Logged In';
const VALUE_LOGGED_IN = 'Mobile App';
const VALUE_AUTOASSIGN_BOOKING = "Autoassign 'Get Booking'";
const VALUE_DISPATCH_ACCEPT = 'Dispatch Accept';
const VALUE_DISPATCH_ACCEPT_WHILE_IN_QUEUE = 'Dispatch Accept while in queue';
const VALUE_REJECTED = 'Rejected';
const VALUE_REJECTED_WHILE_IN_QUEUE = 'Rejected while in queue';
const VALUE_ON_THE_WAY = 'On the way';
const VALUE_DEALLOCATED_ON_DMAND = 'Deallocated on demand';
const VALUE_COMPLETED = 'Completed';
const VALUE_COMPLETED_THREE = '3 Bookings completed in last 24 hours';
const VALUE_SUSPENDED_BY_ADMIN = 'Suspended by Admin';
const VALUE_ACTIVATED_BY_ADMIN = 'Activated by Admin';
const VALUE_AUTOSUSPENDED_GET_BOOKING = 'Auto suspended from "Get booking" by System';
const VALUE_REVIEW = 'Received review';
const VALUE_ASAP_CONFIRMED = 'ASAP Booking Request confirmed';
const VALUE_ASAP_REJECTED = 'ASAP Booking Request rejected';
const VALUE_MANUALLY_DISPATCH = 'Booking manually dispatched (office assigned)';
const VALUE_LOGGED_IN_BETWEEN = 'Logged In between 1 and 3 days';
const VALUE_LOGGED_IN_AFTER_3_DAYS = 'Logged In after 3 days';
const VALUE_BOOKING_ACCEPTED_IN_WEEKEND = 'Booking acceepted in weekend';
const VALUE_NO_BOOKING_ACCEPTED_IN_WEEKEND = 'No booking was accepted during last weekend';
const VALUE_DISPATCHED_NEARBY_WHILE_IN_QUEUE = 'Dispatched booking nearby while in queue. Driver automatically left queue';
const VALUE_DRIVER_LOGGED_UNDER_5_HOURS = 'Driver stayed in app under 5 hours';
const VALUE_DRIVER_LOGGED_OVER_5_HOURS = 'Driver stayed in app over 5 hours';
const VALUE_DRIVER_MANUALLY_LEAVED_QUEUE = 'Driver manually leaved area queue';
const VALUE_LINKED_BOOKING_REQUEST_DEALLOCATED_ON_DEMAND = 'Linked Booking Request Deallocated on demand';
const VALUE_BOOKING_PACKAGE_REQUEST_DEALLOCATED_ON_DEMAND_12_HOURS = 'Booking Package Request Deallocated on demand in last 12 hours';
const VALUE_BOOKING_PACKAGE_REQUEST_DEALLOCATED_ON_DEMAND_24_HOURS = 'Booking Package Request Deallocated on demand over 24 hours';
const VALUE_BOOKING_REQUEST_DEALLOCATED_ON_DEMAND_12_HOURS = 'Booking Request Deallocated on demand in last 12 hours';
const VALUE_BOOKING_REQUEST_DEALLOCATED_ON_DEMAND_24_HOURS = 'Booking Request Deallocated on demand over 24 hours';
const VALUE_BOOKING_PACKAGE_REQUEST_CONFIRMED_12_HOURS = 'Booking Package Request Confirmed in last 12 hours';
const VALUE_BOOKING_PACKAGE_REQUEST_CONFIRMED_24_HOURS = 'Booking Package Request Confirmed over 24 hours';
const VALUE_LINKED_BOOKING_REQUEST_CONFIRMED = 'Linked Booking Request Confirmed';
const VALUE_BOOKING_REQUEST_CONFIRMED_24_HOURS = 'Booking Request Confirmed';
const VALUE_NO_MINIMAL_BOOKINGS_COMPLETED_LAST_WEEK = 'Minimal jobs for last week not reached: ';
const DRIVER_HISTORY_TYPES = [
self::TYPE_DRIVER => 'Driver',
self::TYPE_BOOKING => 'Booking',
];
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected $id;
/**
* @var Driver
*/
#[ORM\JoinColumn(name: 'driver_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: \AdminBundle\Entity\Driver::class, inversedBy: 'driverHistory')]
protected $driver;
/**
* @var int
*/
#[ORM\Column(name: 'type', type: 'integer')]
protected $type;
/**
* @var string
*/
#[ORM\Column(name: 'action', type: 'string', length: 64)]
protected $action;
/**
* @var string
*/
#[ORM\Column(name: 'value', type: 'string', length: 64, nullable: true)]
protected $value;
/**
* @var int
*/
#[ORM\Column(name: 'points', type: 'integer')]
protected $points;
/**
* @var boolean
*/
#[ORM\Column(name: 'is_auto', type: 'boolean', nullable: false, options: ['default' => 1])]
protected $isAuto = true;
/**
* @var DateTime
*/
#[ORM\Column(name: 'created_at', type: 'datetime')]
protected $createdAt;
public function __construct()
{
$this->createdAt = new DateTime();
$this->isAuto = true;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param Driver $driver
*
* @return DriverHistory
*/
public function setDriver(Driver $driver = null)
{
$this->driver = $driver;
return $this;
}
/**
* @return Driver
*/
public function getDriver()
{
return $this->driver;
}
/**
* @param int $type
*
* @return DriverHistory
*/
public function setType($type): DriverHistory
{
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType()
{
return $this->type;
}
/**
* @param string $action
*
* @return DriverHistory
*/
public function setAction($action): DriverHistory
{
$this->action = $action;
return $this;
}
/**
* @return string
*/
public function getAction()
{
return $this->action;
}
/**
* @param string $value
*
* @return DriverHistory
*/
public function setValue($value): DriverHistory
{
$this->value = $value;
return $this;
}
/**
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* @param int $points
*
* @return DriverHistory
*/
public function setPoints($points): DriverHistory
{
$this->points = $points;
return $this;
}
/**
* @return int
*/
public function getPoints()
{
return $this->points;
}
/**
* @param DateTime $createdAt
*
* @return DriverHistory
*/
public function setCreatedAt(DateTime $createdAt): DriverHistory
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return bool
*/
public function getIsAuto()
{
return $this->isAuto;
}
/**
* @param string $isAuto
*
* @return DriverHistory
*/
public function setIsAuto($isAuto): DriverHistory
{
$this->isAuto = $isAuto;
return $this;
}
}