Class: LockstepSdk::CompanySyncModel

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

Overview

The CompanySyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. To import data from an external system, convert your original data into the CompanySyncModel format and call the [Upload Sync File API](developer.lockstep.io/reference/post_api-v1-sync-zip). This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep platform.

Once imported, this record will be available in the Lockstep API as a [CompanyModel](developer.lockstep.io/docs/companymodel).

For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CompanySyncModel

Initialize the CompanySyncModel using the provided prototype



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 33

def initialize(params = {})
    @on_match_action = params.dig(:on_match_action)
    @erp_key = params.dig(:erp_key)
    @company_name = params.dig(:company_name)
    @company_type = params.dig(:company_type)
    @parent_company_erp_key = params.dig(:parent_company_erp_key)
    @is_active = params.dig(:is_active)
    @default_currency_code = params.dig(:default_currency_code)
    @company_logo_url = params.dig(:company_logo_url)
    @primary_contact_erp_key = params.dig(:primary_contact_erp_key)
    @address1 = params.dig(:address1)
    @address2 = params.dig(:address2)
    @address3 = params.dig(:address3)
    @city = params.dig(:city)
    @state_region = params.dig(:state_region)
    @postal_code = params.dig(:postal_code)
    @country = params.dig(:country)
    @phone_number = params.dig(:phone_number)
    @fax_number = params.dig(:fax_number)
    @created = params.dig(:created)
    @modified = params.dig(:modified)
    @tax_id = params.dig(:tax_id)
    @duns_number = params.dig(:duns_number)
    @ap_email_address = params.dig(:ap_email_address)
    @ar_email_address = params.dig(:ar_email_address)
    @preferred_delivery_method = params.dig(:preferred_delivery_method)
    @email_address = params.dig(:email_address)
    @external_reference = params.dig(:external_reference)
    @company_registration_number = params.dig(:company_registration_number)
end

Instance Attribute Details

#address1String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



102
103
104
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 102

def address1
  @address1
end

#address2String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



106
107
108
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 106

def address2
  @address2
end

#address3String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



110
111
112
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 110

def address3
  @address3
end

#ap_email_addressString

Returns If you know the AP (accounts payable) email address of this company, fill it in here. This is the email address where you would send questions to the company if the company owed you money.

Returns:

  • (String)

    If you know the AP (accounts payable) email address of this company, fill it in here. This is the email address where you would send questions to the company if the company owed you money.



154
155
156
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 154

def ap_email_address
  @ap_email_address
end

#ar_email_addressString

Returns If you know the AR (accounts receivable) email address of this company, fill it in here. This is the email address where you would send questions to the company if you owed this company money.

Returns:

  • (String)

    If you know the AR (accounts receivable) email address of this company, fill it in here. This is the email address where you would send questions to the company if you owed this company money.



158
159
160
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 158

def ar_email_address
  @ar_email_address
end

#cityString

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



114
115
116
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 114

def city
  @city
end

#company_logo_urlString

Returns The URL of this company’s logo, if known.

Returns:

  • (String)

    The URL of this company’s logo, if known.



94
95
96
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 94

def company_logo_url
  @company_logo_url
end

#company_nameString

Returns A friendly, short name of the company.

Returns:

  • (String)

    A friendly, short name of the company.



74
75
76
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 74

def company_name
  @company_name
end

#company_registration_numberString

Returns A unique identification number assigned to the company by the national registration office.

Returns:

  • (String)

    A unique identification number assigned to the company by the national registration office.



174
175
176
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 174

def company_registration_number
  @company_registration_number
end

#company_typeString

Returns This field indicates the type of company. It can be one of a limited number of values: ‘Company`, `Customer`, `Group`, `Vendor`, or `Third Party`. A company that represents both a customer and a vendor is identified as a `CustomerVendor`. When loading data into Lockstep, you should focus on the distinction between a company that is part of your own enterprise, or a company that is external to your enterprise. For a company that is within your enterprise, you should set this value to be `Company`. For a company that is external to your enterprise, you should set this value to either `Customer`, `Vendor`, `Third Party`, or `CustomerVendor`. If you don’t know what value to choose, select ‘CustomerVendor`.

Returns:

  • (String)

    This field indicates the type of company. It can be one of a limited number of values: ‘Company`, `Customer`, `Group`, `Vendor`, or `Third Party`. A company that represents both a customer and a vendor is identified as a `CustomerVendor`. When loading data into Lockstep, you should focus on the distinction between a company that is part of your own enterprise, or a company that is external to your enterprise. For a company that is within your enterprise, you should set this value to be `Company`. For a company that is external to your enterprise, you should set this value to either `Customer`, `Vendor`, `Third Party`, or `CustomerVendor`. If you don’t know what value to choose, select ‘CustomerVendor`.



78
79
80
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 78

def company_type
  @company_type
end

#countryString

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



126
127
128
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 126

def country
  @country
end

#createdDate-time

Returns If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.



138
139
140
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 138

def created
  @created
end

#default_currency_codeString

Returns The default currency code for transactions related to this company. For a list of currency codes, see [Query Currencies](developer.lockstep.io/reference/get_api-v1-definitions-currencies).

Returns:



