<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\GlobalModelEvents;

class Bid extends Model
{
    use HasFactory, GlobalModelEvents;

    protected $fillable = [
        // Original columns
        'user_id', 'store_name', 'product_id', 'market_id', 'investment_id',
        'amount', 'quantity', 'status', 'type', 'bid_time',
        // NEXUS columns (added Phase 1 migration, registered Phase 2)
        'nexus_session_id', 'wallet_source',
    ];

    public function product()
    {
        return $this->belongsTo(Product::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function investment()
    {
        return $this->belongsTo(Investment::class);
    }

    public function market()
    {
        return $this->belongsTo(Market::class);
    }
}
