Files
firefly-iii/app/Repositories/ImportJob/ImportJobRepositoryInterface.php

167 lines
4.0 KiB
PHP
Raw Normal View History

2016-06-10 21:00:00 +02:00
<?php
/**
* ImportJobRepositoryInterface.php
2017-10-21 08:40:00 +02:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
2016-06-10 21:00:00 +02:00
*
2017-10-21 08:40:00 +02:00
* This file is part of Firefly III.
*
2017-10-21 08:40:00 +02:00
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 14:44:05 +01:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
2016-06-10 21:00:00 +02:00
*/
declare(strict_types=1);
2016-06-10 21:00:00 +02:00
namespace FireflyIII\Repositories\ImportJob;
use FireflyIII\Exceptions\FireflyException;
2016-06-10 21:00:00 +02:00
use FireflyIII\Models\ImportJob;
2018-05-03 17:23:16 +02:00
use FireflyIII\Models\Tag;
use FireflyIII\User;
2018-05-10 23:01:21 +02:00
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use Symfony\Component\HttpFoundation\File\UploadedFile;
2016-06-10 21:00:00 +02:00
/**
2017-11-15 12:25:49 +01:00
* Interface ImportJobRepositoryInterface.
2016-06-10 21:00:00 +02:00
*/
interface ImportJobRepositoryInterface
{
2018-05-03 17:23:16 +02:00
/**
* Add message to job.
*
* @param ImportJob $job
* @param string $error
*
* @return ImportJob
*/
public function addErrorMessage(ImportJob $job, string $error): ImportJob;
2018-01-05 17:29:42 +01:00
/**
* @param string $importProvider
2018-01-05 17:29:42 +01:00
*
* @return ImportJob
*/
public function create(string $importProvider): ImportJob;
2016-06-10 21:00:00 +02:00
/**
* @param string $key
*
* @return ImportJob
2018-07-23 21:49:15 +02:00
* @deprecated
2016-06-10 21:00:00 +02:00
*/
public function findByKey(string $key): ImportJob;
2017-01-30 16:46:30 +01:00
2018-06-06 21:23:00 +02:00
/**
* Return all attachments for job.
*
* @param ImportJob $job
*
* @return Collection
*/
public function getAttachments(ImportJob $job): Collection;
2018-01-04 18:34:51 +01:00
/**
* Return configuration of job.
*
* @param ImportJob $job
*
* @return array
*/
public function getConfiguration(ImportJob $job): array;
2018-01-05 17:29:42 +01:00
/**
* Return extended status of job.
*
* @param ImportJob $job
*
* @return array
*/
public function getExtendedStatus(ImportJob $job): array;
2017-03-19 17:54:21 +01:00
/**
* @param ImportJob $job
* @param array $configuration
*
* @return ImportJob
*/
public function setConfiguration(ImportJob $job, array $configuration): ImportJob;
2018-01-10 16:49:32 +01:00
/**
* @param ImportJob $job
2018-06-06 21:23:00 +02:00
* @param string $stage
2018-01-10 16:49:32 +01:00
*
* @return ImportJob
*/
2018-06-06 21:23:00 +02:00
public function setStage(ImportJob $job, string $stage): ImportJob;
2018-01-10 16:49:32 +01:00
/**
* @param ImportJob $job
2018-06-06 21:23:00 +02:00
* @param string $status
*
* @return ImportJob
*/
2018-06-06 21:23:00 +02:00
public function setStatus(ImportJob $job, string $status): ImportJob;
2018-06-06 21:23:00 +02:00
/**
* @param ImportJob $job
* @param Tag $tag
*
* @return ImportJob
*/
public function setTag(ImportJob $job, Tag $tag): ImportJob;
/**
* @param ImportJob $job
* @param array $transactions
*
* @return ImportJob
*/
public function setTransactions(ImportJob $job, array $transactions): ImportJob;
2017-01-30 16:46:30 +01:00
/**
* @param User $user
*/
public function setUser(User $user);
2017-03-19 17:54:21 +01:00
2018-06-06 21:23:00 +02:00
/**
* Store file.
*
* @param ImportJob $job
* @param string $name
* @param string $fileName
*
* @return MessageBag
*/
public function storeCLIUpload(ImportJob $job, string $name, string $fileName): MessageBag;
/**
* Handle upload for job.
*
* @param ImportJob $job
* @param string $name
* @param UploadedFile $file
*
* @return MessageBag
* @throws FireflyException
*/
public function storeFileUpload(ImportJob $job, string $name, UploadedFile $file): MessageBag;
2017-03-19 17:54:21 +01:00
/**
* @param ImportJob $job
* @param string $status
*
* @return ImportJob
*/
public function updateStatus(ImportJob $job, string $status): ImportJob;
2018-01-05 17:29:42 +01:00
2016-08-12 15:10:03 +02:00
}