Compare commits

...

77 commits

Author SHA1 Message Date
Korina Cordero
c46fa82b68 Make responsible party field mandatory. Fix issues found for walkin JO. #484 2020-09-08 03:31:22 +00:00
Korina Cordero
dacd9efe01 Merge branch '472-cmb-release' of gitlab.com:jankstudio/resq into 484-cmb-cmb-changes 2020-09-08 02:24:38 +00:00
Korina Cordero
818277159c Remove test hubs and riders. #472 2020-09-07 04:51:35 +00:00
Korina Cordero
5b70085162 Set rider limit to 50. #472 2020-09-07 04:10:02 +00:00
Korina Cordero
92a7380b4f Fix display issue of cancel reason. #472 2020-09-07 03:27:38 +00:00
Korina Cordero
9052f8102c Get name for cancel reason. #472 2020-09-07 03:00:22 +00:00
Korina Cordero
0fb08002e8 Merge branch '484-cmb-cmb-changes' into '472-cmb-release'
Resolve "CMB - CMB changes"

See merge request jankstudio/resq!568
2020-09-07 02:44:09 +00:00
Korina Cordero
399cf23f29 Merge branch '460-cmb-data-migration-for-carfix-data' into '472-cmb-release'
Resolve "CMB - Data migration for Carfix data"

See merge request jankstudio/resq!565
2020-09-07 02:42:34 +00:00
Korina Cordero
ad77e20bd3 Merge branch '460-cmb-data-migration-for-carfix-data' of gitlab.com:jankstudio/resq into 484-cmb-cmb-changes 2020-09-07 02:13:06 +00:00
Korina Cordero
4703cd5080 Remove rider plate number from form. Get plate number from rider. #484 2020-09-07 02:06:20 +00:00
Korina Cordero
ce8e8974bd Add rider plate number to JO. #484 2020-09-04 09:48:50 +00:00
Korina Cordero
171fa14e40 Add job order number to notifications. Add cancel reason to notifications if JO is cancelled. #484 2020-09-04 08:41:20 +00:00
Korina Cordero
5185043934 Merge branch '483-cmb-agent-s-name-in-open-and-view-all' into '472-cmb-release'
Add agent name to the view all and view open JO pages. #483

See merge request jankstudio/resq!567
2020-09-04 08:07:48 +00:00
Korina Cordero
8eebf6ee1c Add invalid mobile numbers to invalid file. #460 2020-09-04 08:07:31 +00:00
Korina Cordero
089bced14c Add agent name to the view all and view open JO pages. #483 2020-09-04 03:14:37 +00:00
Korina Cordero
8c32792c38 Create command to add vehicle manufacturers, vehicles and their compatible batteries. #460 2020-09-02 11:34:50 +00:00
Korina Cordero
49ee85898e Create command to add vehicle manufacturers, vehicles and their compatible batteries. #460 2020-09-02 11:33:17 +00:00
Korina Cordero
b8885edaaa Modify commands for importing battery information. #460 2020-09-02 09:55:45 +00:00
Korina Cordero
9b7fa2048a Add command to create battery manufacturers and models and import battery sizes. #460 2020-09-02 08:36:39 +00:00
Korina Cordero
d0fcbe8cf3 Removed old import carfix data command. #460 2020-09-02 02:46:58 +00:00
Korina Cordero
885d1911a2 Merge branch '472-cmb-release' of gitlab.com:jankstudio/resq into 460-cmb-data-migration-for-carfix-data 2020-09-01 10:01:36 +00:00
Korina Cordero
4e9c503eb2 Add command to migrate the imported CarFix data into CMBLegacyJobOrder. #460 2020-09-01 09:59:49 +00:00
Korina Cordero
ecbd83e3a3 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Set display marker to false when rider is unavailable. #478

See merge request jankstudio/resq!560
2020-08-26 08:56:52 +00:00
Korina Cordero
b31f254c82 Set display marker to false when rider is unavailable. #478 2020-08-26 08:55:53 +00:00
Korina Cordero
f5fa74f945 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Add checking if rider is available. #478

See merge request jankstudio/resq!559
2020-08-26 07:52:30 +00:00
Korina Cordero
ce79354f5d Add checking if rider is available. #478 2020-08-26 07:51:32 +00:00
Korina Cordero
b150c5ed29 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Revert to old behavior. #478

See merge request jankstudio/resq!558
2020-08-26 07:46:50 +00:00
Korina Cordero
663e28c403 Revert to old behavior. #478 2020-08-26 07:45:55 +00:00
Korina Cordero
24a75378c3 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Add checking if rider is available. #478

