refactor(data-processing): adjust data processing logic and update file handling
- Nonaktifkan pengecekan folder `_parameter` di berbagai job untuk memungkinkan pemrosesan file pada folder ini. - Ubah logika konstruksi nama file di job `ProcessTransactionDataJob` agar tidak lagi menyertakan nama folder periode. - Sesuaikan pola nama file pada job `ProcessStmtNarrParamDataJob` dan `ProcessStmtNarrFormatDataJob` untuk menghapus ketergantungan pada nama folder periode. - Tambahkan pemanggilan fungsi `processTransactionData`, `processStmtNarrParamData`, dan `processStmtNarrFormatData` secara eksplisit dengan argumen folder `_parameter` di `MigrasiController`. - Batasi pemrosesan data customer dan akun hanya pada periode tertentu (`20250519`) di `MigrasiController`. - Hapus pemanggilan beberapa fungsi proses data lain di `MigrasiController` untuk periode umum. - Perubahan ini bertujuan untuk meningkatkan fleksibilitas dan mengakomodasi kebutuhan pemrosesan data secara spesifik.
This commit is contained in:
@@ -119,6 +119,11 @@ class MigrasiController extends Controller
|
||||
// Get all directories (periods) in the SFTP disk
|
||||
$allDirectories = $disk->directories();
|
||||
|
||||
$this->processTransactionData(['_parameter']);
|
||||
$this->processStmtNarrParamData(['_parameter']);
|
||||
$this->processStmtNarrFormatData(['_parameter']);
|
||||
|
||||
|
||||
// Filter out the _parameter folder
|
||||
$periods = array_filter($allDirectories, function($dir) {
|
||||
return $dir !== '_parameter';
|
||||
@@ -133,14 +138,11 @@ class MigrasiController extends Controller
|
||||
return response()->json(['message' => 'No valid period folders found in SFTP storage'], 404);
|
||||
}
|
||||
|
||||
$this->processCustomerData($periods);
|
||||
$this->processAccountData($periods);
|
||||
$this->processCustomerData(['20250519']);
|
||||
$this->processAccountData(['20250519']);
|
||||
$this->processArrangementData($periods);
|
||||
$this->processBillDetailData($periods);
|
||||
$this->processTransactionData($periods);
|
||||
$this->processFundsTransferData($periods);
|
||||
$this->processStmtNarrParamData($periods);
|
||||
$this->processStmtNarrFormatData($periods);
|
||||
$this->processStmtEntryData($periods);
|
||||
|
||||
return response()->json(['message' => 'Data processing job has been successfully']);
|
||||
|
||||
@@ -44,13 +44,13 @@ class ProcessStmtNarrFormatDataJob implements ShouldQueue
|
||||
|
||||
foreach ($this->periods as $period) {
|
||||
// Skip the _parameter folder
|
||||
if ($period === '_parameter') {
|
||||
/*if ($period === '_parameter') {
|
||||
Log::info("Skipping _parameter folder");
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Construct the filename based on the period folder name
|
||||
$filename = "$period.ST.STMT.NARR.FORMAT.csv";
|
||||
$filename = "ST.STMT.NARR.FORMAT.csv";
|
||||
$filePath = "$period/$filename";
|
||||
|
||||
Log::info("Processing statement narrative format file: $filePath");
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
|
||||
foreach ($this->periods as $period) {
|
||||
// Skip the _parameter folder
|
||||
if ($period === '_parameter') {
|
||||
/*if ($period === '_parameter') {
|
||||
Log::info("Skipping _parameter folder");
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Construct the filename based on the period folder name
|
||||
$filename = "$period.ST.STMT.NARR.PARAM.csv";
|
||||
$filename = "ST.STMT.NARR.PARAM.csv";
|
||||
$filePath = "$period/$filename";
|
||||
|
||||
Log::info("Processing statement narrative parameter file: $filePath");
|
||||
|
||||
@@ -44,13 +44,13 @@ class ProcessTransactionDataJob implements ShouldQueue
|
||||
|
||||
foreach ($this->periods as $period) {
|
||||
// Skip the _parameter folder
|
||||
if ($period === '_parameter') {
|
||||
/*if ($period === '_parameter') {
|
||||
Log::info("Skipping _parameter folder");
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Construct the filename based on the period folder name
|
||||
$filename = "$period.ST.TRANSACTION.csv";
|
||||
$filename = "ST.TRANSACTION.csv";
|
||||
$filePath = "$period/$filename";
|
||||
|
||||
Log::info("Processing transaction file: $filePath");
|
||||
|
||||
Reference in New Issue
Block a user