From a3965bf6848665cfea23b8f464bcbe4a6b4b7bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20=C5=A0iljak?= <462445+alensiljak@users.noreply.github.com> Date: Sun, 15 Dec 2024 00:03:11 +0100 Subject: [PATCH] renames --- src/appService.ts | 2 -- src/lib/{ => assetAllocation}/AssetAllocation.ts | 0 src/lib/{ => assetAllocation}/AssetClass.ts | 0 src/lib/{ => assetAllocation}/ledgerApi.ts | 0 src/lib/{ => assetAllocation}/ledgerOutputParser.ts | 0 src/lib/{ => assetAllocation}/securityAnalysis.ts | 4 ++-- src/pages/AASetup.vue | 2 -- src/pages/AssetAllocation.vue | 2 +- src/pages/AssetClassDetail.vue | 11 +++++------ src/store/db.ts | 2 +- 10 files changed, 9 insertions(+), 14 deletions(-) rename src/lib/{ => assetAllocation}/AssetAllocation.ts (100%) rename src/lib/{ => assetAllocation}/AssetClass.ts (100%) rename src/lib/{ => assetAllocation}/ledgerApi.ts (100%) rename src/lib/{ => assetAllocation}/ledgerOutputParser.ts (100%) rename src/lib/{ => assetAllocation}/securityAnalysis.ts (98%) diff --git a/src/appService.ts b/src/appService.ts index 1cfd25c..c0e13cd 100644 --- a/src/appService.ts +++ b/src/appService.ts @@ -6,11 +6,9 @@ import db from './store/db' import { Account, - AccountBalance, LastTransaction, Payee, Posting, - ScheduledTransaction, Transaction, } from './model' import { Notify } from 'quasar' diff --git a/src/lib/AssetAllocation.ts b/src/lib/assetAllocation/AssetAllocation.ts similarity index 100% rename from src/lib/AssetAllocation.ts rename to src/lib/assetAllocation/AssetAllocation.ts diff --git a/src/lib/AssetClass.ts b/src/lib/assetAllocation/AssetClass.ts similarity index 100% rename from src/lib/AssetClass.ts rename to src/lib/assetAllocation/AssetClass.ts diff --git a/src/lib/ledgerApi.ts b/src/lib/assetAllocation/ledgerApi.ts similarity index 100% rename from src/lib/ledgerApi.ts rename to src/lib/assetAllocation/ledgerApi.ts diff --git a/src/lib/ledgerOutputParser.ts b/src/lib/assetAllocation/ledgerOutputParser.ts similarity index 100% rename from src/lib/ledgerOutputParser.ts rename to src/lib/assetAllocation/ledgerOutputParser.ts diff --git a/src/lib/securityAnalysis.ts b/src/lib/assetAllocation/securityAnalysis.ts similarity index 98% rename from src/lib/securityAnalysis.ts rename to src/lib/assetAllocation/securityAnalysis.ts index 0d6d109..b979d14 100644 --- a/src/lib/securityAnalysis.ts +++ b/src/lib/assetAllocation/securityAnalysis.ts @@ -1,5 +1,5 @@ import moment from 'moment' -import { settings, SettingKeys } from './settings' +import { settings, SettingKeys } from '../settings' import { LedgerApi } from './ledgerApi' import { LedgerOutputParser } from './ledgerOutputParser' @@ -101,7 +101,7 @@ export class SecurityAnalyser { const report = await this.ledgerApi.query(command) const line = report[0] - if(!line) { + if (!line) { return 'n/a' } diff --git a/src/pages/AASetup.vue b/src/pages/AASetup.vue index f75a48d..742342a 100644 --- a/src/pages/AASetup.vue +++ b/src/pages/AASetup.vue @@ -29,8 +29,6 @@ import { SettingKeys } from '../lib/settings' import appService from '../appService' import { Setting } from '../model' -// const errorMessage = { color: "secondary", textColor: "amber-2" }; - export default { data() { return { diff --git a/src/pages/AssetAllocation.vue b/src/pages/AssetAllocation.vue index db8e091..438f722 100644 --- a/src/pages/AssetAllocation.vue +++ b/src/pages/AssetAllocation.vue @@ -127,7 +127,7 @@ import { useMainStore } from '../store/mainStore' import { computed, onMounted, Ref, ref } from 'vue' import { useQuasar } from 'quasar' import { engine, NUMBER_FORMAT } from '../lib/AssetAllocation' -import { AssetClass } from 'src/lib/AssetClass' +import { AssetClass } from 'src/lib/assetAllocation/AssetClass' import { FileDown, HelpCircle, Menu as IconMenu, MoreVertical, Settings as IconSettings, Scale as IconScale, Share2 diff --git a/src/pages/AssetClassDetail.vue b/src/pages/AssetClassDetail.vue index b8174fd..917f739 100644 --- a/src/pages/AssetClassDetail.vue +++ b/src/pages/AssetClassDetail.vue @@ -35,10 +35,9 @@ import appService from '../appService' import { CashierSync } from '../lib/cashier-sync' import { SettingKeys, settings } from '../lib/settings' import Toolbar from '../components/CashierToolbar.vue' -import { SecurityAnalyser, SecurityAnalysis } from 'src/lib/securityAnalysis' +import { SecurityAnalyser, SecurityAnalysis } from 'src/lib/assetAllocation/securityAnalysis' import { useRoute } from 'vue-router' -import { AssetClass, StockSymbol } from 'src/lib/AssetClass' -import { Collection } from 'dexie' +import { AssetClass, StockSymbol } from 'src/lib/assetAllocation/AssetClass' import { Account } from 'src/model' import useNotifications from '../lib/Notifier' @@ -68,13 +67,13 @@ async function loadData() { async function loadAssetClass() { const ac: AssetClass = await appService.loadAssetClass($route.params.fullname as string) assetClass.value = ac - getConstituents() + populateStocks() } /** * Load all constituents - stocks, currencies. */ -function getConstituents() { +function populateStocks() { let childNames = assetClass.value.symbols if (!childNames || childNames.length == 0) return; @@ -116,7 +115,7 @@ async function fetchAnalysisFor(symbol: string, stockAnalysis: SecurityAnalysis) } catch (error: any) { let msg = symbol + ':' + error.message console.error(msg) - Notification.negative(msg) + Notification.error(msg) } } diff --git a/src/store/db.ts b/src/store/db.ts index 6e50ae3..ecd0363 100644 --- a/src/store/db.ts +++ b/src/store/db.ts @@ -14,7 +14,7 @@ import { ScheduledTransaction, Setting, } from '../model' -import { AssetClass } from '../lib/AssetClass' +import { AssetClass } from '../lib/assetAllocation/AssetClass' // Define the schema