Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed Dec 4, 2024
1 parent 8e69b85 commit 75d2d66
Show file tree
Hide file tree
Showing 8 changed files with 458 additions and 758 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'self' ;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/css ;
font-src 'self' 'unsafe-inline' https://fonts.gstatic.com/ ;
img-src data: ;
default-src 'self' ;
"
/>
<link rel="icon" type="image/svg+xml" href="/src/app/favicon.svg" />
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"LICENSE"
],
"scripts": {
"bot:updater": "node dist/index.js -watch -update",
"build": "yarn run server:build && yarn run client:build",
"build:ib": "cd ./node_modules/@stoqey/ib && yarn install && yarn build",
"build:watch": "yarn tsc --watch",
Expand All @@ -31,8 +32,7 @@
"start": "node dist/index.js -server",
"start:dev": "concurrently \"yarn server:dev\" \"yarn client:dev\"",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build -o dist/storybook",
"updater": "node dist/index.js -watch -update"
"storybook:build": "storybook build -o dist/storybook"
},
"dependencies": {
"@chakra-ui/icons": "^2.2.4",
Expand All @@ -44,9 +44,9 @@
"@stoqey/ib": "stoqey/ib#af290a9eec07a6038c237d8114fd107d274ed400",
"@tanstack/react-table": "^8.20.5",
"chakra-react-select": "^5.0.2",
"chart.js": "^4.4.6",
"chart.js": "^4.4.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"dotenv": "^16.4.6",
"express": "^4.21.1",
"fast-xml-parser": "^4.5.0",
"formik": "^2.4.6",
Expand All @@ -56,7 +56,7 @@
"react": "^18.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.1",
"react-router-dom": "^7.0.2",
"reflect-metadata": "^0.2.2",
"sequelize": "^6.37.5",
"sequelize-typescript": "^2.1.6",
Expand All @@ -68,26 +68,26 @@
"@babel/core": "^7.26.0",
"@chakra-ui/storybook-addon": "^5.2.5",
"@eslint/compat": "^1.2.3",
"@storybook/addon-actions": "^8.4.5",
"@storybook/addon-essentials": "^8.4.5",
"@storybook/addon-links": "^8.4.5",
"@storybook/cli": "^8.4.5",
"@storybook/components": "^8.4.5",
"@storybook/react": "^8.4.5",
"@storybook/react-vite": "^8.4.5",
"@storybook/addon-actions": "^8.4.6",
"@storybook/addon-essentials": "^8.4.6",
"@storybook/addon-links": "^8.4.6",
"@storybook/cli": "^8.4.6",
"@storybook/components": "^8.4.6",
"@storybook/react": "^8.4.6",
"@storybook/react-vite": "^8.4.6",
"@storybook/testing-library": "^0.2.2",
"@types/cors": "^2.8.17",
"@types/express": "^5.0.0",
"@types/json-stringify-safe": "^5.0.3",
"@types/node": "^20.17.7",
"@types/node": "^20.17.9",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@types/validator": "^13.12.2",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-react": "^4.3.4",
"babel-loader": "^9.2.1",
"concurrently": "^9.1.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
Expand All @@ -97,15 +97,15 @@
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"patch-package": "^8.0.0",
"prettier": "^3.3.3",
"prettier": "^3.4.1",
"rxjs": "^7.8.1",
"storybook": "^8.4.5",
"stylelint": "^16.10.0",
"storybook": "^8.4.6",
"stylelint": "^16.11.0",
"stylelint-config-standard": "^36.0.1",
"ts-node-dev": "^2.0.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.15.0",
"vite": "^5.4.11",
"typescript-eslint": "^8.17.0",
"vite": "^6.0.2",
"webpack": "^5.96.1"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/Portfolio/Position/OptionsPositions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ const OptionsPositions: FunctionComponent<PositionsIndexProps> = ({ ..._rest }):
</Tbody>
<Tfoot>
<Tr fontWeight="bold">
<Td>Total</Td>
<Td></Td>
<Td isNumeric>{formatNumber(thePositions.reduce((p, v) => p + Math.abs(v.quantity), 0))}</Td>
<Td></Td>
<Td></Td>
<Td>Total</Td>
<Td></Td>
<Td>Base</Td>
<Td></Td>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/Portfolio/Report/DividendsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const OneCountryTable = ({
</HStack>
)),
)}
<HStack>
<HStack fontWeight="bold">
<Text width="120px">Subtotal</Text>
<Number value={grossTotal} width="120px" />
<Number value={taxesTotal} width="120px" />
Expand Down Expand Up @@ -107,7 +107,7 @@ const Dividends = ({ theReports, ..._rest }: Props): React.ReactNode => {
<OneCountryTable portfolioId={portfolioId} theReports={theReports} country={country} />
</HStack>
))}
<HStack>
<HStack fontWeight="bold">
<Text width="120px">Total</Text>
<Box width="120px"></Box>
<Number value={grossTotal} width="120px" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Portfolio/Report/ReportIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ReportsIndex: FunctionComponent<Props> = ({ ..._rest }): React.ReactNode =
},
{
label: "Dividends",
data: theReports.map((item) => item.dividendsSummary.reduce((p, v) => (p += v.grossAmountInBase), 0)),
data: theReports.map((item) => item.dividendsSummary.reduce((p, v) => (p += v.netAmountInBase), 0)),
},
{
label: "Interests",
Expand Down
2 changes: 1 addition & 1 deletion src/bots/account.bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class AccountUpdateBot extends ITradingBot {
.then(async ([position, created]) => {
if (created) return position;
else {
return position.update(defaults, { logging: console.log });
return position.update(defaults);
}
})
.then(async (position): Promise<Position | undefined> => {
Expand Down
2 changes: 1 addition & 1 deletion src/bots/updater.bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class ContractsUpdaterBot extends ITradingBot {
DISTINCT(contract.symbol),
stock.historical_volatility,
contract.*
FROM trading_parameters, contract, stock
FROM trading_parameters, contract, stock_contract stock
WHERE trading_parameters.stock_id = contract.id
AND trading_parameters.stock_id = stock.id
GROUP BY contract.symbol
Expand Down
Loading

0 comments on commit 75d2d66

Please sign in to comment.