From 4652a82fff6ba5a83851c76b65503fb7100a0ea6 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Wed, 2 May 2018 21:12:49 +0800 Subject: [PATCH 01/14] Support new services #110 --- src/Controller/APIController.php | 36 +++++++++++++++++++++----------- src/Ramcar/ServiceType.php | 2 +- src/Service/InvoiceCreator.php | 17 +++++++++++++++ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index b8736440..4a579109 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -690,7 +690,7 @@ class APIController extends Controller $required_params = [ 'service_type', 'cv_id', - 'batt_id', + // 'batt_id', 'trade_in', 'long', 'lat', @@ -784,13 +784,19 @@ class APIController extends Controller } // check battery - $batt = $em->getRepository(Battery::class)->find($req->request->get('batt_id')); - if ($batt == null) + $batt_id = $req->request->get('batt_id'); + if ($batt_id != null) { - $res->setError(true) - ->setErrorMessage('Invalid battery id'); - return $res->getReturnResponse(); + $batt = $em->getRepository(Battery::class)->find($batt_id); + if ($batt == null) + { + $res->setError(true) + ->setErrorMessage('Invalid battery id'); + return $res->getReturnResponse(); + } } + else + $batt = null; /* // put battery in criteria @@ -860,7 +866,7 @@ class APIController extends Controller $required_params = [ 'service_type', 'cv_id', - 'batt_id', + // 'batt_id', 'trade_in', ]; $em = $this->getDoctrine()->getManager(); @@ -915,13 +921,19 @@ class APIController extends Controller } // check battery - $batt = $em->getRepository(Battery::class)->find($req->request->get('batt_id')); - if ($batt == null) + $batt_id = $req->request->get('batt_id'); + if ($batt_id != null) { - $res->setError(true) - ->setErrorMessage('Invalid battery id'); - return $res->getReturnResponse(); + $batt = $em->getRepository(Battery::class)->find($batt_id); + if ($batt == null) + { + $res->setError(true) + ->setErrorMessage('Invalid battery id'); + return $res->getReturnResponse(); + } } + else + $batt = null; /* // put battery in criteria diff --git a/src/Ramcar/ServiceType.php b/src/Ramcar/ServiceType.php index 29bc03a7..83768bdc 100644 --- a/src/Ramcar/ServiceType.php +++ b/src/Ramcar/ServiceType.php @@ -11,7 +11,7 @@ class ServiceType extends NameValue const POST_RECHARGED = 'post_recharged'; const POST_REPLACEMENT = 'post_replacement'; const TIRE_REPAIR = 'tire'; - const OVERHEAT_ASSITANCE = 'overheat'; + const OVERHEAT_ASSISTANCE = 'overheat'; const EMERGENCY_REFUEL = 'fuel'; const COLLECTION = [ diff --git a/src/Service/InvoiceCreator.php b/src/Service/InvoiceCreator.php index 695a9e2b..b0588dc8 100644 --- a/src/Service/InvoiceCreator.php +++ b/src/Service/InvoiceCreator.php @@ -256,6 +256,18 @@ class InvoiceCreator } } + public function processOtherServices(&$total, $invoice, $stype) + { + $item = new InvoiceItem(); + $item->setInvoice($invoice) + ->setTitle('Service - ' . ServiceType::getName($stype)) + ->setQuantity(1) + ->setPrice(200.00); + $invoice->addItem($item); + + $total['total_price'] = 200.00; + } + public function processCriteria(InvoiceCriteria $criteria) { // initialize @@ -296,6 +308,11 @@ class InvoiceCreator break; case ServiceType::POST_REPLACEMENT: $this->processReplacement($total, $invoice); + break; + case ServiceType::TIRE_REPAIR: + case ServiceType::OVERHEAT_ASSISTANCE: + case ServiceType::EMERGENCY_REFUEL: + $this->processOtherServices($total, $invoice, $stype); } // TODO: check if any promo is applied From 05959d57349d512f06893a79a308e8c8658781a1 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Wed, 2 May 2018 21:39:45 +0800 Subject: [PATCH 02/14] Add service_type to rider status #110 --- src/Controller/APIController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 4a579109..de3e96f7 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -1034,6 +1034,7 @@ class APIController extends Controller $res->setData([ 'status' => APIRiderStatus::OUTLET_ASSIGN, 'jo_id' => $jo->getID(), + 'service_type' => $jo->getServiceType(), 'destination' => [ 'long' => $dest->getLongitude(), 'lat' => $dest->getLatitude(), @@ -1044,6 +1045,7 @@ class APIController extends Controller $res->setData([ 'status' => APIRiderStatus::RIDER_ASSIGN, 'jo_id' => $jo->getID(), + 'service_type' => $jo->getServiceType(), 'destination' => [ 'long' => $dest->getLongitude(), 'lat' => $dest->getLatitude(), @@ -1060,6 +1062,7 @@ class APIController extends Controller $res->setData([ 'status' => APIRiderStatus::RIDER_PICK_UP, 'jo_id' => $jo->getID(), + 'service_type' => $jo->getServiceType(), 'destination' => [ 'long' => $dest->getLongitude(), 'lat' => $dest->getLatitude(), From 7f7707d8273152ec95a8e1a9e42a0c9588492e34 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Mon, 7 May 2018 22:57:08 +0800 Subject: [PATCH 03/14] Force ipv4 resolv for calls to google maps api #113 --- src/Service/MapTools.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Service/MapTools.php b/src/Service/MapTools.php index 693b3c21..aa38cd6d 100644 --- a/src/Service/MapTools.php +++ b/src/Service/MapTools.php @@ -52,7 +52,12 @@ class MapTools // query google maps api - $res = $client->request('GET', $maps_url, ['query' => $gmaps_params]); + $res = $client->request('GET', $maps_url, [ + 'query' => $gmaps_params, + 'curl' => [ + CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 + ], + ]); return $res->getBody(); } From 6dd052e84ee6b914351e0fa787ebe0b24e482aa4 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sat, 19 May 2018 12:52:29 +0800 Subject: [PATCH 04/14] Sort vehicle fetching by make #114 --- src/Entity/VehicleManufacturer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Entity/VehicleManufacturer.php b/src/Entity/VehicleManufacturer.php index 48de14b0..00026b05 100644 --- a/src/Entity/VehicleManufacturer.php +++ b/src/Entity/VehicleManufacturer.php @@ -30,6 +30,7 @@ class VehicleManufacturer // vehicles /** * @ORM\OneToMany(targetEntity="Vehicle", mappedBy="manufacturer") + * @ORM\OrderBy({"make" = "ASC"}) */ protected $vehicles; From 8035dc254c7266f5bd9d2006af7ef7638d0e09c4 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sat, 19 May 2018 15:11:15 +0800 Subject: [PATCH 05/14] Add LPG to fuel type #115 --- src/Ramcar/FuelType.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Ramcar/FuelType.php b/src/Ramcar/FuelType.php index c85a4d81..62f2c13a 100644 --- a/src/Ramcar/FuelType.php +++ b/src/Ramcar/FuelType.php @@ -4,11 +4,13 @@ namespace App\Ramcar; class FuelType extends NameValue { - const GAS = 'gas'; - const DIESEL = 'diesel'; + const GAS = 'gas'; + const DIESEL = 'diesel'; + const LPG = 'lpg'; const COLLECTION = [ 'gas' => 'Gas', 'diesel' => 'Diesel', + 'lpg' => 'LPG', ]; } From 365de1c66d288068609ebe4ba11e991c2a782ae8 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 01:54:41 +0800 Subject: [PATCH 06/14] Set customer mobile phone on update info #118 --- src/Controller/APIController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index de3e96f7..08adc5a7 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -314,6 +314,9 @@ class APIController extends Controller ->setLastName($req->request->get('last_name')) ->setConfirmed($this->session->isConfirmed()); + // update mobile phone of customer + $cust->setPhoneMobile(substr(2, $this->session->getPhoneNumber())); + $em->flush(); return $res->getReturnResponse(); From 8b8d81991067655bfc518c471bda4944bb47fb31 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 13:48:06 +0800 Subject: [PATCH 07/14] Check for existing customers for the same number and merge for mobile API #116 --- src/Controller/APIController.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 08adc5a7..86830b7f 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -218,12 +218,29 @@ class APIController extends Controller ->setPhoneNumber($phone_number); $em->flush(); - // TODO: send sms to number + // TODO: send sms with validation code to number // response return $res->getReturnResponse(); } + // TODO: find session customer by phone number + protected function findNumberSession($number) + { + $em = $this->getDoctrine()->getManager(); + $query = $em->getRepository(MobileSession::class)->createQueryBuilder('s') + ->where('s.phone_number = :number') + ->andWhere('s.customer is not null') + ->andWhere('s.confirm_flag = 1') + ->setParameter('number', $number) + ->getQuery(); + + // we just need one + $res = $query->getOneOrNullResult(); + + return $res; + } + public function validateCode(Request $req) { // check parameters @@ -250,6 +267,16 @@ class APIController extends Controller $date = new DateTime(); $this->session->setDateConfirmed($date) ->setConfirmed(); + + + // TODO: check if we have the number registered before and merge + $dupe_sess = $this->findNumberSession($this->session->getPhoneNumber()); + if ($dupe_sess != null) + { + $dupe_cust = $dupe_sess->getCustomer(); + $this->session->setCustomer($dupe_cust); + } + $em->flush(); // response From 5498119ab3e342784610ab5d581b90cb0ff5ca30 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 14:22:51 +0800 Subject: [PATCH 08/14] Add setMaxResults(1) to assure single result in dupe customer query #116 --- src/Controller/APIController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 86830b7f..e0de5ad2 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -233,6 +233,7 @@ class APIController extends Controller ->andWhere('s.customer is not null') ->andWhere('s.confirm_flag = 1') ->setParameter('number', $number) + ->setMaxResults(1) ->getQuery(); // we just need one From 429dc99b292578d6f34a9e82974b2ab4dc3c88ae Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 22:45:41 +0800 Subject: [PATCH 09/14] Add cancel event and have mobile sendEvent send to all sessions of a job order #122 --- src/Controller/JobOrderController.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index c515c345..f1be02b6 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -1364,15 +1364,20 @@ class JobOrderController extends BaseController protected function sendEvent(JobOrder $job_order, $payload) { - $session = $job_order->getCustomer()->getMobileSessions(); + $sessions = $job_order->getCustomer()->getMobileSessions(); if (count($session) == 0) return; - $phone_num = $session[0]->getPhoneNumber(); - $channel = 'motolite.control.' . $phone_num; $client = new MosquittoClient(); $client->connect('localhost', 1883); - $client->publish($channel, json_encode($payload)); + + foreach ($sessions as $sess) + { + $phone_num = $sess->getPhoneNumber(); + $channel = 'motolite.control.' . $phone_num; + $client->publish($channel, json_encode($payload)); + } + $client->disconnect(); } @@ -1783,6 +1788,13 @@ class JobOrderController extends BaseController // save $em->flush(); + // send mobile app event + $payload = [ + 'event' => 'cancelled', + 'jo_id' => $obj->getID(), + ]; + $this->sendEvent($obj, $payload); + // return successful response return $this->json([ 'success' => 'Job order has been cancelled!' From 3727ae1fedc2b529653e18522bc144a26e078a51 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 23:02:06 +0800 Subject: [PATCH 10/14] Fix typo bug for session #122 --- src/Controller/JobOrderController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index f1be02b6..73970431 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -1365,7 +1365,7 @@ class JobOrderController extends BaseController protected function sendEvent(JobOrder $job_order, $payload) { $sessions = $job_order->getCustomer()->getMobileSessions(); - if (count($session) == 0) + if (count($sessions) == 0) return; $client = new MosquittoClient(); From 5e0023e21511c3209e55ec9925b942366b0d9dcc Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Sun, 20 May 2018 23:18:06 +0800 Subject: [PATCH 11/14] Add cancel reason to mobile event for cancel JO #122 --- src/Controller/JobOrderController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index 73970431..e25be13c 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -1791,6 +1791,7 @@ class JobOrderController extends BaseController // send mobile app event $payload = [ 'event' => 'cancelled', + 'reason' => $cancel_reason, 'jo_id' => $obj->getID(), ]; $this->sendEvent($obj, $payload); From 16478f58214af823eaaff4842405248aabbc2033 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Mon, 21 May 2018 00:08:04 +0800 Subject: [PATCH 12/14] Add page for privacy policy for mobile app #127 --- public/static/privacy.html | 117 +++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 public/static/privacy.html diff --git a/public/static/privacy.html b/public/static/privacy.html new file mode 100644 index 00000000..1db8cafa --- /dev/null +++ b/public/static/privacy.html @@ -0,0 +1,117 @@ +

