feat: add portfolio

This commit is contained in:
2026-08-13 22:45:00 +03:00
parent 6e89c1a8f7
commit 9156f29707
11 changed files with 594 additions and 12 deletions
+59
View File
@@ -116,6 +116,22 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/v1/brokerage-accounts/{accountId}/portfolio": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: operations["PortfolioController_get"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
@@ -150,6 +166,28 @@ export interface components {
/** Format: date */
openedOn: string | null;
};
MoneyDto: {
currency: string;
value: string;
};
PortfolioPositionDto: {
figi: string | null;
displayName: string;
/** @enum {string} */
type: "STOCK" | "BOND" | "FUND" | "CURRENCY" | "FUTURE" | "OPTION" | "STRUCTURED_NOTE" | "DIGITAL_FINANCIAL_ASSET" | "OTHER";
quantity: string;
currentValue: components["schemas"]["MoneyDto"] | null;
averagePurchasePrice: components["schemas"]["MoneyDto"] | null;
absoluteReturn: components["schemas"]["MoneyDto"] | null;
};
PortfolioDto: {
/** Format: date-time */
lastSuccessfulAt: string;
isStale: boolean;
totalsByCurrency: components["schemas"]["MoneyDto"][];
positions: components["schemas"]["PortfolioPositionDto"][];
cashBalances: components["schemas"]["MoneyDto"][];
};
};
responses: never;
parameters: never;
@@ -338,4 +376,25 @@ export interface operations {
};
};
};
PortfolioController_get: {
parameters: {
query?: never;
header?: never;
path: {
accountId: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["PortfolioDto"];
};
};
};
};
}
+20
View File
@@ -42,6 +42,26 @@ export const ru = {
},
},
account: { title: "Счет" },
portfolio: {
title: "Портфель",
emptyTitle: "Портфель пока пуст",
emptyText: "На счете нет позиций и доступных денежных остатков.",
accountUnavailableTitle: "Счет недоступен",
accountUnavailableText: "Вернитесь к списку и выберите доступный счет.",
connectionErrorTitle: "Проверьте подключение T-Bank",
connectionErrorText: "Настройте подключение, чтобы посмотреть портфель.",
back: "К счетам",
staleWarning:
"T-Bank временно недоступен. Показан последний успешный снимок.",
updatedAt: "Данные получены {{date}}",
positions: "Позиции",
stocks: "Акции",
bonds: "Облигации",
otherPositions: "Другие позиции",
cashBalances: "Денежные остатки",
quantity: "Количество: {{value}}",
return: "Доход: {{value}}",
},
settings: { title: "Настройки" },
tbank: {
title: "T-Bank Invest",