Add table/models and admin for expenses #136

This commit is contained in:
Nabeel Shahzad
2018-02-26 15:16:12 -06:00
parent 286ed78436
commit 4a73a5a6b3
27 changed files with 556 additions and 41 deletions
@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateExpensesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('expenses', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('airline_id')->nullable();
$table->string('name');
$table->unsignedDecimal('amount');
$table->unsignedTinyInteger('type');
$table->boolean('multiplier')->nullable()->default(0);
$table->boolean('active')->nullable()->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('expenses');
}
}
+25
View File
@@ -173,6 +173,31 @@ aircraft:
registration:
status: 2
expenses:
- name: Per-Flight (no muliplier)
amount: 100
type: 0
active: 1
- name: Per-Flight (multiplier)
amount: 100
type: 0
multiplier: 1
active: 1
- name: Per-Flight (multiplier, on airline)
airline_id: 1
amount: 200
type: 0
multiplier: 1
active: 1
- name: A daily fee
amount: 800
type: 1
active: 1
- name: A monthly fee
amount: 5000
type: 2
active: 1
fares:
- id: 1
code: Y