<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class VoucherRedemption extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'voucher_redemptions';

    /**
     * @return BelongsTo
     */
    public function voucher(): BelongsTo
    {
        return $this->BelongsTo(Voucher::class, 'voucher_id', 'id');
    }

    /**
     * @return BelongsTo
     */
    public function transaction(): BelongsTo
    {
        return $this->BelongsTo(Transaction::class, 'transaction_id', 'id');
    }

    /**
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->BelongsTo(User::class, 'user_id', 'id');
    }
}
