Lots of new code for recurring transactions. #1469

This commit is contained in:
James Cole
2018-06-16 21:47:51 +02:00
parent 968abd26e8
commit 1cf91c78f8
19 changed files with 769 additions and 79 deletions

View File

@@ -64,8 +64,7 @@ class Recurrence extends Model
* @var array
*/
protected $casts
= [
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'first_date' => 'date',
@@ -73,6 +72,10 @@ class Recurrence extends Model
'active' => 'bool',
'apply_rules' => 'bool',
];
/** @var array */
protected $fillable
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date', 'repeat_until', 'latest_date', 'repetitions', 'apply_rules', 'active'];
/** @var string */
protected $table = 'recurrences';
/**

View File

@@ -47,6 +47,11 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class RecurrenceTransaction extends Model
{
/** @var array */
protected $fillable
= ['recurrence_id', 'transaction_currency_id', 'foreign_currency_id', 'source_account_id', 'destination_account_id', 'amount', 'foreign_amount',
'description'];
/** @var string */
protected $table = 'recurrences_transactions';
/**
@@ -82,7 +87,7 @@ class RecurrenceTransaction extends Model
*/
public function recurrenceTransactionMeta(): HasMany
{
return $this->hasMany(RecurrenceTransactionMeta::class,'rt_id');
return $this->hasMany(RecurrenceTransactionMeta::class, 'rt_id');
}
/**