refactor(frontend): update fsd entities imports to use @/shared/
This commit is contained in:
parent
5355451e35
commit
9816bc6b96
@ -1,5 +1,5 @@
|
|||||||
import { request } from '../../../api/client';
|
import { request } from '@/shared/api/client';
|
||||||
import type { ApiResponseMeta, BrokerAccount, BrokerPortfolio } from '../../../api/responses';
|
import type { ApiResponseMeta, BrokerAccount, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
|
|
||||||
export type BrokerOperationQuery = {
|
export type BrokerOperationQuery = {
|
||||||
from?: string;
|
from?: string;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import type { BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { aggregateBrokerAccounts } from '../model/brokerAccountsOverview';
|
import { aggregateBrokerAccounts } from '../model/brokerAccountsOverview';
|
||||||
|
|
||||||
function portfolio(
|
function portfolio(
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { BrokerMoney, BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerMoney, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
|
|
||||||
export interface BrokerCurrencyAllocationSummary {
|
export interface BrokerCurrencyAllocationSummary {
|
||||||
shares: number;
|
shares: number;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { useQueries } from '@tanstack/react-query';
|
import { useQueries } from '@tanstack/react-query';
|
||||||
import type { BrokerAccount, BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerAccount, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { getBrokerPortfolio } from '../api/brokerAccountApi';
|
import { getBrokerPortfolio } from '../api/brokerAccountApi';
|
||||||
|
|
||||||
export function useBrokerAccountPortfolios(accounts: BrokerAccount[]) {
|
export function useBrokerAccountPortfolios(accounts: BrokerAccount[]) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import type { BrokerAccount } from '../../../api/responses';
|
import type { BrokerAccount } from '@/shared/api/responses';
|
||||||
import { getBrokerAccounts } from '../api/brokerAccountApi';
|
import { getBrokerAccounts } from '../api/brokerAccountApi';
|
||||||
|
|
||||||
export function useBrokerAccounts() {
|
export function useBrokerAccounts() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import type { BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { getBrokerPortfolio } from '../api/brokerAccountApi';
|
import { getBrokerPortfolio } from '../api/brokerAccountApi';
|
||||||
|
|
||||||
export function useBrokerPortfolio(accountId: string | undefined) {
|
export function useBrokerPortfolio(accountId: string | undefined) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { BrokerOperation } from '../../../api/responses';
|
import type { BrokerOperation } from '@/shared/api/responses';
|
||||||
|
|
||||||
export type BrokerOperationImpact = 'adds' | 'reduces' | 'neutral' | 'unknown';
|
export type BrokerOperationImpact = 'adds' | 'reduces' | 'neutral' | 'unknown';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
||||||
import type { BrokerOperationsPage } from '../../../api/responses';
|
import type { BrokerOperationsPage } from '@/shared/api/responses';
|
||||||
import { getBrokerOperations, type BrokerOperationQuery } from '../api/brokerOperationApi';
|
import { getBrokerOperations, type BrokerOperationQuery } from '../api/brokerOperationApi';
|
||||||
|
|
||||||
export function useBrokerOperations(
|
export function useBrokerOperations(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import type { BrokerMoney, BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerMoney, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { buildBrokerAllocation } from './brokerAllocation';
|
import { buildBrokerAllocation } from './brokerAllocation';
|
||||||
|
|
||||||
function money(value: number): BrokerMoney {
|
function money(value: number): BrokerMoney {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerPortfolio } from '@/shared/api/responses';
|
||||||
|
|
||||||
export type BrokerAllocationKey = 'shares' | 'bonds' | 'etf' | 'cash' | 'other';
|
export type BrokerAllocationKey = 'shares' | 'bonds' | 'etf' | 'cash' | 'other';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import type { BrokerOperation, BrokerPosition } from '../../../api/responses';
|
import type { BrokerOperation, BrokerPosition } from '@/shared/api/responses';
|
||||||
import {
|
import {
|
||||||
BROKER_OPERATION_TYPE_OPTIONS,
|
BROKER_OPERATION_TYPE_OPTIONS,
|
||||||
getBrokerInstrumentPath,
|
getBrokerInstrumentPath,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { BrokerPosition } from '../../../api/responses';
|
import type { BrokerPosition } from '@/shared/api/responses';
|
||||||
export {
|
export {
|
||||||
BROKER_OPERATION_TYPE_OPTIONS,
|
BROKER_OPERATION_TYPE_OPTIONS,
|
||||||
getBrokerOperationImpact,
|
getBrokerOperationImpact,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
||||||
import type { BrokerPositionsPage } from '../../../api/responses';
|
import type { BrokerPositionsPage } from '@/shared/api/responses';
|
||||||
import { getBrokerPositions } from '../api/brokerPositionApi';
|
import { getBrokerPositions } from '../api/brokerPositionApi';
|
||||||
|
|
||||||
export function useBrokerPositions(
|
export function useBrokerPositions(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import type { BrokerMoney, BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerMoney, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { SkeletonBlock } from '../../../components/SkeletonBlock';
|
import { SkeletonBlock } from '@/shared/ui/SkeletonBlock';
|
||||||
import { useBrokerOperations } from '../../../entities/broker-operation';
|
import { useBrokerOperations } from '../../../entities/broker-operation';
|
||||||
import { useBrokerAccountContext } from '../../../entities/broker-account/ui/BrokerAccountLayout';
|
import { useBrokerAccountContext } from '../../../entities/broker-account/ui/BrokerAccountLayout';
|
||||||
import { BrokerAllocationChart } from '../../../widgets/broker-allocation-chart';
|
import { BrokerAllocationChart } from '../../../widgets/broker-allocation-chart';
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import type {
|
|||||||
BrokerMoney,
|
BrokerMoney,
|
||||||
BrokerPosition,
|
BrokerPosition,
|
||||||
BrokerPositionsPage as BrokerPositionsPageData,
|
BrokerPositionsPage as BrokerPositionsPageData,
|
||||||
} from '../../../api/responses';
|
} from '@/shared/api/responses';
|
||||||
import { TableSkeleton } from '../../../components/TableSkeleton';
|
import { TableSkeleton } from '@/shared/ui/TableSkeleton';
|
||||||
import { getBrokerInstrumentPath, useBrokerPositions } from '../../../entities/broker-position';
|
import { getBrokerInstrumentPath, useBrokerPositions } from '../../../entities/broker-position';
|
||||||
import { useBrokerAccountContext } from '../../../entities/broker-account/ui/BrokerAccountLayout';
|
import { useBrokerAccountContext } from '../../../entities/broker-account/ui/BrokerAccountLayout';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { SkeletonBlock } from '../../../components/SkeletonBlock';
|
import { SkeletonBlock } from '@/shared/ui/SkeletonBlock';
|
||||||
import type { BrokerAccount, BrokerMoney, BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerAccount, BrokerMoney, BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import { buildBrokerAllocation } from '../../../entities/broker-position';
|
import { buildBrokerAllocation } from '../../../entities/broker-position';
|
||||||
import { BrokerAllocationBar } from '../../../widgets/broker-allocation-chart';
|
import { BrokerAllocationBar } from '../../../widgets/broker-allocation-chart';
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { SkeletonBlock } from '../../../components/SkeletonBlock';
|
import { SkeletonBlock } from '@/shared/ui/SkeletonBlock';
|
||||||
import type { BrokerAccountsAggregate } from '../../../entities/broker-account/model/brokerAccountsOverview';
|
import type { BrokerAccountsAggregate } from '../../../entities/broker-account/model/brokerAccountsOverview';
|
||||||
import { buildBrokerAllocation } from '../../../entities/broker-position';
|
import { buildBrokerAllocation } from '../../../entities/broker-position';
|
||||||
import { BrokerAllocationBar } from '../../../widgets/broker-allocation-chart';
|
import { BrokerAllocationBar } from '../../../widgets/broker-allocation-chart';
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { BrokerPortfolio } from '../../../api/responses';
|
import type { BrokerPortfolio } from '@/shared/api/responses';
|
||||||
import {
|
import {
|
||||||
buildBrokerAllocation,
|
buildBrokerAllocation,
|
||||||
type BrokerAllocationItem,
|
type BrokerAllocationItem,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import type { BrokerMoney, BrokerOperation, BrokerOperationsPage } from '../../../api/responses';
|
import type { BrokerMoney, BrokerOperation, BrokerOperationsPage } from '@/shared/api/responses';
|
||||||
import { TableSkeleton } from '../../../components/TableSkeleton';
|
import { TableSkeleton } from '@/shared/ui/TableSkeleton';
|
||||||
import {
|
import {
|
||||||
getBrokerOperationImpact,
|
getBrokerOperationImpact,
|
||||||
getBrokerOperationTypeLabel,
|
getBrokerOperationTypeLabel,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user