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



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
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 35

def initialize(params = {})
    @erp_key = params.dig(:erp_key)
    @company_name = params.dig(:company_name)
    @company_type = params.dig(:company_type)
    @company_status = params.dig(:company_status)
    @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)
end

Instance Attribute Details

#address1String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



100
101
102
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 100

def address1
  @address1
end

#address2String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



104
105
106
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 104

def address2
  @address2
end

#address3String

Returns The company’s primary mailing address information.

Returns:

  • (String)

    The company’s primary mailing address information



108
109
110
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 108

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.



152
153
154
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 152

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.



156
157
158
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 156

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



112
113
114
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 112

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.



92
93
94
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 92

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.



68
69
70
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 68

def company_name
  @company_name
end

#company_statusString

Returns An optional field including status codes. Defined status codes are ‘Active` and `Inactive`.

Returns:

  • (String)

    An optional field including status codes. Defined status codes are ‘Active` and `Inactive`.



76
77
78
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 76

def company_status
  @company_status
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`.



72
73
74
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 72

def company_type
  @company_type
end

#countryString

Returns The company’s primary mailing address information This will be validated by the /api/v1/countries data set.

Returns:

  • (String)

    The company’s primary mailing address information This will be validated by the /api/v1/countries data set



124
125
126
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 124

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.



136
137
138
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 136

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). This will be validated by the /api/v1/currencies data set.

Returns:



88
89
90
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 88

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.



148
149
150
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 148

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



64
65
66
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 64

def erp_key
  @erp_key
end

#fax_numberString

Returns The main fax number of this company.

Returns:

  • (String)

    The main fax number of this company.



132
133
134
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 132

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.



84
85
86
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 84

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.



140
141
142
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 140

def modified
  @modified
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.



80
81
82
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 80

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.



128
129
130
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 128

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



120
121
122
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 120

def postal_code
  @postal_code
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:



96
97
98
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 96

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



116
117
118
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 116

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.



144
145
146
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 144

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



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 160

def as_json(options={})
    {
        'erpKey' => @erp_key,
        'companyName' => @company_name,
        'companyType' => @company_type,
        'companyStatus' => @company_status,
        '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,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



191
192
193
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 191

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