From 49f90eef43b09e0fc8c77672d2fbafad57802223 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Sun, 8 Jun 2025 23:41:56 +0700 Subject: [PATCH] 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 --- app/Models/AtmTransactionReportLog.php | 69 ++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 app/Models/AtmTransactionReportLog.php diff --git a/app/Models/AtmTransactionReportLog.php b/app/Models/AtmTransactionReportLog.php new file mode 100644 index 0000000..09cfbbb --- /dev/null +++ b/app/Models/AtmTransactionReportLog.php @@ -0,0 +1,69 @@ + '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'); + } +}