Privacy Policy

+

+Oriental and Motolite Marketing Corporation (“Company,” “We,” “Us,” “Our”), is committed to protecting the privacy and security of all personal and/or sensitive information (“Personal Data”) related to its employees, customers, business partners, suppliers, contractors, and other parties that the Company will and is engaged into. For this reason, uniform practice and procedure for collecting, recording, consolidating, updating, disclosing, storing, accessing, transferring, retaining, destroying and disposing of Personal Data by the Company is hereby adopted in order to process Personal Data fairly, appropriately, and lawfully. +

+ +

+This Privacy Policy sets out how the Company uses, protects and controls any Personal Data that you will provide in our website and mobile application (the “Site”). The Company may change this policy from time to time by updating it in accordance with subsequent Laws and Implementing Rules and Regulations. The terms of this Privacy Policy apply to all users of this Site. +

+ +

Collection of Personal Data

+

+The Company collects Personal Data you voluntarily submitted in our Site and our mobile apps, as well as non-personal information provided therein. +

+ +

User Registration

+

+We collect information about you (i) when you register in order to receive a product/service; (ii) when you subscribe to marketing emails; (iii) when you apply for a job post; (iv) when you contact us for inquiries, support or feedback. Information may include Personal Data such as but not limited to your first name, last name, email address, birthdate, gender, mobile number, address and password. +

