Recommit warranty computation changes. #512
This commit is contained in:
parent
f9f3ac6099
commit
b212fa99bc
6 changed files with 53 additions and 6 deletions
|
|
@ -197,6 +197,12 @@ services:
|
||||||
|
|
||||||
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
|
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
|
||||||
|
|
||||||
|
# warranty handler service
|
||||||
|
App\Service\WarrantyHandler\CMBWarrantyHandler: ~
|
||||||
|
|
||||||
|
# warranty handler interface
|
||||||
|
App\Service\WarrantyHandlerInterface: "@App\\Service\\WarrantyHandler\\CMBWarrantyHandler"
|
||||||
|
|
||||||
# map manager
|
# map manager
|
||||||
#App\Service\GISManager\Bing: ~
|
#App\Service\GISManager\Bing: ~
|
||||||
App\Service\GISManager\OpenStreet: ~
|
App\Service\GISManager\OpenStreet: ~
|
||||||
|
|
@ -221,6 +227,12 @@ services:
|
||||||
event: 'postPersist'
|
event: 'postPersist'
|
||||||
entity: 'App\Entity\JobOrder'
|
entity: 'App\Entity\JobOrder'
|
||||||
|
|
||||||
|
App\Service\NotificationManager:
|
||||||
|
arguments:
|
||||||
|
$redis_prov: "@App\\Service\\RedisClientProvider"
|
||||||
|
$redis_mqtt_key: "mqtt_events"
|
||||||
|
$em: "@doctrine.orm.entity_manager"
|
||||||
|
|
||||||
App\Service\JobOrderCache:
|
App\Service\JobOrderCache:
|
||||||
arguments:
|
arguments:
|
||||||
$redis_prov: "@App\\Service\\RedisClientProvider"
|
$redis_prov: "@App\\Service\\RedisClientProvider"
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,12 @@ services:
|
||||||
|
|
||||||
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
|
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
|
||||||
|
|
||||||
|
# warranty handler service
|
||||||
|
App\Service\WarrantyHandler\CMBWarrantyHandler: ~
|
||||||
|
|
||||||
|
# warranty handler interface
|
||||||
|
App\Service\WarrantyHandlerInterface: "@App\\Service\\WarrantyHandler\\CMBWarrantyHandler"
|
||||||
|
|
||||||
# map manager
|
# map manager
|
||||||
#App\Service\GISManager\Bing: ~
|
#App\Service\GISManager\Bing: ~
|
||||||
App\Service\GISManager\OpenStreet: ~
|
App\Service\GISManager\OpenStreet: ~
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,14 @@ namespace App\Ramcar;
|
||||||
|
|
||||||
class CMBWarrantyClass extends NameValue
|
class CMBWarrantyClass extends NameValue
|
||||||
{
|
{
|
||||||
const WTY_PASSENGER = 'passenger';
|
const WTY_PASSENGER = 'passenger';
|
||||||
const WTY_COMMERCIAL = 'commercial';
|
const WTY_COMMERCIAL = 'commercial';
|
||||||
|
const WTY_GRAB = 'grab';
|
||||||
|
|
||||||
const COLLECTION = [
|
const COLLECTION = [
|
||||||
'passenger' => 'Passenger',
|
'passenger' => 'Passenger',
|
||||||
'commercial' => 'Commercial',
|
'commercial' => 'Commercial',
|
||||||
|
'grab' => 'Grab',
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ use App\Service\InvoiceGeneratorInterface;
|
||||||
use App\Service\JobOrderHandlerInterface;
|
use App\Service\JobOrderHandlerInterface;
|
||||||
use App\Service\RiderAssignmentHandlerInterface;
|
use App\Service\RiderAssignmentHandlerInterface;
|
||||||
use App\Service\CustomerHandlerInterface;
|
use App\Service\CustomerHandlerInterface;
|
||||||
use App\Service\WarrantyHandler;
|
use App\Service\WarrantyHandlerInterface;
|
||||||
use App\Service\MQTTClient;
|
use App\Service\MQTTClient;
|
||||||
use App\Service\APNSClient;
|
use App\Service\APNSClient;
|
||||||
use App\Service\MapTools;
|
use App\Service\MapTools;
|
||||||
|
|
@ -75,7 +75,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
public function __construct(Security $security, EntityManagerInterface $em,
|
public function __construct(Security $security, EntityManagerInterface $em,
|
||||||
InvoiceGeneratorInterface $ic, ValidatorInterface $validator,
|
InvoiceGeneratorInterface $ic, ValidatorInterface $validator,
|
||||||
TranslatorInterface $translator, RiderAssignmentHandlerInterface $rah,
|
TranslatorInterface $translator, RiderAssignmentHandlerInterface $rah,
|
||||||
string $country_code, WarrantyHandler $wh,
|
string $country_code, WarrantyHandlerInterface $wh,
|
||||||
CustomerHandlerInterface $cust_handler)
|
CustomerHandlerInterface $cust_handler)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ use App\Service\RiderAPIHandlerInterface;
|
||||||
use App\Service\RedisClientProvider;
|
use App\Service\RedisClientProvider;
|
||||||
use App\Service\RiderCache;
|
use App\Service\RiderCache;
|
||||||
use App\Service\MQTTClient;
|
use App\Service\MQTTClient;
|
||||||
use App\Service\WarrantyHandler;
|
use App\Service\WarrantyHandlerInterface;
|
||||||
use App\Service\JobOrderHandlerInterface;
|
use App\Service\JobOrderHandlerInterface;
|
||||||
use App\Service\InvoiceGeneratorInterface;
|
use App\Service\InvoiceGeneratorInterface;
|
||||||
use App\Service\RiderTracker;
|
use App\Service\RiderTracker;
|
||||||
|
|
@ -61,7 +61,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
public function __construct(EntityManagerInterface $em, RedisClientProvider $redis,
|
public function __construct(EntityManagerInterface $em, RedisClientProvider $redis,
|
||||||
EncoderFactoryInterface $ef, RiderCache $rcache,
|
EncoderFactoryInterface $ef, RiderCache $rcache,
|
||||||
string $country_code, MQTTClient $mclient,
|
string $country_code, MQTTClient $mclient,
|
||||||
WarrantyHandler $wh, JobOrderHandlerInterface $jo_handler,
|
WarrantyHandlerInterface $wh, JobOrderHandlerInterface $jo_handler,
|
||||||
InvoiceGeneratorInterface $ic, string $upload_dir,
|
InvoiceGeneratorInterface $ic, string $upload_dir,
|
||||||
RiderTracker $rider_tracker, NotificationManager $nm,
|
RiderTracker $rider_tracker, NotificationManager $nm,
|
||||||
UrlGeneratorInterface $router)
|
UrlGeneratorInterface $router)
|
||||||
|
|
|
||||||
27
src/Service/WarrantyHandlerInterface.php
Normal file
27
src/Service/WarrantyHandlerInterface.php
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Service;
|
||||||
|
|
||||||
|
use App\Entity\Warranty;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
interface WarrantyHandlerInterface
|
||||||
|
{
|
||||||
|
public function createWarranty(string $serial, string $plate_number, string $first_name, string$last_name,
|
||||||
|
string $mobile_number, array $batt_list, DateTime $date_purchase,
|
||||||
|
string $warranty_class);
|
||||||
|
|
||||||
|
public function updateCustomerVehicle(string $serial, array $batteries, string $plate_number, DateTime $date_expire);
|
||||||
|
|
||||||
|
public function updateWarranty(Warranty $warr, string $first_name, string $last_name, string $mobile_number,
|
||||||
|
array $batt_list, DateTime $date_purchase);
|
||||||
|
|
||||||
|
public function computeDateExpire(DateTime $date_create, int $warranty_period);
|
||||||
|
|
||||||
|
public function getWarrantyPeriod(array $batteries, string $warranty_class);
|
||||||
|
|
||||||
|
public function getBatteriesForWarranty(Warranty $warr);
|
||||||
|
|
||||||
|
public function cleanPlateNumber(string $plate);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue