feat(webstatement): tambah pemrosesan data ATM Transaction

- Menambahkan job `ProcessAtmTransactionJob` untuk memproses data transaksi ATM dari file CSV.
  - Implementasi pemrosesan file CSV termasuk pembacaan, pemetaan header, dan simpan data ke model.
  - Menyediakan logging untuk pemantauan jumlah data yang diproses dan jumlah error.
  - Menambahkan mekanisme penanganan error pada setiap proses baris dan file.

- Menambahkan model `AtmTransaction`:
  - Mendeklarasikan atribut yang bisa diisi (`fillable`) seperti `transaction_id`, `txn_amount`, dan lainnya.
  - Mendefinisikan tipe data casting untuk beberapa atribut seperti `txn_amount` dalam tipe decimal dan `booking_date` dalam tipe datetime.

- Menambahkan migration `2025_05_21_150736_create_atm_transactions_table` untuk tabel `atm_transactions`:
  - Tabel memiliki kolom seperti `transaction_id`, `txn_amount`, `booking_date`, dan indeks untuk kolom tertentu.
  - Meng-handle struktur kolom untuk mendukung atribut yang diperlukan di model.

- Memperbarui `MigrasiController`:
  - Menambahkan fungsi `ProcessAtmTransaction` untuk menjadwalkan `ProcessAtmTransactionJob`.
  - Memperbaiki pesan response pada beberapa fungsi agar lebih deskriptif dan konsisten.

- Memperbarui pemanggilan fungsi dari `__invoke` di bagian pemrosesan data (`ProcessAtmTransaction`) untuk period tertentu.

Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
Daeng Deni Mardaeni
2025-05-21 22:14:58 +07:00
parent e511025307
commit d5495d721e
4 changed files with 342 additions and 6 deletions

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up()
: void
{
Schema::create('atm_transactions', function (Blueprint $table) {
$table->id();
$table->string('transaction_id')->nullable()->index();
$table->string('card_acc_id')->nullable();
$table->string('pan_number')->nullable();
$table->string('txn_type')->nullable();
$table->string('merchant_id')->nullable();
$table->string('txn_amount')->nullable();
$table->string('booking_date')->nullable();
$table->string('trans_ref')->nullable();
$table->string('retrieval_ref_no')->nullable();
$table->string('stmt_nos')->nullable();
$table->string('debit_acct_no')->nullable();
$table->string('credit_acct_no')->nullable();
$table->string('chrg_amount')->nullable();
$table->string('value_date')->nullable();
$table->string('stan_no')->nullable();
$table->string('trans_status')->nullable();
$table->string('proc_code')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('atm_transactions');
}
};