Compare commits
2 Commits
a687385017
...
2e2c8b4b0d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e2c8b4b0d | ||
|
|
e3b6e46d83 |
@@ -19,7 +19,7 @@
|
||||
private const PARAMETER_FOLDER = '_parameter';
|
||||
|
||||
// Konstanta untuk nilai-nilai statis
|
||||
private const FILE_EXTENSION = '.ST.ATM.csv';
|
||||
private const FILE_EXTENSION = '.ST.ATM.TRANSACTION.csv';
|
||||
private const CSV_DELIMITER = '~';
|
||||
private const DISK_NAME = 'sftpStatement';
|
||||
private const HEADER_MAP = [
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
$data = array_combine($headers, $row);
|
||||
try {
|
||||
if ($data['stmt_entry_id'] !== 'stmt_entry_id') {
|
||||
// Bersihkan trans_reference dari \\BNK jika ada
|
||||
if (isset($data['trans_reference'])) {
|
||||
$data['trans_reference'] = str_replace('\\BNK', '', $data['trans_reference']);
|
||||
}
|
||||
|
||||
StmtEntry::updateOrCreate(
|
||||
['stmt_entry_id' => $data['stmt_entry_id']],
|
||||
$data
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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::table('account_balances', function (Blueprint $table) {
|
||||
// First drop the unique constraint since we'll be making these columns the primary key
|
||||
$table->dropUnique(['account_number', 'period']);
|
||||
|
||||
// Drop the id column and its auto-increment primary key
|
||||
$table->dropColumn('id');
|
||||
|
||||
// Set the composite primary key
|
||||
$table->primary(['account_number', 'period']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('account_balances', function (Blueprint $table) {
|
||||
// Drop the composite primary key
|
||||
$table->dropPrimary(['account_number', 'period']);
|
||||
|
||||
// Add back the id column with auto-increment
|
||||
$table->id()->first();
|
||||
|
||||
// Re-add the unique constraint
|
||||
$table->unique(['account_number', 'period']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user