diff --git a/src/bots/importer.bot.ts b/src/bots/importer.bot.ts index 29b07c2..4e3f004 100644 --- a/src/bots/importer.bot.ts +++ b/src/bots/importer.bot.ts @@ -675,6 +675,9 @@ export class ImporterBot extends ITradingBot { case "Commission Adjustments": statementType = StatementTypes.FeeStatement; break; + case "Price Adjustments": + statementType = StatementTypes.PriceAdjustments; + break; default: console.error("undefined cash trasaction type:", element); throw Error("undefined cash trasaction type: " + element.type); @@ -734,6 +737,9 @@ export class ImporterBot extends ITradingBot { ([_interestStatement, _created]) => statement, ); + case StatementTypes.PriceAdjustments: + return Promise.resolve(statement); + default: console.error(element); throw Error("invalid statement type"); diff --git a/src/models/index.ts b/src/models/index.ts index d5a8be9..ddad800 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -6,12 +6,14 @@ import { FutureContract } from "./future_contract.model"; import { Index } from "./index.model"; import { OptionContract } from "./option_contract.model"; import { StockContract } from "./stock_contract.model"; + export * from "./bag_contract.model"; export * from "./balance.model"; export * from "./bond_contract.model"; export * from "./bond_statement.model"; export * from "./cash_contract.model"; export * from "./contract.model"; +export * from "./contract.types"; export * from "./corpo_statement.model"; export * from "./currency.model"; export * from "./dividend_statement.model"; @@ -28,6 +30,7 @@ export * from "./position.model"; export * from "./sales_taxes.model"; export * from "./setting.model"; export * from "./statement.model"; +export * from "./statement.types"; export * from "./stock_contract.model"; export * from "./tax_statement.model"; export * from "./trade.model"; diff --git a/src/models/statement.types.ts b/src/models/statement.types.ts index bd61902..1541489 100644 --- a/src/models/statement.types.ts +++ b/src/models/statement.types.ts @@ -10,5 +10,6 @@ export const StatementTypes = { CashStatement: "Cash", BondStatement: "Bond", SalesTaxStatement: "SalesTax", + PriceAdjustments: "Price Adjustments", } as const; export type StatementTypes = (typeof StatementTypes)[keyof typeof StatementTypes]; diff --git a/src/routers/statements.router.ts b/src/routers/statements.router.ts index 133ac8e..134cfdd 100644 --- a/src/routers/statements.router.ts +++ b/src/routers/statements.router.ts @@ -9,6 +9,7 @@ import { InterestStatement, OptionStatement, Portfolio, + SalesTaxes, Statement, TaxStatement, Trade, @@ -116,6 +117,12 @@ const makeSynthesys = async (statements: Statement[]): Promise { + // Ignored at the moment + return value; + }); + default: // Fallback logger.log( LogLevel.Warning, diff --git a/src/routers/statements.types.ts b/src/routers/statements.types.ts index 07f2e90..47f8d13 100644 --- a/src/routers/statements.types.ts +++ b/src/routers/statements.types.ts @@ -1,4 +1,4 @@ -import { ContractType, OptionType } from "../models/contract.types"; +import { ContractType, OptionType } from "../models"; export type SynthesysEntry = { stocks: number; options: number; dividends: number; interests: number; total: number }; export type StatementsSynthesysEntries = Record<"string", SynthesysEntry>; @@ -87,6 +87,8 @@ export type CashStatementEntry = BaseStatement & { statementType: "Cash" }; export type SalesTaxStatementEntry = BaseStatement & { statementType: "SalesTax" }; +export type PriceAjustmentsStatementEntry = BaseStatement & { statementType: "Price Adjustments" }; + export type StatementEntry = | EquityStatementEntry | OptionStatementEntry @@ -98,4 +100,5 @@ export type StatementEntry = | CorporateStatementEntry | CashStatementEntry | BondStatementEntry - | SalesTaxStatementEntry; + | SalesTaxStatementEntry + | PriceAjustmentsStatementEntry; diff --git a/src/routers/statements.utils.ts b/src/routers/statements.utils.ts index 62315c1..af18a3e 100644 --- a/src/routers/statements.utils.ts +++ b/src/routers/statements.utils.ts @@ -177,6 +177,12 @@ export const statementModelToStatementEntry = async (item: Statement): Promise