diff --git a/app/Http/Controllers/MigrasiController.php b/app/Http/Controllers/MigrasiController.php index da3804c..c8077ed 100644 --- a/app/Http/Controllers/MigrasiController.php +++ b/app/Http/Controllers/MigrasiController.php @@ -3,25 +3,26 @@ namespace Modules\Webstatement\Http\Controllers; use App\Http\Controllers\Controller; + use BadMethodCallException; use Exception; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Storage; use Log; - use Modules\Webstatement\Jobs\ProcessAccountDataJob; - use Modules\Webstatement\Jobs\ProcessArrangementDataJob; - use Modules\Webstatement\Jobs\ProcessAtmTransactionJob; - use Modules\Webstatement\Jobs\ProcessBillDetailDataJob; - use Modules\Webstatement\Jobs\ProcessCategoryDataJob; - use Modules\Webstatement\Jobs\ProcessCompanyDataJob; - use Modules\Webstatement\Jobs\ProcessCustomerDataJob; - use Modules\Webstatement\Jobs\ProcessDataCaptureDataJob; - use Modules\Webstatement\Jobs\ProcessFtTxnTypeConditionJob; - use Modules\Webstatement\Jobs\ProcessFundsTransferDataJob; - use Modules\Webstatement\Jobs\ProcessStmtEntryDataJob; - use Modules\Webstatement\Jobs\ProcessStmtNarrFormatDataJob; - use Modules\Webstatement\Jobs\ProcessStmtNarrParamDataJob; - use Modules\Webstatement\Jobs\ProcessTellerDataJob; - use Modules\Webstatement\Jobs\ProcessTransactionDataJob; + use Modules\Webstatement\Jobs\{ProcessAccountDataJob, + ProcessArrangementDataJob, + ProcessAtmTransactionJob, + ProcessBillDetailDataJob, + ProcessCategoryDataJob, + ProcessCompanyDataJob, + ProcessCustomerDataJob, + ProcessDataCaptureDataJob, + ProcessFtTxnTypeConditionJob, + ProcessFundsTransferDataJob, + ProcessStmtEntryDataJob, + ProcessStmtNarrFormatDataJob, + ProcessStmtNarrParamDataJob, + ProcessTellerDataJob, + ProcessTransactionDataJob}; class MigrasiController extends Controller { @@ -64,6 +65,17 @@ 'billDetail' ]; + public function __call($method, $parameters) + { + if (strpos($method, 'process') === 0) { + $type = lcfirst(substr($method, 7)); + if (isset(self::PROCESS_TYPES[$type])) { + return $this->processData($type, $parameters[0] ?? ''); + } + } + throw new BadMethodCallException("Method {$method} does not exist."); + } + private function processData(string $type, string $period) : JsonResponse { @@ -81,17 +93,6 @@ } } - public function __call($method, $parameters) - { - if (strpos($method, 'process') === 0) { - $type = lcfirst(substr($method, 7)); - if (isset(self::PROCESS_TYPES[$type])) { - return $this->processData($type, $parameters[0] ?? ''); - } - } - throw new BadMethodCallException("Method {$method} does not exist."); - } - public function index() { $disk = Storage::disk('sftpStatement');