diff --git a/backend/api/assets_debts.py b/backend/api/assets_debts.py index c0f5598..5e8ad44 100644 --- a/backend/api/assets_debts.py +++ b/backend/api/assets_debts.py @@ -17,5 +17,8 @@ def compare_balance_sheets(ticker_list: list): df_ret.loc[ticker, 'total_debt'] = selected_data.iloc[0]['CurrentAssets'] df_ret.loc[ticker, 'current_debt'] = selected_data.iloc[0]['CurrentDebt'] + df_ret.loc[:, 'old_assets'] = df_ret['total_assets'].copy() - df_ret['current_assets'].copy() + df_ret.loc[:, 'old_debt'] = df_ret['total_debt'].copy() - df_ret['current_debt'].copy() + df_ret.index.name = 'ticker' return df_ret.reset_index(drop=False).replace({ np.nan: None }).to_dict('records') \ No newline at end of file diff --git a/stockingly-frontend/src/api/index.ts b/stockingly-frontend/src/api/index.ts index 520f861..146e14a 100644 --- a/stockingly-frontend/src/api/index.ts +++ b/stockingly-frontend/src/api/index.ts @@ -30,6 +30,14 @@ export interface PriceHistory { [ticker: string]: string | number; // really just number } +export interface BalanceSheet { + ticker: string; + current_assets: number; + current_debt: number; + total_assets: number; + total_debt: number; +} + export const getCompanies = (tickers?: string[]): Promise => fetch(BACKEND_URL + '/companies' + (tickers ? ('/' + tickers.join('/')) : '')) .then(r => r.json()) @@ -43,3 +51,6 @@ export const getEmployees = (tickers: string[]): Promise => export const getPriceHistory = (tickers: string[]): Promise => fetch(BACKEND_URL + '/price_history/' + tickers.join('/').toUpperCase()).then(r => r.json()) + +export const getBalanceSheet = (tickers: string[]): Promise => + fetch(BACKEND_URL + '/assets_debts/' + tickers.join('/')).then(r=>r.json()) diff --git a/stockingly-frontend/src/api/loader.ts b/stockingly-frontend/src/api/loader.ts index fbd421c..0dd90e7 100644 --- a/stockingly-frontend/src/api/loader.ts +++ b/stockingly-frontend/src/api/loader.ts @@ -12,6 +12,5 @@ export const defineLoader = (apiCall: () => Promise) => re alert('Error loading data'); // don't do this for the final product } this.loading = false; - console.log(this.data, this.loading); } }) \ No newline at end of file diff --git a/stockingly-frontend/src/components/BalanceSheet.vue b/stockingly-frontend/src/components/BalanceSheet.vue new file mode 100644 index 0000000..a010211 --- /dev/null +++ b/stockingly-frontend/src/components/BalanceSheet.vue @@ -0,0 +1,130 @@ + + + \ No newline at end of file diff --git a/stockingly-frontend/src/components/EmployeesChart.vue b/stockingly-frontend/src/components/EmployeesChart.vue index a8713ab..88d1225 100644 --- a/stockingly-frontend/src/components/EmployeesChart.vue +++ b/stockingly-frontend/src/components/EmployeesChart.vue @@ -3,7 +3,7 @@ - Stock price over time + Employees over time @@ -85,7 +85,6 @@ const options = computed(() => { }); onMounted(() => { - console.log(JSON.parse(JSON.stringify(props))); employees.load(); }); \ No newline at end of file diff --git a/stockingly-frontend/src/views/Comparison.vue b/stockingly-frontend/src/views/Comparison.vue index 48dda4a..425802a 100644 --- a/stockingly-frontend/src/views/Comparison.vue +++ b/stockingly-frontend/src/views/Comparison.vue @@ -46,7 +46,10 @@ - + + + + @@ -62,6 +65,10 @@ width: 100%; height: 30em !important; } + +.v-row { + width: 100% !important; +}