Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Reports from "@/pages/Reports";
import Integrations from "@/pages/Integrations";
import Allocations from "@/pages/Allocations";
import Classification from "@/pages/Classification";
import CoaAdmin from "@/pages/CoaAdmin";

// Lazy-load the Orbital Console (57KB + physics sim + canvas rendering)
const OrbitalConsole = lazy(() => import("@/pages/OrbitalConsole"));
Expand Down Expand Up @@ -61,6 +62,7 @@ function Router() {
<Route path="/properties/:id" component={PropertyDetail} />
<Route path="/allocations" component={Allocations} />
<Route path="/classification" component={Classification} />
<Route path="/coa" component={CoaAdmin} />
<Route path="/connections" component={Connections} />
<Route path="/admin" component={Admin} />
<Route path="/orbital">
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Settings, Plug, Building2, Shield,
ChevronDown, ChevronRight, ChevronsUpDown,
Menu, X, Activity, LayoutDashboard,
ArrowLeftRight, Wallet, BarChart3, Cable, Orbit, GitBranch, Tags
ArrowLeftRight, Wallet, BarChart3, Cable, Orbit, GitBranch, Tags, BookOpen
} from "lucide-react";
import { useState, useMemo } from "react";
import { useRole, type UserRole } from "@/contexts/RoleContext";
Expand All @@ -27,6 +27,7 @@ const NAV_ITEMS: NavItem[] = [
{ href: "/orbital", label: "Orbital", icon: Orbit, roles: ["cfo", "accountant", "bookkeeper", "user"], badge: "NEW" },
{ href: "/allocations", label: "Allocations", icon: GitBranch, roles: ["cfo", "accountant"] },
{ href: "/classification", label: "Classification", icon: Tags, roles: ["cfo", "accountant", "bookkeeper"] },
{ href: "/coa", label: "Chart of Accounts", icon: BookOpen, roles: ["cfo", "accountant"] },
{ href: "/reports", label: "Reports", icon: BarChart3, roles: ["cfo", "accountant"] },
{ href: "/integrations", label: "Integrations", icon: Cable, roles: ["cfo", "accountant"] },
{ href: "/connections", label: "Connections", icon: Plug, roles: ["cfo", "accountant"] },
Expand Down
34 changes: 34 additions & 0 deletions client/src/hooks/use-classification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,40 @@ export function useBatchSuggest() {
});
}

/** L4 — create a tenant-specific COA account */
export function useCreateCoaAccount() {
const qc = useQueryClient();
const tenantId = useTenantId();
return useMutation({
mutationFn: (data: {
code: string;
name: string;
type: 'asset' | 'liability' | 'equity' | 'income' | 'expense';
subtype?: string | null;
description?: string | null;
scheduleELine?: string | null;
taxDeductible?: boolean;
parentCode?: string | null;
}) => apiRequest('POST', '/api/coa', data).then((r) => r.json()) as Promise<ChartOfAccount>,
onSuccess: () => {
qc.invalidateQueries({ queryKey: ['/api/coa', tenantId] });
},
});
}

/** L4 — update a tenant-specific COA account */
export function useUpdateCoaAccount() {
const qc = useQueryClient();
const tenantId = useTenantId();
return useMutation({
mutationFn: ({ id, ...data }: { id: string } & Partial<ChartOfAccount>) =>
apiRequest('PATCH', `/api/coa/${id}`, data).then((r) => r.json()) as Promise<ChartOfAccount>,
onSuccess: () => {
qc.invalidateQueries({ queryKey: ['/api/coa', tenantId] });
},
});
}

/** L1 — run GPT-4o-mini AI batch over unclassified queue */
export function useAiSuggest() {
const qc = useQueryClient();
Expand Down
Loading
Loading