grthtrhthjhtyjytjytkergtrhtrjytjerhrfh<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use HasFactory;

    protected $keyType = 'string';
    public $incrementing = false;

    protected $fillable = [
        'id',
        'name',
        'brand',
        'category',
        'sub_category',
        'sku',
        'barcode',
        'imei_tracking',
        'serial_tracking',
        'imei_list',
        'serial_list',
        'unit_price',
        'cost_price',
        'stock',
        'reorder_level',
        'warranty_months',
        'warehouse_location',
        'branch_id',
    ];

    protected $casts = [
        'imei_tracking' => 'boolean',
        'serial_tracking' => 'boolean',
        'imei_list' => 'array',
        'serial_list' => 'array',
        'unit_price' => 'decimal:2',
        'cost_price' => 'decimal:2',
        'stock' => 'integer',
        'reorder_level' => 'integer',
        'warranty_months' => 'integer',
    ];

    /**
     * Relationship with Branch
     */
    public function branch()
    {
        return $th