'boolean', 'display_order' => 'integer', ]; // Relationships public function parentAccount(): BelongsTo { return $this->belongsTo(ChartOfAccount::class, 'parent_account_id'); } public function childAccounts(): HasMany { return $this->hasMany(ChartOfAccount::class, 'parent_account_id')->orderBy('display_order'); } public function budgetItems(): HasMany { return $this->hasMany(BudgetItem::class); } public function transactions(): HasMany { return $this->hasMany(Transaction::class); } // Helper methods public function getFullNameAttribute(): string { return "{$this->account_code} - {$this->account_name_zh}"; } public function isIncome(): bool { return $this->account_type === 'income'; } public function isExpense(): bool { return $this->account_type === 'expense'; } public function isAsset(): bool { return $this->account_type === 'asset'; } public function isLiability(): bool { return $this->account_type === 'liability'; } public function isNetAsset(): bool { return $this->account_type === 'net_asset'; } }