From f6ec647eb684395041a70fc7fed017a4085eec69 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Mon, 26 Feb 2018 17:56:30 -0600 Subject: [PATCH] Add base payrate field for ranks --- .../2017_06_21_165410_create_ranks_table.php | 1 + app/Database/seeds/sample.yml | 3 ++ app/Models/Rank.php | 3 ++ resources/views/admin/ranks/fields.blade.php | 28 +++++++++++++------ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/Database/migrations/2017_06_21_165410_create_ranks_table.php b/app/Database/migrations/2017_06_21_165410_create_ranks_table.php index 637c98c7..18eef7cf 100644 --- a/app/Database/migrations/2017_06_21_165410_create_ranks_table.php +++ b/app/Database/migrations/2017_06_21_165410_create_ranks_table.php @@ -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); diff --git a/app/Database/seeds/sample.yml b/app/Database/seeds/sample.yml index fd70497f..c3fbf42a 100644 --- a/app/Database/seeds/sample.yml +++ b/app/Database/seeds/sample.yml @@ -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 diff --git a/app/Models/Rank.php b/app/Models/Rank.php index 012a2ae0..48e076d5 100644 --- a/app/Models/Rank.php +++ b/app/Models/Rank.php @@ -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() { diff --git a/resources/views/admin/ranks/fields.blade.php b/resources/views/admin/ranks/fields.blade.php index 11208065..bad453a9 100644 --- a/resources/views/admin/ranks/fields.blade.php +++ b/resources/views/admin/ranks/fields.blade.php @@ -6,6 +6,23 @@

{{ $errors->first('name') }}

+
+ {!! Form::label('image_link', 'Image Link:') !!} + {!! Form::text('image_link', null, ['class' => 'form-control']) !!} +

{{ $errors->first('image_link') }}

+
+ +
+
+ {!! Form::label('base_pay_rate', 'Base Pay Rate:') !!} + {!! Form::number('base_pay_rate', null, ['min' => 0, 'class' => 'form-control']) !!} +

{{ $errors->first('base_pay_rate') }}

+ @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 +
+
{!! Form::label('hours', 'Hours:') !!} @@ -13,13 +30,6 @@

{{ $errors->first('hours') }}

-
-
- {!! Form::label('image_link', 'Image Link:') !!} - {!! Form::text('image_link', null, ['class' => 'form-control']) !!} -

{{ $errors->first('image_link') }}

-
-
@@ -27,7 +37,7 @@
@@ -38,7 +48,7 @@