Add base payrate field for ranks

This commit is contained in:
Nabeel Shahzad 2018-02-26 17:56:30 -06:00
parent 4a73a5a6b3
commit f6ec647eb6
4 changed files with 26 additions and 9 deletions

View File

@ -18,6 +18,7 @@ class CreateRanksTable extends Migration
$table->string('name', 50);
$table->string('image_link')->nullable();
$table->unsignedInteger('hours')->default(0);
$table->unsignedDecimal('base_pay_rate')->nullable()->default(0);
$table->boolean('auto_approve_acars')->nullable()->default(false);
$table->boolean('auto_approve_manual')->nullable()->default(false);
$table->boolean('auto_promote')->nullable()->default(true);

View File

@ -75,14 +75,17 @@ ranks:
- id: 2
name: Junior First Officer
hours: 10
base_pay_rate: 100
- id: 3
name: First Officer
hours: 15
base_pay_rate: 250
auto_approve_acars: 1
auto_approve_manual: 1
- id: 4
name: Senior Captain
hours: 20
base_pay_rate: 500
auto_approve_acars: 1
auto_approve_manual: 1
auto_promote: 0

View File

@ -14,6 +14,7 @@ class Rank extends BaseModel
'name',
'hours',
'image_link',
'base_pay_rate',
'auto_approve_acars',
'auto_approve_manual',
'auto_promote',
@ -21,6 +22,7 @@ class Rank extends BaseModel
protected $casts = [
'hours' => 'integer',
'base_pay_rate' => 'float',
'auto_approve_acars' => 'bool',
'auto_approve_manual' => 'bool',
'auto_promote' => 'bool',
@ -29,6 +31,7 @@ class Rank extends BaseModel
public static $rules = [
'name' => 'required',
'hours' => 'required|integer',
'base_pay_rate' => 'nullable|numeric',
];
public function subfleets() {

View File

@ -6,6 +6,23 @@
<p class="text-danger">{{ $errors->first('name') }}</p>
</div>
<div class="form-group col-md-6">
{!! Form::label('image_link', 'Image Link:') !!}
{!! Form::text('image_link', null, ['class' => 'form-control']) !!}
<p class="text-danger">{{ $errors->first('image_link') }}</p>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
{!! Form::label('base_pay_rate', 'Base Pay Rate:') !!}
{!! Form::number('base_pay_rate', null, ['min' => 0, 'class' => 'form-control']) !!}
<p class="text-danger">{{ $errors->first('base_pay_rate') }}</p>
@component('admin.components.info')
This is the base rate of pay, per-flight hour, for this rank.
This can be adjusted via a multiplier on the subfleet.
@endcomponent
</div>
<!-- Hours Field -->
<div class="form-group col-sm-6">
{!! Form::label('hours', 'Hours:') !!}
@ -13,13 +30,6 @@
<p class="text-danger">{{ $errors->first('hours') }}</p>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
{!! Form::label('image_link', 'Image Link:') !!}
{!! Form::text('image_link', null, ['class' => 'form-control']) !!}
<p class="text-danger">{{ $errors->first('image_link') }}</p>
</div>
</div>
<div class="row">
<!-- Auto Approve Acars Field -->
<div class="form-group col-sm-4 text-center">
@ -27,7 +37,7 @@
<label class="checkbox-inline">
{!! Form::hidden('auto_approve_acars', false) !!}
{!! Form::checkbox('auto_approve_acars') !!}
{!! Form::label('auto_approve_acars', 'Auto Approve ACARS') !!}
{!! Form::label('auto_approve_acars', 'Auto Approve ACARS PIREPs') !!}
</label>
</div>
</div>
@ -38,7 +48,7 @@
<label class="checkbox-inline">
{!! Form::hidden('auto_approve_manual', false) !!}
{!! Form::checkbox('auto_approve_manual') !!}
{!! Form::label('auto_approve_manual', 'Auto Approve Manual') !!}
{!! Form::label('auto_approve_manual', 'Auto Approve Manual PIREPs') !!}
</label>
</div>
</div>