See merge request jankstudio/resq!557
2020-08-26 07:37:23 +00:00
Korina Cordero
aa6ec44e27 Add checking if rider is available. #478 2020-08-26 07:35:30 +00:00
Korina Cordero
3f0cca1fc9 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Fix error in goOnline. #478

See merge request jankstudio/resq!556
2020-08-26 04:54:36 +00:00
Korina Cordero
3157ce7edc Fix error in goOnline. #478 2020-08-26 04:53:53 +00:00
Korina Cordero
ab11e8aee5 Merge branch '478-cmb-move-adding-removing-rider-to-and-from-cache' into '472-cmb-release'
Move adding/removal of rider to and from rider cache when going online/offline. #478

See merge request jankstudio/resq!555
2020-08-26 04:42:18 +00:00
Korina Cordero
309605da24 Move adding/removal of rider to and from rider cache when going online/offline. #478 2020-08-26 04:06:50 +00:00
Korina Cordero
832d96c171 Add saving of customer and customer vehicle from legacy job order data. #460 2020-08-25 10:06:24 +00:00
Korina Cordero
deacd5876c Merge branch '474-cmb-notifications-are-always-new' into '472-cmb-release'
Resolve "CMB - notifications are always new"

See merge request jankstudio/resq!554
2020-08-25 07:31:42 +00:00
Korina Cordero
08b4b25f4e Return count of unread notifications. #474 2020-08-25 07:21:24 +00:00
Korina Cordero
f5f771c4ed Merge branch '472-cmb-release' of gitlab.com:jankstudio/resq into 474-cmb-notifications-are-always-new 2020-08-25 02:06:21 +00:00
Korina Cordero
2d24a7b84a Move the delete commands out of the foreign key check block. #472 2020-08-25 01:49:12 +00:00
Korina Cordero
1f6ee02390 Update sql script to delete all customer and customer vehicles. #472 2020-08-25 01:08:33 +00:00
Korina Cordero
0aa3780c77 Set unread and fresh flags for notifications. #474 2020-08-24 11:26:05 +00:00
e4ad0169d7 Merge branch '473-cmb-reassign-issue' into '472-cmb-release'
Fix for error in JO creation. #473

See merge request jankstudio/resq!553
2020-08-24 04:09:00 +00:00
Korina Cordero
9fe4098ac4 Fix for error in JO creation. #473 2020-08-24 03:47:43 +00:00
28ded5faa8 Merge branch '473-cmb-reassign-issue' into '472-cmb-release'
Fix reassign issue. #473

See merge request jankstudio/resq!552
2020-08-24 03:09:22 +00:00
Korina Cordero
ed22eebdc2 Fix reassign issue. #473 2020-08-24 03:05:22 +00:00
198406a5ec Add notification sending for JOs cancelled by rider #472 2020-08-23 01:33:26 +08:00
c2e10a12e6 Make sure date_create has default for Notification entity #472 2020-08-23 01:29:59 +08:00
678dfcc65d Fix generate url inside rider api handler #472 2020-08-23 01:26:19 +08:00
01f5717c1c Add notification sending when rider rejects JO #472 2020-08-23 01:09:45 +08:00
0bd968d753 Fix clear sql to clear rider active JO #472 2020-08-23 00:46:09 +08:00
c8c3ffef42 Fix notification image #472 2020-08-23 00:35:56 +08:00
885665f9d3 Add notification entity and service #472 2020-08-23 00:09:19 +08:00
4e6bc0d95f Add sql for clearing jo data for production #472 2020-08-22 11:07:01 +08:00
b6d2726d41 Fix caching for rider marker name loading #472 2020-08-21 17:42:29 +08:00
78554ec9c6 Fix getting rider name for rider markers #472 2020-08-21 17:04:30 +08:00
Korina Cordero
108d49ca5f Create migration command for cmb legacy job order. #460 2020-08-20 09:51:00 +00:00
Korina Cordero
4bfbfbf995 Create command to import Carfix data. #460 2020-08-20 06:11:34 +00:00
Korina Cordero
4796a9be14 Fix a matching issue in the previous commands. Add saving of customer and customer vehicle for CarFix command. #460 2020-08-19 08:32:50 +00:00
Korina Cordero
eed91a413a Add command to import CarFix data. #460 2020-08-18 10:36:19 +00:00
Korina Cordero
ae2a22b159 Merge branch '457-cmb-add-telephone-number-to-search' of gitlab.com:jankstudio/resq into 460-cmb-data-migration-for-carfix-data 2020-08-18 03:52:51 +00:00
root
a2245fef2b Merge branch '457-cmb-add-telephone-number-to-search' of gitlab.com:jankstudio/resq into 457-cmb-add-telephone-number-to-search 2020-08-17 16:33:43 +08:00
root
a05f53fd88 Pass as option the rider availability url. #457 2020-08-17 16:32:43 +08:00
Korina Cordero
763d141860 Fix SSL problem. #457 2020-08-15 08:02:17 +00:00
Korina Cordero
a864b6b3eb Merge branch '457-cmb-add-telephone-number-to-search' of gitlab.com:jankstudio/resq into 457-cmb-add-telephone-number-to-search 2020-08-15 07:51:08 +00:00
Korina Cordero
4866d01eb3 Add ssl checking. #457 2020-08-15 07:31:17 +00:00
Korina Cordero
2f60c28068 Merge branch 'revert-4874791f' into '457-cmb-add-telephone-number-to-search'
Revert "Merge branch '467-cmb-release-2' into '457-cmb-add-telephone-number-to-search'"

