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
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_amount ⇒ Double
Returns 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_count ⇒ Int32
Returns 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_percentage ⇒ Double
Returns 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_percentage ⇒ Double
Returns 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_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).
42 43 44 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 42 def group_key @group_key end |
#invoice_month_name ⇒ String
Returns 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_period ⇒ Date-time
Returns 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_amount ⇒ Double
Returns 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_count ⇒ Int32
Returns 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.
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(={}) { '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.
94 95 96 |
# File 'lib/lockstep_sdk/models/risk_rate_model.rb', line 94 def to_json(*) "[#{as_json(*).to_json(*)}]" end |