Add event log entries for user api JO calls #162
This commit is contained in:
parent
57eef0a0a4
commit
5b323e155b
1 changed files with 17 additions and 5 deletions
|
|
@ -20,6 +20,7 @@ use App\Ramcar\WarrantyClass;
|
||||||
use App\Ramcar\APIRiderStatus;
|
use App\Ramcar\APIRiderStatus;
|
||||||
use App\Ramcar\TransactionOrigin;
|
use App\Ramcar\TransactionOrigin;
|
||||||
use App\Ramcar\TradeInType;
|
use App\Ramcar\TradeInType;
|
||||||
|
use App\Ramcar\JOEventType;
|
||||||
|
|
||||||
use App\Service\InvoiceCreator;
|
use App\Service\InvoiceCreator;
|
||||||
use App\Service\RisingTideGateway;
|
use App\Service\RisingTideGateway;
|
||||||
|
|
@ -34,6 +35,7 @@ use App\Entity\JobOrder;
|
||||||
use App\Entity\Promo;
|
use App\Entity\Promo;
|
||||||
use App\Entity\Battery;
|
use App\Entity\Battery;
|
||||||
use App\Entity\RiderRating;
|
use App\Entity\RiderRating;
|
||||||
|
use App\Entity\JOEvent;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
|
||||||
|
|
@ -888,6 +890,14 @@ class APIController extends Controller
|
||||||
|
|
||||||
$em->persist($jo);
|
$em->persist($jo);
|
||||||
$em->persist($invoice);
|
$em->persist($invoice);
|
||||||
|
|
||||||
|
// add event log
|
||||||
|
$event = new JOEvent();
|
||||||
|
$event->setDateHappen(new DateTime())
|
||||||
|
->setTypeID(JOEventType::CREATE)
|
||||||
|
->setJobOrder($jo);
|
||||||
|
$em->persist($event);
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
// make invoice json data
|
// make invoice json data
|
||||||
|
|
@ -1311,11 +1321,13 @@ class APIController extends Controller
|
||||||
$cancel_reason = $req->request->get('reason');
|
$cancel_reason = $req->request->get('reason');
|
||||||
|
|
||||||
$jo->cancel($cancel_reason);
|
$jo->cancel($cancel_reason);
|
||||||
/*
|
|
||||||
$jo->setStatus(JOStatus::CANCELLED)
|
// add event log
|
||||||
->setDateCancel(new DateTime())
|
$event = new JOEvent();
|
||||||
->setCancelReason($cancel_reason);
|
$event->setDateHappen(new DateTime())
|
||||||
*/
|
->setTypeID(JOEventType::CANCEL)
|
||||||
|
->setJobOrder($jo);
|
||||||
|
$em->persist($event);
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue