Don't allow cancels from certain states (#396)
* Don't allow cancels from certain states * Unused imports * Don't reset the state doubly * Move SetUserActive into listener; code cleanup * Unused imports * Add missing files into htaccess * Move Command contract to correct folder
This commit is contained in:
@@ -42,6 +42,7 @@ use Illuminate\Support\Collection;
|
||||
* @property Collection fields
|
||||
* @property int status
|
||||
* @property bool state
|
||||
* @property string source
|
||||
* @property Carbon submitted_at
|
||||
* @property Carbon created_at
|
||||
* @property Carbon updated_at
|
||||
@@ -130,7 +131,7 @@ class Pirep extends Model
|
||||
'route' => 'nullable',
|
||||
];
|
||||
|
||||
/**
|
||||
/*
|
||||
* If a PIREP is in these states, then it can't be changed.
|
||||
*/
|
||||
public static $read_only_states = [
|
||||
@@ -139,6 +140,16 @@ class Pirep extends Model
|
||||
PirepState::CANCELLED,
|
||||
];
|
||||
|
||||
/*
|
||||
* If a PIREP is in one of these states, it can't be cancelled
|
||||
*/
|
||||
public static $cancel_states = [
|
||||
PirepState::ACCEPTED,
|
||||
PirepState::REJECTED,
|
||||
PirepState::CANCELLED,
|
||||
PirepState::DELETED,
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the flight ident, e.,g JBU1900
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user