Skip to content

Commit

Permalink
finish remaining category endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mmenanno committed Jan 31, 2024
1 parent 3fb26e1 commit 3d09b67
Show file tree
Hide file tree
Showing 8 changed files with 447 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/lunchmoney/categories/category_calls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,19 @@ def category(category_id)
exclude_from_totals: T::Boolean,
archived: T::Boolean,
group_id: T.nilable(Integer),
).returns(T.any(T::Hash[String, Integer], LunchMoney::Errors))
).returns(T.any(T::Hash[Symbol, Integer], LunchMoney::Errors))
end
def create_category(name:, description: nil, is_income: false, exclude_from_budget: false,
exclude_from_totals: false, archived: false, group_id: nil)

params = {
params = clean_params({
name:,
description:,
is_income:,
exclude_from_budget:,
exclude_from_totals:,
archived:,
group_id:,
}

})
response = post("categories", params)

api_errors = errors(response)
Expand All @@ -87,7 +85,7 @@ def create_category(name:, description: nil, is_income: false, exclude_from_budg
exclude_from_totals: T::Boolean,
category_ids: T::Array[Integer],
new_categories: T::Array[String],
).returns(T.any(T::Hash[String, Integer], LunchMoney::Errors))
).returns(T.any(T::Hash[Symbol, Integer], LunchMoney::Errors))
end
def create_category_group(name:, description: nil, is_income: false, exclude_from_budget: false,
exclude_from_totals: false, category_ids: [], new_categories: [])
Expand Down
56 changes: 56 additions & 0 deletions test/cassettes/categories/add_to_category_group_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions test/cassettes/categories/create_category_group_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions test/cassettes/categories/create_category_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions test/cassettes/categories/delete_category_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions test/cassettes/categories/force_delete_category_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions test/cassettes/categories/update_category_success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d09b67

Please sign in to comment.