See merge request jankstudio/resq!550
2020-08-14 11:22:41 +00:00
Korina Cordero
526296c8a3 Revert "Merge branch '467-cmb-release-2' into '457-cmb-add-telephone-number-to-search'"
This reverts commit 4874791fed
2020-08-14 11:21:53 +00:00
Korina Cordero
4874791fed Merge branch '467-cmb-release-2' into '457-cmb-add-telephone-number-to-search'
# Conflicts:
#   config/routes/rider.yaml
#   public/assets/js/dashboard_map.js
#   public/assets/js/map_mqtt.js
#   src/Controller/RiderController.php
2020-08-14 10:10:45 +00:00
Korina Cordero
166c4942f1 Add rider name to rider labels. #457 2020-08-14 09:35:57 +00:00
Korina Cordero
b1d397c127 Merge branch '458-cmb-service-type-transaction-names' of gitlab.com:jankstudio/resq into 457-cmb-add-telephone-number-to-search 2020-08-14 09:26:37 +00:00
Korina Cordero
b284cb7b64 Merge branch '424-cmb-release' of gitlab.com:jankstudio/resq into 460-cmb-data-migration-for-carfix-data 2020-08-13 06:12:22 +00:00
Korina Cordero
66e46c4bad Merge branch '457-cmb-add-telephone-number-to-search' into '424-cmb-release'
Remove rider name from labels in Dashboard. #457

See merge request jankstudio/resq!539
2020-08-06 08:39:04 +00:00
Korina Cordero
b20c61a830 Remove rider name from labels in Dashboard. #457 2020-08-06 08:38:02 +00:00
Korina Cordero
b9706ede89 Merge branch '457-cmb-add-telephone-number-to-search' into '424-cmb-release'
Remove log messages. #457

See merge request jankstudio/resq!538
2020-08-05 10:32:25 +00:00
Korina Cordero
90918c49ef Merge branch '458-cmb-service-type-transaction-names' into '424-cmb-release'
Resolve "CMB - service type transaction names"

See merge request jankstudio/resq!533
2020-08-05 09:47:01 +00:00
Korina Cordero
8006545242 Merge branch '457-cmb-add-telephone-number-to-search' into '424-cmb-release'
Resolve "CMB - add telephone number to search"

See merge request jankstudio/resq!535
2020-08-05 09:46:31 +00:00
Korina Cordero
74039a8011 Set service types to battery sales, warranty replacement, jumpstart, and warranty claim. #458 2020-08-05 06:48:17 +00:00
69 changed files with 7566 additions and 1159 deletions

View file

@ -74,3 +74,6 @@ MAPTILER_API_KEY=map_tiler_api_key
# API version
API_VERSION=insert_api_version_here
# SSL
SSL_ENABLE=true_or_false

14
composer.lock generated
View file

