<?php

declare(strict_types=1);

namespace App\Models\Market;

use App\Models\Model;
use App\Models\User;

class StoreManager extends Model
{
    protected ?string $table = 'store_managers';

    protected array $fillable = [
        'hashkey',
        'store_id',
        'user_id',
        'created_by',
        'updated_by',
        'is_active',
    ];

    protected array $casts = [
        'is_active' => 'boolean',
    ];

    public function store()
    {
        return $this->belongsTo(Store::class, 'store_id');
    }

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

    public function creator()
    {
        return $this->belongsTo(User::class, 'created_by');
    }

    public function updater()
    {
        return $this->belongsTo(User::class, 'updated_by');
    }
}
