This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Requests\FileImportRequest; | |
use App\Services\FileImport\JoblistFileImportService; | |
class FileImportController extends Controller | |
{ | |
private $service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Requests; | |
use App\Models\Dto\FileImportDto; | |
use Illuminate\Foundation\Http\FormRequest; | |
use Illuminate\Validation\Rule; | |
class FileImportRequest extends FormRequest | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport; | |
use App\Models\Dto\FileImportDto; | |
class JoblistFileImportService | |
{ | |
/** | |
* processFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport; | |
use App\Models\Dto\FileImportDto; | |
use App\Services\FileImport\ImporterFactory; | |
use App\Services\FileImport\Interface\FileImporterInterface; | |
class JoblistFileImportContext | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport; | |
use App\Services\FileImport\Importer\DeliveryJoblistFileImporter; | |
use App\Services\FileImport\Importer\OfficeWorkJoblistFileImporter; | |
use App\Services\FileImport\Importer\RestaurantJoblistFileImporter; | |
use App\Services\FileImport\Interface\FileImporterInterface; | |
class ImporterFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport\Importer; | |
use App\Models\Dto\FileImportDto; | |
use App\Services\FileImport\Interface\FileImporterInterface; | |
class OfficeWorkJoblistFileImporter implements FileImporterInterface | |
{ | |
public static function type(): int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport\Interface; | |
use App\Models\Dto\FileImportDto; | |
interface FileImporterInterface | |
{ | |
/** | |
* type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport; | |
use App\Services\FileImport\Interface\FileImporterInterface; | |
class ImporterFactory | |
{ | |
public function createImporter(): FileImporterInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models\Dto; | |
use Illuminate\Http\UploadedFile; | |
class FileImportDto | |
{ | |
public UploadedFile $uploadedFile; | |
public int $fileType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\FileImport\Importer; | |
use App\Models\Dto\FileImportDto; | |
use App\Services\FileImport\Interface\FileImporterInterface; | |
class OfficeWorkJoblistFileImporter implements FileImporterInterface | |
{ | |
public function readData(FileImportDto $fileDto): array |