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



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

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @report_period = params.dig(:report_period)
    @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_amountDouble

Returns The sum of the outstanding balance of open invoices over 90 days from the calculation month.

Returns:

  • (Double)

    The sum of the outstanding balance of open invoices over 90 days from the calculation month



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

def at_risk_amount
  @at_risk_amount
end

#at_risk_countInt32

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



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

def at_risk_count
  @at_risk_count
end

#at_risk_count_percentageDouble

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



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

def at_risk_count_percentage
  @at_risk_count_percentage
end

#at_risk_percentageDouble

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



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

def at_risk_percentage
  @at_risk_percentage
end

#group_keyUuid

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](developer.lockstep.io/docs/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](developer.lockstep.io/docs/accounts-and-groupkeys).



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

def group_key
  @group_key
end

#invoice_month_nameString

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



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

def invoice_month_name
  @invoice_month_name
end

#report_periodDate-time

Returns The month the risk rate was calculated for.

Returns:

  • (Date-time)

    The month the risk rate was calculated for



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

def report_period
  @report_period
end

#total_invoice_amountDouble

Returns The sum of the total amount for invoices in the calculation month.

Returns:

  • (Double)

    The sum of the total amount for invoices in the calculation month



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

def total_invoice_amount
  @total_invoice_amount
end

#total_invoice_countInt32

Returns The count of all invoices in the calculation month.

Returns:

  • (Int32)

    The count of all invoices in the calculation month



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

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



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 78

def as_json(options={})
    {
        'groupKey' => @group_key,
        'reportPeriod' => @report_period,
        '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



94
95
96
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 94

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