feat(performance): consume investment performance API contract (WealthLedger/main#54)

This commit is contained in:
2026-11-08 14:20:56 +03:00
parent 010e3ab8af
commit 21383852d9
4 changed files with 716 additions and 716 deletions
@@ -0,0 +1,20 @@
import { apiQueryClient, type paths, useAuthenticatedQuery } from "@/shared/api";
type Performance = NonNullable<
paths["/api/v1/brokerage-accounts/{accountId}/performance"]["get"]["responses"][200]["content"]["application/json"]["data"]
>;
function usePerformance(accountId: string) {
return useAuthenticatedQuery({
meta: { accessGroup: "brokerage" },
...apiQueryClient.queryOptions(
"get",
"/api/v1/brokerage-accounts/{accountId}/performance",
{ params: { path: { accountId } } },
),
enabled: Boolean(accountId),
staleTime: 30_000,
});
}
export { type Performance, usePerformance };
+1
View File
@@ -0,0 +1 @@
export { type Performance, usePerformance } from "./api/usePerformance";