Skip to content

Commit

Permalink
various naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Dec 8, 2024
1 parent cd34ddf commit 998c048
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/appService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion src/components/FavouritesCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/components/JournalCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/components/ScheduledTxCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/transactionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/lib/transactionAugmenter.ts → src/lib/xactAugmenter.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -153,7 +153,7 @@ export class TransactionAugmenter {
* @param {Array<Transaction>} txs
* @returns {Array<AccountBalance>} An array of balance records that matches the transactions.
*/
static calculateTxAmounts(txs: Transaction[]): AccountBalance[] {
static calculateXactAmounts(txs: Transaction[]): Money[] {
// get Amounts
TransactionAugmenter.calculateEmptyPostingAmounts(txs)

Expand Down
5 changes: 3 additions & 2 deletions src/pages/Favourites.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
</q-header>

<!-- account list -->
<q-slide-item v-for="(account, index) in accounts" :key="account.name" right-color="secondary" @right="onRightSlide">
<q-slide-item v-for="(account, index) in accounts" :key="account.name" right-color="secondary"
@right="onRightSlide">
<template #right>
<div class="row items-center text-accent" @click="removeAccount(index)">
Click to confirm or wait 2s to cancel
Expand Down Expand Up @@ -85,7 +86,7 @@
<script setup lang="ts">
import { useStore } from 'vuex'
import { useMainStore } from '../store/mainStore'
import { TransactionAugmenter } from 'src/lib/transactionAugmenter'
import { TransactionAugmenter } from 'src/lib/xactAugmenter'
import appService from '../appService'
import { SET_SELECT_MODE } from '../mutations'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { SET_SELECT_MODE } from '../mutations'
import { SelectionModeMetadata, SettingKeys, settings } from '../lib/settings'
import { Account, Posting } from 'src/model'
import { TransactionParser } from 'src/lib/transactionParser'
import { TransactionAugmenter } from 'src/lib/transactionAugmenter'
import { TransactionAugmenter } from 'src/lib/xactAugmenter'
import useNotifications from 'src/lib/Notifier'
import { Plus as IconPlus } from 'lucide-vue-next'
import { AccountService } from 'src/lib/accountsService'
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"include": ["./tests"],
"compilerOptions": {
"composite": true,
"target": "esnext",
"module": "esnext",
"types": ["@types/node", "vitest/globals"]
}
}

0 comments on commit 998c048

Please sign in to comment.