Move the model callbacks into Observables; reduce caching since it held balances incorrectly

This commit is contained in:
Nabeel Shahzad
2018-03-18 20:37:35 -05:00
parent 6b002f24a8
commit 36ea12e135
25 changed files with 336 additions and 266 deletions

View File

@@ -25,22 +25,27 @@ class Rank extends BaseModel
];
protected $casts = [
'hours' => 'integer',
'base_pay_rate' => 'float',
'auto_approve_acars' => 'bool',
'hours' => 'integer',
'base_pay_rate' => 'float',
'auto_approve_acars' => 'bool',
'auto_approve_manual' => 'bool',
'auto_promote' => 'bool',
'auto_promote' => 'bool',
];
public static $rules = [
'name' => 'required',
'name' => 'required',
'hours' => 'required|integer',
'acars_base_pay_rate' => 'nullable|numeric',
'manual_base_pay_rate' => 'nullable|numeric',
];
public function subfleets() {
/*
* Relationships
*/
public function subfleets()
{
return $this->belongsToMany(Subfleet::class, 'subfleet_rank')
->withPivot('acars_pay', 'manual_pay');
->withPivot('acars_pay', 'manual_pay');
}
}