Remove import code.

This commit is contained in:
James Cole
2020-06-06 21:23:26 +02:00
parent 60fa0d7244
commit 6cc4d14fcb
217 changed files with 41 additions and 23415 deletions

View File

@@ -94,6 +94,12 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read int|null $notes_count
* @property-read int|null $piggy_banks_count
* @property-read int|null $transactions_count
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property int $account_type_id
* @property bool $encrypted
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\AccountMeta[] $accountMeta
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
*/
class Account extends Model
{

View File

@@ -1,150 +0,0 @@
<?php
/**
* ImportJob.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Models;
use Carbon\Carbon;
use Eloquent;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class ImportJob.
*
* @codeCoverageIgnore
* @deprecated
* @property array $transactions
* @property array $configuration
* @property User $user
* @property int $user_id
* @property string $status
* @property string $stage
* @property string $key
* @property string $provider
* @property string $file_type
* @property int $tag_id
* @property Tag $tag
* @property array $errors
* @property array extended_status
* @property int id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property-read Collection|Attachment[] $attachments
* @method static Builder|ImportJob newModelQuery()
* @method static Builder|ImportJob newQuery()
* @method static Builder|ImportJob query()
* @method static Builder|ImportJob whereConfiguration($value)
* @method static Builder|ImportJob whereCreatedAt($value)
* @method static Builder|ImportJob whereErrors($value)
* @method static Builder|ImportJob whereExtendedStatus($value)
* @method static Builder|ImportJob whereFileType($value)
* @method static Builder|ImportJob whereId($value)
* @method static Builder|ImportJob whereKey($value)
* @method static Builder|ImportJob whereProvider($value)
* @method static Builder|ImportJob whereStage($value)
* @method static Builder|ImportJob whereStatus($value)
* @method static Builder|ImportJob whereTagId($value)
* @method static Builder|ImportJob whereTransactions($value)
* @method static Builder|ImportJob whereUpdatedAt($value)
* @method static Builder|ImportJob whereUserId($value)
* @mixin Eloquent
* @property-read int|null $attachments_count
* @property int $id
* @property array|null $extended_status
*/
class ImportJob extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'user_id' => 'int',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'configuration' => 'array',
'extended_status' => 'array',
'transactions' => 'array',
'errors' => 'array',
];
/** @var array Fields that can be filled */
protected $fillable = ['key', 'user_id', 'file_type', 'provider', 'status', 'stage', 'configuration', 'extended_status', 'transactions', 'errors'];
/**
* Route binder. Converts the key in the URL to the specified object (or throw 404).
*
* @param $value
*
* @throws NotFoundHttpException
* @return mixed
*
*/
public static function routeBinder(string $value): ImportJob
{
if (auth()->check()) {
$key = trim($value);
/** @var User $user */
$user = auth()->user();
/** @var ImportJob $importJob */
$importJob = $user->importJobs()->where('key', $key)->first();
if (null !== $importJob) {
return $importJob;
}
}
throw new NotFoundHttpException;
}
/**
* @codeCoverageIgnore
* @return MorphMany
*/
public function attachments(): MorphMany
{
return $this->morphMany(Attachment::class, 'attachable');
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function tag(): BelongsTo
{
return $this->belongsTo(Tag::class);
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@@ -8,6 +8,13 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class ObjectGroup
*
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
* @property-read int|null $piggy_banks_count
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup query()
* @mixin \Eloquent
*/
class ObjectGroup extends Model
{

View File

@@ -78,6 +78,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read int|null $notes_count
* @property-read int|null $piggy_bank_events_count
* @property-read int|null $piggy_bank_repetitions_count
* @property bool $encrypted
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ObjectGroup[] $objectGroups
* @property-read int|null $object_groups_count
*/
class PiggyBank extends Model
{

View File

@@ -78,6 +78,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read \Illuminate\Database\Eloquent\Collection|Location[] $locations
* @property-read int|null $locations_count
* @property-read int|null $transaction_journals_count
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string $tagMode
* @property string|null $description
* @property float|null $latitude
* @property float|null $longitude
* @property int|null $zoomLevel
*/
class Tag extends Model
{