New event to create budget limits, new handler to handle said event, new routes for budget control, new routes for limit control, extended migration, extended models, extended JS. [skip-ci]

This commit is contained in:
James Cole
2014-07-20 18:24:27 +02:00
parent 0bcda34738
commit 08cbd91dd9
42 changed files with 1482 additions and 121 deletions

View File

@@ -18,8 +18,9 @@ class CreateLimitsTable extends Migration {
$table->timestamps();
$table->integer('component_id')->unsigned();
$table->date('startdate');
$table->date('enddate');
$table->decimal('amount',10,2);
$table->boolean('repeats');
$table->enum('repeat_freq', ['daily', 'weekly','monthly','quarterly','half-year','yearly']);
// connect component
$table->foreign('component_id')

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLimitRepeatTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('limit_repetitions', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
$table->integer('limit_id')->unsigned();
$table->date('startdate');
$table->date('enddate');
$table->decimal('amount',10,2);
$table->unique(['limit_id','startdate','enddate']);
// connect limit
$table->foreign('limit_id')
->references('id')->on('limits')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('limit_repetitions');
}
}