Class: Tufy::BuildAccountSegment

Inherits:
BuildSegment show all
Defined in:
lib/tufy/build_account_segment.rb

Defined Under Namespace

Modules: Constants

Constant Summary collapse

REQUIRED_KEYS =
[
  :account_number,
  :restructured_account_number,
  :user_id,
  :account_status,
  :account_type,
  :currency_code,
  :opened_date,
  :payment_amount,
  :credit_limit_or_loan_amount,
  :shared_by,
  :outstanding_balance,
  :interest_and_fees,
  :number_of_days_past_due,
  :past_due_amount,
  :installment_amount,
  :number_of_installments,
  :payment_frequency,
  :expiry_date,
  :consumer_or_commercial,
  :legal_action,
]

Class Method Summary collapse

Class Method Details

.past_due_code(days_past_due) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/tufy/build_account_segment.rb', line 34

def self.past_due_code(days_past_due)
  case days_past_due
  when 0
    0
  when (1..30)
    1
  else
    ((days_past_due - 1) / 30) * 30
  end
end