Files
frontend/src/pages/account/model/positions.fixtures.ts
T
ksv741 7c28a423dd
Frontend verify / commits (pull_request) Successful in 24s
Frontend verify / security (pull_request) Failing after 9s
Frontend verify / verify (pull_request) Skipped
refactor: tighten types and reuse instrument UI
2026-09-29 06:15:31 +03:00

74 lines
1.9 KiB
TypeScript

import type { Portfolio } from "@/entities/portfolio";
const portfolio
= {
cashBalances: [{ currency: "USD", value: "1" }],
isStale: true,
lastSuccessfulAt: "2026-08-13T10:00:00Z",
positions: [
{
absoluteReturn: { currency: "RUB", value: "10" },
averagePurchasePrice: null,
currentValue: { currency: "RUB", value: "100" },
displayName: "Акция",
figi: "FIGI-STOCK",
isin: null,
logoName: "akciya.png",
quantity: "2",
ticker: null,
type: "STOCK",
},
{
absoluteReturn: { currency: "RUB", value: "-5" },
averagePurchasePrice: { currency: "RUB", value: "45" },
currentValue: { currency: "RUB", value: "50" },
displayName: "Облигация",
figi: "FIGI-BOND",
isin: "RU000A0JX0J2",
logoName: null,
quantity: "1",
ticker: null,
type: "BOND",
},
{
absoluteReturn: null,
averagePurchasePrice: null,
currentValue: null,
displayName: "Фонд",
figi: "FIGI-FUND",
isin: null,
logoName: "fond.png",
quantity: "3",
ticker: null,
type: "FUND",
},
] satisfies [Portfolio["positions"][number], ...Portfolio["positions"]],
structure: { currencies: [], unvaluedCategories: [] },
totalsByCurrency: [{ currency: "RUB", value: "150" }],
} satisfies Portfolio;
const position: Portfolio["positions"][number] = {
...portfolio.positions[0],
absoluteReturn: { currency: "RUB", value: "25" },
account: { id: "a", name: "Основной" },
averagePurchasePrice: { currency: "RUB", value: "280" },
currentValue: { currency: "RUB", value: "375" },
displayName: "Сбербанк",
figi: "FIGI-SBER",
isin: "RU0009029540",
logoName: null,
quantity: "1.25",
ticker: "SBER",
};
const second = {
...position,
absoluteReturn: null,
account: { id: "b", name: "ИИС" },
averagePurchasePrice: null,
currentValue: null,
quantity: "-2",
};
export { portfolio, position, second };