Rename InvoiceCreator to InvoiceGenerator. #265

This commit is contained in:
Korina Cordero 2019-09-20 06:38:52 +00:00
parent cce4638c78
commit dc2eecbe0c
7 changed files with 29 additions and 29 deletions

View file

@ -132,7 +132,7 @@ services:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
# invoice creator
App\Service\InvoiceCreator\CMBInvoiceCreator: ~
App\Service\InvoiceGenerator\ResqInvoiceGenerator: ~
# invoice creator interface
App\Service\InvoiceCreatorInterface: "@App\\Service\\InvoiceCreator\\CMBInvoiceCreator"
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\ResqInvoiceGenerator"

View file

@ -24,7 +24,7 @@ use App\Ramcar\TransactionOrigin;
use App\Ramcar\TradeInType;
use App\Ramcar\JOEventType;
use App\Service\InvoiceCreatorInterface;
use App\Service\InvoiceGeneratorInterface;
use App\Service\RisingTideGateway;
use App\Service\MQTTClient;
use App\Service\GeofenceTracker;
@ -808,7 +808,7 @@ class APIController extends Controller
return $res->getReturnResponse();
}
public function requestJobOrder(Request $req, InvoiceCreatorInterface $ic, GeofenceTracker $geo)
public function requestJobOrder(Request $req, InvoiceGeneratorInterface $ic, GeofenceTracker $geo)
{
// check required parameters and api key
$required_params = [
@ -1020,7 +1020,7 @@ class APIController extends Controller
return $res->getReturnResponse();
}
public function getEstimate(Request $req, InvoiceCreatorInterface $ic)
public function getEstimate(Request $req, InvoiceGeneratorInterface $ic)
{
// $this->debugRequest($req);

View file

@ -27,7 +27,7 @@ use App\Entity\Battery;
use App\Entity\JOEvent;
use App\Entity\JORejection;
use App\Service\InvoiceCreatorInterface;
use App\Service\InvoiceGeneratorInterface;
use App\Service\MapTools;
use App\Service\HubCounter;
use App\Service\MQTTClient;
@ -251,7 +251,7 @@ class JobOrderController extends Controller
return $this->render('job-order/form.html.twig', $params);
}
public function openEditSubmit(Request $req, ValidatorInterface $validator, InvoiceCreatorInterface $ic, $id)
public function openEditSubmit(Request $req, ValidatorInterface $validator, InvoiceGeneratorInterface $ic, $id)
{
$this->denyAccessUnlessGranted('jo_open.edit', null, 'No access.');
@ -425,7 +425,7 @@ class JobOrderController extends Controller
return $this->render('job-order/form.html.twig', $params);
}
public function incomingSubmit(Request $req, ValidatorInterface $validator, InvoiceCreatorInterface $ic)
public function incomingSubmit(Request $req, ValidatorInterface $validator, InvoiceGeneratorInterface $ic)
{
$this->denyAccessUnlessGranted('jo_in.list', null, 'No access.');
@ -2482,7 +2482,7 @@ class JobOrderController extends Controller
return null;
}
public function generateInvoice(Request $req, InvoiceCreatorInterface $ic)
public function generateInvoice(Request $req, InvoiceGeneratorInterface $ic)
{
// error_log('generating invoice...');
$error = false;

View file

@ -25,7 +25,7 @@ use App\Ramcar\InvoiceStatus;
use App\Ramcar\ModeOfPayment;
use App\Ramcar\JOEventType;
use App\Service\InvoiceCreatorInterface;
use App\Service\InvoiceGeneratorInterface;
use App\Service\MQTTClient;
use App\Entity\RiderSession;
@ -739,7 +739,7 @@ class RAPIController extends Controller
error_log(print_r($all, true));
}
public function changeService(Request $req, InvoiceCreatorInterface $ic)
public function changeService(Request $req, InvoiceGeneratorInterface $ic)
{
$this->debugRequest($req);

View file

@ -1,14 +0,0 @@
<?php
namespace App\Service;
use App\Entity\Invoice;
use App\Ramcar\InvoiceCriteria;
interface InvoiceCreatorInterface
{
// process invoice criteria
public function processCriteria(InvoiceCriteria $criteria);
}

View file

@ -1,6 +1,6 @@
<?php
namespace App\Service\InvoiceCreator;
namespace App\Service\InvoiceGenerator;
use App\Ramcar\InvoiceCriteria;
use App\Ramcar\TradeInType;
@ -12,11 +12,11 @@ use App\Entity\Invoice;
use App\Entity\InvoiceItem;
use App\Entity\User;
use App\Service\InvoiceCreatorInterface;
use App\Service\InvoiceGeneratorInterface;
use Doctrine\Common\Util\Debug;
class ResqInvoiceCreator implements InvoiceCreatorInterface
class ResqInvoiceGenerator implements InvoiceGeneratorInterface
{
const TAX_RATE = 0.12;
const SERVICE_FEE = 300;
@ -27,7 +27,7 @@ class ResqInvoiceCreator implements InvoiceCreatorInterface
{
}
public function processCriteria(InvoiceCriteria $criteria)
public function generateInvoice(InvoiceCriteria $criteria)
{
// initialize
$invoice = new Invoice();

View file

@ -0,0 +1,14 @@
<?php
namespace App\Service;
use App\Entity\Invoice;
use App\Ramcar\InvoiceCriteria;
interface InvoiceGeneratorInterface
{
// generate invoice using a criteria
public function generateInvoice(InvoiceCriteria $criteria);
}