2017-12-16 01:03:35 -06:00
|
|
|
<?php
|
2018-04-02 07:43:06 -05:00
|
|
|
|
2017-12-17 07:44:46 -06:00
|
|
|
/**
|
|
|
|
* import.php
|
2019-10-01 23:38:00 -05:00
|
|
|
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
2017-12-17 07:44:46 -06:00
|
|
|
*
|
2019-10-01 23:38:00 -05:00
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
2017-12-17 07:44:46 -06:00
|
|
|
*
|
2019-10-01 23:38:00 -05:00
|
|
|
* 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.
|
2017-12-17 07:44:46 -06:00
|
|
|
*
|
2019-10-01 23:38:00 -05:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2017-12-17 07:44:46 -06:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2019-10-01 23:38:00 -05:00
|
|
|
* GNU Affero General Public License for more details.
|
2017-12-17 07:44:46 -06:00
|
|
|
*
|
2019-10-01 23:38:00 -05:00
|
|
|
* 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/>.
|
2017-12-17 07:44:46 -06:00
|
|
|
*/
|
|
|
|
|
2018-05-11 03:08:34 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-05-23 05:36:12 -05:00
|
|
|
use FireflyIII\Import\JobConfiguration\BunqJobConfiguration;
|
2018-05-11 03:08:34 -05:00
|
|
|
use FireflyIII\Import\JobConfiguration\FakeJobConfiguration;
|
|
|
|
use FireflyIII\Import\JobConfiguration\FileJobConfiguration;
|
2018-10-01 12:24:24 -05:00
|
|
|
use FireflyIII\Import\JobConfiguration\FinTSJobConfiguration;
|
2018-05-19 03:44:33 -05:00
|
|
|
use FireflyIII\Import\JobConfiguration\SpectreJobConfiguration;
|
2018-07-29 00:30:06 -05:00
|
|
|
use FireflyIII\Import\JobConfiguration\YnabJobConfiguration;
|
2018-05-23 05:36:12 -05:00
|
|
|
use FireflyIII\Import\Prerequisites\BunqPrerequisites;
|
2018-05-11 03:08:34 -05:00
|
|
|
use FireflyIII\Import\Prerequisites\FakePrerequisites;
|
2018-05-13 08:00:30 -05:00
|
|
|
use FireflyIII\Import\Prerequisites\SpectrePrerequisites;
|
2018-07-29 00:30:06 -05:00
|
|
|
use FireflyIII\Import\Prerequisites\YnabPrerequisites;
|
2018-05-23 05:36:12 -05:00
|
|
|
use FireflyIII\Import\Routine\BunqRoutine;
|
2018-05-11 03:08:34 -05:00
|
|
|
use FireflyIII\Import\Routine\FakeRoutine;
|
|
|
|
use FireflyIII\Import\Routine\FileRoutine;
|
2018-10-01 12:24:24 -05:00
|
|
|
use FireflyIII\Import\Routine\FinTSRoutine;
|
2018-05-14 13:21:00 -05:00
|
|
|
use FireflyIII\Import\Routine\SpectreRoutine;
|
2018-07-29 00:30:06 -05:00
|
|
|
use FireflyIII\Import\Routine\YnabRoutine;
|
2018-05-11 03:08:34 -05:00
|
|
|
use FireflyIII\Support\Import\Routine\File\CSVProcessor;
|
2017-12-16 01:03:35 -06:00
|
|
|
|
|
|
|
return [
|
2018-05-13 02:01:10 -05:00
|
|
|
// these import providers are available:
|
|
|
|
'enabled' => [
|
|
|
|
'fake' => true,
|
2017-12-16 01:03:35 -06:00
|
|
|
'file' => true,
|
2019-09-06 23:23:26 -05:00
|
|
|
'bunq' => false,
|
2018-05-14 10:59:43 -05:00
|
|
|
'spectre' => true,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => true,
|
2018-05-13 02:01:10 -05:00
|
|
|
'plaid' => false,
|
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => true,
|
2018-05-30 11:04:23 -05:00
|
|
|
'bad' => false, // always disabled
|
2018-05-13 02:01:10 -05:00
|
|
|
],
|
|
|
|
// demo user can use these import providers (when enabled):
|
|
|
|
'allowed_for_demo' => [
|
|
|
|
'fake' => true,
|
|
|
|
'file' => false,
|
|
|
|
'bunq' => false,
|
|
|
|
'spectre' => false,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => false,
|
2017-12-17 12:24:43 -06:00
|
|
|
'plaid' => false,
|
2018-04-29 11:03:55 -05:00
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => false,
|
2018-04-29 11:03:55 -05:00
|
|
|
],
|
2018-05-13 02:01:10 -05:00
|
|
|
// a normal user user can use these import providers (when enabled):
|
|
|
|
'allowed_for_user' => [
|
|
|
|
'fake' => false,
|
|
|
|
'file' => true,
|
|
|
|
'bunq' => true,
|
|
|
|
'spectre' => true,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => true,
|
2018-05-13 02:01:10 -05:00
|
|
|
'plaid' => true,
|
|
|
|
'quovo' => true,
|
|
|
|
'yodlee' => true,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => true,
|
2018-05-13 02:01:10 -05:00
|
|
|
],
|
2018-05-13 08:00:30 -05:00
|
|
|
// some providers have pre-requisites.
|
2018-05-13 02:01:10 -05:00
|
|
|
'has_prereq' => [
|
2018-05-03 15:20:06 -05:00
|
|
|
'fake' => true,
|
|
|
|
'file' => false,
|
2018-04-29 11:03:55 -05:00
|
|
|
'bunq' => true,
|
|
|
|
'spectre' => true,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => true,
|
2018-04-29 11:03:55 -05:00
|
|
|
'plaid' => true,
|
|
|
|
'quovo' => true,
|
|
|
|
'yodlee' => true,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => false,
|
2017-12-16 01:03:35 -06:00
|
|
|
],
|
2018-05-13 08:00:30 -05:00
|
|
|
// if so, there must be a class to handle them.
|
2018-05-13 02:01:10 -05:00
|
|
|
'prerequisites' => [
|
2018-04-29 12:07:54 -05:00
|
|
|
'fake' => FakePrerequisites::class,
|
2018-05-06 13:42:30 -05:00
|
|
|
'file' => false,
|
2018-05-23 05:36:12 -05:00
|
|
|
'bunq' => BunqPrerequisites::class,
|
2018-05-14 10:59:43 -05:00
|
|
|
'spectre' => SpectrePrerequisites::class,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => YnabPrerequisites::class,
|
2018-04-29 23:37:29 -05:00
|
|
|
'plaid' => false,
|
2018-04-29 11:03:55 -05:00
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => false,
|
2018-04-29 11:03:55 -05:00
|
|
|
],
|
2018-05-14 10:59:43 -05:00
|
|
|
// some providers may need extra configuration per job
|
2018-05-30 11:04:23 -05:00
|
|
|
'has_job_config' => [
|
2018-05-03 15:20:06 -05:00
|
|
|
'fake' => true,
|
2018-04-29 11:03:55 -05:00
|
|
|
'file' => true,
|
2018-05-23 05:36:12 -05:00
|
|
|
'bunq' => true,
|
2018-05-19 03:44:33 -05:00
|
|
|
'spectre' => true,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => true,
|
2018-05-14 10:59:43 -05:00
|
|
|
'plaid' => false,
|
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => true,
|
2017-12-16 01:03:35 -06:00
|
|
|
],
|
2018-05-13 08:00:30 -05:00
|
|
|
// if so, this is the class that handles it.
|
2018-05-13 02:01:10 -05:00
|
|
|
'configuration' => [
|
2018-04-29 13:01:03 -05:00
|
|
|
'fake' => FakeJobConfiguration::class,
|
2018-05-03 15:20:06 -05:00
|
|
|
'file' => FileJobConfiguration::class,
|
2018-05-23 05:36:12 -05:00
|
|
|
'bunq' => BunqJobConfiguration::class,
|
2018-05-19 03:44:33 -05:00
|
|
|
'spectre' => SpectreJobConfiguration::class,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => YnabJobConfiguration::class,
|
2018-04-29 23:37:29 -05:00
|
|
|
'plaid' => false,
|
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => FinTSJobConfiguration::class,
|
2017-12-16 01:03:35 -06:00
|
|
|
],
|
2018-05-13 08:00:30 -05:00
|
|
|
// this is the routine that runs the actual import.
|
2018-05-13 02:01:10 -05:00
|
|
|
'routine' => [
|
2018-04-29 23:37:29 -05:00
|
|
|
'fake' => FakeRoutine::class,
|
2018-04-02 07:43:06 -05:00
|
|
|
'file' => FileRoutine::class,
|
2018-05-23 05:36:12 -05:00
|
|
|
'bunq' => BunqRoutine::class,
|
2018-05-14 13:21:00 -05:00
|
|
|
'spectre' => SpectreRoutine::class,
|
2018-07-29 00:30:06 -05:00
|
|
|
'ynab' => YnabRoutine::class,
|
2018-04-29 23:37:29 -05:00
|
|
|
'plaid' => false,
|
|
|
|
'quovo' => false,
|
|
|
|
'yodlee' => false,
|
2018-10-01 12:24:24 -05:00
|
|
|
'fints' => FinTSRoutine::class,
|
2017-12-16 12:47:14 -06:00
|
|
|
],
|
|
|
|
|
2018-05-13 02:01:10 -05:00
|
|
|
'options' => [
|
|
|
|
'fake' => [],
|
2018-04-29 11:03:55 -05:00
|
|
|
'file' => [
|
2017-12-16 10:19:10 -06:00
|
|
|
'import_formats' => ['csv'], // mt940
|
|
|
|
'default_import_format' => 'csv',
|
2018-03-10 00:16:38 -06:00
|
|
|
'processors' => [
|
2018-05-06 13:42:30 -05:00
|
|
|
'csv' => CSVProcessor::class,
|
2017-12-16 13:21:05 -06:00
|
|
|
],
|
2017-12-16 10:19:10 -06:00
|
|
|
],
|
2018-04-29 11:03:55 -05:00
|
|
|
'bunq' => [
|
2018-05-13 02:01:10 -05:00
|
|
|
'live' => [
|
|
|
|
'server' => 'api.bunq.com',
|
|
|
|
'version' => 'v1',
|
|
|
|
],
|
|
|
|
'sandbox' => [
|
|
|
|
'server' => 'sandbox.public.api.bunq.com', // sandbox.public.api.bunq.com - api.bunq.com
|
|
|
|
'version' => 'v1',
|
|
|
|
],
|
2018-03-10 00:16:38 -06:00
|
|
|
],
|
2018-04-28 08:35:43 -05:00
|
|
|
'spectre' => [
|
|
|
|
'server' => 'www.saltedge.com',
|
|
|
|
],
|
2018-07-29 14:02:03 -05:00
|
|
|
'ynab' => [
|
|
|
|
'live' => 'api.youneedabudget.com',
|
|
|
|
'version' => 'v1',
|
2018-07-29 00:30:06 -05:00
|
|
|
],
|
2018-05-13 08:00:30 -05:00
|
|
|
'plaid' => [],
|
|
|
|
'quovo' => [],
|
|
|
|
'yodlee' => [],
|
2017-12-16 10:19:10 -06:00
|
|
|
],
|
2017-12-27 15:29:25 -06:00
|
|
|
];
|