Add delivery status to job order. #617
This commit is contained in:
parent
b6f840f5d7
commit
1554f173a8
6 changed files with 79 additions and 4 deletions
|
|
@ -31,6 +31,7 @@ use App\Ramcar\AutoAssignStatus;
|
||||||
use App\Ramcar\WarrantySource;
|
use App\Ramcar\WarrantySource;
|
||||||
use App\Ramcar\HubCriteria;
|
use App\Ramcar\HubCriteria;
|
||||||
use App\Ramcar\CustomerSource;
|
use App\Ramcar\CustomerSource;
|
||||||
|
use App\Ramcar\DeliveryStatus;
|
||||||
|
|
||||||
use App\Service\InvoiceGeneratorInterface;
|
use App\Service\InvoiceGeneratorInterface;
|
||||||
use App\Service\RisingTideGateway;
|
use App\Service\RisingTideGateway;
|
||||||
|
|
@ -2947,6 +2948,7 @@ class APIController extends Controller implements LoggedController
|
||||||
$jo->setRider($assigned_rider);
|
$jo->setRider($assigned_rider);
|
||||||
$jo->setStatus(JOStatus::ASSIGNED);
|
$jo->setStatus(JOStatus::ASSIGNED);
|
||||||
$jo->setStatusAutoAssign(AutoAssignStatus::HUB_AND_RIDER_ASSIGNED);
|
$jo->setStatusAutoAssign(AutoAssignStatus::HUB_AND_RIDER_ASSIGNED);
|
||||||
|
$jo->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN);
|
||||||
|
|
||||||
$assigned_rider->setAvailable(false);
|
$assigned_rider->setAvailable(false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ class RiderController extends APIController
|
||||||
'has_warranty_doc' => false,
|
'has_warranty_doc' => false,
|
||||||
'flag_coolant' => $jo->hasCoolant(),
|
'flag_coolant' => $jo->hasCoolant(),
|
||||||
'has_motolite' => $cv->hasMotoliteBattery(),
|
'has_motolite' => $cv->hasMotoliteBattery(),
|
||||||
|
'delivery_status' => $jo->getDeliveryStatus(),
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,12 @@ class JobOrder
|
||||||
*/
|
*/
|
||||||
protected $no_trade_in_reason;
|
protected $no_trade_in_reason;
|
||||||
|
|
||||||
|
// delivery status of the job order
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=30, nullable=true)
|
||||||
|
*/
|
||||||
|
protected $delivery_status;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->date_create = new DateTime();
|
$this->date_create = new DateTime();
|
||||||
|
|
@ -1032,4 +1038,16 @@ class JobOrder
|
||||||
{
|
{
|
||||||
return $this->no_trade_in_reason;
|
return $this->no_trade_in_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setDeliveryStatus($delivery_status)
|
||||||
|
{
|
||||||
|
$this->delivery_status = $delivery_status;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDeliveryStatus()
|
||||||
|
{
|
||||||
|
return $this->delivery_status;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
41
src/Ramcar/DeliveryStatus.php
Normal file
41
src/Ramcar/DeliveryStatus.php
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Ramcar;
|
||||||
|
|
||||||
|
class DeliveryStatus extends NameValue
|
||||||
|
{
|
||||||
|
const RIDER_ASSIGN = 'rider_assign';
|
||||||
|
const REQUEUE = 'requeue';
|
||||||
|
const RIDER_ACCEPT = 'accept';
|
||||||
|
const RIDER_ARRIVE = 'arrive';
|
||||||
|
const RIDER_EDIT = 'rider_edit';
|
||||||
|
const RIDER_DEPART_HUB = 'rider_depart_hub';
|
||||||
|
const RIDER_ARRIVE_HUB_PRE_JO = 'rider_arrive_hub_pre_jo';
|
||||||
|
const RIDER_DEPART_HUB_PRE_JO = 'rider_depart_hub_pre_jo';
|
||||||
|
const RIDER_START = 'rider_start';
|
||||||
|
const RIDER_END = 'rider_end';
|
||||||
|
const RIDER_ARRIVE_HUB_POST_JO = 'rider_arrive_hub_post_jo';
|
||||||
|
const RIDER_DEPART_HUB_POST_JO = 'rider_depart_hub_post_jo';
|
||||||
|
const RIDER_ARRIVE_HUB = 'rider_arrive_hub';
|
||||||
|
const CANCELLED = 'cancelled';
|
||||||
|
const FULFILLED = 'fulfilled';
|
||||||
|
|
||||||
|
const COLLECTION = [
|
||||||
|
'rider_assign' => 'Assigned Rider',
|
||||||
|
'requeue' => 'Requeue',
|
||||||
|
'accept' => 'Rider Accept',
|
||||||
|
'arrive' => 'Rider Arrive',
|
||||||
|
'rider_edit' => 'Rider Edit',
|
||||||
|
'rider_depart_hub' => 'Rider Depart Hub',
|
||||||
|
'rider_arrive_hub_pre_jo' => 'Rider Arrive Hub Pre JO',
|
||||||
|
'rider_depart_hub_pre_jo' => 'Rider Depart Hub Pre JO',
|
||||||
|
'rider_start' => 'Rider Start',
|
||||||
|
'rider_end' => 'Rider End',
|
||||||
|
'rider_arrive_hub_post_jo' => 'Rider Arrive Hub Post JO',
|
||||||
|
'rider_depart_hub_post_jo' => 'Rider Depart Hub Post JO',
|
||||||
|
'rider_arrive_hub' => 'Rider Arrive Hub',
|
||||||
|
'cancelled' => 'Cancelled',
|
||||||
|
'fulfilled' => 'Fulfilled',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -34,5 +34,13 @@ class JOEventType extends NameValue
|
||||||
'accept' => 'Rider Accept',
|
'accept' => 'Rider Accept',
|
||||||
'arrive' => 'Rider Arrive',
|
'arrive' => 'Rider Arrive',
|
||||||
'rider_edit' => 'Rider Edit',
|
'rider_edit' => 'Rider Edit',
|
||||||
|
'rider_depart_hub' => 'Rider Depart Hub',
|
||||||
|
'rider_arrive_hub_pre_jo' => 'Rider Arrive Hub Pre JO',
|
||||||
|
'rider_depart_hub_pre_jo' => 'Rider Depart Hub Pre JO',
|
||||||
|
'rider_start' => 'Rider Start',
|
||||||
|
'rider_end' => 'Rider End',
|
||||||
|
'rider_arrive_hub_post_jo' => 'Rider Arrive Hub Post JO',
|
||||||
|
'rider_depart_hub_post_jo' => 'Rider Depart Hub Post JO',
|
||||||
|
'rider_arrive_hub' => 'Rider Arrive Hub',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ use App\Ramcar\NoTradeInReason;
|
||||||
use App\Ramcar\WillingToWaitContent;
|
use App\Ramcar\WillingToWaitContent;
|
||||||
use App\Ramcar\WarrantySource;
|
use App\Ramcar\WarrantySource;
|
||||||
use App\Ramcar\HubCriteria;
|
use App\Ramcar\HubCriteria;
|
||||||
|
use App\Ramcar\DeliveryStatus;
|
||||||
|
|
||||||
use App\Service\InvoiceGeneratorInterface;
|
use App\Service\InvoiceGeneratorInterface;
|
||||||
use App\Service\JobOrderHandlerInterface;
|
use App\Service\JobOrderHandlerInterface;
|
||||||
|
|
@ -932,7 +933,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setLandmark($req->request->get('landmark'))
|
->setLandmark($req->request->get('landmark'))
|
||||||
->setWillWait($req->request->get('flag_willing_to_wait'))
|
->setWillWait($req->request->get('flag_willing_to_wait'))
|
||||||
->setReasonNotWait($reason)
|
->setReasonNotWait($reason)
|
||||||
->setNotWaitingNotes($more_reason);
|
->setNotWaitingNotes($more_reason)
|
||||||
|
->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN);
|
||||||
|
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
{
|
{
|
||||||
|
|
@ -1028,7 +1030,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setLandmark($req->request->get('landmark'))
|
->setLandmark($req->request->get('landmark'))
|
||||||
->setWillWait($req->request->get('flag_willing_to_wait'))
|
->setWillWait($req->request->get('flag_willing_to_wait'))
|
||||||
->setReasonNotWait($reason)
|
->setReasonNotWait($reason)
|
||||||
->setNotWaitingNotes($more_reason);
|
->setNotWaitingNotes($more_reason)
|
||||||
|
->setDeliveryStatus(DeliveryStatus::FULFILLED);
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
$errors = $this->validator->validate($obj);
|
$errors = $this->validator->validate($obj);
|
||||||
|
|
@ -1143,7 +1146,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
|
|
||||||
$cancel_reason = $req->request->get('cancel_reason');
|
$cancel_reason = $req->request->get('cancel_reason');
|
||||||
error_log($cancel_reason);
|
error_log($cancel_reason);
|
||||||
$obj->cancel($cancel_reason);
|
$obj->cancel($cancel_reason)
|
||||||
|
->setDeliveryStatus(DeliveryStatus::CANCELLED);
|
||||||
|
|
||||||
// the event
|
// the event
|
||||||
$event = new JOEvent();
|
$event = new JOEvent();
|
||||||
|
|
@ -1484,7 +1488,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setLandmark($req->request->get('landmark'))
|
->setLandmark($req->request->get('landmark'))
|
||||||
->setWillWait($req->request->get('flag_willing_to_wait'))
|
->setWillWait($req->request->get('flag_willing_to_wait'))
|
||||||
->setReasonNotWait($reason)
|
->setReasonNotWait($reason)
|
||||||
->setNotWaitingNotes($more_reason);
|
->setNotWaitingNotes($more_reason)
|
||||||
|
->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN);
|
||||||
|
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue