Class: LockstepSdk::CustomerSummaryModel

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

Overview

Contains summarized data for a customer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CustomerSummaryModel

Initialize the CustomerSummaryModel using the provided prototype



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 25

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)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @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)
    @closed_invoices_past_thirty_days = params.dig(:closed_invoices_past_thirty_days)
    @amount_collected = params.dig(:amount_collected)
    @amount_collected_past_thirty_days = params.dig(:amount_collected_past_thirty_days)
    @outstanding_amount = params.dig(:outstanding_amount)
    @invoiced_amount_past_thirty_days = params.dig(:invoiced_amount_past_thirty_days)
    @outstanding_amount_past_thirty_days = params.dig(:outstanding_amount_past_thirty_days)
    @invoices_past_thirty_days = params.dig(:invoices_past_thirty_days)
    @amount_past_due = params.dig(:amount_past_due)
    @unapplied_payments = params.dig(:unapplied_payments)
    @unapplied_amount_past_thirty_days = params.dig(:unapplied_amount_past_thirty_days)
    @percent_of_total_ar = params.dig(:percent_of_total_ar)
    @dso = params.dig(:dso)
    @newest_activity = params.dig(:newest_activity)
    @modified = params.dig(:modified)
end

Instance Attribute Details

#amount_collectedDouble

Returns The total from collected payments.

Returns:

  • (Double)

    The total from collected payments.



93
94
95
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 93

def amount_collected
  @amount_collected
end

#amount_collected_past_thirty_daysDouble

Returns The total from collected payments in the past thirty days.

Returns:

  • (Double)

    The total from collected payments in the past thirty days.



97
98
99
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 97

def amount_collected_past_thirty_days
  @amount_collected_past_thirty_days
end

#amount_past_dueDouble

Returns The total amount past due for this customer.

Returns:

  • (Double)

    The total amount past due for this customer.



117
118
119
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 117

def amount_past_due
  @amount_past_due
end

#app_enrollment_idUuid

Returns The app enrollment ID this Customer is associated with.

Returns:

  • (Uuid)

    The app enrollment ID this Customer is associated with



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

def app_enrollment_id
  @app_enrollment_id
end

#closed_invoicesInt32

Returns The number of closed invoices for this customer.

Returns:

  • (Int32)

    The number of closed invoices for this customer.



85
86
87
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 85

def closed_invoices
  @closed_invoices
end

#closed_invoices_past_thirty_daysInt32

Returns The number of closed invoices for this customer in the past thirty days.

Returns:

  • (Int32)

    The number of closed invoices for this customer in the past thirty days.



89
90
91
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 89

def closed_invoices_past_thirty_days
  @closed_invoices_past_thirty_days
end

#company_idUuid

Returns The unique ID of this company.

Returns:

  • (Uuid)

    The unique ID of this company.



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

def company_id
  @company_id
end

#company_nameString

Returns The name of the company.

Returns:

  • (String)

    The name of the company.



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

def company_name
  @company_name
end

#dsoDouble

Returns Daily sales outstanding value for this Customer.

Returns:

  • (Double)

    Daily sales outstanding value for this Customer.



133
134
135
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 133

def dso
  @dso
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).



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

def group_key
  @group_key
end

#invoiced_amount_past_thirty_daysDouble

Returns The total amount invoiced in the past thirty days.

Returns:

  • (Double)

    The total amount invoiced in the past thirty days.



105
106
107
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 105

def invoiced_amount_past_thirty_days
  @invoiced_amount_past_thirty_days
end

#invoices_past_thirty_daysInt32

Returns The number of invoices invoiced in the past thirty days.

Returns:

  • (Int32)

    The number of invoices invoiced in the past thirty days.



113
114
115
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 113

def invoices_past_thirty_days
  @invoices_past_thirty_days
end

#modifiedDate-time

Returns The modified date of the customer.

Returns:

  • (Date-time)

    The modified date of the customer.



141
142
143
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 141

def modified
  @modified
end

#newest_activityDate

Returns The date stamp for the newest Activity on this Customer.

Returns:

  • (Date)

    The date stamp for the newest Activity on this Customer.



137
138
139
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 137

def newest_activity
  @newest_activity
end

#outstanding_amountDouble

Returns The total balance of outstanding invoices.

Returns:

  • (Double)

    The total balance of outstanding invoices.



101
102
103
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 101

def outstanding_amount
  @outstanding_amount
end

#outstanding_amount_past_thirty_daysDouble

Returns The total amount outstanding from the invoices invoiced in the past thirty days.

Returns:

  • (Double)

    The total amount outstanding from the invoices invoiced in the past thirty days.



109
110
111
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 109

def outstanding_amount_past_thirty_days
  @outstanding_amount_past_thirty_days
end

#outstanding_invoicesInt32

Returns The number of outstanding invoices for this customer.

Returns:

  • (Int32)

    The number of outstanding invoices for this customer.



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

def outstanding_invoices
  @outstanding_invoices
end

#percent_of_total_arDouble

Returns Portion of Total AR for this Customer that is Past due. (TotalPastDue / Total AR).

Returns:

  • (Double)

    Portion of Total AR for this Customer that is Past due. (TotalPastDue / Total AR).



129
130
131
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 129

def percent_of_total_ar
  @percent_of_total_ar
end

#primary_contactString

Returns The name of the primary contact.

Returns:

  • (String)

    The name of the primary contact.



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

def primary_contact
  @primary_contact
end

#total_invoices_openInt32

Returns The number of open invoices.

Returns:

  • (Int32)

    The number of open invoices.



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

def total_invoices_open
  @total_invoices_open
end

#total_invoices_past_dueInt32

Returns The number of past due invoices.

Returns:

  • (Int32)

    The number of past due invoices.



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

def total_invoices_past_due
  @total_invoices_past_due
end

#unapplied_amount_past_thirty_daysDouble

Returns The total value of unapplied Payments for this Customer in the past thirty days.

Returns:

  • (Double)

    The total value of unapplied Payments for this Customer in the past thirty days.



125
126
127
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 125

def unapplied_amount_past_thirty_days
  @unapplied_amount_past_thirty_days
end

#unapplied_paymentsDouble

Returns The total value of unapplied Payments for this Customer.

Returns:

  • (Double)

    The total value of unapplied Payments for this Customer.



121
122
123
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 121

def unapplied_payments
  @unapplied_payments
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



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 145

def as_json(options={})
    {
        'groupKey' => @group_key,
        'companyId' => @company_id,
        'companyName' => @company_name,
        'primaryContact' => @primary_contact,
        'appEnrollmentId' => @app_enrollment_id,
        'outstandingInvoices' => @outstanding_invoices,
        'totalInvoicesOpen' => @total_invoices_open,
        'totalInvoicesPastDue' => @total_invoices_past_due,
        'closedInvoices' => @closed_invoices,
        'closedInvoicesPastThirtyDays' => @closed_invoices_past_thirty_days,
        'amountCollected' => @amount_collected,
        'amountCollectedPastThirtyDays' => @amount_collected_past_thirty_days,
        'outstandingAmount' => @outstanding_amount,
        'invoicedAmountPastThirtyDays' => @invoiced_amount_past_thirty_days,
        'outstandingAmountPastThirtyDays' => @outstanding_amount_past_thirty_days,
        'invoicesPastThirtyDays' => @invoices_past_thirty_days,
        'amountPastDue' => @amount_past_due,
        'unappliedPayments' => @unapplied_payments,
        'unappliedAmountPastThirtyDays' => @unapplied_amount_past_thirty_days,
        'percentOfTotalAr' => @percent_of_total_ar,
        'dso' => @dso,
        'newestActivity' => @newest_activity,
        'modified' => @modified,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



175
176
177
# File 'lib/lockstep_sdk/models/customer_summary_model.rb', line 175

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