Class: LockstepSdk::CustomerSummaryModel
- Inherits:
-
Object
- Object
- LockstepSdk::CustomerSummaryModel
- Defined in:
- lib/lockstep_sdk/models/customer_summary_model.rb
Overview
Contains summarized data for a customer
Instance Attribute Summary collapse
-
#amount_collected ⇒ Double
The total from collected payments.
-
#amount_past_due ⇒ Double
The total amount past due for this customer.
-
#closed_invoices ⇒ Int32
The number of closed invoices for this customer.
-
#company_id ⇒ Uuid
The unique ID of this company.
-
#company_name ⇒ String
The name of the company.
-
#dso ⇒ Double
Daily sales outstanding value for this Customer.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#newest_activity ⇒ Date
The date stamp for the newest Activity on this Customer.
-
#outstanding_amount ⇒ Double
The total balance of outstanding invoices.
-
#outstanding_invoices ⇒ Int32
The number of outstanding invoices for this customer.
-
#percent_of_total_ar ⇒ Double
Portion of Total AR for this Customer that is Past due.
-
#primary_contact ⇒ String
The name of the primary contact.
-
#total_invoices_open ⇒ Int32
The number of open invoices.
-
#total_invoices_past_due ⇒ Int32
The number of past due invoices.
-
#unapplied_payments ⇒ Double
The total value of unapplied Payments for this Customer.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ CustomerSummaryModel
constructor
Initialize the CustomerSummaryModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ CustomerSummaryModel
Initialize the CustomerSummaryModel using the provided prototype
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 28 def initialize(params = {}) @group_key = params.dig(:group_key) @company_id = params.dig(:company_id) @company_name = params.dig(:company_name) @primary_contact = params.dig(:primary_contact) @outstanding_invoices = params.dig(:outstanding_invoices) @total_invoices_open = params.dig(:total_invoices_open) @total_invoices_past_due = params.dig(:total_invoices_past_due) @closed_invoices = params.dig(:closed_invoices) @amount_collected = params.dig(:amount_collected) @outstanding_amount = params.dig(:outstanding_amount) @amount_past_due = params.dig(:amount_past_due) @unapplied_payments = params.dig(:unapplied_payments) @percent_of_total_ar = params.dig(:percent_of_total_ar) @dso = params.dig(:dso) @newest_activity = params.dig(:newest_activity) end |
Instance Attribute Details
#amount_collected ⇒ Double
Returns The total from collected payments.
80 81 82 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 80 def amount_collected @amount_collected end |
#amount_past_due ⇒ Double
Returns The total amount past due for this customer.
88 89 90 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 88 def amount_past_due @amount_past_due end |
#closed_invoices ⇒ Int32
Returns The number of closed invoices for this customer.
76 77 78 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 76 def closed_invoices @closed_invoices end |
#company_id ⇒ Uuid
Returns The unique ID of this company.
52 53 54 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 52 def company_id @company_id end |
#company_name ⇒ String
Returns The name of the company.
56 57 58 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 56 def company_name @company_name end |
#dso ⇒ Double
Returns Daily sales outstanding value for this Customer.
100 101 102 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 100 def dso @dso 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).
48 49 50 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 48 def group_key @group_key end |
#newest_activity ⇒ Date
Returns The date stamp for the newest Activity on this Customer.
104 105 106 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 104 def newest_activity @newest_activity end |
#outstanding_amount ⇒ Double
Returns The total balance of outstanding invoices.
84 85 86 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 84 def outstanding_amount @outstanding_amount end |
#outstanding_invoices ⇒ Int32
Returns The number of outstanding invoices for this customer.
64 65 66 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 64 def outstanding_invoices @outstanding_invoices end |
#percent_of_total_ar ⇒ Double
Returns Portion of Total AR for this Customer that is Past due. (TotalPastDue / Total AR).
96 97 98 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 96 def percent_of_total_ar @percent_of_total_ar end |
#primary_contact ⇒ String
Returns The name of the primary contact.
60 61 62 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 60 def primary_contact @primary_contact end |
#total_invoices_open ⇒ Int32
Returns The number of open invoices.
68 69 70 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 68 def total_invoices_open @total_invoices_open end |
#total_invoices_past_due ⇒ Int32
Returns The number of past due invoices.
72 73 74 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 72 def total_invoices_past_due @total_invoices_past_due end |
#unapplied_payments ⇒ Double
Returns The total value of unapplied Payments for this Customer.
92 93 94 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 92 def unapplied_payments @unapplied_payments end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 108 def as_json(={}) { 'groupKey' => @group_key, 'companyId' => @company_id, 'companyName' => @company_name, 'primaryContact' => @primary_contact, 'outstandingInvoices' => @outstanding_invoices, 'totalInvoicesOpen' => @total_invoices_open, 'totalInvoicesPastDue' => @total_invoices_past_due, 'closedInvoices' => @closed_invoices, 'amountCollected' => @amount_collected, 'outstandingAmount' => @outstanding_amount, 'amountPastDue' => @amount_past_due, 'unappliedPayments' => @unapplied_payments, 'percentOfTotalAr' => @percent_of_total_ar, 'dso' => @dso, 'newestActivity' => @newest_activity, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
130 131 132 |
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 130 def to_json(*) "[#{as_json(*).to_json(*)}]" end |