<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class CompanySetting extends Model
{
    protected $fillable = [
        'division','company_name','address','phone','email',
        'logo_path','bank_name','bank_account','bank_account_name','invoice_footer',
        'csat_auto_send','csat_default_channel'
    ];

    protected $casts = [
        'csat_auto_send' => 'boolean',
    ];

    public static function forDivision(string $division): self
    {
        return self::where('division', $division)->firstOrNew(['division' => $division]);
    }
}