@ -1,7 +1,7 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f03b92d48946e8b2ee19466f931c826f",
@ -3214,20 +3214,20 @@
},
{
"name": "symfony/filesystem",
"version": "v4.4.4",
"version": "v4.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd"
"reference": "b27f491309db5757816db672b256ea2e03677d30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/266c9540b475f26122b61ef8b23dd9198f5d1cfd",
"reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/b27f491309db5757816db672b256ea2e03677d30",
"reference": "b27f491309db5757816db672b256ea2e03677d30",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
@ -3260,7 +3260,7 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2020-01-21T08:20:44+00:00"
"time": "2020-05-30T18:50:54+00:00"
},
{
"name": "symfony/finder",

View file

@ -270,6 +270,8 @@ access_keys:
label: Autoassign Test
- id: jo_hub.list
label: Hub View
- id: jo_behind_schedule.list
label: View Behind Schedule
- id: support
label: Customer Support Access

View file

@ -118,6 +118,10 @@ main_menu:
acl: jo_all.list
label: View All
parent: joborder
- id: jo_behind_schedule
acl: jo_behind_schedule.list
label: View Behind Schedule
parent: joborder
- id: support
acl: support.menu

View file

@ -5,6 +5,7 @@ parameters:
latitude: 14.6091
longitude: 121.0223
image_upload_directory: '%kernel.project_dir%/public/uploads'
jo_extra_upload_directory: '%kernel.project_dir%/public/uploads/jo_extra'
job_order_refresh_interval: 300000
api_acl_file: 'api_acl.yaml'
api_access_key: 'api_access_keys'
@ -12,6 +13,7 @@ parameters:
app_access_key: 'access_keys'
cvu_brand_id: "%env(CVU_BRAND_ID)%"
country_code: "%env(COUNTRY_CODE)%"
api_version: "%env(API_VERSION)%"
services:
# default configuration for services in *this* file
@ -73,6 +75,7 @@ services:
$pass: "%env(RT_PASS)%"
$usage_type: "%env(RT_USAGE_TYPE)%"
$shortcode: "%env(RT_SHORTCODE)%"
$dr_url: "https://resqaws.jankstudio.com/sms/delivery_receipt"
App\Service\MQTTClient:
arguments:
@ -167,7 +170,7 @@ services:
# job order generator
App\Service\JobOrderHandler\CMBJobOrderHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
$country_code: "%env(COUNTRY_CODE)%"
#job order generator interface
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler"
@ -187,13 +190,13 @@ services:
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
# rider API service
App\Service\RiderAPIHandler\CMBRiderAPIHandler:
App\Service\RiderAPIHandler\CMBRiderAPIHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
$upload_dir: "%jo_extra_upload_directory%"
# rider API interface
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
# map manager
#App\Service\GISManager\Bing: ~
App\Service\GISManager\OpenStreet: ~
@ -229,6 +232,14 @@ services:
$loc_key: "%env(LOCATION_RIDER_ACTIVE_KEY)%"
$status_key: "%env(STATUS_RIDER_KEY)%"
# inventory manager
App\Service\InventoryManager:
arguments:
$api_url: "%env(INVENTORY_API_URL)%"
$api_ocp_key: "%env(INVENTORY_API_OCP)%"
$api_auth_prefix: "%env(INVENTORY_API_AUTH_TOKEN_PREFIX)%"
$api_auth_token: "%env(INVENTORY_API_AUTH_TOKEN)%"
# API logging
App\EventSubscriber\LogSubscriber:
arguments:

View file

@ -37,6 +37,10 @@ main_menu:
acl: rider.list
label: Riders
parent: logistics
- id: service_charge_list
acl: service_charge.list
label: Service Charges
parent: logistics
- id: battery
acl: battery.menu
@ -98,21 +102,13 @@ main_menu:
acl: joborder.menu
label: Job Order
icon: flaticon-calendar-3
- id: jo_in
acl: jo_in.list
label: Incoming
- id: jo_onestep_form
acl: jo_onestep.form
label: One-step Process
parent: joborder
- id: jo_proc
acl: jo_proc.list
label: Dispatch
parent: joborder
- id: jo_assign
acl: jo_assign.list
label: Rider Assignment
parent: joborder
- id: jo_fulfill
acl: jo_fulfill.list
label: Fulfillment
- id: jo_walkin_form
acl: jo_walkin.form
label: Walk-in
parent: joborder
- id: jo_open
acl: jo_open.list
@ -122,9 +118,9 @@ main_menu:
acl: jo_all.list
label: View All
parent: joborder
- id: jo_hub_view
acl: jo_hub.list
label: Hub View
- id: jo_behind_schedule
acl: jo_behind_schedule.list
label: View Behind Schedule
parent: joborder
- id: support
@ -185,12 +181,3 @@ main_menu:
acl: review.list
label: Reviews
parent: partner
- id: analytics
acl: analytics.menu
label: Analytics
icon: flaticon-graphic
- id: analytics_forecast_form
acl: analytics.forecast
label: Forecasting
parent: analytics

View file

@ -46,6 +46,10 @@ security:
provider: api_key_user_provider
user_checker: Catalyst\AuthBundle\Service\UserChecker
cmb_rider_api:
pattern: ^\/cmbrapi\/
security: false
main:
provider: user_provider
form_login:

View file

@ -8,3 +8,4 @@ twig:
mqtt_host: "%env(MQTT_WS_HOST)%"
mqtt_port: "%env(MQTT_WS_PORT)%"
dashboard_enable: "%env(DASHBOARD_ENABLE)%"
ssl_enable: "%env(SSL_ENABLE)%"

View file

@ -74,6 +74,7 @@ services:
$pass: "%env(RT_PASS)%"
$usage_type: "%env(RT_USAGE_TYPE)%"
$shortcode: "%env(RT_SHORTCODE)%"
$dr_url: "https://resqaws.jankstudio.com/sms/delivery_receipt"
App\Service\MQTTClient:
arguments:

View file

@ -0,0 +1,156 @@
# rider app api
cmb_rapi_register:
path: /cmbrapi/register
controller: App\Controller\CMBRAPIController::register
methods: [POST]
cmb_rapi_login:
path: /cmbrapi/login
controller: App\Controller\CMBRAPIController::login
methods: [POST]
cmb_rapi_logout:
path: /cmbrapi/logout
controller: App\Controller\CMBRAPIController::logout
methods: [POST]
cmb_rapi_jo_get:
path: /cmbrapi/joborder
controller: App\Controller\CMBRAPIController::getJobOrder
methods: [GET]
cmb_rapi_jo_accept:
path: /cmbrapi/joaccept
controller: App\Controller\CMBRAPIController::acceptJobOrder
methods: [POST]
cmb_rapi_jo_cancel:
path: /cmbrapi/jocancel
controller: App\Controller\CMBRAPIController::cancelJobOrder
methods: [POST]
cmb_rapi_arrive:
path: /cmbrapi/arrive
controller: App\Controller\CMBRAPIController::arrive
methods: [POST]
cmb_rapi_performed:
path: /cmbrapi/joperform
controller: App\Controller\CMBRAPIController::performJobOrder
methods: [POST]
cmb_rapi_payment:
path: /cmbrapi/jopayment
controller: App\Controller\CMBRAPIController::payment
methods: [POST]
cmb_rapi_hub_arrive:
path: /cmbrapi/hub_arrive
controller: App\Controller\CMBRAPIController::hubArrive
methods: [POST]
cmb_rapi_promos:
path: /cmbrapi/promos
controller: App\Controller\CMBRAPIController::getPromos
methods: [GET]
cmb_rapi_batteries:
path: /cmbrapi/batteries
controller: App\Controller\CMBRAPIController::getBatteries
methods: [GET]
cmb_rapi_change_service:
path: /cmbrapi/service
controller: App\Controller\CMBRAPIController::changeService
methods: [POST]
cmb_rapi_available:
path: /cmbrapi/available
controller: App\Controller\CMBRAPIController::available
methods: [POST]
cmb_rapi_jo_history:
path: /cmbrapi/johistory/{period}
controller: App\Controller\CMBRAPIController::getJobOrderHistory
methods: [GET]
cmb_rapi_assigned_jo_get:
path: /cmbrapi/assignedjos
controller: App\Controller\CMBRAPIController::getAssignedJobOrders
methods: [GET]
cmb_rapi_jo_in_transit:
path: /cmbrapi/jotransit
controller: App\Controller\CMBRAPIController::setJobOrderInTransit
methods: [POST]
cmb_rapi_invoice_generate:
path: /cmbrapi/generateinvoice
controller: App\Controller\CMBRAPIController::generateInvoice
methods: [GET]
cmb_rapi_online:
path: /cmbrapi/online
controller: App\Controller\CMBRAPIController::goOnline
methods: [POST]
cmb_rapi_offline:
path: /cmbrapi/offline
controller: App\Controller\CMBRAPIController::goOffline
methods: [POST]
cmb_rapi_jo_start:
path: /cmbrapi/jostart
controller: App\Controller\CMBRAPIController::startJobOrder
methods: [POST]
cmb_rapi_jo_complete:
path: /cmbrapi/jocomplete
controller: App\Controller\CMBRAPIController::completeJobOrder
methods: [POST]
cmb_rapi_jo_set_active:
path: /cmbrapi/joactive
controller: App\Controller\CMBRAPIController::setActiveJobOrder
methods: [POST]
cmb_rapi_jo_reject:
path: /cmbrapi/joreject
controller: App\Controller\CMBRAPIController::rejectJobOrder
methods: [POST]
cmb_rapi_jo_odometer:
path: /cmbrapi/odometer
controller: App\Controller\CMBRAPIController::setOdometer
methods: [POST]
cmb_rapi_jo_finish_photos_upload:
path: /cmbrapi/uploadfinishphotos
controller: App\Controller\CMBRAPIController::uploadFinishPhotos
methods: [POST]
cmb_rapi_status:
path: /cmbrapi/status
controller: App\Controller\CMBRAPIController::getStatus
methods: [GET]
cmb_rapi_jo_ongoing:
path: /cmbrapi/joongoing
controller: App\Controller\CMBRAPIController::getOngoingJobOrder
methods: [GET]
cmb_rapi_payment_methods:
path: /cmbrapi/paymentmethods
controller: App\Controller\CMBRAPIController::getPaymentMethods
methods: [GET]
cmb_rapi_cancel_reasons:
path: /cmbrapi/cancelreasons
controller: App\Controller\CMBRAPIController::getCancelReasons
methods: [GET]
cmb_rapi_jo_verify:
path: /cmbrapi/joverify
controller: App\Controller\CMBRAPIController::verifyJobOrder
methods: [GET]

View file

@ -253,3 +253,14 @@ jo_hub_view_form:
controller: App\Controller\JobOrderController::hubViewForm
methods: [GET]
jo_behind_schedule:
path: /job-order/behind-schedule
controller: App\Controller\JobOrderController::listBehindSchedule
methods: [GET]
jo_behind_schedule_rows:
path: /job-order/behind-schedule-rows
controller: App\Controller\JobOrderController::getRows
methods: [POST]
defaults:
tier: "behind_schedule"

View file

@ -0,0 +1,9 @@
notification_ajax_list:
path: /ajax/notifications
controller: App\Controller\NotificationController::ajaxList
methods: [GET]
notification_ajax_update:
path: /ajax/notifications
controller: App\Controller\NotificationController::ajaxUpdate
methods: [POST]

View file

@ -56,3 +56,14 @@ rider_priority_down_jo:
path: /riders/{id}/priority_down/{jo_id}
controller: App\Controller\RiderController::priorityDownJO
methods: [GET]
rider_ajax_avialable:
path: /riders/{id}/available
controller: App\Controller\RiderController::ajaxAvailable
methods: [GET]
rider_ajax_rider_name:
path: /riders/{id}/name
controller: App\Controller\RiderController::ajaxRiderName
methods: [GET]

View file

@ -5,6 +5,7 @@ parameters:
latitude: 14.6091
longitude: 121.0223
image_upload_directory: '%kernel.project_dir%/public/uploads'
jo_extra_upload_directory: '%kernel.project_dir%/public/uploads/jo_extra'
job_order_refresh_interval: 300000
api_acl_file: 'api_acl.yaml'
api_access_key: 'api_access_keys'
@ -161,39 +162,40 @@ services:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
# invoice generator
App\Service\InvoiceGenerator\ResqInvoiceGenerator: ~
App\Service\InvoiceGenerator\CMBInvoiceGenerator: ~
# invoice generator interface
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\ResqInvoiceGenerator"
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\CMBInvoiceGenerator"
# job order generator
App\Service\JobOrderHandler\ResqJobOrderHandler:
App\Service\JobOrderHandler\CMBJobOrderHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
#job order generator interface
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\ResqJobOrderHandler"
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler"
# customer generator
App\Service\CustomerHandler\ResqCustomerHandler:
App\Service\CustomerHandler\CMBCustomerHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
# customer generator interface
App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\ResqCustomerHandler"
App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\CMBCustomerHandler"
# rider assignment
App\Service\RiderAssignmentHandler\ResqRiderAssignmentHandler: ~
App\Service\RiderAssignmentHandler\CMBRiderAssignmentHandler: ~
# rider assignment interface
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\ResqRiderAssignmentHandler"
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
# rider API service
App\Service\RiderAPIHandler\ResqRiderAPIHandler:
App\Service\RiderAPIHandler\CMBRiderAPIHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
$country_code: "%env(COUNTRY_CODE)%"
$upload_dir: "%jo_extra_upload_directory%"
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\ResqRiderAPIHandler"
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
# map manager
#App\Service\GISManager\Bing: ~
@ -219,6 +221,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"

View file

@ -155,6 +155,29 @@ span.has-danger,
color: #fff !important;
}
.m-table__row--is_in_progress td {
background-color: #FFA500 !important;
color: #fff !important;
}
.m-table__row--is_in_progress td > span,
.m-table__row--is_in_progress td > span a,
.m-table__row--is_in_progress td > span a i {
color: #fff !important;
}
.m-table__row--is_assigned td {
background-color: #0000ff !important;
color: #fff !important;
}
.m-table__row--is_assigned td > span,
.m-table__row--is_assigned td > span a,
.m-table__row--is_assigned td > span a i {
color: #fff !important;
}
.m-datatable.m-datatable--default > .m-datatable__table {
min-height: 0 !important;
}
@ -358,4 +381,4 @@ span.has-danger,
.map-info .m-badge {
border-radius: 0;
}
}

