reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+29 -10
View File
@@ -6,8 +6,11 @@ use App\Models\BaseModel;
class PaymentError extends BaseModel
{
protected $table = 'payment_error'; // The DB table
protected $primaryKey = 'id'; // Primary key
protected $table = 'payment_error';
// CI: useTimestamps = false (logged_at managed manually)
public $timestamps = false;
protected $fillable = [
'payment_id',
'invoice_id',
@@ -22,12 +25,28 @@ class PaymentError extends BaseModel
'semester',
];
public $timestamps = false; // We'll manage logged_at manually
protected $validationRules = [
'wrong_paid_amount' => 'required|decimal',
'payment_id' => 'required|integer',
'invoice_id' => 'required|integer',
'parent_id' => 'required|integer'
];
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');
}
}