90
91
92
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 90

def default_currency_code
  @default_currency_code
end

#duns_numberString

Returns The Dun and Bradstreet number for this company, if known.

Returns:

  • (String)

    The Dun and Bradstreet number for this company, if known.



150
151
152
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 150

def duns_number
  @duns_number
end

#email_addressString

Returns The company email address.

Returns:

  • (String)

    The company email address.



166
167
168
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 166

def email_address
  @email_address
end

#erp_keyString

Returns This is the primary key of the Company record. For this field, you should use whatever the company’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your company records in a database, whatever the primary key for the company table is in the database should be the ‘ErpKey`. Example: If you use a financial system such as Quickbooks or Xero, look for the primary ID number of the company record within that financial system. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    This is the primary key of the Company record. For this field, you should use whatever the company’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your company records in a database, whatever the primary key for the company table is in the database should be the ‘ErpKey`. Example: If you use a financial system such as Quickbooks or Xero, look for the primary ID number of the company record within that financial system. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



70
71
72
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 70

def erp_key
  @erp_key
end

#external_referenceString

Returns An external reference that identifies the Company from the originating ERP system, separate from the ErpKey.

Returns:

  • (String)

    An external reference that identifies the Company from the originating ERP system, separate from the ErpKey.



170
171
172
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 170

def external_reference
  @external_reference
end

#fax_numberString

Returns The main fax number of this company.

Returns:

  • (String)

    The main fax number of this company.



134
135
136
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 134

def fax_number
  @fax_number
end

#is_activeBoolean

Returns This flag indicates whether the company is currently active. An inactive company will be hidden from the user interface but will still be available for querying.

Returns:

  • (Boolean)

    This flag indicates whether the company is currently active. An inactive company will be hidden from the user interface but will still be available for querying.



86
87
88
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 86

def is_active
  @is_active
end

#modifiedDate-time

Returns If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.



142
143
144
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 142

def modified
  @modified
end

#on_match_actionMatchAction

Returns Indicates what action to take when an existing object has been found during the sync process.

Returns:

  • (MatchAction)

    Indicates what action to take when an existing object has been found during the sync process.



66
67
68
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 66

def on_match_action
  @on_match_action
end

#parent_company_erp_keyString

Returns If this company has a parent company, identify the parent company’s ‘ErpKey` value here. This value should be the original primary key or unique ID of the parent company to this company belongs. This value should match the original ErpKey field on the parent company. If this company is not a child company, leave this field null.

Returns:

  • (String)

    If this company has a parent company, identify the parent company’s ‘ErpKey` value here. This value should be the original primary key or unique ID of the parent company to this company belongs. This value should match the original ErpKey field on the parent company. If this company is not a child company, leave this field null.



82
83
84
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 82

def parent_company_erp_key
  @parent_company_erp_key
end

#phone_numberString

Returns The main phone number of this company.

Returns:

  • (String)

    The main phone number of this company.



130
131
132
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 130

def phone_number
  @phone_number
end

#postal_codeString

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



122
123
124
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 122

def postal_code
  @postal_code
end

#preferred_delivery_methodString

Returns Indicates the preferred invoice delivery method. Examples include Print, Email, Fax.

Returns:

  • (String)

    Indicates the preferred invoice delivery method. Examples include Print, Email, Fax



162
163
164
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 162

def preferred_delivery_method
  @preferred_delivery_method
end

#primary_contact_erp_keyString

Returns The ‘ErpKey` of the primary contact for this company. This value should match the `ErpKey` value of the [Importing Contacts](developer.lockstep.io/docs/importing-contacts) record for the contact table.

Returns:



98
99
100
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 98

def primary_contact_erp_key
  @primary_contact_erp_key
end

#state_regionString

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



118
119
120
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 118

def state_region
  @state_region
end

#tax_idString

Returns The company’s Tax ID number for the appropriate government for this company.

Returns:

  • (String)

    The company’s Tax ID number for the appropriate government for this company.



146
147
148
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 146

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



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 178

def as_json(options={})
    {
        'onMatchAction' => @on_match_action,
        'erpKey' => @erp_key,
        'companyName' => @company_name,
        'companyType' => @company_type,
        'parentCompanyErpKey' => @parent_company_erp_key,
        'isActive' => @is_active,
        'defaultCurrencyCode' => @default_currency_code,
        'companyLogoUrl' => @company_logo_url,
        'primaryContactErpKey' => @primary_contact_erp_key,
        'address1' => @address1,
        'address2' => @address2,
        'address3' => @address3,
        'city' => @city,
        'stateRegion' => @state_region,
        'postalCode' => @postal_code,
        'country' => @country,
        'phoneNumber' => @phone_number,
        'faxNumber' => @fax_number,
        'created' => @created,
        'modified' => @modified,
        'taxId' => @tax_id,
        'dunsNumber' => @duns_number,
        'apEmailAddress' => @ap_email_address,
        'arEmailAddress' => @ar_email_address,
        'preferredDeliveryMethod' => @preferred_delivery_method,
        'emailAddress' => @email_address,
        'externalReference' => @external_reference,
        'companyRegistrationNumber' => @company_registration_number,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



213
214
215
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 213

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