diff --git a/config/cmb.services.yaml b/config/cmb.services.yaml index 3d9fd7a3..07354a8a 100644 --- a/config/cmb.services.yaml +++ b/config/cmb.services.yaml @@ -196,6 +196,12 @@ services: $upload_dir: "%jo_extra_upload_directory%" 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 #App\Service\GISManager\Bing: ~ @@ -221,6 +227,12 @@ services: event: 'postPersist' 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: arguments: $redis_prov: "@App\\Service\\RedisClientProvider" diff --git a/config/services.yaml b/config/services.yaml index 7d585e08..07354a8a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -196,6 +196,12 @@ services: $upload_dir: "%jo_extra_upload_directory%" 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 #App\Service\GISManager\Bing: ~ diff --git a/src/Ramcar/CMBWarrantyClass.php b/src/Ramcar/CMBWarrantyClass.php index 1e2c69b4..c7544719 100644 --- a/src/Ramcar/CMBWarrantyClass.php +++ b/src/Ramcar/CMBWarrantyClass.php @@ -4,12 +4,14 @@ namespace App\Ramcar; class CMBWarrantyClass extends NameValue { - const WTY_PASSENGER = 'passenger'; - const WTY_COMMERCIAL = 'commercial'; + const WTY_PASSENGER = 'passenger'; + const WTY_COMMERCIAL = 'commercial'; + const WTY_GRAB = 'grab'; const COLLECTION = [ 'passenger' => 'Passenger', 'commercial' => 'Commercial', + 'grab' => 'Grab', ]; } diff --git a/src/Service/JobOrderHandler/CMBJobOrderHandler.php b/src/Service/JobOrderHandler/CMBJobOrderHandler.php index 05d9ce45..4760d286 100644 --- a/src/Service/JobOrderHandler/CMBJobOrderHandler.php +++ b/src/Service/JobOrderHandler/CMBJobOrderHandler.php @@ -44,7 +44,7 @@ use App\Service\InvoiceGeneratorInterface; use App\Service\JobOrderHandlerInterface; use App\Service\RiderAssignmentHandlerInterface; use App\Service\CustomerHandlerInterface; -use App\Service\WarrantyHandler; +use App\Service\WarrantyHandlerInterface; use App\Service\MQTTClient; use App\Service\APNSClient; use App\Service\MapTools; @@ -75,7 +75,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface public function __construct(Security $security, EntityManagerInterface $em, InvoiceGeneratorInterface $ic, ValidatorInterface $validator, TranslatorInterface $translator, RiderAssignmentHandlerInterface $rah, - string $country_code, WarrantyHandler $wh, + string $country_code, WarrantyHandlerInterface $wh, CustomerHandlerInterface $cust_handler) { $this->em = $em; diff --git a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php index 72c6f949..6fc80932 100644 --- a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php +++ b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php @@ -20,7 +20,7 @@ use App\Service\RiderAPIHandlerInterface; use App\Service\RedisClientProvider; use App\Service\RiderCache; use App\Service\MQTTClient; -use App\Service\WarrantyHandler; +use App\Service\WarrantyHandlerInterface; use App\Service\JobOrderHandlerInterface; use App\Service\InvoiceGeneratorInterface; use App\Service\RiderTracker; @@ -61,7 +61,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface public function __construct(EntityManagerInterface $em, RedisClientProvider $redis, EncoderFactoryInterface $ef, RiderCache $rcache, string $country_code, MQTTClient $mclient, - WarrantyHandler $wh, JobOrderHandlerInterface $jo_handler, + WarrantyHandlerInterface $wh, JobOrderHandlerInterface $jo_handler, InvoiceGeneratorInterface $ic, string $upload_dir, RiderTracker $rider_tracker, NotificationManager $nm, UrlGeneratorInterface $router) diff --git a/src/Service/WarrantyHandlerInterface.php b/src/Service/WarrantyHandlerInterface.php new file mode 100644 index 00000000..13950ed5 --- /dev/null +++ b/src/Service/WarrantyHandlerInterface.php @@ -0,0 +1,27 @@ +