<?php

namespace App\Models\Finance;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class TradingPartner extends Model
{
    use SoftDeletes;

    protected $table = 'trading_partners';

    protected $fillable = [
        'tenant_id',
        'name',
        'trade_type',
        'type',
        'category',
        'biz_no',
        'ceo',
        'bank_account',
        'contact',
        'email',
        'address',
        'manager',
        'manager_phone',
        'status',
        'memo',
    ];

    public function scopeActive($query)
    {
        return $query->where('status', 'active');
    }

    public function scopeForTenant($query, $tenantId)
    {
        return $query->where('tenant_id', $tenantId);
    }
}
