Class: LockstepSdk::RiskRateModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/risk_rate_model.rb

Overview

Represents a risk rate calculation for a single month

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ RiskRateModel

Initialize the RiskRateModel using the provided prototype



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 25

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @base_currency_code = params.dig(:base_currency_code)
    @report_period = params.dig(:report_period)
    @report_date = params.dig(:report_date)
    @invoice_month_name = params.dig(:invoice_month_name)
    @total_invoice_count = params.dig(:total_invoice_count)
    @total_invoice_amount = params.dig(:total_invoice_amount)
    @at_risk_count = params.dig(:at_risk_count)
    @at_risk_amount = params.dig(:at_risk_amount)
    @at_risk_count_percentage = params.dig(:at_risk_count_percentage)
    @at_risk_percentage = params.dig(:at_risk_percentage)
end

Instance Attribute Details

#at_risk_amount ⇒ Double

Returns The sum of the outstanding balance of open invoices over 90 days from the calculation month in the group's base currency.

Returns:

  • (Double) —

    The sum of the outstanding balance of open invoices over 90 days from the calculation month in the group's base currency.



73
74
75
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 73

def at_risk_amount
  @at_risk_amount
end

#at_risk_count ⇒ Int32

Returns The count of open invoices over 90 days from the calculation month.

Returns:

  • (Int32) —

    The count of open invoices over 90 days from the calculation month



69
70
71
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 69

def at_risk_count
  @at_risk_count
end

#at_risk_count_percentage ⇒ Double

Returns The percentage of all open invoices for the calculation month that are over 90 days based on count.

Returns:

  • (Double) —

    The percentage of all open invoices for the calculation month that are over 90 days based on count



77
78
79
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 77

def at_risk_count_percentage
  @at_risk_count_percentage
end

#at_risk_percentage ⇒ Double

Returns The percentage of all open invoices for the calculation month that are over 90 days based on outstanding balance.

Returns:

  • (Double) —

    The percentage of all open invoices for the calculation month that are over 90 days based on outstanding balance



81
82
83
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 81

def at_risk_percentage
  @at_risk_percentage
end

#base_currency_code ⇒ String

Returns The base currency code of the group.

Returns:

  • (String) —

    The base currency code of the group.



45
46
47
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 45

def base_currency_code
  @base_currency_code
end

#group_key ⇒ Uuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see Accounts and GroupKeys.

Returns:

  • (Uuid) —

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see Accounts and GroupKeys.



41
42
43
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 41

def group_key
  @group_key
end

#invoice_month_name ⇒ String

Returns The string name of the month the risk rate was calculated for.

Returns:

  • (String) —

    The string name of the month the risk rate was calculated for



57
58
59
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 57

def invoice_month_name
  @invoice_month_name
end

#report_date ⇒ Date-time

Returns The month the risk rate was calculated for.

Returns:

  • (Date-time) —

    The month the risk rate was calculated for



53
54
55
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 53

def report_date
  @report_date
end

#report_period ⇒ Date-time

Returns The month the risk rate was calculated for.

Returns:

  • (Date-time) —

    The month the risk rate was calculated for



49
50
51
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 49

def report_period
  @report_period
end

#total_invoice_amount ⇒ Double

Returns The sum of the total amount for invoices in the calculation month in the group's base currency.

Returns:

  • (Double) —

    The sum of the total amount for invoices in the calculation month in the group's base currency.



65
66
67
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 65

def total_invoice_amount
  @total_invoice_amount
end

#total_invoice_count ⇒ Int32

Returns The count of all invoices in the calculation month.

Returns:

  • (Int32) —

    The count of all invoices in the calculation month



61
62
63
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 61

def total_invoice_count
  @total_invoice_count
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object) —

    This object as a JSON key-value structure



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 85

def as_json(options={})
    {
        'groupKey' => @group_key,
        'baseCurrencyCode' => @base_currency_code,
        'reportPeriod' => @report_period,
        'reportDate' => @report_date,
        'invoiceMonthName' => @invoice_month_name,
        'totalInvoiceCount' => @total_invoice_count,
        'totalInvoiceAmount' => @total_invoice_amount,
        'atRiskCount' => @at_risk_count,
        'atRiskAmount' => @at_risk_amount,
        'atRiskCountPercentage' => @at_risk_count_percentage,
        'atRiskPercentage' => @at_risk_percentage,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String) —

    This object converted to a JSON string



103
104
105
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 103

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end