diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d6e9fb57..342fa6d1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.187.0" + ".": "1.188.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 91752aef..df82cbc8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-3309070d0c282e00842afa3021c80774f8e1f3a4517959927adfd9ffaa81c94c.yml -openapi_spec_hash: 57927271c019ee8ddd428afa8a57baaf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-994727afca8b769c05b3531b0e560cfc71b7d2c45a49b54e09bbf73d0dbcaa1f.yml +openapi_spec_hash: bb1c55d7e08fb038a7383976bba226d1 config_hash: 27e44ed36b9c5617b580ead7231a594a diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b3fc2a7..71c7479a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.188.0 (2026-01-30) + +Full Changelog: [v1.187.0...v1.188.0](https://github.com/Increase/increase-ruby/compare/v1.187.0...v1.188.0) + +### Features + +* **api:** api update ([edc7e8c](https://github.com/Increase/increase-ruby/commit/edc7e8c374bf5a108ea08346136ed22be11beca2)) + ## 1.187.0 (2026-01-30) Full Changelog: [v1.186.0...v1.187.0](https://github.com/Increase/increase-ruby/compare/v1.186.0...v1.187.0) diff --git a/Gemfile.lock b/Gemfile.lock index 40a32059..5595bda9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (1.187.0) + increase (1.188.0) cgi connection_pool diff --git a/README.md b/README.md index 08ad48e5..be7a711d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "increase", "~> 1.187.0" +gem "increase", "~> 1.188.0" ``` @@ -273,25 +273,25 @@ increase.accounts.create(**params) Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: ```ruby -# :active -puts(Increase::AccountNumberUpdateParams::Status::ACTIVE) +# :loan +puts(Increase::AccountCreateParams::Funding::LOAN) -# Revealed type: `T.all(Increase::AccountNumberUpdateParams::Status, Symbol)` -T.reveal_type(Increase::AccountNumberUpdateParams::Status::ACTIVE) +# Revealed type: `T.all(Increase::AccountCreateParams::Funding, Symbol)` +T.reveal_type(Increase::AccountCreateParams::Funding::LOAN) ``` Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: ```ruby # Using the enum constants preserves the tagged type information: -increase.account_numbers.update( - status: Increase::AccountNumberUpdateParams::Status::ACTIVE, +increase.accounts.create( + funding: Increase::AccountCreateParams::Funding::LOAN, # … ) # Literal values are also permissible: -increase.account_numbers.update( - status: :active, +increase.accounts.create( + funding: :loan, # … ) ``` diff --git a/lib/increase/models/account.rb b/lib/increase/models/account.rb index c3fb4891..b3a61603 100644 --- a/lib/increase/models/account.rb +++ b/lib/increase/models/account.rb @@ -52,6 +52,12 @@ class Account < Increase::Internal::Type::BaseModel # @return [String] required :entity_id, String + # @!attribute funding + # Whether the Account is funded by a loan or by deposits. + # + # @return [Symbol, Increase::Models::Account::Funding, nil] + required :funding, enum: -> { Increase::Account::Funding }, nil?: true + # @!attribute idempotency_key # The idempotency key you chose for this object. This value is unique across # Increase and is used to ensure that a request is only processed once. Learn more @@ -89,6 +95,12 @@ class Account < Increase::Internal::Type::BaseModel # @return [String] required :interest_rate, String + # @!attribute loan + # The Account's loan-related information, if the Account is a loan account. + # + # @return [Increase::Models::Account::Loan, nil] + required :loan, -> { Increase::Account::Loan }, nil?: true + # @!attribute name # The name you choose for the Account. # @@ -115,7 +127,7 @@ class Account < Increase::Internal::Type::BaseModel # @return [Symbol, Increase::Models::Account::Type] required :type, enum: -> { Increase::Account::Type } - # @!method initialize(id:, account_revenue_rate:, bank:, closed_at:, created_at:, currency:, entity_id:, idempotency_key:, informational_entity_id:, interest_accrued:, interest_accrued_at:, interest_rate:, name:, program_id:, status:, type:) + # @!method initialize(id:, account_revenue_rate:, bank:, closed_at:, created_at:, currency:, entity_id:, funding:, idempotency_key:, informational_entity_id:, interest_accrued:, interest_accrued_at:, interest_rate:, loan:, name:, program_id:, status:, type:) # Some parameter documentations has been truncated, see # {Increase::Models::Account} for more details. # @@ -136,6 +148,8 @@ class Account < Increase::Internal::Type::BaseModel # # @param entity_id [String] The identifier for the Entity the Account belongs to. # + # @param funding [Symbol, Increase::Models::Account::Funding, nil] Whether the Account is funded by a loan or by deposits. + # # @param idempotency_key [String, nil] The idempotency key you chose for this object. This value is unique across Incre # # @param informational_entity_id [String, nil] The identifier of an Entity that, while not owning the Account, is associated wi @@ -146,6 +160,8 @@ class Account < Increase::Internal::Type::BaseModel # # @param interest_rate [String] The interest rate currently being earned on the account, as a string containing # + # @param loan [Increase::Models::Account::Loan, nil] The Account's loan-related information, if the Account is a loan account. + # # @param name [String] The name you choose for the Account. # # @param program_id [String] The identifier of the Program determining the compliance and commercial terms of @@ -187,6 +203,88 @@ module Currency # @return [Array] end + # Whether the Account is funded by a loan or by deposits. + # + # @see Increase::Models::Account#funding + module Funding + extend Increase::Internal::Type::Enum + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN = :loan + + # An account funded by deposits. + DEPOSITS = :deposits + + # @!method self.values + # @return [Array] + end + + # @see Increase::Models::Account#loan + class Loan < Increase::Internal::Type::BaseModel + # @!attribute credit_limit + # The maximum amount of money that can be borrowed on the Account. + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute grace_period_days + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + # + # @return [Integer] + required :grace_period_days, Integer + + # @!attribute maturity_date + # The date on which the loan matures. + # + # @return [Date, nil] + required :maturity_date, Date, nil?: true + + # @!attribute statement_day_of_month + # The day of the month on which the loan statement is generated. + # + # @return [Integer] + required :statement_day_of_month, Integer + + # @!attribute statement_payment_type + # The type of payment for the loan. + # + # @return [Symbol, Increase::Models::Account::Loan::StatementPaymentType] + required :statement_payment_type, enum: -> { Increase::Account::Loan::StatementPaymentType } + + # @!method initialize(credit_limit:, grace_period_days:, maturity_date:, statement_day_of_month:, statement_payment_type:) + # Some parameter documentations has been truncated, see + # {Increase::Models::Account::Loan} for more details. + # + # The Account's loan-related information, if the Account is a loan account. + # + # @param credit_limit [Integer] The maximum amount of money that can be borrowed on the Account. + # + # @param grace_period_days [Integer] The number of days after the statement date that the Account can be past due bef + # + # @param maturity_date [Date, nil] The date on which the loan matures. + # + # @param statement_day_of_month [Integer] The day of the month on which the loan statement is generated. + # + # @param statement_payment_type [Symbol, Increase::Models::Account::Loan::StatementPaymentType] The type of payment for the loan. + + # The type of payment for the loan. + # + # @see Increase::Models::Account::Loan#statement_payment_type + module StatementPaymentType + extend Increase::Internal::Type::Enum + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE = :balance + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY = :interest_until_maturity + + # @!method self.values + # @return [Array] + end + end + # The status of the Account. # # @see Increase::Models::Account#status diff --git a/lib/increase/models/account_create_params.rb b/lib/increase/models/account_create_params.rb index c9c7cd0a..48298f97 100644 --- a/lib/increase/models/account_create_params.rb +++ b/lib/increase/models/account_create_params.rb @@ -19,6 +19,12 @@ class AccountCreateParams < Increase::Internal::Type::BaseModel # @return [String, nil] optional :entity_id, String + # @!attribute funding + # Whether the Account is funded by a loan or by deposits. + # + # @return [Symbol, Increase::Models::AccountCreateParams::Funding, nil] + optional :funding, enum: -> { Increase::AccountCreateParams::Funding } + # @!attribute informational_entity_id # The identifier of an Entity that, while not owning the Account, is associated # with its activity. This is generally the beneficiary of the funds. @@ -26,6 +32,12 @@ class AccountCreateParams < Increase::Internal::Type::BaseModel # @return [String, nil] optional :informational_entity_id, String + # @!attribute loan + # The loan details for the account. + # + # @return [Increase::Models::AccountCreateParams::Loan, nil] + optional :loan, -> { Increase::AccountCreateParams::Loan } + # @!attribute program_id # The identifier for the Program that this Account falls under. Required if you # operate more than one Program. @@ -33,7 +45,7 @@ class AccountCreateParams < Increase::Internal::Type::BaseModel # @return [String, nil] optional :program_id, String - # @!method initialize(name:, entity_id: nil, informational_entity_id: nil, program_id: nil, request_options: {}) + # @!method initialize(name:, entity_id: nil, funding: nil, informational_entity_id: nil, loan: nil, program_id: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Increase::Models::AccountCreateParams} for more details. # @@ -41,11 +53,94 @@ class AccountCreateParams < Increase::Internal::Type::BaseModel # # @param entity_id [String] The identifier for the Entity that will own the Account. # + # @param funding [Symbol, Increase::Models::AccountCreateParams::Funding] Whether the Account is funded by a loan or by deposits. + # # @param informational_entity_id [String] The identifier of an Entity that, while not owning the Account, is associated wi # + # @param loan [Increase::Models::AccountCreateParams::Loan] The loan details for the account. + # # @param program_id [String] The identifier for the Program that this Account falls under. Required if you op # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + + # Whether the Account is funded by a loan or by deposits. + module Funding + extend Increase::Internal::Type::Enum + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN = :loan + + # An account funded by deposits. + DEPOSITS = :deposits + + # @!method self.values + # @return [Array] + end + + class Loan < Increase::Internal::Type::BaseModel + # @!attribute credit_limit + # The maximum amount of money that can be drawn from the Account. + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute grace_period_days + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + # + # @return [Integer] + required :grace_period_days, Integer + + # @!attribute statement_day_of_month + # The day of the month on which the loan statement is generated. + # + # @return [Integer] + required :statement_day_of_month, Integer + + # @!attribute statement_payment_type + # The type of statement payment for the account. + # + # @return [Symbol, Increase::Models::AccountCreateParams::Loan::StatementPaymentType] + required :statement_payment_type, enum: -> { Increase::AccountCreateParams::Loan::StatementPaymentType } + + # @!attribute maturity_date + # The date on which the loan matures. + # + # @return [Date, nil] + optional :maturity_date, Date + + # @!method initialize(credit_limit:, grace_period_days:, statement_day_of_month:, statement_payment_type:, maturity_date: nil) + # Some parameter documentations has been truncated, see + # {Increase::Models::AccountCreateParams::Loan} for more details. + # + # The loan details for the account. + # + # @param credit_limit [Integer] The maximum amount of money that can be drawn from the Account. + # + # @param grace_period_days [Integer] The number of days after the statement date that the Account can be past due bef + # + # @param statement_day_of_month [Integer] The day of the month on which the loan statement is generated. + # + # @param statement_payment_type [Symbol, Increase::Models::AccountCreateParams::Loan::StatementPaymentType] The type of statement payment for the account. + # + # @param maturity_date [Date] The date on which the loan matures. + + # The type of statement payment for the account. + # + # @see Increase::Models::AccountCreateParams::Loan#statement_payment_type + module StatementPaymentType + extend Increase::Internal::Type::Enum + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE = :balance + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY = :interest_until_maturity + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/increase/models/account_statement.rb b/lib/increase/models/account_statement.rb index 23d7f15e..e6be4425 100644 --- a/lib/increase/models/account_statement.rb +++ b/lib/increase/models/account_statement.rb @@ -35,6 +35,12 @@ class AccountStatement < Increase::Internal::Type::BaseModel # @return [String] required :file_id, String + # @!attribute loan + # The loan balances. + # + # @return [Increase::Models::AccountStatement::Loan, nil] + required :loan, -> { Increase::AccountStatement::Loan }, nil?: true + # @!attribute starting_balance # The Account's balance at the start of its statement period. # @@ -62,7 +68,7 @@ class AccountStatement < Increase::Internal::Type::BaseModel # @return [Symbol, Increase::Models::AccountStatement::Type] required :type, enum: -> { Increase::AccountStatement::Type } - # @!method initialize(id:, account_id:, created_at:, ending_balance:, file_id:, starting_balance:, statement_period_end:, statement_period_start:, type:) + # @!method initialize(id:, account_id:, created_at:, ending_balance:, file_id:, loan:, starting_balance:, statement_period_end:, statement_period_start:, type:) # Some parameter documentations has been truncated, see # {Increase::Models::AccountStatement} for more details. # @@ -80,6 +86,8 @@ class AccountStatement < Increase::Internal::Type::BaseModel # # @param file_id [String] The identifier of the File containing a PDF of the statement. # + # @param loan [Increase::Models::AccountStatement::Loan, nil] The loan balances. + # # @param starting_balance [Integer] The Account's balance at the start of its statement period. # # @param statement_period_end [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end @@ -88,6 +96,40 @@ class AccountStatement < Increase::Internal::Type::BaseModel # # @param type [Symbol, Increase::Models::AccountStatement::Type] A constant representing the object's type. For this resource it will always be ` + # @see Increase::Models::AccountStatement#loan + class Loan < Increase::Internal::Type::BaseModel + # @!attribute due_at + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + # + # @return [Time, nil] + required :due_at, Time, nil?: true + + # @!attribute due_balance + # The total amount due on the loan. + # + # @return [Integer] + required :due_balance, Integer + + # @!attribute past_due_balance + # The amount past due on the loan. + # + # @return [Integer] + required :past_due_balance, Integer + + # @!method initialize(due_at:, due_balance:, past_due_balance:) + # Some parameter documentations has been truncated, see + # {Increase::Models::AccountStatement::Loan} for more details. + # + # The loan balances. + # + # @param due_at [Time, nil] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan pa + # + # @param due_balance [Integer] The total amount due on the loan. + # + # @param past_due_balance [Integer] The amount past due on the loan. + end + # A constant representing the object's type. For this resource it will always be # `account_statement`. # diff --git a/lib/increase/models/account_update_params.rb b/lib/increase/models/account_update_params.rb index 344104bc..a7e7dcbe 100644 --- a/lib/increase/models/account_update_params.rb +++ b/lib/increase/models/account_update_params.rb @@ -7,16 +7,37 @@ class AccountUpdateParams < Increase::Internal::Type::BaseModel extend Increase::Internal::Type::RequestParameters::Converter include Increase::Internal::Type::RequestParameters + # @!attribute loan + # The loan details for the account. + # + # @return [Increase::Models::AccountUpdateParams::Loan, nil] + optional :loan, -> { Increase::AccountUpdateParams::Loan } + # @!attribute name # The new name of the Account. # # @return [String, nil] optional :name, String - # @!method initialize(name: nil, request_options: {}) + # @!method initialize(loan: nil, name: nil, request_options: {}) + # @param loan [Increase::Models::AccountUpdateParams::Loan] The loan details for the account. + # # @param name [String] The new name of the Account. # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + + class Loan < Increase::Internal::Type::BaseModel + # @!attribute credit_limit + # The maximum amount of money that can be drawn from the Account. + # + # @return [Integer] + required :credit_limit, Integer + + # @!method initialize(credit_limit:) + # The loan details for the account. + # + # @param credit_limit [Integer] The maximum amount of money that can be drawn from the Account. + end end end end diff --git a/lib/increase/models/balance_lookup.rb b/lib/increase/models/balance_lookup.rb index 3df36fb5..4df74321 100644 --- a/lib/increase/models/balance_lookup.rb +++ b/lib/increase/models/balance_lookup.rb @@ -24,6 +24,12 @@ class BalanceLookup < Increase::Internal::Type::BaseModel # @return [Integer] required :current_balance, Integer + # @!attribute loan + # The loan balances for the Account. + # + # @return [Increase::Models::BalanceLookup::Loan, nil] + required :loan, -> { Increase::BalanceLookup::Loan }, nil?: true + # @!attribute type # A constant representing the object's type. For this resource it will always be # `balance_lookup`. @@ -31,7 +37,7 @@ class BalanceLookup < Increase::Internal::Type::BaseModel # @return [Symbol, Increase::Models::BalanceLookup::Type] required :type, enum: -> { Increase::BalanceLookup::Type } - # @!method initialize(account_id:, available_balance:, current_balance:, type:) + # @!method initialize(account_id:, available_balance:, current_balance:, loan:, type:) # Some parameter documentations has been truncated, see # {Increase::Models::BalanceLookup} for more details. # @@ -44,8 +50,44 @@ class BalanceLookup < Increase::Internal::Type::BaseModel # # @param current_balance [Integer] The Account's current balance, representing the sum of all posted Transactions o # + # @param loan [Increase::Models::BalanceLookup::Loan, nil] The loan balances for the Account. + # # @param type [Symbol, Increase::Models::BalanceLookup::Type] A constant representing the object's type. For this resource it will always be ` + # @see Increase::Models::BalanceLookup#loan + class Loan < Increase::Internal::Type::BaseModel + # @!attribute due_at + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + # + # @return [Time, nil] + required :due_at, Time, nil?: true + + # @!attribute due_balance + # The total amount due on the loan. + # + # @return [Integer] + required :due_balance, Integer + + # @!attribute past_due_balance + # The amount past due on the loan. + # + # @return [Integer] + required :past_due_balance, Integer + + # @!method initialize(due_at:, due_balance:, past_due_balance:) + # Some parameter documentations has been truncated, see + # {Increase::Models::BalanceLookup::Loan} for more details. + # + # The loan balances for the Account. + # + # @param due_at [Time, nil] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan pa + # + # @param due_balance [Integer] The total amount due on the loan. + # + # @param past_due_balance [Integer] The amount past due on the loan. + end + # A constant representing the object's type. For this resource it will always be # `balance_lookup`. # diff --git a/lib/increase/models/program.rb b/lib/increase/models/program.rb index 344a6201..6bb49e19 100644 --- a/lib/increase/models/program.rb +++ b/lib/increase/models/program.rb @@ -43,6 +43,12 @@ class Program < Increase::Internal::Type::BaseModel # @return [String] required :interest_rate, String + # @!attribute lending + # The lending details for the program. + # + # @return [Increase::Models::Program::Lending, nil] + required :lending, -> { Increase::Program::Lending }, nil?: true + # @!attribute name # The name of the Program. # @@ -63,7 +69,7 @@ class Program < Increase::Internal::Type::BaseModel # @return [Time] required :updated_at, Time - # @!method initialize(id:, bank:, billing_account_id:, created_at:, default_digital_card_profile_id:, interest_rate:, name:, type:, updated_at:) + # @!method initialize(id:, bank:, billing_account_id:, created_at:, default_digital_card_profile_id:, interest_rate:, lending:, name:, type:, updated_at:) # Some parameter documentations has been truncated, see # {Increase::Models::Program} for more details. # @@ -84,6 +90,8 @@ class Program < Increase::Internal::Type::BaseModel # # @param interest_rate [String] The Interest Rate currently being earned on the accounts in this program, as a s # + # @param lending [Increase::Models::Program::Lending, nil] The lending details for the program. + # # @param name [String] The name of the Program. # # @param type [Symbol, Increase::Models::Program::Type] A constant representing the object's type. For this resource it will always be ` @@ -109,6 +117,20 @@ module Bank # @return [Array] end + # @see Increase::Models::Program#lending + class Lending < Increase::Internal::Type::BaseModel + # @!attribute maximum_extendable_credit + # The maximum extendable credit of the program. + # + # @return [Integer] + required :maximum_extendable_credit, Integer + + # @!method initialize(maximum_extendable_credit:) + # The lending details for the program. + # + # @param maximum_extendable_credit [Integer] The maximum extendable credit of the program. + end + # A constant representing the object's type. For this resource it will always be # `program`. # diff --git a/lib/increase/models/simulations/program_create_params.rb b/lib/increase/models/simulations/program_create_params.rb index 230f8615..73a1c445 100644 --- a/lib/increase/models/simulations/program_create_params.rb +++ b/lib/increase/models/simulations/program_create_params.rb @@ -20,17 +20,25 @@ class ProgramCreateParams < Increase::Internal::Type::BaseModel # @return [Symbol, Increase::Models::Simulations::ProgramCreateParams::Bank, nil] optional :bank, enum: -> { Increase::Simulations::ProgramCreateParams::Bank } + # @!attribute lending_maximum_extendable_credit + # The maximum extendable credit of the program being added. + # + # @return [Integer, nil] + optional :lending_maximum_extendable_credit, Integer + # @!attribute reserve_account_id # The identifier of the Account the Program should be added to is for. # # @return [String, nil] optional :reserve_account_id, String - # @!method initialize(name:, bank: nil, reserve_account_id: nil, request_options: {}) + # @!method initialize(name:, bank: nil, lending_maximum_extendable_credit: nil, reserve_account_id: nil, request_options: {}) # @param name [String] The name of the program being added. # # @param bank [Symbol, Increase::Models::Simulations::ProgramCreateParams::Bank] The bank for the program's accounts, defaults to First Internet Bank. # + # @param lending_maximum_extendable_credit [Integer] The maximum extendable credit of the program being added. + # # @param reserve_account_id [String] The identifier of the Account the Program should be added to is for. # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/increase/resources/accounts.rb b/lib/increase/resources/accounts.rb index 067ab836..37cfda82 100644 --- a/lib/increase/resources/accounts.rb +++ b/lib/increase/resources/accounts.rb @@ -8,14 +8,18 @@ class Accounts # # Create an Account # - # @overload create(name:, entity_id: nil, informational_entity_id: nil, program_id: nil, request_options: {}) + # @overload create(name:, entity_id: nil, funding: nil, informational_entity_id: nil, loan: nil, program_id: nil, request_options: {}) # # @param name [String] The name you choose for the Account. # # @param entity_id [String] The identifier for the Entity that will own the Account. # + # @param funding [Symbol, Increase::Models::AccountCreateParams::Funding] Whether the Account is funded by a loan or by deposits. + # # @param informational_entity_id [String] The identifier of an Entity that, while not owning the Account, is associated wi # + # @param loan [Increase::Models::AccountCreateParams::Loan] The loan details for the account. + # # @param program_id [String] The identifier for the Program that this Account falls under. Required if you op # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] @@ -56,10 +60,12 @@ def retrieve(account_id, params = {}) # Update an Account # - # @overload update(account_id, name: nil, request_options: {}) + # @overload update(account_id, loan: nil, name: nil, request_options: {}) # # @param account_id [String] The identifier of the Account to update. # + # @param loan [Increase::Models::AccountUpdateParams::Loan] The loan details for the account. + # # @param name [String] The new name of the Account. # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/increase/resources/simulations/programs.rb b/lib/increase/resources/simulations/programs.rb index 766b0923..22094446 100644 --- a/lib/increase/resources/simulations/programs.rb +++ b/lib/increase/resources/simulations/programs.rb @@ -9,12 +9,14 @@ class Programs # operates more than one program, `program_id` is a required field when creating # accounts. # - # @overload create(name:, bank: nil, reserve_account_id: nil, request_options: {}) + # @overload create(name:, bank: nil, lending_maximum_extendable_credit: nil, reserve_account_id: nil, request_options: {}) # # @param name [String] The name of the program being added. # # @param bank [Symbol, Increase::Models::Simulations::ProgramCreateParams::Bank] The bank for the program's accounts, defaults to First Internet Bank. # + # @param lending_maximum_extendable_credit [Integer] The maximum extendable credit of the program being added. + # # @param reserve_account_id [String] The identifier of the Account the Program should be added to is for. # # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/increase/version.rb b/lib/increase/version.rb index 6e85ea7f..d932b8a2 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "1.187.0" + VERSION = "1.188.0" end diff --git a/rbi/increase/models/account.rbi b/rbi/increase/models/account.rbi index 995cd22c..accecbcf 100644 --- a/rbi/increase/models/account.rbi +++ b/rbi/increase/models/account.rbi @@ -40,6 +40,10 @@ module Increase sig { returns(String) } attr_accessor :entity_id + # Whether the Account is funded by a loan or by deposits. + sig { returns(T.nilable(Increase::Account::Funding::TaggedSymbol)) } + attr_accessor :funding + # The idempotency key you chose for this object. This value is unique across # Increase and is used to ensure that a request is only processed once. Learn more # about [idempotency](https://increase.com/documentation/idempotency-keys). @@ -67,6 +71,13 @@ module Increase sig { returns(String) } attr_accessor :interest_rate + # The Account's loan-related information, if the Account is a loan account. + sig { returns(T.nilable(Increase::Account::Loan)) } + attr_reader :loan + + sig { params(loan: T.nilable(Increase::Account::Loan::OrHash)).void } + attr_writer :loan + # The name you choose for the Account. sig { returns(String) } attr_accessor :name @@ -96,11 +107,13 @@ module Increase created_at: Time, currency: Increase::Account::Currency::OrSymbol, entity_id: String, + funding: T.nilable(Increase::Account::Funding::OrSymbol), idempotency_key: T.nilable(String), informational_entity_id: T.nilable(String), interest_accrued: String, interest_accrued_at: T.nilable(Date), interest_rate: String, + loan: T.nilable(Increase::Account::Loan::OrHash), name: String, program_id: String, status: Increase::Account::Status::OrSymbol, @@ -128,6 +141,8 @@ module Increase currency:, # The identifier for the Entity the Account belongs to. entity_id:, + # Whether the Account is funded by a loan or by deposits. + funding:, # The idempotency key you chose for this object. This value is unique across # Increase and is used to ensure that a request is only processed once. Learn more # about [idempotency](https://increase.com/documentation/idempotency-keys). @@ -145,6 +160,8 @@ module Increase # a decimal number. For example, a 1% interest rate would be represented as # "0.01". interest_rate:, + # The Account's loan-related information, if the Account is a loan account. + loan:, # The name you choose for the Account. name:, # The identifier of the Program determining the compliance and commercial terms of @@ -168,11 +185,13 @@ module Increase created_at: Time, currency: Increase::Account::Currency::TaggedSymbol, entity_id: String, + funding: T.nilable(Increase::Account::Funding::TaggedSymbol), idempotency_key: T.nilable(String), informational_entity_id: T.nilable(String), interest_accrued: String, interest_accrued_at: T.nilable(Date), interest_rate: String, + loan: T.nilable(Increase::Account::Loan), name: String, program_id: String, status: Increase::Account::Status::TaggedSymbol, @@ -227,6 +246,133 @@ module Increase end end + # Whether the Account is funded by a loan or by deposits. + module Funding + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::Account::Funding) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN = T.let(:loan, Increase::Account::Funding::TaggedSymbol) + + # An account funded by deposits. + DEPOSITS = T.let(:deposits, Increase::Account::Funding::TaggedSymbol) + + sig do + override.returns(T::Array[Increase::Account::Funding::TaggedSymbol]) + end + def self.values + end + end + + class Loan < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::Account::Loan, Increase::Internal::AnyHash) + end + + # The maximum amount of money that can be borrowed on the Account. + sig { returns(Integer) } + attr_accessor :credit_limit + + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + sig { returns(Integer) } + attr_accessor :grace_period_days + + # The date on which the loan matures. + sig { returns(T.nilable(Date)) } + attr_accessor :maturity_date + + # The day of the month on which the loan statement is generated. + sig { returns(Integer) } + attr_accessor :statement_day_of_month + + # The type of payment for the loan. + sig do + returns(Increase::Account::Loan::StatementPaymentType::TaggedSymbol) + end + attr_accessor :statement_payment_type + + # The Account's loan-related information, if the Account is a loan account. + sig do + params( + credit_limit: Integer, + grace_period_days: Integer, + maturity_date: T.nilable(Date), + statement_day_of_month: Integer, + statement_payment_type: + Increase::Account::Loan::StatementPaymentType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The maximum amount of money that can be borrowed on the Account. + credit_limit:, + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + grace_period_days:, + # The date on which the loan matures. + maturity_date:, + # The day of the month on which the loan statement is generated. + statement_day_of_month:, + # The type of payment for the loan. + statement_payment_type: + ) + end + + sig do + override.returns( + { + credit_limit: Integer, + grace_period_days: Integer, + maturity_date: T.nilable(Date), + statement_day_of_month: Integer, + statement_payment_type: + Increase::Account::Loan::StatementPaymentType::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of payment for the loan. + module StatementPaymentType + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Increase::Account::Loan::StatementPaymentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE = + T.let( + :balance, + Increase::Account::Loan::StatementPaymentType::TaggedSymbol + ) + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY = + T.let( + :interest_until_maturity, + Increase::Account::Loan::StatementPaymentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Increase::Account::Loan::StatementPaymentType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + # The status of the Account. module Status extend Increase::Internal::Type::Enum diff --git a/rbi/increase/models/account_create_params.rbi b/rbi/increase/models/account_create_params.rbi index 0661d075..cf392834 100644 --- a/rbi/increase/models/account_create_params.rbi +++ b/rbi/increase/models/account_create_params.rbi @@ -22,6 +22,17 @@ module Increase sig { params(entity_id: String).void } attr_writer :entity_id + # Whether the Account is funded by a loan or by deposits. + sig do + returns(T.nilable(Increase::AccountCreateParams::Funding::OrSymbol)) + end + attr_reader :funding + + sig do + params(funding: Increase::AccountCreateParams::Funding::OrSymbol).void + end + attr_writer :funding + # The identifier of an Entity that, while not owning the Account, is associated # with its activity. This is generally the beneficiary of the funds. sig { returns(T.nilable(String)) } @@ -30,6 +41,13 @@ module Increase sig { params(informational_entity_id: String).void } attr_writer :informational_entity_id + # The loan details for the account. + sig { returns(T.nilable(Increase::AccountCreateParams::Loan)) } + attr_reader :loan + + sig { params(loan: Increase::AccountCreateParams::Loan::OrHash).void } + attr_writer :loan + # The identifier for the Program that this Account falls under. Required if you # operate more than one Program. sig { returns(T.nilable(String)) } @@ -42,7 +60,9 @@ module Increase params( name: String, entity_id: String, + funding: Increase::AccountCreateParams::Funding::OrSymbol, informational_entity_id: String, + loan: Increase::AccountCreateParams::Loan::OrHash, program_id: String, request_options: Increase::RequestOptions::OrHash ).returns(T.attached_class) @@ -52,9 +72,13 @@ module Increase name:, # The identifier for the Entity that will own the Account. entity_id: nil, + # Whether the Account is funded by a loan or by deposits. + funding: nil, # The identifier of an Entity that, while not owning the Account, is associated # with its activity. This is generally the beneficiary of the funds. informational_entity_id: nil, + # The loan details for the account. + loan: nil, # The identifier for the Program that this Account falls under. Required if you # operate more than one Program. program_id: nil, @@ -67,7 +91,9 @@ module Increase { name: String, entity_id: String, + funding: Increase::AccountCreateParams::Funding::OrSymbol, informational_entity_id: String, + loan: Increase::AccountCreateParams::Loan, program_id: String, request_options: Increase::RequestOptions } @@ -75,6 +101,148 @@ module Increase end def to_hash end + + # Whether the Account is funded by a loan or by deposits. + module Funding + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::AccountCreateParams::Funding) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN = + T.let(:loan, Increase::AccountCreateParams::Funding::TaggedSymbol) + + # An account funded by deposits. + DEPOSITS = + T.let(:deposits, Increase::AccountCreateParams::Funding::TaggedSymbol) + + sig do + override.returns( + T::Array[Increase::AccountCreateParams::Funding::TaggedSymbol] + ) + end + def self.values + end + end + + class Loan < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::AccountCreateParams::Loan, + Increase::Internal::AnyHash + ) + end + + # The maximum amount of money that can be drawn from the Account. + sig { returns(Integer) } + attr_accessor :credit_limit + + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + sig { returns(Integer) } + attr_accessor :grace_period_days + + # The day of the month on which the loan statement is generated. + sig { returns(Integer) } + attr_accessor :statement_day_of_month + + # The type of statement payment for the account. + sig do + returns( + Increase::AccountCreateParams::Loan::StatementPaymentType::OrSymbol + ) + end + attr_accessor :statement_payment_type + + # The date on which the loan matures. + sig { returns(T.nilable(Date)) } + attr_reader :maturity_date + + sig { params(maturity_date: Date).void } + attr_writer :maturity_date + + # The loan details for the account. + sig do + params( + credit_limit: Integer, + grace_period_days: Integer, + statement_day_of_month: Integer, + statement_payment_type: + Increase::AccountCreateParams::Loan::StatementPaymentType::OrSymbol, + maturity_date: Date + ).returns(T.attached_class) + end + def self.new( + # The maximum amount of money that can be drawn from the Account. + credit_limit:, + # The number of days after the statement date that the Account can be past due + # before being considered delinquent. + grace_period_days:, + # The day of the month on which the loan statement is generated. + statement_day_of_month:, + # The type of statement payment for the account. + statement_payment_type:, + # The date on which the loan matures. + maturity_date: nil + ) + end + + sig do + override.returns( + { + credit_limit: Integer, + grace_period_days: Integer, + statement_day_of_month: Integer, + statement_payment_type: + Increase::AccountCreateParams::Loan::StatementPaymentType::OrSymbol, + maturity_date: Date + } + ) + end + def to_hash + end + + # The type of statement payment for the account. + module StatementPaymentType + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Increase::AccountCreateParams::Loan::StatementPaymentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE = + T.let( + :balance, + Increase::AccountCreateParams::Loan::StatementPaymentType::TaggedSymbol + ) + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY = + T.let( + :interest_until_maturity, + Increase::AccountCreateParams::Loan::StatementPaymentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Increase::AccountCreateParams::Loan::StatementPaymentType::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/increase/models/account_statement.rbi b/rbi/increase/models/account_statement.rbi index 3bc04645..7dc6874c 100644 --- a/rbi/increase/models/account_statement.rbi +++ b/rbi/increase/models/account_statement.rbi @@ -29,6 +29,15 @@ module Increase sig { returns(String) } attr_accessor :file_id + # The loan balances. + sig { returns(T.nilable(Increase::AccountStatement::Loan)) } + attr_reader :loan + + sig do + params(loan: T.nilable(Increase::AccountStatement::Loan::OrHash)).void + end + attr_writer :loan + # The Account's balance at the start of its statement period. sig { returns(Integer) } attr_accessor :starting_balance @@ -58,6 +67,7 @@ module Increase created_at: Time, ending_balance: Integer, file_id: String, + loan: T.nilable(Increase::AccountStatement::Loan::OrHash), starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, @@ -76,6 +86,8 @@ module Increase ending_balance:, # The identifier of the File containing a PDF of the statement. file_id:, + # The loan balances. + loan:, # The Account's balance at the start of its statement period. starting_balance:, # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end @@ -98,6 +110,7 @@ module Increase created_at: Time, ending_balance: Integer, file_id: String, + loan: T.nilable(Increase::AccountStatement::Loan), starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, @@ -108,6 +121,57 @@ module Increase def to_hash end + class Loan < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::AccountStatement::Loan, Increase::Internal::AnyHash) + end + + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + sig { returns(T.nilable(Time)) } + attr_accessor :due_at + + # The total amount due on the loan. + sig { returns(Integer) } + attr_accessor :due_balance + + # The amount past due on the loan. + sig { returns(Integer) } + attr_accessor :past_due_balance + + # The loan balances. + sig do + params( + due_at: T.nilable(Time), + due_balance: Integer, + past_due_balance: Integer + ).returns(T.attached_class) + end + def self.new( + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + due_at:, + # The total amount due on the loan. + due_balance:, + # The amount past due on the loan. + past_due_balance: + ) + end + + sig do + override.returns( + { + due_at: T.nilable(Time), + due_balance: Integer, + past_due_balance: Integer + } + ) + end + def to_hash + end + end + # A constant representing the object's type. For this resource it will always be # `account_statement`. module Type diff --git a/rbi/increase/models/account_update_params.rbi b/rbi/increase/models/account_update_params.rbi index 81cf5c0a..a64b075c 100644 --- a/rbi/increase/models/account_update_params.rbi +++ b/rbi/increase/models/account_update_params.rbi @@ -11,6 +11,13 @@ module Increase T.any(Increase::AccountUpdateParams, Increase::Internal::AnyHash) end + # The loan details for the account. + sig { returns(T.nilable(Increase::AccountUpdateParams::Loan)) } + attr_reader :loan + + sig { params(loan: Increase::AccountUpdateParams::Loan::OrHash).void } + attr_writer :loan + # The new name of the Account. sig { returns(T.nilable(String)) } attr_reader :name @@ -20,11 +27,14 @@ module Increase sig do params( + loan: Increase::AccountUpdateParams::Loan::OrHash, name: String, request_options: Increase::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # The loan details for the account. + loan: nil, # The new name of the Account. name: nil, request_options: {} @@ -33,11 +43,41 @@ module Increase sig do override.returns( - { name: String, request_options: Increase::RequestOptions } + { + loan: Increase::AccountUpdateParams::Loan, + name: String, + request_options: Increase::RequestOptions + } ) end def to_hash end + + class Loan < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::AccountUpdateParams::Loan, + Increase::Internal::AnyHash + ) + end + + # The maximum amount of money that can be drawn from the Account. + sig { returns(Integer) } + attr_accessor :credit_limit + + # The loan details for the account. + sig { params(credit_limit: Integer).returns(T.attached_class) } + def self.new( + # The maximum amount of money that can be drawn from the Account. + credit_limit: + ) + end + + sig { override.returns({ credit_limit: Integer }) } + def to_hash + end + end end end end diff --git a/rbi/increase/models/balance_lookup.rbi b/rbi/increase/models/balance_lookup.rbi index 34046067..4f70b6e8 100644 --- a/rbi/increase/models/balance_lookup.rbi +++ b/rbi/increase/models/balance_lookup.rbi @@ -22,6 +22,15 @@ module Increase sig { returns(Integer) } attr_accessor :current_balance + # The loan balances for the Account. + sig { returns(T.nilable(Increase::BalanceLookup::Loan)) } + attr_reader :loan + + sig do + params(loan: T.nilable(Increase::BalanceLookup::Loan::OrHash)).void + end + attr_writer :loan + # A constant representing the object's type. For this resource it will always be # `balance_lookup`. sig { returns(Increase::BalanceLookup::Type::TaggedSymbol) } @@ -34,6 +43,7 @@ module Increase account_id: String, available_balance: Integer, current_balance: Integer, + loan: T.nilable(Increase::BalanceLookup::Loan::OrHash), type: Increase::BalanceLookup::Type::OrSymbol ).returns(T.attached_class) end @@ -46,6 +56,8 @@ module Increase # The Account's current balance, representing the sum of all posted Transactions # on the Account. current_balance:, + # The loan balances for the Account. + loan:, # A constant representing the object's type. For this resource it will always be # `balance_lookup`. type: @@ -58,6 +70,7 @@ module Increase account_id: String, available_balance: Integer, current_balance: Integer, + loan: T.nilable(Increase::BalanceLookup::Loan), type: Increase::BalanceLookup::Type::TaggedSymbol } ) @@ -65,6 +78,57 @@ module Increase def to_hash end + class Loan < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::BalanceLookup::Loan, Increase::Internal::AnyHash) + end + + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + sig { returns(T.nilable(Time)) } + attr_accessor :due_at + + # The total amount due on the loan. + sig { returns(Integer) } + attr_accessor :due_balance + + # The amount past due on the loan. + sig { returns(Integer) } + attr_accessor :past_due_balance + + # The loan balances for the Account. + sig do + params( + due_at: T.nilable(Time), + due_balance: Integer, + past_due_balance: Integer + ).returns(T.attached_class) + end + def self.new( + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan + # payment is due. + due_at:, + # The total amount due on the loan. + due_balance:, + # The amount past due on the loan. + past_due_balance: + ) + end + + sig do + override.returns( + { + due_at: T.nilable(Time), + due_balance: Integer, + past_due_balance: Integer + } + ) + end + def to_hash + end + end + # A constant representing the object's type. For this resource it will always be # `balance_lookup`. module Type diff --git a/rbi/increase/models/program.rbi b/rbi/increase/models/program.rbi index 2594a5b3..bcfd30ea 100644 --- a/rbi/increase/models/program.rbi +++ b/rbi/increase/models/program.rbi @@ -33,6 +33,15 @@ module Increase sig { returns(String) } attr_accessor :interest_rate + # The lending details for the program. + sig { returns(T.nilable(Increase::Program::Lending)) } + attr_reader :lending + + sig do + params(lending: T.nilable(Increase::Program::Lending::OrHash)).void + end + attr_writer :lending + # The name of the Program. sig { returns(String) } attr_accessor :name @@ -59,6 +68,7 @@ module Increase created_at: Time, default_digital_card_profile_id: T.nilable(String), interest_rate: String, + lending: T.nilable(Increase::Program::Lending::OrHash), name: String, type: Increase::Program::Type::OrSymbol, updated_at: Time @@ -80,6 +90,8 @@ module Increase # string containing a decimal number. For example, a 1% interest rate would be # represented as "0.01". interest_rate:, + # The lending details for the program. + lending:, # The name of the Program. name:, # A constant representing the object's type. For this resource it will always be @@ -100,6 +112,7 @@ module Increase created_at: Time, default_digital_card_profile_id: T.nilable(String), interest_rate: String, + lending: T.nilable(Increase::Program::Lending), name: String, type: Increase::Program::Type::TaggedSymbol, updated_at: Time @@ -134,6 +147,31 @@ module Increase end end + class Lending < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::Program::Lending, Increase::Internal::AnyHash) + end + + # The maximum extendable credit of the program. + sig { returns(Integer) } + attr_accessor :maximum_extendable_credit + + # The lending details for the program. + sig do + params(maximum_extendable_credit: Integer).returns(T.attached_class) + end + def self.new( + # The maximum extendable credit of the program. + maximum_extendable_credit: + ) + end + + sig { override.returns({ maximum_extendable_credit: Integer }) } + def to_hash + end + end + # A constant representing the object's type. For this resource it will always be # `program`. module Type diff --git a/rbi/increase/models/simulations/program_create_params.rbi b/rbi/increase/models/simulations/program_create_params.rbi index 6628523d..a090651d 100644 --- a/rbi/increase/models/simulations/program_create_params.rbi +++ b/rbi/increase/models/simulations/program_create_params.rbi @@ -36,6 +36,13 @@ module Increase end attr_writer :bank + # The maximum extendable credit of the program being added. + sig { returns(T.nilable(Integer)) } + attr_reader :lending_maximum_extendable_credit + + sig { params(lending_maximum_extendable_credit: Integer).void } + attr_writer :lending_maximum_extendable_credit + # The identifier of the Account the Program should be added to is for. sig { returns(T.nilable(String)) } attr_reader :reserve_account_id @@ -47,6 +54,7 @@ module Increase params( name: String, bank: Increase::Simulations::ProgramCreateParams::Bank::OrSymbol, + lending_maximum_extendable_credit: Integer, reserve_account_id: String, request_options: Increase::RequestOptions::OrHash ).returns(T.attached_class) @@ -56,6 +64,8 @@ module Increase name:, # The bank for the program's accounts, defaults to First Internet Bank. bank: nil, + # The maximum extendable credit of the program being added. + lending_maximum_extendable_credit: nil, # The identifier of the Account the Program should be added to is for. reserve_account_id: nil, request_options: {} @@ -67,6 +77,7 @@ module Increase { name: String, bank: Increase::Simulations::ProgramCreateParams::Bank::OrSymbol, + lending_maximum_extendable_credit: Integer, reserve_account_id: String, request_options: Increase::RequestOptions } diff --git a/rbi/increase/resources/accounts.rbi b/rbi/increase/resources/accounts.rbi index 119e3b16..9223a7f9 100644 --- a/rbi/increase/resources/accounts.rbi +++ b/rbi/increase/resources/accounts.rbi @@ -8,7 +8,9 @@ module Increase params( name: String, entity_id: String, + funding: Increase::AccountCreateParams::Funding::OrSymbol, informational_entity_id: String, + loan: Increase::AccountCreateParams::Loan::OrHash, program_id: String, request_options: Increase::RequestOptions::OrHash ).returns(Increase::Account) @@ -18,9 +20,13 @@ module Increase name:, # The identifier for the Entity that will own the Account. entity_id: nil, + # Whether the Account is funded by a loan or by deposits. + funding: nil, # The identifier of an Entity that, while not owning the Account, is associated # with its activity. This is generally the beneficiary of the funds. informational_entity_id: nil, + # The loan details for the account. + loan: nil, # The identifier for the Program that this Account falls under. Required if you # operate more than one Program. program_id: nil, @@ -46,6 +52,7 @@ module Increase sig do params( account_id: String, + loan: Increase::AccountUpdateParams::Loan::OrHash, name: String, request_options: Increase::RequestOptions::OrHash ).returns(Increase::Account) @@ -53,6 +60,8 @@ module Increase def update( # The identifier of the Account to update. account_id, + # The loan details for the account. + loan: nil, # The new name of the Account. name: nil, request_options: {} diff --git a/rbi/increase/resources/simulations/programs.rbi b/rbi/increase/resources/simulations/programs.rbi index 477dd414..811f8dd9 100644 --- a/rbi/increase/resources/simulations/programs.rbi +++ b/rbi/increase/resources/simulations/programs.rbi @@ -12,6 +12,7 @@ module Increase params( name: String, bank: Increase::Simulations::ProgramCreateParams::Bank::OrSymbol, + lending_maximum_extendable_credit: Integer, reserve_account_id: String, request_options: Increase::RequestOptions::OrHash ).returns(Increase::Program) @@ -21,6 +22,8 @@ module Increase name:, # The bank for the program's accounts, defaults to First Internet Bank. bank: nil, + # The maximum extendable credit of the program being added. + lending_maximum_extendable_credit: nil, # The identifier of the Account the Program should be added to is for. reserve_account_id: nil, request_options: {} diff --git a/sig/increase/models/account.rbs b/sig/increase/models/account.rbs index 840c6c6e..5ac10b60 100644 --- a/sig/increase/models/account.rbs +++ b/sig/increase/models/account.rbs @@ -9,11 +9,13 @@ module Increase created_at: Time, currency: Increase::Models::Account::currency, entity_id: String, + funding: Increase::Models::Account::funding?, idempotency_key: String?, informational_entity_id: String?, interest_accrued: String, interest_accrued_at: Date?, interest_rate: String, + loan: Increase::Account::Loan?, name: String, program_id: String, status: Increase::Models::Account::status, @@ -35,6 +37,8 @@ module Increase attr_accessor entity_id: String + attr_accessor funding: Increase::Models::Account::funding? + attr_accessor idempotency_key: String? attr_accessor informational_entity_id: String? @@ -45,6 +49,8 @@ module Increase attr_accessor interest_rate: String + attr_accessor loan: Increase::Account::Loan? + attr_accessor name: String attr_accessor program_id: String @@ -61,11 +67,13 @@ module Increase created_at: Time, currency: Increase::Models::Account::currency, entity_id: String, + funding: Increase::Models::Account::funding?, idempotency_key: String?, informational_entity_id: String?, interest_accrued: String, interest_accrued_at: Date?, interest_rate: String, + loan: Increase::Account::Loan?, name: String, program_id: String, status: Increase::Models::Account::status, @@ -80,11 +88,13 @@ module Increase created_at: Time, currency: Increase::Models::Account::currency, entity_id: String, + funding: Increase::Models::Account::funding?, idempotency_key: String?, informational_entity_id: String?, interest_accrued: String, interest_accrued_at: Date?, interest_rate: String, + loan: Increase::Account::Loan?, name: String, program_id: String, status: Increase::Models::Account::status, @@ -119,6 +129,71 @@ module Increase def self?.values: -> ::Array[Increase::Models::Account::currency] end + type funding = :loan | :deposits + + module Funding + extend Increase::Internal::Type::Enum + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN: :loan + + # An account funded by deposits. + DEPOSITS: :deposits + + def self?.values: -> ::Array[Increase::Models::Account::funding] + end + + type loan = + { + credit_limit: Integer, + grace_period_days: Integer, + maturity_date: Date?, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::Account::Loan::statement_payment_type + } + + class Loan < Increase::Internal::Type::BaseModel + attr_accessor credit_limit: Integer + + attr_accessor grace_period_days: Integer + + attr_accessor maturity_date: Date? + + attr_accessor statement_day_of_month: Integer + + attr_accessor statement_payment_type: Increase::Models::Account::Loan::statement_payment_type + + def initialize: ( + credit_limit: Integer, + grace_period_days: Integer, + maturity_date: Date?, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::Account::Loan::statement_payment_type + ) -> void + + def to_hash: -> { + credit_limit: Integer, + grace_period_days: Integer, + maturity_date: Date?, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::Account::Loan::statement_payment_type + } + + type statement_payment_type = :balance | :interest_until_maturity + + module StatementPaymentType + extend Increase::Internal::Type::Enum + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE: :balance + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY: :interest_until_maturity + + def self?.values: -> ::Array[Increase::Models::Account::Loan::statement_payment_type] + end + end + type status = :closed | :open module Status diff --git a/sig/increase/models/account_create_params.rbs b/sig/increase/models/account_create_params.rbs index 96e29407..4d7db2b2 100644 --- a/sig/increase/models/account_create_params.rbs +++ b/sig/increase/models/account_create_params.rbs @@ -4,7 +4,9 @@ module Increase { name: String, entity_id: String, + funding: Increase::Models::AccountCreateParams::funding, informational_entity_id: String, + loan: Increase::AccountCreateParams::Loan, program_id: String } & Increase::Internal::Type::request_parameters @@ -19,10 +21,22 @@ module Increase def entity_id=: (String) -> String + attr_reader funding: Increase::Models::AccountCreateParams::funding? + + def funding=: ( + Increase::Models::AccountCreateParams::funding + ) -> Increase::Models::AccountCreateParams::funding + attr_reader informational_entity_id: String? def informational_entity_id=: (String) -> String + attr_reader loan: Increase::AccountCreateParams::Loan? + + def loan=: ( + Increase::AccountCreateParams::Loan + ) -> Increase::AccountCreateParams::Loan + attr_reader program_id: String? def program_id=: (String) -> String @@ -30,7 +44,9 @@ module Increase def initialize: ( name: String, ?entity_id: String, + ?funding: Increase::Models::AccountCreateParams::funding, ?informational_entity_id: String, + ?loan: Increase::AccountCreateParams::Loan, ?program_id: String, ?request_options: Increase::request_opts ) -> void @@ -38,10 +54,79 @@ module Increase def to_hash: -> { name: String, entity_id: String, + funding: Increase::Models::AccountCreateParams::funding, informational_entity_id: String, + loan: Increase::AccountCreateParams::Loan, program_id: String, request_options: Increase::RequestOptions } + + type funding = :loan | :deposits + + module Funding + extend Increase::Internal::Type::Enum + + # An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program. + LOAN: :loan + + # An account funded by deposits. + DEPOSITS: :deposits + + def self?.values: -> ::Array[Increase::Models::AccountCreateParams::funding] + end + + type loan = + { + credit_limit: Integer, + grace_period_days: Integer, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::AccountCreateParams::Loan::statement_payment_type, + maturity_date: Date + } + + class Loan < Increase::Internal::Type::BaseModel + attr_accessor credit_limit: Integer + + attr_accessor grace_period_days: Integer + + attr_accessor statement_day_of_month: Integer + + attr_accessor statement_payment_type: Increase::Models::AccountCreateParams::Loan::statement_payment_type + + attr_reader maturity_date: Date? + + def maturity_date=: (Date) -> Date + + def initialize: ( + credit_limit: Integer, + grace_period_days: Integer, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::AccountCreateParams::Loan::statement_payment_type, + ?maturity_date: Date + ) -> void + + def to_hash: -> { + credit_limit: Integer, + grace_period_days: Integer, + statement_day_of_month: Integer, + statement_payment_type: Increase::Models::AccountCreateParams::Loan::statement_payment_type, + maturity_date: Date + } + + type statement_payment_type = :balance | :interest_until_maturity + + module StatementPaymentType + extend Increase::Internal::Type::Enum + + # The borrower must pay the full balance of the loan at the end of the statement period. + BALANCE: :balance + + # The borrower must pay the accrued interest at the end of the statement period. + INTEREST_UNTIL_MATURITY: :interest_until_maturity + + def self?.values: -> ::Array[Increase::Models::AccountCreateParams::Loan::statement_payment_type] + end + end end end end diff --git a/sig/increase/models/account_statement.rbs b/sig/increase/models/account_statement.rbs index 67a71a79..8f62ed7b 100644 --- a/sig/increase/models/account_statement.rbs +++ b/sig/increase/models/account_statement.rbs @@ -7,6 +7,7 @@ module Increase created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan?, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, @@ -24,6 +25,8 @@ module Increase attr_accessor file_id: String + attr_accessor loan: Increase::AccountStatement::Loan? + attr_accessor starting_balance: Integer attr_accessor statement_period_end: Time @@ -38,6 +41,7 @@ module Increase created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan?, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, @@ -50,12 +54,36 @@ module Increase created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan?, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, type: Increase::Models::AccountStatement::type_ } + type loan = + { due_at: Time?, due_balance: Integer, past_due_balance: Integer } + + class Loan < Increase::Internal::Type::BaseModel + attr_accessor due_at: Time? + + attr_accessor due_balance: Integer + + attr_accessor past_due_balance: Integer + + def initialize: ( + due_at: Time?, + due_balance: Integer, + past_due_balance: Integer + ) -> void + + def to_hash: -> { + due_at: Time?, + due_balance: Integer, + past_due_balance: Integer + } + end + type type_ = :account_statement module Type diff --git a/sig/increase/models/account_update_params.rbs b/sig/increase/models/account_update_params.rbs index c7244351..e1501a6f 100644 --- a/sig/increase/models/account_update_params.rbs +++ b/sig/increase/models/account_update_params.rbs @@ -1,25 +1,44 @@ module Increase module Models type account_update_params = - { name: String } & Increase::Internal::Type::request_parameters + { loan: Increase::AccountUpdateParams::Loan, name: String } + & Increase::Internal::Type::request_parameters class AccountUpdateParams < Increase::Internal::Type::BaseModel extend Increase::Internal::Type::RequestParameters::Converter include Increase::Internal::Type::RequestParameters + attr_reader loan: Increase::AccountUpdateParams::Loan? + + def loan=: ( + Increase::AccountUpdateParams::Loan + ) -> Increase::AccountUpdateParams::Loan + attr_reader name: String? def name=: (String) -> String def initialize: ( + ?loan: Increase::AccountUpdateParams::Loan, ?name: String, ?request_options: Increase::request_opts ) -> void def to_hash: -> { + loan: Increase::AccountUpdateParams::Loan, name: String, request_options: Increase::RequestOptions } + + type loan = { credit_limit: Integer } + + class Loan < Increase::Internal::Type::BaseModel + attr_accessor credit_limit: Integer + + def initialize: (credit_limit: Integer) -> void + + def to_hash: -> { credit_limit: Integer } + end end end end diff --git a/sig/increase/models/balance_lookup.rbs b/sig/increase/models/balance_lookup.rbs index 738557ad..34895d59 100644 --- a/sig/increase/models/balance_lookup.rbs +++ b/sig/increase/models/balance_lookup.rbs @@ -5,6 +5,7 @@ module Increase account_id: String, available_balance: Integer, current_balance: Integer, + loan: Increase::BalanceLookup::Loan?, type: Increase::Models::BalanceLookup::type_ } @@ -15,12 +16,15 @@ module Increase attr_accessor current_balance: Integer + attr_accessor loan: Increase::BalanceLookup::Loan? + attr_accessor type: Increase::Models::BalanceLookup::type_ def initialize: ( account_id: String, available_balance: Integer, current_balance: Integer, + loan: Increase::BalanceLookup::Loan?, type: Increase::Models::BalanceLookup::type_ ) -> void @@ -28,9 +32,33 @@ module Increase account_id: String, available_balance: Integer, current_balance: Integer, + loan: Increase::BalanceLookup::Loan?, type: Increase::Models::BalanceLookup::type_ } + type loan = + { due_at: Time?, due_balance: Integer, past_due_balance: Integer } + + class Loan < Increase::Internal::Type::BaseModel + attr_accessor due_at: Time? + + attr_accessor due_balance: Integer + + attr_accessor past_due_balance: Integer + + def initialize: ( + due_at: Time?, + due_balance: Integer, + past_due_balance: Integer + ) -> void + + def to_hash: -> { + due_at: Time?, + due_balance: Integer, + past_due_balance: Integer + } + end + type type_ = :balance_lookup module Type diff --git a/sig/increase/models/program.rbs b/sig/increase/models/program.rbs index a046403d..7fe99570 100644 --- a/sig/increase/models/program.rbs +++ b/sig/increase/models/program.rbs @@ -8,6 +8,7 @@ module Increase created_at: Time, default_digital_card_profile_id: String?, interest_rate: String, + lending: Increase::Program::Lending?, name: String, type: Increase::Models::Program::type_, updated_at: Time @@ -26,6 +27,8 @@ module Increase attr_accessor interest_rate: String + attr_accessor lending: Increase::Program::Lending? + attr_accessor name: String attr_accessor type: Increase::Models::Program::type_ @@ -39,6 +42,7 @@ module Increase created_at: Time, default_digital_card_profile_id: String?, interest_rate: String, + lending: Increase::Program::Lending?, name: String, type: Increase::Models::Program::type_, updated_at: Time @@ -51,6 +55,7 @@ module Increase created_at: Time, default_digital_card_profile_id: String?, interest_rate: String, + lending: Increase::Program::Lending?, name: String, type: Increase::Models::Program::type_, updated_at: Time @@ -73,6 +78,16 @@ module Increase def self?.values: -> ::Array[Increase::Models::Program::bank] end + type lending = { maximum_extendable_credit: Integer } + + class Lending < Increase::Internal::Type::BaseModel + attr_accessor maximum_extendable_credit: Integer + + def initialize: (maximum_extendable_credit: Integer) -> void + + def to_hash: -> { maximum_extendable_credit: Integer } + end + type type_ = :program module Type diff --git a/sig/increase/models/simulations/program_create_params.rbs b/sig/increase/models/simulations/program_create_params.rbs index e648605d..9a89ef22 100644 --- a/sig/increase/models/simulations/program_create_params.rbs +++ b/sig/increase/models/simulations/program_create_params.rbs @@ -5,6 +5,7 @@ module Increase { name: String, bank: Increase::Models::Simulations::ProgramCreateParams::bank, + lending_maximum_extendable_credit: Integer, reserve_account_id: String } & Increase::Internal::Type::request_parameters @@ -21,6 +22,10 @@ module Increase Increase::Models::Simulations::ProgramCreateParams::bank ) -> Increase::Models::Simulations::ProgramCreateParams::bank + attr_reader lending_maximum_extendable_credit: Integer? + + def lending_maximum_extendable_credit=: (Integer) -> Integer + attr_reader reserve_account_id: String? def reserve_account_id=: (String) -> String @@ -28,6 +33,7 @@ module Increase def initialize: ( name: String, ?bank: Increase::Models::Simulations::ProgramCreateParams::bank, + ?lending_maximum_extendable_credit: Integer, ?reserve_account_id: String, ?request_options: Increase::request_opts ) -> void @@ -35,6 +41,7 @@ module Increase def to_hash: -> { name: String, bank: Increase::Models::Simulations::ProgramCreateParams::bank, + lending_maximum_extendable_credit: Integer, reserve_account_id: String, request_options: Increase::RequestOptions } diff --git a/sig/increase/resources/accounts.rbs b/sig/increase/resources/accounts.rbs index 99070a3a..ec0e18aa 100644 --- a/sig/increase/resources/accounts.rbs +++ b/sig/increase/resources/accounts.rbs @@ -4,7 +4,9 @@ module Increase def create: ( name: String, ?entity_id: String, + ?funding: Increase::Models::AccountCreateParams::funding, ?informational_entity_id: String, + ?loan: Increase::AccountCreateParams::Loan, ?program_id: String, ?request_options: Increase::request_opts ) -> Increase::Account @@ -16,6 +18,7 @@ module Increase def update: ( String account_id, + ?loan: Increase::AccountUpdateParams::Loan, ?name: String, ?request_options: Increase::request_opts ) -> Increase::Account diff --git a/sig/increase/resources/simulations/programs.rbs b/sig/increase/resources/simulations/programs.rbs index 0624e327..b86ee155 100644 --- a/sig/increase/resources/simulations/programs.rbs +++ b/sig/increase/resources/simulations/programs.rbs @@ -5,6 +5,7 @@ module Increase def create: ( name: String, ?bank: Increase::Models::Simulations::ProgramCreateParams::bank, + ?lending_maximum_extendable_credit: Integer, ?reserve_account_id: String, ?request_options: Increase::request_opts ) -> Increase::Program diff --git a/test/increase/resources/account_statements_test.rb b/test/increase/resources/account_statements_test.rb index ebed26dd..2926021b 100644 --- a/test/increase/resources/account_statements_test.rb +++ b/test/increase/resources/account_statements_test.rb @@ -17,6 +17,7 @@ def test_retrieve created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan | nil, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, @@ -46,6 +47,7 @@ def test_list created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan | nil, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, diff --git a/test/increase/resources/accounts_test.rb b/test/increase/resources/accounts_test.rb index baadae9b..1c7be5bd 100644 --- a/test/increase/resources/accounts_test.rb +++ b/test/increase/resources/accounts_test.rb @@ -19,11 +19,13 @@ def test_create_required_params created_at: Time, currency: Increase::Account::Currency, entity_id: String, + funding: Increase::Account::Funding | nil, idempotency_key: String | nil, informational_entity_id: String | nil, interest_accrued: String, interest_accrued_at: Date | nil, interest_rate: String, + loan: Increase::Account::Loan | nil, name: String, program_id: String, status: Increase::Account::Status, @@ -48,11 +50,13 @@ def test_retrieve created_at: Time, currency: Increase::Account::Currency, entity_id: String, + funding: Increase::Account::Funding | nil, idempotency_key: String | nil, informational_entity_id: String | nil, interest_accrued: String, interest_accrued_at: Date | nil, interest_rate: String, + loan: Increase::Account::Loan | nil, name: String, program_id: String, status: Increase::Account::Status, @@ -77,11 +81,13 @@ def test_update created_at: Time, currency: Increase::Account::Currency, entity_id: String, + funding: Increase::Account::Funding | nil, idempotency_key: String | nil, informational_entity_id: String | nil, interest_accrued: String, interest_accrued_at: Date | nil, interest_rate: String, + loan: Increase::Account::Loan | nil, name: String, program_id: String, status: Increase::Account::Status, @@ -113,11 +119,13 @@ def test_list created_at: Time, currency: Increase::Account::Currency, entity_id: String, + funding: Increase::Account::Funding | nil, idempotency_key: String | nil, informational_entity_id: String | nil, interest_accrued: String, interest_accrued_at: Date | nil, interest_rate: String, + loan: Increase::Account::Loan | nil, name: String, program_id: String, status: Increase::Account::Status, @@ -138,6 +146,7 @@ def test_balance account_id: String, available_balance: Integer, current_balance: Integer, + loan: Increase::BalanceLookup::Loan | nil, type: Increase::BalanceLookup::Type } end @@ -159,11 +168,13 @@ def test_close created_at: Time, currency: Increase::Account::Currency, entity_id: String, + funding: Increase::Account::Funding | nil, idempotency_key: String | nil, informational_entity_id: String | nil, interest_accrued: String, interest_accrued_at: Date | nil, interest_rate: String, + loan: Increase::Account::Loan | nil, name: String, program_id: String, status: Increase::Account::Status, diff --git a/test/increase/resources/programs_test.rb b/test/increase/resources/programs_test.rb index 44a6043b..8e67b011 100644 --- a/test/increase/resources/programs_test.rb +++ b/test/increase/resources/programs_test.rb @@ -18,6 +18,7 @@ def test_retrieve created_at: Time, default_digital_card_profile_id: String | nil, interest_rate: String, + lending: Increase::Program::Lending | nil, name: String, type: Increase::Program::Type, updated_at: Time @@ -47,6 +48,7 @@ def test_list created_at: Time, default_digital_card_profile_id: String | nil, interest_rate: String, + lending: Increase::Program::Lending | nil, name: String, type: Increase::Program::Type, updated_at: Time diff --git a/test/increase/resources/simulations/account_statements_test.rb b/test/increase/resources/simulations/account_statements_test.rb index b2376a08..316109e6 100644 --- a/test/increase/resources/simulations/account_statements_test.rb +++ b/test/increase/resources/simulations/account_statements_test.rb @@ -17,6 +17,7 @@ def test_create_required_params created_at: Time, ending_balance: Integer, file_id: String, + loan: Increase::AccountStatement::Loan | nil, starting_balance: Integer, statement_period_end: Time, statement_period_start: Time, diff --git a/test/increase/resources/simulations/programs_test.rb b/test/increase/resources/simulations/programs_test.rb index a60e90f0..9e508e6d 100644 --- a/test/increase/resources/simulations/programs_test.rb +++ b/test/increase/resources/simulations/programs_test.rb @@ -18,6 +18,7 @@ def test_create_required_params created_at: Time, default_digital_card_profile_id: String | nil, interest_rate: String, + lending: Increase::Program::Lending | nil, name: String, type: Increase::Program::Type, updated_at: Time