From a6cd5dee0d15f549fa68a3b9fb8a919bace349cc Mon Sep 17 00:00:00 2001 From: Robert Dyer Date: Sat, 10 Aug 2024 18:16:38 -0500 Subject: [PATCH] rename ENV variables to drop "IMPORTER" from the names and be more consistent --- README.md | 21 +++++++++++++++++---- apply-interest.js | 2 +- kbb.js | 2 +- track-investments.js | 5 ++--- utils.js | 2 +- zestimate.js | 2 +- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3a1c058..e6876d0 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,14 @@ ACTUAL_FILE_PASSWORD="" ACTUAL_CACHE_DIR="./cache" # optional, name of the payee for added interest transactions -IMPORTER_INTEREST_PAYEE_NAME="Loan Interest" +INTEREST_PAYEE_NAME="Loan Interest" + +# optional, name of the payee for added interest transactions +INVESTMENT_PAYEE_NAME="Investment" +# optional, name of the cateogry group for added investment tracking transactions +INTEREST_CATEGORY_GROUP_NAME="Income" +# optional, name of the category for added investment tracking transactions +INTEREST_CATEGORY_NAME="Investment" ``` ## Installation @@ -81,7 +88,7 @@ interest transaction on the 28th of the month, set the account note to `interestRate:0.045 interestDay:28`. You can optionally change the payee used for the interest transactions by -setting `IMPORTER_INTEREST_PAYEE_NAME` in the `.env` file. +setting `INTEREST_PAYEE_NAME` in the `.env` file. To run: @@ -111,7 +118,7 @@ adding an `ownership:0.0X` tag to the account note. For example, if you own then use that percentage to track the home's value. You can optionally change the payee used for the transactions by setting -`IMPORTER_ZESTIMATE_PAYEE_NAME` in the `.env` file. +`ZESTIMATE_PAYEE_NAME` in the `.env` file. To run: @@ -149,7 +156,7 @@ on the values in the URL. - `kbbOptions:XXX,XXX,XXX,...` You can optionally change the payee used for the transactions by setting -`IMPORTER_KBB_PAYEE_NAME` in the `.env` file. +`KBB_PAYEE_NAME` in the `.env` file. To run: @@ -199,6 +206,12 @@ modified. This function lists transactions whose note contains certain strings that are targeted when using `zeroSmall` and `dropPayments`. You may need to update this to add additional notes to look for. +You can optionally change the payee used for the transactions by setting +`INVESTMENT_PAYEE_NAME` in the `.env` file. + +You can optionally change the category used for the transactions by setting +`INVESTMENT_CATEGORY_NAME` in the `.env` file. + To run: ```console diff --git a/apply-interest.js b/apply-interest.js index 2f73955..1609701 100644 --- a/apply-interest.js +++ b/apply-interest.js @@ -5,7 +5,7 @@ require("dotenv").config(); (async () => { await openBudget(); - const payeeId = await ensurePayee(process.env.IMPORTER_INTEREST_PAYEE_NAME || 'Loan Interest'); + const payeeId = await ensurePayee(process.env.INTEREST_PAYEE_NAME || 'Loan Interest'); const accounts = await api.getAccounts(); for (const account of accounts) { diff --git a/kbb.js b/kbb.js index dde8b96..c8cdb4a 100644 --- a/kbb.js +++ b/kbb.js @@ -25,7 +25,7 @@ async function getKBB(URL) { (async function() { await openBudget(); - const payeeId = await ensurePayee(process.env.IMPORTER_KBB_PAYEE_NAME || 'KBB'); + const payeeId = await ensurePayee(process.env.KBB_PAYEE_NAME || 'KBB'); const accounts = await api.getAccounts(); for (const account of accounts) { diff --git a/track-investments.js b/track-investments.js index 1da470c..f7ecbde 100644 --- a/track-investments.js +++ b/track-investments.js @@ -70,9 +70,8 @@ const zeroTransaction = async (payment) => { (async () => { await openBudget(); - const payeeId = await ensurePayee(process.env.IMPORTER_INVESTMENT_PAYEE_NAME || 'Investment'); - - const categoryId = await ensureCategory(process.env.IMPORTER_INVESTMENT_CATEGORY_NAME || 'Investment'); + const payeeId = await ensurePayee(process.env.INVESTMENT_PAYEE_NAME || 'Investment'); + const categoryId = await ensureCategory(process.env.INVESTMENT_CATEGORY_NAME || 'Investment'); const simplefinBalances = await getSimplefinBalances(); if (simplefinBalances) { diff --git a/utils.js b/utils.js index ad36c2a..274bb27 100644 --- a/utils.js +++ b/utils.js @@ -12,7 +12,7 @@ const Utils = { const password = process.env.ACTUAL_SERVER_PASSWORD || ''; const file_password = process.env.ACTUAL_FILE_PASSWORD || ''; const sync_id = process.env.ACTUAL_SYNC_ID || ''; - const cache = process.env.IMPORTER_CACHE_DIR || './cache'; + const cache = process.env.ACTUAL_CACHE_DIR || './cache'; if (!url || !password || !sync_id) { console.error('Required settings for Actual not provided.'); diff --git a/zestimate.js b/zestimate.js index 0622e32..8f6a30a 100644 --- a/zestimate.js +++ b/zestimate.js @@ -37,7 +37,7 @@ async function getZestimate(URL) { (async function() { await openBudget(); - const payeeId = await ensurePayee(process.env.IMPORTER_ZESTIMATE_PAYEE_NAME || 'Zestimate'); + const payeeId = await ensurePayee(process.env.ZESTIMATE_PAYEE_NAME || 'Zestimate'); const accounts = await api.getAccounts(); for (const account of accounts) {