- Break entity shim chain: brokerPositionApi, brokerOperationApi now use shared/api/client directly - Remove all 43 shim re-export files (api/, hooks/, context/, components/, pages/ flat shims, routes.tsx) - Remove entire pages/broker/ dead code directory - Remove api/broker.ts after breaking the shim chain - Switch auth consumers from AuthProvider (shim) to SessionProvider (FSD) - Fix api/screener.ts imports to use @/shared/api - Update frontend hooks.md and routes.md documentation - 2840 lines removed, 71 lines added
31 lines
852 B
TypeScript
31 lines
852 B
TypeScript
import { request } from '@/shared/api/client';
|
|
import type { ApiResponseMeta, BrokerOperationsPage } from '@/shared/api/responses';
|
|
|
|
export type BrokerOperationQuery = {
|
|
from?: string;
|
|
to?: string;
|
|
cursor?: string;
|
|
limit?: number;
|
|
instrumentId?: string;
|
|
operationTypes?: string;
|
|
state?: string;
|
|
};
|
|
|
|
export function getBrokerOperations(
|
|
accountId: string,
|
|
query: BrokerOperationQuery = {},
|
|
): Promise<{ data: BrokerOperationsPage; meta: ApiResponseMeta }> {
|
|
return request<BrokerOperationsPage>(
|
|
`/api/v1/broker/accounts/${encodeURIComponent(accountId)}/operations`,
|
|
{
|
|
from: query.from,
|
|
to: query.to,
|
|
cursor: query.cursor,
|
|
limit: query.limit ? String(query.limit) : undefined,
|
|
instrumentId: query.instrumentId,
|
|
operationTypes: query.operationTypes,
|
|
state: query.state,
|
|
},
|
|
);
|
|
}
|