mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some cleaning up and new tests for the piggy bank controller.
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use LaravelBook\Ardent\Ardent as Ardent;
|
||||
|
||||
/**
|
||||
* Piggybank
|
||||
*
|
||||
* @property integer $id
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $account_id
|
||||
* @property integer $account_id
|
||||
* @property \Carbon\Carbon $targetdate
|
||||
* @property string $name
|
||||
* @property float $amount
|
||||
* @property float $target
|
||||
* @property integer $order
|
||||
* @property-read \Account $account
|
||||
* @property string $name
|
||||
* @property float $amount
|
||||
* @property float $target
|
||||
* @property integer $order
|
||||
* @property-read \Account $account
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereUpdatedAt($value)
|
||||
@@ -36,6 +37,21 @@ class Piggybank extends Ardent
|
||||
'order' => 'required:min:1',
|
||||
];
|
||||
|
||||
public static function factory()
|
||||
{
|
||||
$start = new Carbon;
|
||||
$start->endOfMonth();
|
||||
|
||||
return [
|
||||
'name' => 'string',
|
||||
'account_id' => 'factory|Account',
|
||||
'targetdate' => $start,
|
||||
'amount' => 0,
|
||||
'target' => 100,
|
||||
'order' => 1
|
||||
];
|
||||
}
|
||||
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('Account');
|
||||
|
||||
Reference in New Issue
Block a user