Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capability to delete existing transaction entry #11

Open
utkuufuk opened this issue Oct 15, 2019 · 9 comments
Open

Add capability to delete existing transaction entry #11

utkuufuk opened this issue Oct 15, 2019 · 9 comments

Comments

@utkuufuk
Copy link
Owner

@vitokhangnguyen This is a very good idea!

@utkuufuk utkuufuk changed the title Add capability to delete existing transacaction entry Add capability to delete existing transaction entry Oct 15, 2019
@Aravind22
Copy link

May I take a look into it? I am thinking of a scenario like this.
"User enters the description of the transaction he/she wants to delete, app displays last 5/10 transactions with the same description and user chooses which to delete".
If this seems fine, I can make it work.

@vitokhangnguyen
Copy link
Contributor

vitokhangnguyen commented Oct 15, 2019

Right now, the command budget log is displayimg the line index of an income or expense entry. User can leverage that index and use it to delete an entry. For eg...

budget delete income 3 aug

will delete the 3rd income entry of August spreadsheet.

@utkuufuk
Copy link
Owner Author

I think we could do both:

  1. If the user runs the command:

    budget delete <income|expense> <index>

    We'll handle it as @vitokhangnguyen suggested. I think the command should not accept a month argument, because the user can only see the transactions for the current month when he/she runs budget log

  2. If the user runs the command:
    budget delete <query>

    We could display search results as @Aravind22 suggested, with a generated ID for each transaction. Then wait for a second input for the ID. (This can be added to the edit operation as well.)

Personally I'd prefer the first option if I had to choose only one.

@vitokhangnguyen
Copy link
Contributor

I think the month argument is ok since the user can see other month's transaction through

budget log <month>

and the result does show the line index.

However, we can do it your way and not having it for now. I just think it does not add much complexity to the problem.

@utkuufuk
Copy link
Owner Author

@vitokhangnguyen That's right, I honestly forgot about that feature 🤣

Then the command should default to the current month if only 3 arguments are provided. A particular month should be used if a 4th argument is provided, as in your example.

BTW, we could add that optional 4th argument to the edit command as well. I'll create a new issue for that in case you or anybody else wants to work on it.

@vitokhangnguyen
Copy link
Contributor

@utkuufuk In the edit command, I thought about it and think that it does make it ambiguous. The edit command takes a transaction as an argument that has a date field. Currently, the program is choosing the spreadsheet id based on the month of that date field.

@utkuufuk
Copy link
Owner Author

@vitokhangnguyen Yeah that makes sense, let's ignore the optional month argument for the edit command for now.

@Aravind22
Copy link

I am facing an issue while using this app, i followed the steps and installed it successfully but when i invoke budget, i am getting command not found.
Screenshot from 2019-10-15 23-25-59

@utkuufuk
Copy link
Owner Author

@Aravind22 In your .bashrc or .zshrc, make sure that the correct directories are in your $PATH. For instance, here's my configuration:

export PATH="$HOME/.config/composer/vendor/bin:$HOME/.local/bin:$HOME/bin"

And the budget executable is located in:

~/.local/bin

which is in my $PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants