Create journal when new airline is created #667 (#670)

This commit is contained in:
Nabeel S
2020-04-26 10:31:58 -04:00
committed by GitHub
parent 866d95c945
commit 03cfc648b0
6 changed files with 33 additions and 7 deletions

View File

@@ -28,6 +28,21 @@ class AirlineService extends Service
$this->subfleetRepo = $subfleetRepo;
}
/**
* Create a new airline, and initialize the journal
*
* @param array $attr
*
* @return \App\Models\Airline
*/
public function createAirline(array $attr): Airline
{
$airline = $this->airlineRepo->create($attr);
$airline->initJournal(setting('units.currency'));
return $airline;
}
/**
* Can the airline be deleted? Check if there are flights, etc associated with it
*