View file

@ -3,6 +3,8 @@ class DashboardMap {
this.options = options;
this.rider_markers = rider_markers;
this.cust_markers = cust_markers;
this.rider_availability = {};
this.rider_names = {};
// layer groups
this.layer_groups = {
@ -146,6 +148,49 @@ class DashboardMap {
}
}
putMarkerWithLabel(id, lat, lng, markers, icon, layer_group, popup_url, name) {
var my = this;
// existing marker
if (markers.hasOwnProperty(id)) {
markers[id].setLatLng(L.latLng(lat, lng));
return;
}
// new marker
// add label
markers[id] = L.marker(
[lat, lng],
{ icon: icon }
);
var marker_label = id + ' - ' + name;
markers[id].bindTooltip(marker_label,
{
permanent: true,
direction: 'right'
}
);
markers[id].addTo(layer_group);
if (my.options.enable_popup) {
markers[id].bindPopup('Loading...');
// bind ajax for popup
markers[id].on('click', function(e) {
var popup = e.target.getPopup();
var url = popup_url.replace('[id]', id);
console.log(url);
$.get(url).done(function(data) {
popup.setContent(data);
popup.update();
});
});
}
}
putCustomerMarker(id, lat, lng) {
this.putMarker(
id,
@ -170,6 +215,8 @@ class DashboardMap {
this.layer_groups.customer.removeLayer(markers[id]);
this.layer_groups.mobile_customer.removeLayer(markers[id]);
delete markers[id];
}
putMobileCustomerMarker(id, lat, lng) {
@ -185,27 +232,37 @@ class DashboardMap {
}
putRiderAvailableMarker(id, lat, lng) {
this.putMarker(
id,
lat,
lng,
this.rider_markers,
this.options.icons.rider_available,
this.layer_groups.rider_available,
this.options.rider_popup_url
);
var my = this;
my.getRiderName(id, function(name) {
my.putMarkerWithLabel(
id,
lat,
lng,
my.rider_markers,
my.options.icons.rider_available,
my.layer_groups.rider_available,
my.options.rider_popup_url,
name
);
});
}
putRiderActiveJOMarker(id, lat, lng) {
this.putMarker(
id,
lat,
lng,
this.rider_markers,
this.options.icons.rider_active_jo,
this.layer_groups.rider_active_jo,
this.options.rider_popup_url
);
var my = this;
my.getRiderName(id, function(name) {
my.putMarkerWithLabel(
id,
lat,
lng,
my.rider_markers,
my.options.icons.rider_active_jo,
my.layer_groups.rider_active_jo,
my.options.rider_popup_url,
name
);
});
}
removeRiderMarker(id) {
@ -219,6 +276,8 @@ class DashboardMap {
this.layer_groups.rider_active_jo.removeLayer(markers[id]);
this.layer_groups.rider_available.removeLayer(markers[id]);
delete markers[id];
}
loadLocations(location_url) {
@ -252,6 +311,7 @@ class DashboardMap {
$.each(riders, function(id, data) {
var lat = data.latitude;
var lng = data.longitude;
var name = '';
if (data.has_jo)
my.putRiderActiveJOMarker(id, lat, lng);
@ -262,4 +322,31 @@ class DashboardMap {
// console.log(rider_markers);
});
}
getRiderName(id, callback) {
var name = '';
var rider_url = this.options.rider_name_url.replace('[id]', id);
var my = this;
console.log('getting rider name for rider ' + id);
// check if we have it in cache
if (this.rider_names.hasOwnProperty(id)) {
name = this.rider_names[id];
callback(name);
} else {
// ajax call to get it
$.ajax({
method: "GET",
url: rider_url
}).done(function(response) {
name = response.rider_name;
// set name in cache
my.rider_names[id] = name;
callback(name);
});
}
}
}

View file

@ -1,7 +1,8 @@
class MapEventHandler {
constructor(options, dashmap) {
constructor(options, dashmap, ssl) {
this.options = options;
this.dashmap = dashmap;
this.ssl = ssl;
}
connect(user_id, host, port) {
@ -11,7 +12,7 @@ class MapEventHandler {
this.mqtt = new Paho.MQTT.Client(host, port, client_id);
var options = {
// useSSL: true,
useSSL: this.ssl,
timeout: 3,
invocationContext: this,
onSuccess: this.onConnect.bind(this),
@ -35,6 +36,10 @@ class MapEventHandler {
// subscribe to rider status
console.log('subscribing to ' + my.options.channels.rider_status);
my.mqtt.subscribe(my.options.channels.rider_status);
// subscribe to rider availability
console.log('subscribing to ' + my.options.channels.rider_availability);
my.mqtt.subscribe(my.options.channels.rider_availability);
}
if (my.options.track_jo) {
@ -55,7 +60,7 @@ class MapEventHandler {
onMessage(msg) {
// console.log(msg);
console.log('received message');
// console.log('received message');
var channel = msg.destinationName;
var chan_split = channel.split('/');
@ -73,13 +78,55 @@ class MapEventHandler {
}
handleRider(chan_split, payload) {
console.log("rider message");
//console.log("rider message");
var rider_id = chan_split[1];
//console.log('url ' + this.dashmap.options.rider_availability_url);
switch (chan_split[2]) {
case "location":
console.log("got location for rider " + chan_split[1] + " - " + payload);
var pl_split = payload.split(':');
console.log(pl_split);
case "availability":
console.log("got availability for rider " + chan_split[1] + " - " + payload);
var obj = JSON.parse(payload);
var status = obj.status;
console.log("status " + status);
switch (status) {
case 'rider_offline':
this.dashmap.rider_availability[chan_split[1]] = false;
this.dashmap.removeRiderMarker(chan_split[1]);
break;
case 'rider_online':
this.dashmap.rider_availability[chan_split[1]] = true;
var lat = parseFloat(obj.latitude);
var lng = parseFloat(obj.longitude);
// cheeck if rider is available / unavailable
// TODO: make url not hardcoded
var dashmap = this.dashmap;
var url = dashmap.options.rider_availability_url;
var rider_availability_url = url.replace('[id]', chan_split[1]);
//console.log(rider_availability_url);
$.get(rider_availability_url).done(function(data) {
console.log('rider availability - ' + data);
switch (data) {
case 'available':
console.log('putting available marker ' + chan_split[1] + ' ' + lat + ':' + lng);
dashmap.switchRiderStatus(chan_split[1], 'available');
dashmap.putRiderAvailableMarker(chan_split[1], lat, lng);
break;
case 'unavailable':
console.log('putting active jo marker ' + chan_split[1] + ' ' + lat + ':' + lng);
dashmap.switchRiderStatus(chan_split[1], 'jo');
dashmap.putRiderActiveJOMarker(chan_split[1], lat, lng);
break;
}
});
break;
}
break;
case "location":
// console.log("got location for rider " + chan_split[1] + " - " + payload
var pl_split = payload.split(':');
// console.log(pl_split);
// check for correct format
if (pl_split.length != 2)
break;
@ -87,8 +134,22 @@ class MapEventHandler {
var lat = parseFloat(pl_split[0]);
var lng = parseFloat(pl_split[1]);
// TODO: check if available or not
this.dashmap.putRiderAvailableMarker(chan_split[1], lat, lng);
var display_marker = true;
if (this.dashmap.rider_availability.hasOwnProperty(chan_split[1])) {
if (!this.dashmap.rider_availability[chan_split[1]]) {
console.log('NOT displaying marker for inactive rider');
display_marker = false;
}
} else {
console.log('rider not in availability check');
display_marker = false;
}
// TODO: cache rider availability (available vs active jo) status and check before displaying icon
// NOTE: we really should fix our terms since available can mean many things
if (display_marker) {
this.dashmap.putRiderAvailableMarker(chan_split[1], lat, lng);
}
break;
case "status":
console.log("got status for rider " + chan_split[1] + " - " + payload);

View file

@ -0,0 +1,111 @@
class NotificationHandler {
constructor(options) {
this.options = options;
}
clearAll() {
// clear notification count
document.getElementById('notif-count').innerHTML = '';
// remove notifications
document.getElementById('notif-body').innerHTML = '';
}
loadAll() {
console.log('loading notifications');
// ajax load
var self = this;
var notif_update_url = this.options['notif_ajax_update_url'];
var xhr = new XMLHttpRequest();
xhr.open('GET', this.options['notif_ajax_url']);
xhr.onload = function() {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
var notifs = data.notifications;
// update notification unread count
var count_html = data.unread_count;
document.getElementById('notif-count').innerHTML = count_html;
// do we have any notifications?
if (notifs.length <= 0)
return;
// add actual notifications
var notif_body = document.getElementById('notif-body');
var notif_index = 0;
notifs.forEach(function(notif) {
var notif_date = moment(notif.date).fromNow();
var notif_html = '<div class="m-list-timeline__item">';
notif_html += '<span class="m-list-timeline__badge -m-list-timeline__badge--state-success"></span>';
notif_html += '<span class="m-list-timeline__text">';
notif_html += '<a href="">' + notif.text + '</a>'
notif_html += '</span>';
notif_html += '<span class="m-list-timeline__time">';
notif_html += notif_date;
notif_html += '</span>';
notif_html += '</div>';
notif_body.insertAdjacentHTML('beforeend', notif_html);
document.getElementsByClassName('m-list-timeline__item')[notif_index].addEventListener('click', function(e) {
e.preventDefault();
$.ajax({
method: "POST",
url: notif_update_url,
data: {id: notif.id}
}).done(function(response) {
window.location.href = notif.link;
});
});
notif_index++;
});
}
};
xhr.send();
}
listen(user_id, host, port, use_ssl = false) {
var d = new Date();