Files
alrahma_sunday_school_api/app/Models/PaymentError.php
T
2026-06-04 02:41:08 -04:00

52 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use App\Models\BaseModel;
class PaymentError extends BaseModel
{
protected $table = 'payment_error';
// legacy: useTimestamps = false (logged_at managed manually)
public $timestamps = false;
protected $fillable = [
'payment_id',
'invoice_id',
'parent_id',
'wrong_paid_amount',
'wrong_payment_method',
'wrong_check_file',
'error_note',
'semester',
'school_year',
'logged_at',
'logged_by',
];
protected $casts = [
'payment_id' => 'integer',
'invoice_id' => 'integer',
'parent_id' => 'integer',
'wrong_paid_amount' => 'decimal:2', // adjust precision if needed
'logged_by' => 'integer',
'logged_at' => 'datetime',
];
/* Optional relationships */
public function invoice()
{
return $this->belongsTo(Invoice::class, 'invoice_id');
}
public function parent()
{
return $this->belongsTo(User::class, 'parent_id');
}
public function logger()
{
return $this->belongsTo(User::class, 'logged_by');
}
}