<?php

declare(strict_types=1);

namespace App\Models;

use App\Models\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Cart extends Model
{
    use BelongsToTenant;
    use HasUuids;

    protected $fillable = ['tenant_id', 'user_id', 'session_id', 'expires_at'];

    protected $casts = ['expires_at' => 'datetime'];

    public function items(): HasMany
    {
        return $this->hasMany(CartItem::class);
    }
}
