Class: LockstepSdk::CustomerDetailsModel

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

Overview

Contains customer details data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CustomerDetailsModel

Initialize the CustomerDetailsModel using the provided prototype



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_details_model.rb', line 28

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @customer_id = params.dig(:customer_id)
    @name = params.dig(:name)
    @address1 = params.dig(:address1)
    @address2 = params.dig(:address2)
    @address3 = params.dig(:address3)
    @city = params.dig(:city)
    @state = params.dig(:state)
    @postal_code = params.dig(:postal_code)
    @country = params.dig(:country)
    @phone_number = params.dig(:phone_number)
    @fax_number = params.dig(:fax_number)
    @email = params.dig(:email)
    @contact_id = params.dig(:contact_id)
    @contact_name = params.dig(:contact_name)
    @contact_email = params.dig(:contact_email)
    @outstanding_invoices = params.dig(:outstanding_invoices)
    @outstanding_amount = params.dig(:outstanding_amount)
    @amount_past_due = params.dig(:amount_past_due)
    @payments = params.dig(:payments)
end

Instance Attribute Details

#address1String

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

def address1
  @address1
end

#address2String

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

def address2
  @address2
end

#address3String

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

def address3
  @address3
end

#amount_past_dueDouble

Returns Customer total past due amount.

Returns:

  • (Double)

    Customer total past due amount



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

def amount_past_due
  @amount_past_due
end

#cityString

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

def city
  @city
end

#contact_emailString

Returns Customer primary contact email address.

Returns:

  • (String)

    Customer primary contact email address



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

def contact_email
  @contact_email
end

#contact_idUuid

Returns Customer primary contact id.

Returns:

  • (Uuid)

    Customer primary contact id



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

def contact_id
  @contact_id
end

#contact_nameString

Returns Customer primary contact name.

Returns:

  • (String)

    Customer primary contact name



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

def contact_name
  @contact_name
end

#countryString

Returns Customer address country.

Returns:

  • (String)

    Customer address country



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

def country
  @country
end

#customer_idUuid

Returns The unique ID of this customer.

Returns:

  • (Uuid)

    The unique ID of this customer



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

def customer_id
  @customer_id
end

#emailString

Returns Customer AR email address.

Returns:

  • (String)

    Customer AR email address



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

def email
  @email
end

#fax_numberString

Returns Customer fax number.

Returns:

  • (String)

    Customer fax number



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

def fax_number
  @fax_number
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_details_model.rb', line 53

def group_key
  @group_key
end

#nameString

Returns The unique ID of this customer.

Returns:

  • (String)

    The unique ID of this customer



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

def name
  @name
end

#outstanding_amountDouble

Returns Customer total outstanding invoice amount.

Returns:

  • (Double)

    Customer total outstanding invoice amount



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

def outstanding_amount
  @outstanding_amount
end

#outstanding_invoicesInt32

Returns Customer number of outstanding invoices.

Returns:

  • (Int32)

    Customer number of outstanding invoices



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

def outstanding_invoices
  @outstanding_invoices
end

#paymentsCustomerDetailsPaymentModel

Returns Customer payments collected.

Returns:



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

def payments
  @payments
end

#phone_numberString

Returns Customer phone number.

Returns:

  • (String)

    Customer phone number



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

def phone_number
  @phone_number
end

#postal_codeString

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

def postal_code
  @postal_code
end

#stateString

Returns Customer address info.

Returns:

  • (String)

    Customer address info



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

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



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/lockstep_sdk/models/customer_details_model.rb', line 133

def as_json(options={})
    {
        'groupKey' => @group_key,
        'customerId' => @customer_id,
        'name' => @name,
        'address1' => @address1,
        'address2' => @address2,
        'address3' => @address3,
        'city' => @city,
        'state' => @state,
        'postalCode' => @postal_code,
        'country' => @country,
        'phoneNumber' => @phone_number,
        'faxNumber' => @fax_number,
        'email' => @email,
        'contactId' => @contact_id,
        'contactName' => @contact_name,
        'contactEmail' => @contact_email,
        'outstandingInvoices' => @outstanding_invoices,
        'outstandingAmount' => @outstanding_amount,
        'amountPastDue' => @amount_past_due,
        'payments' => @payments,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



160
161
162
# File 'lib/lockstep_sdk/models/customer_details_model.rb', line 160

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