+ +

Log information

+

+When you visit our Site, we may also collect non-personal information such as but not limited to web page from which you came to our Site, your web page request, Internet Protocol (IP) address, geolocation, browser type, browser language, the date and time of your request and your registration data. Please be noted that when you purchase a product or use a web-based service in our Site, we may also log the specific path, actions, and navigation choices you make. +

+ +

Cookies

+

+We may use cookies in analyzing and evaluating performance to provide you better experience when using our Site. Cookies are small files that a Site or its service provider transfers to your computer's hard drive through your web browser (you can disable this) that allows the Site's or service provider's systems to recognize your browser and capture and remember certain information. +

+ +

Location Services

+

+Your current location is only determined if you permit our services to do so. If you allow your location to be obtained using our RESQ app, or with a browser, we will use this information to return your estimated location. We use this information solely to distinguish your current location and not to identify you. Motolite does not automatically track your location. +

+ +

Use of Personal Data

+

+

    +
  • The Company uses your Personal Data for the following purposes, without limitation:
  • +
  • to deliver or improve our products and services
  • +
  • to administer a content, promotion, survey or other Site feature
  • +
  • to send periodic emails regarding your account or other products and services
  • +
  • to process your application for any of our job posts
  • +
  • to process your application for a franchise
  • +
  • to effectively respond to your customer service requests and support needs.
  • +
