Add fare import/exporter #194

This commit is contained in:
Nabeel Shahzad
2018-03-22 17:48:57 -05:00
parent a44204b185
commit 46d8fb125a
17 changed files with 322 additions and 58 deletions

View File

@@ -7,6 +7,7 @@ use App\Interfaces\Service;
use App\Services\ImportExport\AircraftExporter;
use App\Services\ImportExport\AirportExporter;
use App\Services\ImportExport\ExpenseExporter;
use App\Services\ImportExport\FareExporter;
use App\Services\ImportExport\FlightExporter;
use Illuminate\Support\Collection;
use League\Csv\CharsetConverter;
@@ -97,6 +98,18 @@ class ExportService extends Service
return $this->runExport($expenses, $exporter);
}
/**
* Export all of the fares
* @param Collection $fares
* @return mixed
* @throws \League\Csv\CannotInsertRecord
*/
public function exportFares($fares)
{
$exporter = new FareExporter();
return $this->runExport($fares, $exporter);
}
/**
* Export all of the flights
* @param Collection $flights