refactor(webstatement): update data processing and migration logic
- Menonaktifkan pemanggilan fungsi-fungsi yang tidak diperlukan untuk data processing di `MigrasiController`: - `processTransactionData`, `processStmtNarrFormatData`, `processAccountData`, dan `ProcessCompanyData`. - Mengubah argumen di beberapa pemanggilan fungsi untuk data processing agar lebih spesifik ke periode tertentu: - Mengganti `$periods` menjadi `['20250512']` untuk `processArrangementData`, `processBillDetailData`, `processFundsTransferData`, dan `processStmtEntryData`. - Memodifikasi logika skipping folder `_parameter` pada `ProcessFtTxnTypeConditionJob` dengan mengomentari proses pengecekan. - Mengubah delimiter `fgetcsv` pada `ProcessBillDetailDataJob` dari `;` menjadi `~`. - Menambahkan file migrasi baru untuk mengubah tipe kolom pada tabel `temp_fund_transfer`: - Mengubah semua kolom pada tabel menjadi tipe `text` untuk mendukung data yang lebih besar. - Menyediakan metode `down` untuk rollback tipe data kembali ke `string`. Perubahan ini bertujuan untuk meningkatkan efisiensi proses data, mendukung fleksibilitas data lebih besar pada migrasi database, serta membuka jalan untuk refaktor atau penghapusan fungsi yang tidak digunakan. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -151,9 +151,9 @@ class MigrasiController extends Controller
|
|||||||
// Get all directories (periods) in the SFTP disk
|
// Get all directories (periods) in the SFTP disk
|
||||||
$allDirectories = $disk->directories();
|
$allDirectories = $disk->directories();
|
||||||
|
|
||||||
$this->processTransactionData(['_parameter']);
|
//$this->processTransactionData(['_parameter']);
|
||||||
$this->processStmtNarrParamData(['_parameter']);
|
$this->processStmtNarrParamData(['_parameter']);
|
||||||
$this->processStmtNarrFormatData(['_parameter']);
|
//$this->processStmtNarrFormatData(['_parameter']);
|
||||||
|
|
||||||
$this->ProcessFtTxnTypeConditioData(['_parameter']);
|
$this->ProcessFtTxnTypeConditioData(['_parameter']);
|
||||||
|
|
||||||
@@ -172,13 +172,13 @@ class MigrasiController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->processCustomerData(['20250519']);
|
$this->processCustomerData(['20250519']);
|
||||||
$this->processAccountData(['20250519']);
|
//$this->processAccountData(['20250519']);
|
||||||
$this->processArrangementData($periods);
|
$this->processArrangementData(['20250512']);
|
||||||
$this->processBillDetailData($periods);
|
$this->processBillDetailData(['20250512']);
|
||||||
$this->processFundsTransferData($periods);
|
$this->processFundsTransferData(['20250512']);
|
||||||
$this->processStmtEntryData($periods);
|
$this->processStmtEntryData(['20250512']);
|
||||||
|
|
||||||
$this->ProcessCompanyData($periods);
|
//$this->ProcessCompanyData($periods);
|
||||||
$this->ProcessDataCaptureData($periods);
|
$this->ProcessDataCaptureData($periods);
|
||||||
|
|
||||||
return response()->json(['message' => 'Data processing job has been successfully']);
|
return response()->json(['message' => 'Data processing job has been successfully']);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ProcessBillDetailDataJob implements ShouldQueue
|
|||||||
$headers = (new TempBillDetail())->getFillable();
|
$headers = (new TempBillDetail())->getFillable();
|
||||||
$rowCount = 0;
|
$rowCount = 0;
|
||||||
|
|
||||||
while (($row = fgetcsv($handle, 0, ";")) !== false) {
|
while (($row = fgetcsv($handle, 0, "~")) !== false) {
|
||||||
$rowCount++;
|
$rowCount++;
|
||||||
|
|
||||||
if (count($headers) === count($row)) {
|
if (count($headers) === count($row)) {
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ class ProcessFtTxnTypeConditionJob implements ShouldQueue
|
|||||||
|
|
||||||
foreach ($this->periods as $period) {
|
foreach ($this->periods as $period) {
|
||||||
// Skip the _parameter folder
|
// Skip the _parameter folder
|
||||||
if ($period === '_parameter') {
|
/*if ($period === '_parameter') {
|
||||||
Log::info("Skipping _parameter folder");
|
Log::info("Skipping _parameter folder");
|
||||||
continue;
|
continue;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Construct the filepath based on the period folder name
|
// Construct the filepath based on the period folder name
|
||||||
$filePath = "$period/{$this->filename}";
|
$filePath = "$period/{$this->filename}";
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user