+

+ +

+The Company may share the Personal Data gathered from you within the Ramcar Group of Companies and will use it consistent with the purpose of this Privacy Policy. We may also use the information in the aggregate to understand how our users as a group, use the services and resources provided on our Site. +

+ +

Further Disclosure

+

+We take reasonable precautions to be sure that nonaffiliated third parties and affiliates, to whom we disclose your Personal Data are aware of our Privacy Policy and will treat the information in a similarly responsible manner. Our contracts and written agreements with nonaffiliated third parties that receive information from us about you prohibit those parties from transferring the information other than to provide the service that you obtain from us. +

+ +

Agents and contractors

+

+Our contractors sometimes have access to your Personal Data in the course of assisting in operating our business and providing products or services to you. These contractors may include vendors and suppliers that provide us with technology, services, and/or content for the operation and maintenance of our Site. Access to your Personal Data by these contractors is limited to the information reasonably necessary for the contractor to perform its limited function. Contractors have an obligation under their contracts with us to keep your information confidential and to comply with our privacy and security policies. +

+ +

Disclosure for legal reasons

+

+We may release Personal Data to third parties: (1) to comply with valid legal requirements such as a law, regulation, search warrant, subpoena or court order; or (2) in special cases, such as a threat to security, a threat to our system or network, or cases in which we believe it is reasonably necessary to investigate or prevent harm, fraud, abuse, or illegal conduct. +

