chore: sync brokerage accounts contract (WealthLedger/backend#138)

This commit is contained in:
2026-10-27 05:29:11 +03:00
parent c24704affa
commit 0e4bbec2a7
2 changed files with 202 additions and 124 deletions
+42 -25
View File
@@ -909,12 +909,54 @@ export interface components {
version: number;
archived?: boolean;
};
PortfolioStructureCategoryDto: {
/** @enum {string} */
type: "STOCK" | "BOND" | "OTHER" | "CASH";
/** @description Exact known value as a decimal string. */
value: string;
/** @description Percentage including cash, rounded to six decimal places. Null for incomplete, negative or zero-total compositions. */
sharePercent: string | null;
};
PortfolioStructureCurrencyDto: {
currency: string;
totalValue: string;
/** @description Any negative constituent, even if netted positive. */
hasNegativeValues: boolean;
categories: components["schemas"]["PortfolioStructureCategoryDto"][];
};
PortfolioUnvaluedCategoryDto: {
/** @enum {string} */
type: "STOCK" | "BOND" | "OTHER";
count: number;
};
PortfolioStructureDto: {
currencies: components["schemas"]["PortfolioStructureCurrencyDto"][];
/** @description Positions without current value and known valuation currency. Shares are unavailable across all currencies when nonempty. */
unvaluedCategories: components["schemas"]["PortfolioUnvaluedCategoryDto"][];
};
UnrealizedReturnDto: {
currency: string;
/** @example 12.345678901 */
absolute: string;
/** @example 100.00 */
costBasis: string;
/** @example 12.34 */
percent: string | null;
partial: boolean;
};
PortfolioSummaryDto: {
totalsByCurrency: components["schemas"]["MoneyDto"][];
cashBalances: components["schemas"]["MoneyDto"][];
structure: components["schemas"]["PortfolioStructureDto"];
unrealizedReturnByCurrency: components["schemas"]["UnrealizedReturnDto"][];
/** @description Number of non-zero stock positions, not the number of units. */
stockPositionCount: number;
/** @description Number of non-zero bond positions, not the number of units. */
bondPositionCount: number;
/** @description Number of non-zero fund positions, not the number of units. */
fundPositionCount: number;
/** @description Number of all non-zero positions, not the number of units. */
totalPositionCount: number;
};
BrokerageAccountDto: {
id: string;
@@ -1026,31 +1068,6 @@ export interface components {
ticker: string | null;
logoName: string | null;
};
PortfolioStructureCategoryDto: {
/** @enum {string} */
type: "STOCK" | "BOND" | "OTHER" | "CASH";
/** @description Exact known value as a decimal string. */
value: string;
/** @description Percentage including cash, rounded to six decimal places. Null for incomplete, negative or zero-total compositions. */
sharePercent: string | null;
};
PortfolioStructureCurrencyDto: {
currency: string;
totalValue: string;
/** @description Any negative constituent, even if netted positive. */
hasNegativeValues: boolean;
categories: components["schemas"]["PortfolioStructureCategoryDto"][];
};
PortfolioUnvaluedCategoryDto: {
/** @enum {string} */
type: "STOCK" | "BOND" | "OTHER";
count: number;
};
PortfolioStructureDto: {
currencies: components["schemas"]["PortfolioStructureCurrencyDto"][];
/** @description Positions without current value and known valuation currency. Shares are unavailable across all currencies when nonempty. */
unvaluedCategories: components["schemas"]["PortfolioUnvaluedCategoryDto"][];
};
PortfolioDto: {
/** Format: date-time */
lastSuccessfulAt: string;
+160 -99
View File
@@ -5819,6 +5819,135 @@
"version"
]
},
"PortfolioStructureCategoryDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"STOCK",
"BOND",
"OTHER",
"CASH"
]
},
"value": {
"type": "string",
"description": "Exact known value as a decimal string."
},
"sharePercent": {
"type": "string",
"nullable": true,
"description": "Percentage including cash, rounded to six decimal places. Null for incomplete, negative or zero-total compositions."
}
},
"required": [
"type",
"value",
"sharePercent"
]
},
"PortfolioStructureCurrencyDto": {
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"totalValue": {
"type": "string"
},
"hasNegativeValues": {
"type": "boolean",
"description": "Any negative constituent, even if netted positive."
},
"categories": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioStructureCategoryDto"
}
}
},
"required": [
"currency",
"totalValue",
"hasNegativeValues",
"categories"
]
},
"PortfolioUnvaluedCategoryDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"STOCK",
"BOND",
"OTHER"
]
},
"count": {
"type": "number",
"minimum": 1
}
},
"required": [
"type",
"count"
]
},
"PortfolioStructureDto": {
"type": "object",
"properties": {
"currencies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioStructureCurrencyDto"
}
},
"unvaluedCategories": {
"description": "Positions without current value and known valuation currency. Shares are unavailable across all currencies when nonempty.",
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioUnvaluedCategoryDto"
}
}
},
"required": [
"currencies",
"unvaluedCategories"
]
},
"UnrealizedReturnDto": {
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"absolute": {
"type": "string",
"example": "12.345678901"
},
"costBasis": {
"type": "string",
"example": "100.00"
},
"percent": {
"type": "string",
"nullable": true,
"example": "12.34"
},
"partial": {
"type": "boolean"
}
},
"required": [
"currency",
"absolute",
"costBasis",
"percent",
"partial"
]
},
"PortfolioSummaryDto": {
"type": "object",
"properties": {
@@ -5828,6 +5957,21 @@
"$ref": "#/components/schemas/MoneyDto"
}
},
"cashBalances": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MoneyDto"
}
},
"structure": {
"$ref": "#/components/schemas/PortfolioStructureDto"
},
"unrealizedReturnByCurrency": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UnrealizedReturnDto"
}
},
"stockPositionCount": {
"type": "integer",
"minimum": 0,
@@ -5837,12 +5981,27 @@
"type": "integer",
"minimum": 0,
"description": "Number of non-zero bond positions, not the number of units."
},
"fundPositionCount": {
"type": "integer",
"minimum": 0,
"description": "Number of non-zero fund positions, not the number of units."
},
"totalPositionCount": {
"type": "integer",
"minimum": 0,
"description": "Number of all non-zero positions, not the number of units."
}
},
"required": [
"totalsByCurrency",
"cashBalances",
"structure",
"unrealizedReturnByCurrency",
"stockPositionCount",
"bondPositionCount"
"bondPositionCount",
"fundPositionCount",
"totalPositionCount"
]
},
"BrokerageAccountDto": {
@@ -6314,104 +6473,6 @@
"logoName"
]
},
"PortfolioStructureCategoryDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"STOCK",
"BOND",
"OTHER",
"CASH"
]
},
"value": {
"type": "string",
"description": "Exact known value as a decimal string."
},
"sharePercent": {
"type": "string",
"nullable": true,
"description": "Percentage including cash, rounded to six decimal places. Null for incomplete, negative or zero-total compositions."
}
},
"required": [
"type",
"value",
"sharePercent"
]
},
"PortfolioStructureCurrencyDto": {
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"totalValue": {
"type": "string"
},
"hasNegativeValues": {
"type": "boolean",
"description": "Any negative constituent, even if netted positive."
},
"categories": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioStructureCategoryDto"
}
}
},
"required": [
"currency",
"totalValue",
"hasNegativeValues",
"categories"
]
},
"PortfolioUnvaluedCategoryDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"STOCK",
"BOND",
"OTHER"
]
},
"count": {
"type": "number",
"minimum": 1
}
},
"required": [
"type",
"count"
]
},
"PortfolioStructureDto": {
"type": "object",
"properties": {
"currencies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioStructureCurrencyDto"
}
},
"unvaluedCategories": {
"description": "Positions without current value and known valuation currency. Shares are unavailable across all currencies when nonempty.",
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioUnvaluedCategoryDto"
}
}
},
"required": [
"currencies",
"unvaluedCategories"
]
},
"PortfolioDto": {
"type": "object",
"properties": {