feat(webstatement): tambahkan model AtmTransactionReportLog
- Menambahkan model `AtmTransactionReportLog` untuk pengelolaan log laporan transaksi ATM. - Memperkenalkan atribut berikut: - `period`, `report_date`, `status`, `authorization_status`, `file_path`, `file_size`, `record_count`, `error_message`, `is_downloaded`, `downloaded_at`, `user_id`, `created_by`, `updated_by`, `authorized_by`, `authorized_at`, `ip_address`, `user_agent`. - Menambahkan pengaturan casting untuk tipe data seperti `date`, `datetime`, `boolean`, dan `integer`. - Menambahkan relasi `belongsTo` ke model `User` untuk atribut: - `user_id` (pembuat permintaan laporan). - `created_by` (pencipta entri log). - `authorized_by` (pemberi otorisasi laporan) Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
69
app/Models/AtmTransactionReportLog.php
Normal file
69
app/Models/AtmTransactionReportLog.php
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Webstatement\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Modules\Usermanagement\Models\User;
|
||||||
|
|
||||||
|
class AtmTransactionReportLog extends Model
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'period',
|
||||||
|
'report_date',
|
||||||
|
'status',
|
||||||
|
'authorization_status',
|
||||||
|
'file_path',
|
||||||
|
'file_size',
|
||||||
|
'record_count',
|
||||||
|
'error_message',
|
||||||
|
'is_downloaded',
|
||||||
|
'downloaded_at',
|
||||||
|
'user_id',
|
||||||
|
'created_by',
|
||||||
|
'updated_by',
|
||||||
|
'authorized_by',
|
||||||
|
'authorized_at',
|
||||||
|
'ip_address',
|
||||||
|
'user_agent',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast.
|
||||||
|
*/
|
||||||
|
protected $casts = [
|
||||||
|
'report_date' => 'date',
|
||||||
|
'downloaded_at' => 'datetime',
|
||||||
|
'authorized_at' => 'datetime',
|
||||||
|
'is_downloaded' => 'boolean',
|
||||||
|
'file_size' => 'integer',
|
||||||
|
'record_count' => 'integer',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the user who created this report request.
|
||||||
|
*/
|
||||||
|
public function user(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'user_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the user who created this report request.
|
||||||
|
*/
|
||||||
|
public function creator(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the user who authorized this report request.
|
||||||
|
*/
|
||||||
|
public function authorizer(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'authorized_by');
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user