feat(jobs): tambahkan job untuk memproses data parameter narasi
- Menambahkan kelas ProcessStmtNarrParamDataJob untuk memproses file CSV. - Membuat model TempStmtNarrParam untuk menyimpan data parameter narasi. - Menambahkan migrasi untuk membuat tabel temp_stmt_narr_param di database.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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
|
||||
{
|
||||
$fields = '_id,date_time,system_id,field_name,field_operand,field_value,narr_format,record_status,curr_no,inputter,authoriser,co_code,dept_code,auditor_code,audit_date_time,nr_prm_id,k_file,file';
|
||||
$fieldsArray = explode(',', $fields);
|
||||
|
||||
Schema::create('temp_stmt_narr_param', function (Blueprint $table) use ($fieldsArray) {
|
||||
$table->id();
|
||||
foreach ($fieldsArray as $field) {
|
||||
$field = trim($field);
|
||||
$table->string($field)->nullable();
|
||||
}
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('temp_stmt_narr_param');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user