+ +

Changes in our corporate structure

+

+If all or part of the Company is sold, merged or otherwise transferred to another entity, the Personal Data you have provided to us may be transferred as part of that transaction. We will take steps to ensure that, without your consent, any Personal Data that is transferred will not be used or shared in a manner inconsistent with this Privacy Policy. +

+ +

Accuracy and Access

+

+The Company will keep your Personal Data as accurate, complete and up-to-date as is necessary for the purpose for which it is processed. In case you need to access, correct, amend, delete inaccurate Personal Data, or withdraw your consent, please immediately inform us. (see Contact Us section below) +

+ +

Security

+

+The Company employs adequate organizational, physical and technical security measures such as password protection, encryption, firewalls and other controls, to ensure and preserve the confidentiality, integrity and availability of your Personal Data. We work to protect the security of your information during transmission by using Secure Sockets Layer (SSL) software, which encrypts information you input online. Only authorized persons from the Company will have access to your Personal Data. Employees who misuse any information are subject to disciplinary action, including termination. +

+ +

Third Party Links

+

+The Company may offer links to sites that is run by third parties. If you visit other sites, you should read the site’s privacy policy, terms and conditions, and their other policies. The Company is not responsible for the policies and practices of third parties. Any information you give to those organizations is dealt with under their privacy statement, terms and conditions, and other policies. + +

Retention and Disposal

+

+The Company will retain your Personal Data only as long as necessary for the fulfillment of the stated purposes. In case that the Site is no longer functional or decommissioned, all of your Personal Data in digital or hard copies will be disposed or erased according to the Company’s guidelines, where it is irretrievable, unreadable, or unidentifiable. In case you subscribed to email/SMS marketing, you will still receive email/SMS notifications. If you want to cancel your subscription, you may click the unsubscribe link at the bottom of any email message from the Company, or follow the SMS cancellation instructions. +

+ +

Minors' Privacy

+

+The Company takes minors’ privacy seriously. If you are under 18 years of age, please do not submit any Personal Data through our Site without the express consent and participation of a parent or guardian. If you are a parent or guardian, please make every effort to guard your children's privacy. +

+ +

Applicable Law and Rights

+

+The Company upholds compliance with Republic Act No. 10173 or the Data Privacy Act of 2012 (DPA), its Implementing Rules and Regulations, and other relevant policies, including issuances of the National Privacy Commission. The Company acknowledges your right to be informed, object processing, access and rectify, suspend or withdraw Personal Data, and be indemnified in case of damages pursuant to the provisions of DPA. +

+ +

Changes to Privacy Policy

+

+The Company reserves the right to amend this Privacy Policy at any time, consistent with applicable law. In such case, an updated version will be posted in our Site. If we are going to process your Personal Data in a manner different from that stated at the time of collection, we will notify you, and you will have a choice as to whether or not we can use your Personal Data in such a way. +

+ +

Contact Us

+

+For any inquiry regarding this Privacy Policy, please contact our Data Privacy Officer, Mr. Luis Quiogue at: +

+ +

+OMMC
+Ramcar Center
+80-82 Roces Ave.
+Diliman, Quezon City PH
+(+632) 370-1100 +

From a96ac83a5f9f040fd16b12e3f5d95118c6f4ba15 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Mon, 21 May 2018 00:15:12 +0800 Subject: [PATCH 13/14] Fixed special characters for privacy policy #127 --- public/static/privacy.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/static/privacy.html b/public/static/privacy.html index 1db8cafa..bcecf84e 100644 --- a/public/static/privacy.html +++ b/public/static/privacy.html @@ -1,10 +1,10 @@

Privacy Policy

