-
Notifications
You must be signed in to change notification settings - Fork 7
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
Api endpoints #21
base: dev
Are you sure you want to change the base?
Api endpoints #21
Conversation
v0.2.2 Release - Added Get-YnabTransaction
Added functionality for endpoint - /budgets/{budget_id}/months/{month}/categories/{category_id} Expanded Get-YnabCategory to include -month and -categoryID to allow for single category by month. Returns single category.
Alright I had a chance to look at this and have a couple of questions/issues, and would be interested in your input. MonthYou are defining
Alternatively we could add a Month header to the data:
Also your Month flag does not support returning data for multiple categories. Do you think there is value in being able to say, "Show me data for December and January for my Food, Fuel, and Leisure categories"? I'm not sure if it's worth the effort to add the functionality vs just implementing the API to spec. CategoryIDWhen I first started building this module I included the ability to specify IDs as well as Names as identifiers for items like Budgets, Accounts, Categories, etc. This quickly became unmanageable with hundreds of branching parameter sets, trying to ensure that either an ID or Name is specified for every call. I eventually settled on making the Name a required field and dropping the IDs completely, instead performing lookups for IDs based on names. I understand this removes a bit of flexibility and also slows things down if you already have the ID on hand. An alternative may be to use the Category parameter for both values, simply treating the value as an ID if it matches a certain regex pattern ( In the meantime I propose removing your CategoryID change and instead suggest we use the Category. |
I rewrote this to meet my own requirements on a branch called 'feat/CategoryMonth'. Let me know what you think. > Get-YnabCategory -Category 'Work Food','Drinking','Electricity' -Month 2018-11-04,2018-12-01,(get-date) | select * -exclude CategoryID | ft -autosize
Month Category Note Budgeted Activity Balance Hidden
----- -------- ---- -------- -------- ------- ------
2018-11-01 Work Food 152.12 -152.12 0 False
2018-12-01 Work Food 71.5 -71.5 0 False
2019-01-01 Work Food 125 -45.69 79.31 False
2018-11-01 Drinking 20 0 20 False
2018-12-01 Drinking 20 0 40 False
2019-01-01 Drinking 20 -94.63 -34.63 False
2018-11-01 Electricity 149 -149 0 False
2018-12-01 Electricity 149 -149 0 False
2019-01-01 Electricity 74.5 0 74.5 False |
Added switches to Get-YnabCategory, month and CategoryID to allow cmdlet to retrieve data from this API endpoint - /budgets/{budget_id}/months/{month}/categories/{category_id}
Also added to Jsonparse to include goal data in the single category portion.