Class: LockstepSdk::RiskRateModel
- Inherits:
-
Object
- Object
- LockstepSdk::RiskRateModel
- Defined in:
- lib/lockstep_sdk/models/risk_rate_model.rb
Overview
Represents a risk rate calculation for a single month
Instance Attribute Summary collapse
-
#at_risk_amount ⇒ Double
The sum of the outstanding balance of open invoices over 90 days from the calculation month.
-
#at_risk_count ⇒ Int32
The count of open invoices over 90 days from the calculation month.
-
#at_risk_count_percentage ⇒ Double
The percentage of all open invoices for the calculation month that are over 90 days based on count.
-
#at_risk_percentage ⇒ Double
The percentage of all open invoices for the calculation month that are over 90 days based on outstanding balance.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#invoice_month_name ⇒ String
The string name of the month the risk rate was calculated for.
-
#report_period ⇒ Date-time
The month the risk rate was calculated for.
-
#total_invoice_amount ⇒ Double
The sum of the total amount for invoices in the calculation month.
-
#total_invoice_count ⇒ Int32
The count of all invoices in the calculation month.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ RiskRateModel
constructor
Initialize the RiskRateModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ RiskRateModel
Initialize the RiskRateModel using the provided prototype
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 26 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_amount ⇒ Double
Returns The sum of the outstanding balance of open invoices over 90 days from the calculation month.
51 52 53 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 51 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.
49 50 51 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 49 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.
53 54 55 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 53 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.
55 56 57 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 55 def at_risk_percentage @at_risk_percentage 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](developer.lockstep.io/docs/accounts-and-groupkeys).
39 40 41 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 39 def group_key @group_key end |
#invoice_month_name ⇒ String
Returns The string name of the month the risk rate was calculated for.
43 44 45 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 43 def invoice_month_name @invoice_month_name end |
#report_period ⇒ Date-time
Returns The month the risk rate was calculated for.
41 42 43 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 41 def report_period @report_period end |
#total_invoice_amount ⇒ Double
Returns The sum of the total amount for invoices in the calculation month.
47 48 49 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 47 def total_invoice_amount @total_invoice_amount end |
#total_invoice_count ⇒ Int32
Returns The count of all invoices in the calculation month.
45 46 47 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 45 def total_invoice_count @total_invoice_count end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 58 def as_json(={}) { '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.
73 74 75 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 73 def to_json(*) "[#{as_json(*).to_json(*)}]" end |