Class: ThePlaidApi::CreditSessionBankEmploymentStatus

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

Overview

Status of the Bank Employment Link session. ‘APPROVED`: User has approved and verified their employment. `NO_EMPLOYMENTS_FOUND`: We attempted, but were unable to find any employment in the connected account. `EMPLOYER_NOT_LISTED`: The user explicitly indicated that they did not see their current or previous employer in the list of employer names found. `STARTED`: The user began the bank income portion of the link flow. `INTERNAL_ERROR`: The user encountered an internal error.

Constant Summary collapse

CREDIT_SESSION_BANK_EMPLOYMENT_STATUS =
[
  # TODO: Write general description for APPROVED
  APPROVED = 'APPROVED'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = APPROVED) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/the_plaid_api/models/credit_session_bank_employment_status.rb', line 32

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

  str = value.to_s.strip

  case str.downcase
  when 'approved' then APPROVED
  when 'no_employers_found' then NO_EMPLOYERS_FOUND
  when 'employer_not_listed' then EMPLOYER_NOT_LISTED
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/the_plaid_api/models/credit_session_bank_employment_status.rb', line 26

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

  CREDIT_SESSION_BANK_EMPLOYMENT_STATUS.include?(value)
end