feat(webstatement): tambahkan fitur proses data teller

- Menambahkan job baru `ProcessTellerDataJob` untuk memproses data teller dari file CSV.
- Membuat controller method `ProcessTellerData` di `MigrasiController` untuk dispatch job `ProcessTellerDataJob`.
- Menambahkan model baru `Teller` yang merepresentasikan data teller dengan kolom sesuai header map pada CSV.
- Menambahkan migrasi `2025_05_21_144332_create_tellers_table.php` untuk membuat tabel database `tellers` dengan struktur data lengkap.
- Menambahkan logika pada job untuk membaca, memproses, dan menyimpan data CSV ke dalam database.
- Menyediakan mekanisme pemrosesan file CSV termasuk:
  - Validasi jumlah kolom pada CSV jika tidak sesuai dengan header.
  - Membuat dan menghapus file sementara selama pemrosesan.
  - Mapping data CSV ke atribut model `Teller`.
  - Penanganan error saat menyimpan data ke model `Teller`.
  - Logging proses meliputi jumlah data yang diproses dan error selama jalannya job.

Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
Daeng Deni Mardaeni
2025-05-21 22:01:31 +07:00
parent 285c2409ea
commit e511025307
4 changed files with 574 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ 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;
class MigrasiController extends Controller
@@ -152,6 +153,15 @@ class MigrasiController extends Controller
}
}
public function ProcessTellerData($periods){
try {
ProcessTellerDataJob::dispatch($periods);
return response()->json(['message' => 'Data TempStmtEntry processing job has been successfully']);
} catch (Exception $e) {
return response()->json(['error' => $e->getMessage()], 500);
}
}
public function index()
{
@@ -187,6 +197,7 @@ class MigrasiController extends Controller
//$this->processStmtEntryData($periods);
//$this->ProcessDataCaptureData($periods);
//$this->processFundsTransferData($periods);
$this->ProcessTellerData($periods);
//$this->processArrangementData($periods);
//$this->processBillDetailData($periods);