<?php

namespace App\Models\Lookups;

use Illuminate\Database\Eloquent\Model;

/**
 * Deliberately NOT BelongsToTenant, unlike the other lookup tables:
 * Grn::isDraft()/isConfirmed()/isDeleted() compare grn_status_id directly
 * against the DRAFT/CONFIRMED/DELETED int constants below, so these 3 rows
 * have to be the same global ids for every tenant, not per-tenant-editable
 * data seeded by LookupSeeder. (grn_statuses does carry a `tenant_id` column
 * — added by the blanket 2026_07_08 tenant_id migration along with every
 * other "owned" table — but it's vestigial here; scoping by it would leave
 * every tenant except whichever one existed at migration time with zero
 * rows and a blank/null grnStatus relation everywhere it's used.)
 */
class GrnStatus extends Model
{
    /** Status IDs — match the seeded grn_statuses rows exactly. */
    public const DRAFT = 1;

    public const CONFIRMED = 2;

    public const DELETED = 3;

    public $timestamps = false;

    protected $fillable = ['code', 'name', 'color', 'sort_order'];
}
