Merge branch 'master' of gitlab.com:jankstudio/resq
This commit is contained in:
commit
cab1af0356
9 changed files with 165 additions and 1 deletions
|
|
@ -175,3 +175,13 @@ access_keys:
|
||||||
label: Update
|
label: Update
|
||||||
- id: rider.delete
|
- id: rider.delete
|
||||||
label: Delete
|
label: Delete
|
||||||
|
|
||||||
|
- id: joborder
|
||||||
|
label: Job Order
|
||||||
|
acls:
|
||||||
|
- id: joborder.menu
|
||||||
|
label: Menu
|
||||||
|
- id: jo_in.list
|
||||||
|
label: Incoming
|
||||||
|
- id: jo_proc.list
|
||||||
|
label: Processing
|
||||||
|
|
|
||||||
|
|
@ -75,3 +75,18 @@ main_menu:
|
||||||
acl: hub.menu
|
acl: hub.menu
|
||||||
label: Hub
|
label: Hub
|
||||||
parent: location
|
parent: location
|
||||||
|
|
||||||
|
|
||||||
|
- id: joborder
|
||||||
|
acl: joborder.menu
|
||||||
|
label: Job Order
|
||||||
|
icon: flaticon-transport
|
||||||
|
- id: jo_in
|
||||||
|
acl: jo_in.list
|
||||||
|
label: Incoming
|
||||||
|
parent: joborder
|
||||||
|
- id: jo_proc
|
||||||
|
acl: jo_proc.list
|
||||||
|
label: Processing
|
||||||
|
parent: joborder
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,12 @@ class Customer
|
||||||
*/
|
*/
|
||||||
protected $vehicles;
|
protected $vehicles;
|
||||||
|
|
||||||
|
// job orders made by customer
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="customer")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
// if any of their mobile numbers have been confirmed
|
// if any of their mobile numbers have been confirmed
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
|
|
@ -63,6 +69,7 @@ class Customer
|
||||||
$this->numbers = new ArrayCollection();
|
$this->numbers = new ArrayCollection();
|
||||||
$this->sessions = new ArrayCollection();
|
$this->sessions = new ArrayCollection();
|
||||||
$this->vehicles = new ArrayCollection();
|
$this->vehicles = new ArrayCollection();
|
||||||
|
$this->job_orders = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getID()
|
public function getID()
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,12 @@ class CustomerVehicle
|
||||||
*/
|
*/
|
||||||
protected $curr_battery;
|
protected $curr_battery;
|
||||||
|
|
||||||
|
// job orders that involve customer vehicle
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="cus_vehicle")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
// vehicle using motolite battery?
|
// vehicle using motolite battery?
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ use Doctrine\ORM\Mapping as ORM;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
* @ORM\Table(name="job_order")
|
* @ORM\Table(name="job_order")
|
||||||
|
|
@ -21,24 +23,89 @@ class JobOrder
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
// date job order was created
|
// date job order was created
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="datetime")
|
||||||
|
*/
|
||||||
protected $date_create;
|
protected $date_create;
|
||||||
|
|
||||||
// date and time of schedule
|
// date and time of schedule
|
||||||
// defaults to current date / time
|
// defaults to current date / time
|
||||||
protected $schedule;
|
/**
|
||||||
|
* @ORM\Column(type="datetime")
|
||||||
|
*/
|
||||||
|
protected $date_schedule;
|
||||||
|
|
||||||
|
// date that the job order was fulfilled / delivered
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="datetime", nullable=true)
|
||||||
|
*/
|
||||||
|
protected $date_fulfill;
|
||||||
|
|
||||||
|
// coordinates of the customer vehicle that needs service
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="point")
|
||||||
|
*/
|
||||||
|
protected $coordinates;
|
||||||
|
|
||||||
// is it an advanced order (future date)
|
// is it an advanced order (future date)
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
*/
|
||||||
protected $flag_advance;
|
protected $flag_advance;
|
||||||
|
|
||||||
// user that created the job order
|
// user that created the job order
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="User", inversedBy="job_orders")
|
||||||
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
|
||||||
|
*/
|
||||||
protected $created_by;
|
protected $created_by;
|
||||||
|
|
||||||
// service type
|
// service type
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=12)
|
||||||
|
*/
|
||||||
protected $service_type;
|
protected $service_type;
|
||||||
|
|
||||||
// customer that requested job order
|
// customer that requested job order
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="job_orders")
|
||||||
|
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
|
||||||
|
*/
|
||||||
protected $customer;
|
protected $customer;
|
||||||
|
|
||||||
// customer vehicle that needs servicing
|
// customer vehicle that needs servicing
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="CustomerVehicle", inversedBy="job_orders")
|
||||||
|
* @ORM\JoinColumn(name="cvehicle_id", referencedColumnName="id")
|
||||||
|
*/
|
||||||
protected $cus_vehicle;
|
protected $cus_vehicle;
|
||||||
|
|
||||||
|
// assigned outlet
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Outlet", inversedBy="job_orders")
|
||||||
|
* @ORM\JoinColumn(name="outlet_id", referencedColumnName="id")
|
||||||
|
*/
|
||||||
|
protected $outlet;
|
||||||
|
|
||||||
|
// assigned rider
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Rider", inversedBy="job_orders")
|
||||||
|
* @ORM\JoinColumn(name="rider_id", referencedColumnName="id")
|
||||||
|
*/
|
||||||
|
protected $rider;
|
||||||
|
|
||||||
|
// where requested job order came from (mobile or web)
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=10)
|
||||||
|
*/
|
||||||
|
protected $source;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->date_create = new DateTime();
|
||||||
|
$this->date_schedule = new DateTime();
|
||||||
|
|
||||||
|
$this->flag_advance = false;
|
||||||
|
$this->source = 'mobile';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,13 @@ class Outlet
|
||||||
*/
|
*/
|
||||||
protected $time_close;
|
protected $time_close;
|
||||||
|
|
||||||
|
// job orders assigned to outlet
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="outlet")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ namespace App\Entity;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
* @ORM\Table(name="rider")
|
* @ORM\Table(name="rider")
|
||||||
|
|
@ -43,6 +45,16 @@ class Rider
|
||||||
*/
|
*/
|
||||||
protected $hub;
|
protected $hub;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="rider")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->job_orders = new ArrayCollection();
|
||||||
|
}
|
||||||
|
|
||||||
public function getID()
|
public function getID()
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,16 @@ class User implements AdvancedUserInterface, Serializable
|
||||||
*/
|
*/
|
||||||
protected $email;
|
protected $email;
|
||||||
|
|
||||||
|
// job orders made by this user
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="created_by")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->roles = new ArrayCollection();
|
$this->roles = new ArrayCollection();
|
||||||
|
$this->job_orders = new ArrayCollection();
|
||||||
$this->enabled = true;
|
$this->enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
33
src/Ramcar/ServiceType.php
Normal file
33
src/Ramcar/ServiceType.php
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Ramcar;
|
||||||
|
|
||||||
|
class ServiceType
|
||||||
|
{
|
||||||
|
const BATTERY_REPLACEMENT = 'battery';
|
||||||
|
const TIRE_REPAIR = 'tire';
|
||||||
|
const OVERHEAT_ASSITANCE = 'overheat';
|
||||||
|
const EMERGENCY_REFUEL = 'fuel';
|
||||||
|
|
||||||
|
const COLLECTION = [
|
||||||
|
'battery' => 'Battery Replacement',
|
||||||
|
'tire' => 'Tire Repair',
|
||||||
|
'overheat' => 'Overheat Assistance',
|
||||||
|
'fuel' => 'Emergency Refuel',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
static public function getServiceTypes()
|
||||||
|
{
|
||||||
|
return self::COLLECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function validate($type_text)
|
||||||
|
{
|
||||||
|
if (isset(self::COLLECTION[$type_text]))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue