'boolean', 'sort_order' => 'integer', 'depth' => 'integer', ]; // Categories (대분류) — API 표준 public const CATEGORY_ASSET = 'asset'; public const CATEGORY_LIABILITY = 'liability'; public const CATEGORY_CAPITAL = 'capital'; public const CATEGORY_REVENUE = 'revenue'; public const CATEGORY_EXPENSE = 'expense'; public const CATEGORIES = [ self::CATEGORY_ASSET => '자산', self::CATEGORY_LIABILITY => '부채', self::CATEGORY_CAPITAL => '자본', self::CATEGORY_REVENUE => '수익', self::CATEGORY_EXPENSE => '비용', ]; /** * 테넌트 관계 */ public function tenant(): BelongsTo { return $this->belongsTo(Tenant::class); } /** * 테넌트별 활성 계정과목 조회 (하위 호환용) */ public static function getActiveByTenant(int $tenantId) { return self::getActive(); } /** * 전체 활성 계정과목 조회 */ public static function getActive() { return self::where('is_active', true) ->orderBy('sort_order') ->orderBy('code') ->get(); } /** * 전체 계정과목 조회 */ public static function getAll() { return self::orderBy('sort_order') ->orderBy('code') ->get(); } }