2016-06-10 21:00:00 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* ImportJobRepositoryInterface.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
2016-10-05 06:52:15 +02:00
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
2016-06-10 21:00:00 +02:00
|
|
|
*/
|
|
|
|
|
2017-04-09 07:44:22 +02:00
|
|
|
declare(strict_types=1);
|
2016-06-10 21:00:00 +02:00
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\ImportJob;
|
|
|
|
|
|
|
|
use FireflyIII\Models\ImportJob;
|
2017-01-30 16:40:49 +01:00
|
|
|
use FireflyIII\User;
|
2017-06-10 15:09:41 +02:00
|
|
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
2016-06-10 21:00:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface ImportJobRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\ImportJob
|
|
|
|
*/
|
|
|
|
interface ImportJobRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param string $fileType
|
|
|
|
*
|
|
|
|
* @return ImportJob
|
|
|
|
*/
|
|
|
|
public function create(string $fileType): ImportJob;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $key
|
|
|
|
*
|
|
|
|
* @return ImportJob
|
|
|
|
*/
|
|
|
|
public function findByKey(string $key): ImportJob;
|
2017-01-30 16:46:30 +01:00
|
|
|
|
2017-06-10 15:09:41 +02:00
|
|
|
/**
|
|
|
|
* @param ImportJob $job
|
|
|
|
* @param UploadedFile $file
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function processFile(ImportJob $job, UploadedFile $file): bool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ImportJob $job
|
|
|
|
* @param UploadedFile $file
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function processConfiguration(ImportJob $job, UploadedFile $file): bool;
|
|
|
|
|
2017-03-19 17:54:21 +01:00
|
|
|
/**
|
|
|
|
* @param ImportJob $job
|
|
|
|
* @param array $configuration
|
|
|
|
*
|
|
|
|
* @return ImportJob
|
|
|
|
*/
|
|
|
|
public function setConfiguration(ImportJob $job, array $configuration): 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
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ImportJob $job
|
|
|
|
* @param string $status
|
|
|
|
*
|
|
|
|
* @return ImportJob
|
|
|
|
*/
|
|
|
|
public function updateStatus(ImportJob $job, string $status): ImportJob;
|
2016-08-12 15:10:03 +02:00
|
|
|
}
|