<?php

namespace App\Models;

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

class MarketplaceDetail extends Model
{
    protected $fillable = ['annonce_id', 'prix', 'etat', 'categorie_produit', 'negociable'];

    protected function casts(): array
    {
        return [
            'prix' => 'decimal:2',
            'negociable' => 'boolean',
        ];
    }

    public function annonce(): BelongsTo
    {
        return $this->belongsTo(Annonce::class);
    }
}