feat(webstatement): tambah fitur request dan pengelolaan print statement
- Tambah menu baru untuk "Print Statement" di konfigurasi module. - Tambah route baru untuk pengelolaan statement seperti list, download, otorisasi, dan datatables. - Implementasi `PrintStatementController` untuk operasi terkait request dan manajemen statement. - Implementasi model `PrintStatementLog` untuk mencatat log request statement, termasuk validasi dan relasi yang dibutuhkan. - Tambah form request `PrintStatementRequest` untuk validasi input. - Tambah migration untuk tabel `print_statement_logs` yang menyimpan rekaman log statement. - Tambah halaman blade untuk index dan form request statement. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?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('print_statement_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id')->nullable()->comment('User who requested the statement');
|
||||
$table->string('branch_code')->comment('Branch code');
|
||||
$table->string('account_number')->comment('Account number');
|
||||
$table->string('period_from')->comment('Statement period start (YYYYMM format)');
|
||||
$table->string('period_to')->nullable()->comment('Statement period end (YYYYMM format), null if single period');
|
||||
$table->boolean('is_period_range')->default(false)->comment('Whether the statement is for a period range');
|
||||
$table->boolean('is_available')->default(false)->comment('Whether the statement was found');
|
||||
$table->boolean('is_downloaded')->default(false)->comment('Whether the statement was downloaded');
|
||||
$table->string('ip_address')->nullable()->comment('IP address of requester');
|
||||
$table->string('user_agent')->nullable()->comment('User agent of requester');
|
||||
$table->timestamp('downloaded_at')->nullable()->comment('When the statement was downloaded');
|
||||
|
||||
$table->enum('authorization_status', ['pending', 'approved', 'rejected'])->default('pending');
|
||||
|
||||
// Add index for faster searching
|
||||
$table->index(['branch_code', 'account_number', 'period_from', 'period_to']);
|
||||
$table->index(['user_id', 'is_downloaded']);
|
||||
$table->index('authorization_status');
|
||||
|
||||
// User tracking fields
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('print_statement_logs');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user