diff --git a/src/appService.ts b/src/appService.ts index 07ac57a..1cfd25c 100644 --- a/src/appService.ts +++ b/src/appService.ts @@ -17,7 +17,7 @@ import { Notify } from 'quasar' import { settings, SettingKeys } from './lib/settings' import { toRaw } from 'vue' import { TransactionParser } from './lib/transactionParser' -import { TransactionAugmenter } from './lib/transactionAugmenter' +import { TransactionAugmenter } from './lib/xactAugmenter' import { Collection } from 'dexie' import { AccountService } from './lib/accountsService' diff --git a/src/components/FavouritesCard.vue b/src/components/FavouritesCard.vue index 564210d..f8f8d86 100644 --- a/src/components/FavouritesCard.vue +++ b/src/components/FavouritesCard.vue @@ -28,7 +28,7 @@ import { onMounted, Ref, ref } from 'vue' import { useQuasar } from 'quasar' import appService from '../appService' -import { TransactionAugmenter } from 'src/lib/transactionAugmenter' +import { TransactionAugmenter } from 'src/lib/xactAugmenter' import { Account } from 'src/model' import { Star } from 'lucide-vue-next' import { AccountService } from '../lib/accountsService' diff --git a/src/components/JournalCard.vue b/src/components/JournalCard.vue index 4a57750..de9fa11 100644 --- a/src/components/JournalCard.vue +++ b/src/components/JournalCard.vue @@ -40,7 +40,7 @@ import { useRouter } from 'vue-router' import appService from '../appService' import useNotifications from 'src/lib/Notifier' import { Money, Transaction } from 'src/model' -import { TransactionAugmenter } from 'src/lib/transactionAugmenter' +import { TransactionAugmenter } from 'src/lib/xactAugmenter' import { FileUp, Scroll } from 'lucide-vue-next' const Notifier = useNotifications() @@ -117,7 +117,7 @@ async function loadData() { } try { - const amounts = TransactionAugmenter.calculateTxAmounts(txs) + const amounts = TransactionAugmenter.calculateXactAmounts(txs) xactBalances.value.push(...amounts) } catch (error: any) { console.error(error) diff --git a/src/components/ScheduledTxCard.vue b/src/components/ScheduledTxCard.vue index 8936b29..87ed815 100644 --- a/src/components/ScheduledTxCard.vue +++ b/src/components/ScheduledTxCard.vue @@ -41,7 +41,7 @@ import moment, { Moment } from 'moment' import { useRouter } from 'vue-router' import useNotifications from 'src/lib/Notifier' import appService from '../appService' -import { TransactionAugmenter } from 'src/lib/transactionAugmenter' +import { TransactionAugmenter } from 'src/lib/xactAugmenter' import { ScheduledTransaction, Transaction } from 'src/model' import { TransactionParser } from 'src/lib/transactionParser' import { CalendarClock, CalendarDays } from 'lucide-vue-next' @@ -70,12 +70,12 @@ async function loadData() { // add the transaction amounts. let txs: Transaction[] = schtxs.map((schtx) => schtx.transaction) as Transaction[] - TransactionAugmenter.calculateTxAmounts(txs) + TransactionAugmenter.calculateXactAmounts(txs) list.value = schtxs } catch (error: any) { console.error(error) - Notification.negative(error.message) + Notification.error(error.message) } } diff --git a/src/lib/transactionParser.ts b/src/lib/transactionParser.ts index 9a18ba6..a3a2339 100644 --- a/src/lib/transactionParser.ts +++ b/src/lib/transactionParser.ts @@ -3,7 +3,7 @@ * Used for calculation of the empty postings */ import { Posting, Transaction } from 'src/model' -import { TransactionAugmenter } from './transactionAugmenter' +import { TransactionAugmenter } from './xactAugmenter' export class TransactionParser { /** diff --git a/src/lib/transactionAugmenter.ts b/src/lib/xactAugmenter.ts similarity index 97% rename from src/lib/transactionAugmenter.ts rename to src/lib/xactAugmenter.ts index c8c4088..3fa5f07 100644 --- a/src/lib/transactionAugmenter.ts +++ b/src/lib/xactAugmenter.ts @@ -1,4 +1,4 @@ -import { Account, AccountBalance, Transaction } from 'src/model' +import { Account, Money, Transaction } from 'src/model' import appService from '../appService' import { TransactionParser } from './transactionParser' import { AccountService } from './accountsService' @@ -9,7 +9,7 @@ import { SettingKeys, settings } from './settings' * like the amount on a missing posting. */ export class TransactionAugmenter { - constructor() {} + constructor() { } /** * Calculates and adds the amounts for the empty postings. This "completes" the Postings @@ -153,7 +153,7 @@ export class TransactionAugmenter { * @param {Array} txs * @returns {Array} An array of balance records that matches the transactions. */ - static calculateTxAmounts(txs: Transaction[]): AccountBalance[] { + static calculateXactAmounts(txs: Transaction[]): Money[] { // get Amounts TransactionAugmenter.calculateEmptyPostingAmounts(txs) diff --git a/src/pages/Favourites.vue b/src/pages/Favourites.vue index a0e306e..bc9c291 100644 --- a/src/pages/Favourites.vue +++ b/src/pages/Favourites.vue @@ -42,7 +42,8 @@ - +