Management UI at link.ladill.com with GHS 0.05 per link wallet billing, click analytics, and legacy fallback to ladill.com/q for QR ecosystem codes. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
931 B
PHP
46 lines
931 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class LinkTransaction extends Model
|
|
{
|
|
public const TYPE_DEBIT = 'debit';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'link_wallet_id',
|
|
'short_link_id',
|
|
'type',
|
|
'amount_ghs',
|
|
'balance_after_ghs',
|
|
'reference',
|
|
'status',
|
|
'description',
|
|
'metadata',
|
|
];
|
|
|
|
protected $casts = [
|
|
'amount_ghs' => 'decimal:4',
|
|
'balance_after_ghs' => 'decimal:4',
|
|
'metadata' => 'array',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function wallet(): BelongsTo
|
|
{
|
|
return $this->belongsTo(LinkWallet::class, 'link_wallet_id');
|
|
}
|
|
|
|
public function shortLink(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ShortLink::class);
|
|
}
|
|
}
|