Compare commits

...

6 commits

Author SHA1 Message Date
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
b20c61a830 Remove rider name from labels in Dashboard. #457 2020-08-06 08:38:02 +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
50 changed files with 4907 additions and 454 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

@ -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: ~

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) {
@ -184,27 +231,29 @@ class DashboardMap {
);
}
putRiderAvailableMarker(id, lat, lng) {
this.putMarker(
putRiderAvailableMarker(id, lat, lng, name) {
this.putMarkerWithLabel(
id,
lat,
lng,
this.rider_markers,
this.options.icons.rider_available,
this.layer_groups.rider_available,
this.options.rider_popup_url
this.options.rider_popup_url,
name
);
}
putRiderActiveJOMarker(id, lat, lng) {
this.putMarker(
putRiderActiveJOMarker(id, lat, lng, name) {
this.putMarkerWithLabel(
id,
lat,
lng,
this.rider_markers,
this.options.icons.rider_active_jo,
this.layer_groups.rider_active_jo,
this.options.rider_popup_url
this.options.rider_popup_url,
name
);
}
@ -219,6 +268,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,14 +303,43 @@ 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);
else
my.putRiderAvailableMarker(id, lat, lng);
if (my.rider_names.hasOwnProperty(id)) {
name = my.rider_names[id];
if (data.has_jo)
my.putRiderActiveJOMarker(id, lat, lng, name);
else
my.putRiderAvailableMarker(id, lat, lng, name)
} else {
getRiderName(id, my.options.rider_name_url, function(name) {
my.rider_names[id] = name;
if (data.has_jo)
my.putRiderActiveJOMarker(id, lat, lng, name);
else
my.putRiderAvailableMarker(id, lat, lng, name)
});
}
});
// console.log(rider_markers);
});
}
}
function getRiderName(id, url, callback) {
var name = '';
var rider_url = url.replace('[id]', id);
$.ajax({
method: "GET",
url: rider_url
}).done(function(response) {
name = response.rider_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,12 +78,50 @@ class MapEventHandler {
}
handleRider(chan_split, payload) {
console.log("rider message");
// console.log("rider message");
var rider_id = chan_split[1];
switch (chan_split[2]) {
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;
$.get('https://cmbdev.wildcard.cc/riders/' + chan_split[1] + '/available').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);
// console.log("got location for rider " + chan_split[1] + " - " + payload
var pl_split = payload.split(':');
console.log(pl_split);
// console.log(pl_split);
// check for correct format
if (pl_split.length != 2)
@ -87,8 +130,21 @@ 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');
}
// 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);

179
resq_settings/cmb/menu.yaml Normal file
View file

@ -0,0 +1,179 @@
main_menu:
- id: home
acl: dashboard.menu
label: Dashboard
icon: flaticon-line-graph
- id: user
acl: user.menu
label: User
icon: flaticon-users
- id: user_list
acl: user.list
label: Users
parent: user
- id: role_list
acl: role.list
label: Roles
parent: user
- id: apiuser
acl: apiuser.menu
label: API User
icon: flaticon-users
- id: api_user_list
acl: apiuser.list
label: API Users
parent: apiuser
- id: api_role_list
acl: apirole.list
label: API Roles
parent: apiuser
- id: logistics
acl: logistics.menu
label: Logistics
icon: fa fa-truck
- id: rider_list
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
label: Battery
icon: fa fa-battery-3
- id: battery_list
acl: battery.list
label: Batteries
parent: battery
- id: bmfg_list
acl: bmfg.list
label: Manufacturers
parent: battery
- id: bmodel_list
acl: bmodel.list
label: Models
parent: battery
- id: bsize_list
acl: bsize.list
label: Sizes
parent: battery
- id: promo_list
acl: promo.list
label: Promos
parent: battery
- id: vehicle
acl: vehicle.menu
label: Vehicle
icon: fa fa-car
- id: vehicle_list
acl: vehicle.list
label: Vehicles
parent: vehicle
- id: vmfg_list
acl: vmfg.list
label: Manufacturers
parent: vehicle
- id: location
acl: location.menu
label: Location
icon: fa fa-home
- id: outlet_list
acl: outlet.menu
label: Outlet
parent: location
- id: hub_list
acl: hub.menu
label: Hub
parent: location
- id: geofence_list
acl: geofence.menu
label: Geofence
parent: location
- id: joborder
acl: joborder.menu
label: Job Order
icon: flaticon-calendar-3
- id: jo_onestep_form
acl: jo_onestep.form
label: One-step Process
parent: joborder
- id: jo_walkin_form
acl: jo_walkin.form
label: Walk-in
parent: joborder
- id: jo_open
acl: jo_open.list
label: Open
parent: joborder
- id: jo_all
acl: jo_all.list
label: View All
parent: joborder
- id: support
acl: support.menu
label: Customer Support
icon: flaticon-support
- id: customer_list
acl: customer.list
label: Customers
parent: support
- id: ticket_list
acl: ticket.list
label: Tickets
parent: support
- id: general_search
acl: general.search
label: Search
parent: support
- id: warranty_search
acl: warranty.search
label: Customer Battery Search
parent: support
- id: privacy_policy_list
acl: privacy_policy.list
label: Privacy Policy
parent: support
- id: warranty_list
acl: warranty.list
label: Warranty
parent: support
- id: warranty_upload
acl: warranty.upload
label: Warranty Upload
parent: support
- id: static_content_list
acl: static_content.list
label: Static Content
parent: support
- id: service
acl: service.menu
label: Other Services
icon: flaticon-squares
- id: service_list
acl: service.list
label: Services
parent: service
- id: partner
acl: partner.menu
label: Partners
icon: flaticon-network
- id: partner_list
acl: partner.list
label: Partners
parent: partner
- id: review_list
acl: review.list
label: Reviews
parent: partner

View file

@ -0,0 +1,27 @@
# text
title_login: Res-Q for CMB | Login
block_title: Res-Q for CMB
control_panel_sign_in: Sign-in to Control Panel
alt_image_logo_login: Res-Q for CMB
alt_image_dashboard: Res-Q for CMB
copyright: Res-Q for CMB
battery_size_tradein_brand: Trade-in Motolite
battery_size_tradein_premium: Trade-in Premium
battery_size_tradein_other: Trade-in Other
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
jo_title_pdf: Res-Q for CMB Job Order
country_code_prefix: '+60'
delivery_instructions_label: 'CarFix Details'
# images
image_logo_login: /assets/images/black-text-logo-01.png
icon_login: /assets/images/battery-assist-bm-logo-32x32.png
icon_base_32x32: /assets/images/black-text-logo-01-32x32.png
icon_base_16x16: /assets/images/black-text-logo-01-16x16.png
image_dashboard: /assets/images/century_logo.png
image_jo_pdf: /public/assets/images/black-text-logo-01-115x115.png
# default point for maps
default_lat: 3.084216
default_long: 101.6129996
default_region: my

View file

@ -0,0 +1,246 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
map_default:
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'
app_acl_file: 'acl.yaml'
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
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{Entity,Migrations,Tests,Menu,Access}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\Menu\Generator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
Catalyst\AuthBundle\Service\ACLGenerator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
$acl_file: "%app_acl_file%"
Catalyst\AuthBundle\Service\ACLVoter:
arguments:
$user_class: "App\\Entity\\User"
tags: ['security.voter']
Catalyst\AuthBundle\Service\UserChecker:
App\Service\FileUploader:
arguments:
$target_dir: '%image_upload_directory%'
App\Service\MapTools:
arguments:
$em: "@doctrine.orm.entity_manager"
$gmaps_api_key: "%env(GMAPS_API_KEY)%"
$cust_dist_limit: "%env(CUST_DISTANCE_LIMIT)%"
App\Service\RisingTideGateway:
arguments:
$em: "@doctrine.orm.entity_manager"
$user: "%env(RT_USER)%"
$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:
$redis_client: "@App\\Service\\RedisClientProvider"
$key: "mqtt_events"
App\Service\APNSClient:
arguments:
$redis_client: "@App\\Service\\RedisClientProvider"
App\Service\RedisClientProvider:
arguments:
$scheme: "%env(REDIS_CLIENT_SCHEME)%"
$host: "%env(REDIS_CLIENT_HOST)%"
$port: "%env(REDIS_CLIENT_PORT)%"
$password: "%env(REDIS_CLIENT_PASSWORD)%"
App\Service\GeofenceTracker:
arguments:
$geofence_flag: "%env(GEOFENCE_ENABLE)%"
App\Service\WarrantyHandler:
arguments:
$em: "@doctrine.orm.entity_manager"
App\Command\SetCustomerPrivacyPolicyCommand:
arguments:
$policy_promo: "%env(POLICY_PROMO)%"
$policy_third_party: "%env(POLICY_THIRD_PARTY)%"
$policy_mobile: "%env(POLICY_MOBILE)%"
App\Command\CreateCustomerFromWarrantyCommand:
arguments:
$cvu_mfg_id: "%env(CVU_MFG_ID)%"
$cvu_brand_id: "%env(CVU_BRAND_ID)%"
# rider tracker service
App\Service\RiderTracker:
arguments:
$redis_client: "@App\\Service\\RedisClientProvider"
Catalyst\APIBundle\Security\APIKeyUserProvider:
arguments:
$em: "@doctrine.orm.entity_manager"
Catalyst\APIBundle\Security\APIKeyAuthenticator:
arguments:
$em: "@doctrine.orm.entity_manager"
Catalyst\APIBundle\Command\UserCreateCommand:
arguments:
$em: "@doctrine.orm.entity_manager"
tags: ['console.command']
Catalyst\APIBundle\Command\TestCommand:
tags: ['console.command']
Catalyst\APIBundle\Command\TestAPICommand:
tags: ['console.command']
Catalyst\APIBundle\Access\Voter:
arguments:
$acl_gen: "@Catalyst\\APIBundle\\Access\\Generator"
$user_class: "Catalyst\\APIBundle\\Entity\\User"
tags: ['security.voter']
Catalyst\APIBundle\Access\Generator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
$acl_file: "%api_acl_file%"
Catalyst\MenuBundle\Menu\Generator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
Catalyst\MenuBundle\Listener\MenuAnnotationListener:
arguments:
$menu_name: "main_menu"
tags:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
# invoice generator
App\Service\InvoiceGenerator\CMBInvoiceGenerator: ~
# invoice generator interface
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\CMBInvoiceGenerator"
# job order generator
App\Service\JobOrderHandler\CMBJobOrderHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
#job order generator interface
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler"
# customer generator
App\Service\CustomerHandler\CMBCustomerHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
# customer generator interface
App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\CMBCustomerHandler"
# rider assignment
App\Service\RiderAssignmentHandler\CMBRiderAssignmentHandler: ~
# rider assignment interface
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
# rider API service
App\Service\RiderAPIHandler\CMBRiderAPIHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
$upload_dir: "%jo_extra_upload_directory%"
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
# map manager
#App\Service\GISManager\Bing: ~
App\Service\GISManager\OpenStreet: ~
#App\Service\GISManager\Google: ~
#App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Bing"
App\Service\GISManagerInterface: "@App\\Service\\GISManager\\OpenStreet"
#App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Google"
App\EventListener\JobOrderActiveCacheListener:
arguments:
$jo_cache: "@App\\Service\\JobOrderCache"
$mqtt: "@App\\Service\\MQTTClient"
tags:
- name: 'doctrine.orm.entity_listener'
event: 'postUpdate'
entity: 'App\Entity\JobOrder'
- name: 'doctrine.orm.entity_listener'
event: 'postRemove'
entity: 'App\Entity\JobOrder'
- name: 'doctrine.orm.entity_listener'
event: 'postPersist'
entity: 'App\Entity\JobOrder'
App\Service\JobOrderCache:
arguments:
$redis_prov: "@App\\Service\\RedisClientProvider"
$active_jo_key: "%env(LOCATION_JO_ACTIVE_KEY)%"
App\Service\RiderCache:
arguments:
$redis_prov: "@App\\Service\\RedisClientProvider"
$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:
$api_log_flag: "%env(API_LOGGING)%"

View file

@ -0,0 +1,186 @@
main_menu:
- id: home
acl: dashboard.menu
label: Dashboard
icon: flaticon-line-graph
- id: user
acl: user.menu
label: User
icon: flaticon-users
- id: user_list
acl: user.list
label: Users
parent: user
- id: role_list
acl: role.list
label: Roles
parent: user
- id: apiuser
acl: apiuser.menu
label: API User
icon: flaticon-users
- id: api_user_list
acl: apiuser.list
label: API Users
parent: apiuser
- id: api_role_list
acl: apirole.list
label: API Roles
parent: apiuser
- id: logistics
acl: logistics.menu
label: Logistics
icon: fa fa-truck
- id: rider_list
acl: rider.list
label: Riders
parent: logistics
- id: battery
acl: battery.menu
label: Battery
icon: fa fa-battery-3
- id: battery_list
acl: battery.list
label: Batteries
parent: battery
- id: bmfg_list
acl: bmfg.list
label: Manufacturers
parent: battery
- id: bmodel_list
acl: bmodel.list
label: Models
parent: battery
- id: bsize_list
acl: bsize.list
label: Sizes
parent: battery
- id: promo_list
acl: promo.list
label: Promos
parent: battery
- id: vehicle
acl: vehicle.menu
label: Vehicle
icon: fa fa-car
- id: vehicle_list
acl: vehicle.list
label: Vehicles
parent: vehicle
- id: vmfg_list
acl: vmfg.list
label: Manufacturers
parent: vehicle
- id: location
acl: location.menu
label: Location
icon: fa fa-home
- id: outlet_list
acl: outlet.menu
label: Outlet
parent: location
- id: hub_list
acl: hub.menu
label: Hub
parent: location
- id: geofence_list
acl: geofence.menu
label: Geofence
parent: location
- id: joborder
acl: joborder.menu
label: Job Order
icon: flaticon-calendar-3
- id: jo_in
acl: jo_in.list
label: Incoming
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
parent: joborder
- id: jo_open
acl: jo_open.list
label: Open
parent: joborder
- id: jo_all
acl: jo_all.list
label: View All
parent: joborder
- id: jo_hub.view
label: Hub View
parent: joborder
- id: support
acl: support.menu
label: Customer Support
icon: flaticon-support
- id: customer_list
acl: customer.list
label: Customers
parent: support
- id: ticket_list
acl: ticket.list
label: Tickets
parent: support
- id: general_search
acl: general.search
label: Search
parent: support
- id: warranty_search
acl: warranty.search
label: Customer Battery Search
parent: support
- id: privacy_policy_list
acl: privacy_policy.list
label: Privacy Policy
parent: support
- id: warranty_list
acl: warranty.list
label: Warranty
parent: support
- id: warranty_upload
acl: warranty.upload
label: Warranty Upload
parent: support
- id: static_content_list
acl: static_content.list
label: Static Content
parent: support
- id: service
acl: service.menu
label: Other Services
icon: flaticon-squares
- id: service_list
acl: service.list
label: Services
parent: service
- id: partner
acl: partner.menu
label: Partners
icon: flaticon-network
- id: partner_list
acl: partner.list
label: Partners
parent: partner
- id: review_list
acl: review.list
label: Reviews
parent: partner

View file

@ -0,0 +1,27 @@
# text
title_login: Motolite Res-Q | Login
block_title: Motolite Res-Q
control_panel_sign_in: Sign-in to Control Panel
alt_image_logo_login: Res-Q
alt_image_dashboard: Motolite
copyright: Motolite Res-Q
battery_size_tradein_brand: Trade-in Motolite
battery_size_tradein_premium: Trade-in Premium
battery_size_tradein_other: Trade-in Other
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
jo_title_pdf: Motolite Res-Q Job Order
country_code_prefix: '+63'
delivery_instructions_label: Delivery Instructions
# images
image_logo_login: /assets/images/logo-resq.png
icon_login: /assets/demo/default/media/img/logo/favicon.ico
icon_base_32x32: /assets/images/favicon/favicon-32x32.png
icon_base_16x16: /assets/images/favicon/favicon-16x16.png
image_dashboard: /assets/images/logo-motolite.png
image_jo_pdf: /public/assets/images/logo-resq.png
# default point for maps
default_lat: 14.6091
default_long: 121.0223
default_region: ph

View file

@ -0,0 +1,244 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
map_default:
latitude: 14.6091
longitude: 121.0223
image_upload_directory: '%kernel.project_dir%/public/uploads'
job_order_refresh_interval: 300000
api_acl_file: 'api_acl.yaml'
api_access_key: 'api_access_keys'
app_acl_file: 'acl.yaml'
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
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{Entity,Migrations,Tests,Menu,Access}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\Menu\Generator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
Catalyst\AuthBundle\Service\ACLGenerator:
arguments:
$router: "@router.default"
$cache_dir: "%kernel.cache_dir%"
$config_dir: "%kernel.root_dir%/../config"
$acl_file: "%app_acl_file%"
Catalyst\AuthBundle\Service\ACLVoter:
arguments:
$user_class: "App\\Entity\\User"
tags: ['security.voter']
Catalyst\AuthBundle\Service\UserChecker:
App\Service\FileUploader:
arguments:
$target_dir: '%image_upload_directory%'
App\Service\MapTools:
arguments:
$em: "@doctrine.orm.entity_manager"
$gmaps_api_key: "%env(GMAPS_API_KEY)%"
$cust_dist_limit: "%env(CUST_DISTANCE_LIMIT)%"
App\Service\RisingTideGateway:
arguments:
$em: "@doctrine.orm.entity_manager"
$user: "%env(RT_USER)%"
$pass: "%env(RT_PASS)%"