| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * ImporterInterface.php | 
					
						
							|  |  |  |  * Copyright (C) 2016 thegrumpydictator@gmail.com | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This software may be modified and distributed under the terms | 
					
						
							|  |  |  |  * of the MIT license.  See the LICENSE file for details. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | declare(strict_types = 1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Import\Importer; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use FireflyIII\Import\Role\Map; | 
					
						
							|  |  |  | use FireflyIII\Models\ImportJob; | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  | use Illuminate\Http\Request; | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  | use Symfony\Component\HttpFoundation\FileBag; | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Interface ImporterInterface | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package FireflyIII\Import\Importer | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | interface ImporterInterface | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-07-15 22:26:08 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Run the actual import | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return bool | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function start(): bool; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * After uploading, and after setJob(), prepare anything that is | 
					
						
							|  |  |  |      * necessary for the configure() line. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return bool | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function configure(): bool; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Returns any data necessary to do the configuration. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getConfigurationData(): array; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 14:24:34 +02:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  |      * This method returns the data required for the view that will let the user add settings to the import job. | 
					
						
							| 
									
										
										
										
											2016-06-24 14:24:34 +02:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  |      * @return array | 
					
						
							| 
									
										
										
										
											2016-06-24 14:24:34 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  |     public function getDataForSettings(): array; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  |      * Store the settings filled in by the user, if applicable. | 
					
						
							|  |  |  |      *  | 
					
						
							|  |  |  |      * @param Request $request | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  |      * | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  |     public function storeSettings(Request $request); | 
					
						
							| 
									
										
										
										
											2016-06-24 14:24:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  |      * This method returns the name of the view that will be shown to the user to further configure | 
					
						
							|  |  |  |      * the import job. | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  |      * @return string | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-07-02 17:33:57 +02:00
										 |  |  |     public function getViewForSettings(): string; | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 15:15:46 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * This method returns whether or not the user must configure this import | 
					
						
							|  |  |  |      * job further. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return bool | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function requireUserSettings(): bool; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @param array $data | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return bool | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function saveImportConfiguration(array $data, FileBag $files): bool; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-10 21:00:00 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * @param ImportJob $job | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function setJob(ImportJob $job); | 
					
						
							|  |  |  | } |