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 support for recurring_granularity and recurring_quantity fields on transaction object #330

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/lunchmoney/objects/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class Transaction < TransactionBase
sig { returns(T.nilable(T::Array[LunchMoney::Objects::ChildTransaction])) }
attr_accessor :children

# TODO: Fix types when I have a response on what they should be https://github.com/mmenanno/lunchmoney/issues/329
sig { returns(T.untyped) }
attr_accessor :recurring_granularity, :recurring_quantity

sig do
params(
id: Integer,
Expand Down Expand Up @@ -103,6 +107,8 @@ class Transaction < TransactionBase
display_notes: T.nilable(String),
external_id: T.nilable(Integer),
children: T.nilable(T::Array[LunchMoney::Objects::ChildTransaction]),
recurring_granularity: T.untyped,
recurring_quantity: T.untyped,
).void
end
def initialize(id:, date:, amount:, currency:, to_base:, payee:, is_income:, exclude_from_budget:,
Expand All @@ -113,7 +119,7 @@ def initialize(id:, date:, amount:, currency:, to_base:, payee:, is_income:, exc
recurring_currency: nil, parent_id: nil, group_id: nil, asset_id: nil, asset_institution_name: nil,
asset_name: nil, asset_display_name: nil, asset_status: nil, plaid_account_id: nil, plaid_account_name: nil,
plaid_account_mask: nil, institution_name: nil, plaid_account_display_name: nil, plaid_metadata: nil,
display_notes: nil, external_id: nil, children: nil)
display_notes: nil, external_id: nil, children: nil, recurring_granularity: nil, recurring_quantity: nil)
super(id:, date:, amount:, currency:, to_base:, payee:, notes:, asset_id:, plaid_account_id:)
@is_income = is_income
@exclude_from_budget = exclude_from_budget
Expand Down Expand Up @@ -154,6 +160,8 @@ def initialize(id:, date:, amount:, currency:, to_base:, payee:, is_income:, exc
@display_notes = display_notes
@children = children
@external_id = external_id
@recurring_granularity = recurring_granularity
@recurring_quantity = recurring_quantity
end
end
end
Expand Down
31 changes: 31 additions & 0 deletions sorbet/rbi/annotations/activesupport.rbi

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

119 changes: 119 additions & 0 deletions sorbet/rbi/annotations/minitest.rbi

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

17 changes: 8 additions & 9 deletions test/cassettes/transactions/transaction_group_success.yml

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

16 changes: 8 additions & 8 deletions test/cassettes/transactions/transaction_success.yml

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

Loading