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

[Feature Request] Add additional filters to "get_transactions" #106

Open
DarkPhyber-hg opened this issue May 13, 2024 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DarkPhyber-hg
Copy link

I'd like to see the ability to search by Merchant and Amount.

I'm trying to write a script to categorize my amazon transactions based on my downloaded amazon history. Finding a transaction by date, merchant and amount should allow me to identify most transactions programmatically.

@hammem hammem added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 14, 2024
@DarkPhyber-hg
Copy link
Author

DarkPhyber-hg commented May 14, 2024

I've never done a pull request before, or else i'd submit one.

I cloned the repo and played around with the code looking at the chrome dev tools (first time using the dev tools and playing around with apis), i figured out how to find transactions by amount. There are 2 values, that i assume are floats, that can be used as search filters.
absAmountGte & absAmountLte

I assigned them as floats and it works. I've never done a pull request before or else i'd submit one.

under the async def get_transactions() block at line 1412 I added the following 2 lines

        AmountGt: Optional[float] = None,
        AmountLt: Optional[float] = None,

then there are a series of if statements under the comment
"# If bool filters are not defined (i.e. None), then it should not apply the filter"

so at line 1546 I added

        if AmountGt is not None:
            variables["filters"]["absAmountGte"] = AmountGt
        if AmountLt is not None:
            variables["filters"]["absAmountLte"] = AmountLt   

Merchants appears to just be a list of Merchant Id's with an api value of "merchants", but i haven't added the code for it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants