mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 21:16:47 +00:00
Some changes to facilitate piggy bank events (see issue #6) and extra view info for clarity. [skip ci]
This commit is contained in:
@@ -42,18 +42,18 @@ class Piggybank extends Ardent
|
||||
{
|
||||
public static $rules
|
||||
= [
|
||||
'account_id' => 'required|exists:accounts,id', // link to Account
|
||||
'name' => 'required|between:1,255', // name
|
||||
'targetamount' => 'required|min:0', // amount you want to save
|
||||
'startdate' => 'date', // when you started
|
||||
'targetdate' => 'date', // when its due
|
||||
'repeats' => 'required|between:0,1', // does it repeat?
|
||||
'rep_length' => 'in:day,week,month,year', // how long is the period?
|
||||
'rep_every' => 'required|min:1|max:100', // how often does it repeat? every 3 years.
|
||||
'rep_times' => 'min:1|max:100', // how many times do you want to save this amount? eg. 3 times
|
||||
'reminder' => 'in:day,week,month,year', // want a reminder to put money in this?
|
||||
'account_id' => 'required|exists:accounts,id', // link to Account
|
||||
'name' => 'required|between:1,255', // name
|
||||
'targetamount' => 'required|min:0', // amount you want to save
|
||||
'startdate' => 'date', // when you started
|
||||
'targetdate' => 'date', // when its due
|
||||
'repeats' => 'required|between:0,1', // does it repeat?
|
||||
'rep_length' => 'in:day,week,month,year', // how long is the period?
|
||||
'rep_every' => 'required|min:1|max:100', // how often does it repeat? every 3 years.
|
||||
'rep_times' => 'min:1|max:100', // how many times do you want to save this amount? eg. 3 times
|
||||
'reminder' => 'in:day,week,month,year', // want a reminder to put money in this?
|
||||
'reminder_skip' => 'required|min:0|max:100', // every week? every 2 months?
|
||||
'order' => 'required:min:1', // not yet used.
|
||||
'order' => 'required:min:1', // not yet used.
|
||||
];
|
||||
public $fillable
|
||||
= [
|
||||
@@ -82,18 +82,18 @@ class Piggybank extends Ardent
|
||||
$end->endOfMonth();
|
||||
|
||||
return [
|
||||
'account_id' => 'factory|Account',
|
||||
'name' => 'string',
|
||||
'targetamount' => 'integer',
|
||||
'startdate' => $start->format('Y-m-d'),
|
||||
'targetdate' => $end->format('Y-m-d'),
|
||||
'repeats' => 0,
|
||||
'rep_length' => null,
|
||||
'rep_times' => 0,
|
||||
'rep_every' => 0,
|
||||
'reminder' => null,
|
||||
'account_id' => 'factory|Account',
|
||||
'name' => 'string',
|
||||
'targetamount' => 'integer',
|
||||
'startdate' => $start->format('Y-m-d'),
|
||||
'targetdate' => $end->format('Y-m-d'),
|
||||
'repeats' => 0,
|
||||
'rep_length' => null,
|
||||
'rep_times' => 0,
|
||||
'rep_every' => 0,
|
||||
'reminder' => null,
|
||||
'reminder_skip' => 0,
|
||||
'order' => 1,
|
||||
'order' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -212,4 +212,12 @@ class Piggybank extends Ardent
|
||||
return $this->hasMany('PiggybankRepetition');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function piggybankevents()
|
||||
{
|
||||
return $this->hasMany('PiggybankEvent');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user