Fix CSV imports giving Storage class not found #454 (#462)

* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert
This commit is contained in:
Nabeel S
2019-12-10 13:53:55 -05:00
committed by GitHub
parent d9a1e6aba7
commit 1f65b744a0
22 changed files with 658 additions and 578 deletions

View File

@@ -6,15 +6,21 @@ use App\Contracts\Service;
use App\Models\Airline;
use App\Models\Journal;
use App\Models\JournalTransaction;
use App\Repositories\AirlineRepository;
use App\Repositories\JournalRepository;
use App\Support\Dates;
use App\Support\Money;
class FinanceService extends Service
{
private $airlineRepo;
private $journalRepo;
public function __construct(JournalRepository $journalRepo)
{
public function __construct(
AirlineRepository $airlineRepo,
JournalRepository $journalRepo
) {
$this->airlineRepo = $airlineRepo;
$this->journalRepo = $journalRepo;
}
@@ -91,6 +97,32 @@ class FinanceService extends Service
);
}
/**
* Get all of the transactions for every airline in a given month
*
* @param string $month In Y-m format
*
* @return array
*/
public function getAllAirlineTransactionsBetween($month): array
{
$between = Dates::getMonthBoundary($month);
$transaction_groups = [];
$airlines = $this->airlineRepo->orderBy('icao')->all();
// group by the airline
foreach ($airlines as $airline) {
$transaction_groups[] = $this->getAirlineTransactionsBetween(
$airline,
$between[0],
$between[1]
);
}
return $transaction_groups;
}
/**
* Get all of the transactions for an airline between two given dates. Returns an array
* with `credits`, `debits` and `transactions` fields, where transactions contains the