mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
First attempt at an import/migration procedure.
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Transaction extends Eloquent
|
||||
class Transaction extends Elegant
|
||||
{
|
||||
public static $rules
|
||||
= [
|
||||
'account_id' => 'numeric|required|exists:accounts,id',
|
||||
'transaction_journal_id' => 'numeric|required|exists:transaction_journals,id',
|
||||
'description' => 'between:1,255',
|
||||
'amount' => 'required|between:-65536,65536',
|
||||
];
|
||||
|
||||
|
||||
public function account()
|
||||
{
|
||||
|
||||
@@ -1,17 +1,35 @@
|
||||
<?php
|
||||
|
||||
|
||||
class TransactionJournal extends Eloquent {
|
||||
class TransactionJournal extends Elegant
|
||||
{
|
||||
|
||||
public function transactionType() {
|
||||
public static $rules
|
||||
= [
|
||||
'transaction_type_id' => 'required|exists:transaction_types,id',
|
||||
'transaction_currency_id' => 'required|exists:transaction_currencies,id',
|
||||
'description' => 'between:1,255',
|
||||
'date' => 'date',
|
||||
];
|
||||
|
||||
public function transactionType()
|
||||
{
|
||||
return $this->belongsTo('TransactionType');
|
||||
}
|
||||
public function transactionCurrency() {
|
||||
|
||||
public function transactionCurrency()
|
||||
{
|
||||
return $this->belongsTo('TransactionCurrency');
|
||||
}
|
||||
|
||||
public function transactions() {
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasMany('Transaction');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return array('created_at', 'updated_at', 'date');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user