mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some more catches and small tweaks for issue #6. [skip ci]
This commit is contained in:
@@ -24,42 +24,48 @@ use LaravelBook\Ardent\Ardent as Ardent;
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereAmount($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTarget($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereOrder($value)
|
||||
* @property float $targetamount
|
||||
* @property string $startdate
|
||||
* @property boolean $repeats
|
||||
* @property string $rep_length
|
||||
* @property integer $rep_times
|
||||
* @property string $reminder
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value)
|
||||
* @property float $targetamount
|
||||
* @property string $startdate
|
||||
* @property boolean $repeats
|
||||
* @property string $rep_length
|
||||
* @property integer $rep_times
|
||||
* @property string $reminder
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value)
|
||||
*/
|
||||
class Piggybank extends Ardent
|
||||
{
|
||||
public $fillable = [
|
||||
'name',
|
||||
'account_id',
|
||||
'targetamount',
|
||||
'repeats',
|
||||
'rep_times',
|
||||
'order'
|
||||
];
|
||||
|
||||
public static $rules
|
||||
= [
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'name' => 'required|between:1,255',
|
||||
'targetamount' => 'required|min:0',
|
||||
'targetdate' => 'date',
|
||||
'startdate' => 'date',
|
||||
'repeats' => 'required|between:0,1',
|
||||
'rep_length' => 'in:day,week,month,year',
|
||||
'rep_times' => 'required|min:0|max:100',
|
||||
'reminder' => 'in:day,week,month,year',
|
||||
'order' => 'required:min:1',
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'name' => 'required|between:1,255',
|
||||
'targetamount' => 'required|min:0',
|
||||
'targetdate' => 'date',
|
||||
'startdate' => 'date',
|
||||
'repeats' => 'required|between:0,1',
|
||||
'rep_length' => 'in:day,week,month,year',
|
||||
'rep_times' => 'required|min:0|max:100',
|
||||
'reminder' => 'in:day,week,month,year',
|
||||
'reminder_skip' => 'required|min:0|max:100',
|
||||
'order' => 'required:min:1',
|
||||
];
|
||||
public $fillable
|
||||
= [
|
||||
'account_id',
|
||||
'name',
|
||||
'targetamount',
|
||||
'targetdate',
|
||||
'startdate',
|
||||
'repeats',
|
||||
'rep_length',
|
||||
'rep_times',
|
||||
'reminder',
|
||||
'reminder_skip',
|
||||
'order'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -72,8 +78,8 @@ class Piggybank extends Ardent
|
||||
$today = new Carbon;
|
||||
|
||||
return [
|
||||
'account_id' => 'factory|Account',
|
||||
'name' => 'string',
|
||||
'account_id' => 'factory|Account',
|
||||
'name' => 'string',
|
||||
'targetamount' => 'required|min:0',
|
||||
'targetdate' => $start,
|
||||
'startdate' => $today,
|
||||
@@ -81,6 +87,7 @@ class Piggybank extends Ardent
|
||||
'rep_length' => null,
|
||||
'rep_times' => 0,
|
||||
'reminder' => null,
|
||||
'reminder_skip' => 0,
|
||||
'order' => 1,
|
||||
];
|
||||
}
|
||||
@@ -93,10 +100,6 @@ class Piggybank extends Ardent
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
public function piggybankrepetitions() {
|
||||
return $this->hasMany('PiggybankRepetition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -105,4 +108,9 @@ class Piggybank extends Ardent
|
||||
return ['created_at', 'updated_at', 'targetdate'];
|
||||
}
|
||||
|
||||
public function piggybankrepetitions()
|
||||
{
|
||||
return $this->hasMany('PiggybankRepetition');
|
||||
}
|
||||
|
||||
}
|
@@ -5,6 +5,22 @@ use LaravelBook\Ardent\Ardent as Ardent;
|
||||
|
||||
/**
|
||||
* Class PiggybankRepetition
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $piggybank_id
|
||||
* @property \Carbon\Carbon $targetdate
|
||||
* @property \Carbon\Carbon $startdate
|
||||
* @property float $currentamount
|
||||
* @property-read \Piggybank $piggybank
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition wherePiggybankId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereTargetdate($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereStartdate($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCurrentamount($value)
|
||||
*/
|
||||
class PiggybankRepetition extends Ardent
|
||||
{
|
||||
|
@@ -75,6 +75,10 @@ use LaravelBook\Ardent\Ardent;
|
||||
* 'Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\
|
||||
* 'Category[] $categories
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\
|
||||
* 'Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\
|
||||
* 'Category[] $categories
|
||||
*/
|
||||
class TransactionJournal extends Ardent
|
||||
{
|
||||
|
Reference in New Issue
Block a user