<?php
namespace App\Models;

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

class SubscriptionTransaction extends Model
{
    protected $fillable = [
        'vendor_id', 'plan', 'amount', 'currency', 'payment_method',
        'transaction_id', 'status', 'starts_at', 'expires_at', 'metadata',
    ];
    protected $casts = [
        'amount' => 'decimal:2', 'metadata' => 'array',
        'starts_at' => 'datetime', 'expires_at' => 'datetime',
    ];
    public function vendor(): BelongsTo { return $this->belongsTo(Vendor::class); }
}
