mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
First basic import #145
This commit is contained in:
@@ -27,7 +27,8 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Support\Import\JobConfiguration\Ynab\NewYnabJobHandler;
|
||||
use FireflyIII\Support\Import\JobConfiguration\Ynab\SelectBudgetsHandler;
|
||||
use FireflyIII\Support\Import\JobConfiguration\Ynab\SelectAccountsHandler;
|
||||
use FireflyIII\Support\Import\JobConfiguration\Ynab\SelectBudgetHandler;
|
||||
use FireflyIII\Support\Import\JobConfiguration\Ynab\YnabJobConfigurationInterface;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Log;
|
||||
@@ -121,8 +122,12 @@ class YnabJobConfiguration implements JobConfigurationInterface
|
||||
$handler->setImportJob($this->importJob);
|
||||
break;
|
||||
case 'select_budgets':
|
||||
/** @var SelectBudgetsHandler $handler */
|
||||
$handler = app(SelectBudgetsHandler::class);
|
||||
/** @var SelectBudgetHandler $handler */
|
||||
$handler = app(SelectBudgetHandler::class);
|
||||
$handler->setImportJob($this->importJob);
|
||||
break;
|
||||
case 'select_accounts':
|
||||
$handler = app(SelectAccountsHandler::class);
|
||||
$handler->setImportJob($this->importJob);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Routine\Ynab\GetAccountsHandler;
|
||||
use FireflyIII\Support\Import\Routine\Ynab\ImportDataHandler;
|
||||
use FireflyIII\Support\Import\Routine\Ynab\StageGetAccessHandler;
|
||||
use FireflyIII\Support\Import\Routine\Ynab\StageGetBudgetsHandler;
|
||||
use Log;
|
||||
@@ -104,7 +105,18 @@ class YnabRoutine implements RoutineInterface
|
||||
|
||||
$this->repository->setStage($this->importJob, 'select_accounts');
|
||||
$this->repository->setStatus($this->importJob, 'need_job_config');
|
||||
|
||||
return;
|
||||
}
|
||||
if('go-for-import' === $this->importJob->stage) {
|
||||
$this->repository->setStatus($this->importJob, 'running');
|
||||
$this->repository->setStage($this->importJob, 'do_import');
|
||||
/** @var ImportDataHandler $handler */
|
||||
$handler = app(ImportDataHandler::class);
|
||||
$handler->setImportJob($this->importJob);
|
||||
$handler->run();
|
||||
$this->repository->setStatus($this->importJob, 'provider_finished');
|
||||
$this->repository->setStage($this->importJob, 'final');
|
||||
return;
|
||||
}
|
||||
|
||||
// if ('match_accounts' === $this->importJob->stage) {
|
||||
|
||||
Reference in New Issue
Block a user