2018-02-27 05:16:12 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Events;
|
|
|
|
|
2020-09-04 00:50:42 +08:00
|
|
|
use App\Contracts\Event;
|
2018-02-27 05:16:12 +08:00
|
|
|
use App\Models\Pirep;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This event is dispatched when the expenses for a flight report
|
|
|
|
* are collected. Your listeners should return a list of Expense
|
|
|
|
* models. Don't call save on the model!
|
|
|
|
*
|
|
|
|
* Example return:
|
|
|
|
*
|
|
|
|
* [
|
|
|
|
* new Expense([
|
|
|
|
* 'airline_id': '', # < optional field
|
|
|
|
* 'name': '',
|
|
|
|
* 'amount': [DECIMAL],
|
|
|
|
* 'type': int from ExpenseType enum class
|
|
|
|
* ]),
|
|
|
|
* ]
|
|
|
|
*
|
|
|
|
* The event caller will check the 'type' to make sure that it
|
|
|
|
* will filter out expenses that only apply to the current process
|
|
|
|
*
|
|
|
|
* The event will have a copy of the PIREP model, if it's applicable
|
|
|
|
*/
|
2020-09-04 00:50:42 +08:00
|
|
|
class Expenses extends Event
|
2018-02-27 05:16:12 +08:00
|
|
|
{
|
2022-03-14 23:45:18 +08:00
|
|
|
public ?Pirep $pirep;
|
2018-02-27 05:16:12 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Pirep|null $pirep
|
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
public function __construct(Pirep $pirep = null)
|
2018-02-27 05:16:12 +08:00
|
|
|
{
|
|
|
|
$this->pirep = $pirep;
|
|
|
|
}
|
|
|
|
}
|