Class: ThePlaidApi::CreditBankIncomeCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/credit_bank_income_category.rb

Overview

The income category. ‘BANK_INTEREST`: Interest earned from a bank account. `BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. `CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. `CASH_DEPOSIT`: A cash or check deposit. `CHILD_SUPPORT`: Child support payments received. `GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. `LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. `OTHER`: Income that could not be categorized as any other income category. `MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. `RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. `RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. `SALARY`: Payment from an employer to an earner or other form of permanent employment. `TAX_REFUND`: A tax refund. `TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. `UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.

Constant Summary collapse

CREDIT_BANK_INCOME_CATEGORY =
[
  # TODO: Write general description for SALARY
  SALARY = 'SALARY'.freeze,

  # TODO: Write general description for UNEMPLOYMENT
  UNEMPLOYMENT = 'UNEMPLOYMENT'.freeze,

  # TODO: Write general description for CASH
  CASH = 'CASH'.freeze,

  # TODO: Write general description for GIG_ECONOMY
  GIG_ECONOMY = 'GIG_ECONOMY'.freeze,

  # TODO: Write general description for RENTAL
  RENTAL = 'RENTAL'.freeze,

  # TODO: Write general description for CHILD_SUPPORT
  CHILD_SUPPORT = 'CHILD_SUPPORT'.freeze,

  # TODO: Write general description for MILITARY
  MILITARY = 'MILITARY'.freeze,

  # TODO: Write general description for RETIREMENT
  RETIREMENT = 'RETIREMENT'.freeze,

  # TODO: Write general description for LONG_TERM_DISABILITY
  LONG_TERM_DISABILITY = 'LONG_TERM_DISABILITY'.freeze,

  # TODO: Write general description for BANK_INTEREST
  BANK_INTEREST = 'BANK_INTEREST'.freeze,

  # TODO: Write general description for CASH_DEPOSIT
  CASH_DEPOSIT = 'CASH_DEPOSIT'.freeze,

  # TODO: Write general description for TRANSFER_FROM_APPLICATION
  TRANSFER_FROM_APPLICATION = 'TRANSFER_FROM_APPLICATION'.freeze,

  # TODO: Write general description for TAX_REFUND
  TAX_REFUND = 'TAX_REFUND'.freeze,

  # TODO: Write general description for BENEFIT_OTHER
  BENEFIT_OTHER = 'BENEFIT_OTHER'.freeze,

  # TODO: Write general description for OTHER
  OTHER = 'OTHER'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SALARY) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/credit_bank_income_category.rb', line 84

def self.from_value(value, default_value = SALARY)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'salary' then SALARY
  when 'unemployment' then UNEMPLOYMENT
  when 'cash' then CASH
  when 'gig_economy' then GIG_ECONOMY
  when 'rental' then RENTAL
  when 'child_support' then CHILD_SUPPORT
  when 'military' then MILITARY
  when 'retirement' then RETIREMENT
  when 'long_term_disability' then LONG_TERM_DISABILITY
  when 'bank_interest' then BANK_INTEREST
  when 'cash_deposit' then CASH_DEPOSIT
  when 'transfer_from_application' then TRANSFER_FROM_APPLICATION
  when 'tax_refund' then TAX_REFUND
  when 'benefit_other' then BENEFIT_OTHER
  when 'other' then OTHER
  else
    default_value
  end
end

.validate(value) ⇒ Object



78
79
80
81
82
# File 'lib/the_plaid_api/models/credit_bank_income_category.rb', line 78

def self.validate(value)
  return false if value.nil?

  CREDIT_BANK_INCOME_CATEGORY.include?(value)
end