-Oriental and Motolite Marketing Corporation (“Company,” “We,” “Us,” “Our”), is committed to protecting the privacy and security of all personal and/or sensitive information (“Personal Data”) related to its employees, customers, business partners, suppliers, contractors, and other parties that the Company will and is engaged into. For this reason, uniform practice and procedure for collecting, recording, consolidating, updating, disclosing, storing, accessing, transferring, retaining, destroying and disposing of Personal Data by the Company is hereby adopted in order to process Personal Data fairly, appropriately, and lawfully. +Oriental and Motolite Marketing Corporation ("Company," "We," "Us," "Our"), is committed to protecting the privacy and security of all personal and/or sensitive information ("Personal Data") related to its employees, customers, business partners, suppliers, contractors, and other parties that the Company will and is engaged into. For this reason, uniform practice and procedure for collecting, recording, consolidating, updating, disclosing, storing, accessing, transferring, retaining, destroying and disposing of Personal Data by the Company is hereby adopted in order to process Personal Data fairly, appropriately, and lawfully.

-This Privacy Policy sets out how the Company uses, protects and controls any Personal Data that you will provide in our website and mobile application (the “Site”). The Company may change this policy from time to time by updating it in accordance with subsequent Laws and Implementing Rules and Regulations. The terms of this Privacy Policy apply to all users of this Site. +This Privacy Policy sets out how the Company uses, protects and controls any Personal Data that you will provide in our website and mobile application (the "Site"). The Company may change this policy from time to time by updating it in accordance with subsequent Laws and Implementing Rules and Regulations. The terms of this Privacy Policy apply to all users of this Site.

Collection of Personal Data

@@ -85,12 +85,12 @@ The Company may offer links to sites that is run by third parties. If you visit

Retention and Disposal

-The Company will retain your Personal Data only as long as necessary for the fulfillment of the stated purposes. In case that the Site is no longer functional or decommissioned, all of your Personal Data in digital or hard copies will be disposed or erased according to the Company’s guidelines, where it is irretrievable, unreadable, or unidentifiable. In case you subscribed to email/SMS marketing, you will still receive email/SMS notifications. If you want to cancel your subscription, you may click the unsubscribe link at the bottom of any email message from the Company, or follow the SMS cancellation instructions. +The Company will retain your Personal Data only as long as necessary for the fulfillment of the stated purposes. In case that the Site is no longer functional or decommissioned, all of your Personal Data in digital or hard copies will be disposed or erased according to the Company's guidelines, where it is irretrievable, unreadable, or unidentifiable. In case you subscribed to email/SMS marketing, you will still receive email/SMS notifications. If you want to cancel your subscription, you may click the unsubscribe link at the bottom of any email message from the Company, or follow the SMS cancellation instructions.

Minors' Privacy

-The Company takes minors’ privacy seriously. If you are under 18 years of age, please do not submit any Personal Data through our Site without the express consent and participation of a parent or guardian. If you are a parent or guardian, please make every effort to guard your children's privacy. +The Company takes minors' privacy seriously. If you are under 18 years of age, please do not submit any Personal Data through our Site without the express consent and participation of a parent or guardian. If you are a parent or guardian, please make every effort to guard your children's privacy.

Applicable Law and Rights

From 7e53a4d6de86bbdaecbac0456130a57442783dca Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Mon, 21 May 2018 01:23:59 +0800 Subject: [PATCH 14/14] Add rider rating comment feature #120 --- src/Controller/APIController.php | 5 +++++ src/Entity/RiderRating.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index e0de5ad2..acf3cb74 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -1225,6 +1225,11 @@ class APIController extends Controller ->setJobOrder($jo) ->setRating($rating_num); + // rider rating comment + $comment = $req->request->get('comment'); + if (!empty($comment)) + $rating->setComment($comment); + $em->persist($rating); $em->flush(); diff --git a/src/Entity/RiderRating.php b/src/Entity/RiderRating.php index e0a03ddc..f5875c27 100644 --- a/src/Entity/RiderRating.php +++ b/src/Entity/RiderRating.php @@ -52,10 +52,17 @@ class RiderRating */ protected $rating; + // customer's comment that goes along with the rating + /** + * @ORM\Column(type="text") + */ + protected $comment; + public function __construct() { $this->date_create = new DateTime(); $this->rating = 0; + $this->comment = ''; } public function getID() @@ -111,4 +118,15 @@ class RiderRating { return $this->rating; } + + public function setComment($comment) + { + $this->comment = $comment; + return $this; + } + + public function getComment() + { + return $this->comment; + } }