<?php

namespace MtcPharmacy\ReferAFriend\Models;

use App\Casts\OptionalEncrypted;
use Illuminate\Database\Eloquent\Model;

class ReferralActivityLog extends Model
{
    public $timestamps = false;

    protected $table = 'referral_activity_log';

    protected $fillable = [
        'referral_id',
        'member_id',
        'action',
        'details',
        'ip_address',
        'created_at',
    ];

    protected $casts = [
        'created_at' => 'datetime',
        'ip_address' => OptionalEncrypted::class,
    ];

    // --- Relationships ---

    public function referral()
    {
        return $this->belongsTo(Referral::class, 'referral_id');
    }
}
