Class: LockstepSdk::CompanySyncModel
- Inherits:
-
Object
- Object
- LockstepSdk::CompanySyncModel
- 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
-
#address1 ⇒ String
The company’s primary mailing address information.
-
#address2 ⇒ String
The company’s primary mailing address information.
-
#address3 ⇒ String
The company’s primary mailing address information.
-
#ap_email_address ⇒ String
If you know the AP (accounts payable) email address of this company, fill it in here.
-
#ar_email_address ⇒ String
If you know the AR (accounts receivable) email address of this company, fill it in here.
-
#city ⇒ String
The company’s primary mailing address information.
-
#company_logo_url ⇒ String
The URL of this company’s logo, if known.
-
#company_name ⇒ String
A friendly, short name of the company.
-
#company_type ⇒ String
This field indicates the type of company.
-
#country ⇒ String
The company’s primary mailing address information.
-
#created ⇒ Date-time
If known, the date when this record was created according to the originating financial system in which this record is maintained.
-
#default_currency_code ⇒ String
The default currency code for transactions related to this company.
-
#duns_number ⇒ String
The Dun and Bradstreet number for this company, if known.
-
#email_address ⇒ String
The company email address.
-
#erp_key ⇒ String
This is the primary key of the Company record.
-
#external_reference ⇒ String
An external reference that identifies the Company from the originating ERP system, separate from the ErpKey.
-
#fax_number ⇒ String
The main fax number of this company.
-
#is_active ⇒ Boolean
This flag indicates whether the company is currently active.
-
#modified ⇒ 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.
-
#on_match_action ⇒ UpdateAction
Indicates what action to take when a sync model has been found during the sync process.
-
#parent_company_erp_key ⇒ String
If this company has a parent company, identify the parent company’s ‘ErpKey` value here.
-
#phone_number ⇒ String
The main phone number of this company.
-
#postal_code ⇒ String
The company’s primary mailing address information.
-
#preferred_delivery_method ⇒ String
Indicates the preferred invoice delivery method.
-
#primary_contact_erp_key ⇒ String
The ‘ErpKey` of the primary contact for this company.
-
#state_region ⇒ String
The company’s primary mailing address information.
-
#tax_id ⇒ String
The company’s Tax ID number for the appropriate government for this company.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ CompanySyncModel
constructor
Initialize the CompanySyncModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
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 |
# 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) end |
Instance Attribute Details
#address1 ⇒ String
Returns The company’s primary mailing address information.
101 102 103 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 101 def address1 @address1 end |
#address2 ⇒ String
Returns The company’s primary mailing address information.
105 106 107 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 105 def address2 @address2 end |
#address3 ⇒ String
Returns The company’s primary mailing address information.
109 110 111 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 109 def address3 @address3 end |
#ap_email_address ⇒ String
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.
153 154 155 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 153 def ap_email_address @ap_email_address end |
#ar_email_address ⇒ String
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.
157 158 159 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 157 def ar_email_address @ar_email_address end |
#city ⇒ String
Returns The company’s primary mailing address information.
113 114 115 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 113 def city @city end |
#company_logo_url ⇒ String
Returns The URL of this company’s logo, if known.
93 94 95 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 93 def company_logo_url @company_logo_url end |
#company_name ⇒ String
Returns A friendly, short name of the company.
73 74 75 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 73 def company_name @company_name end |
#company_type ⇒ String
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`.
77 78 79 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 77 def company_type @company_type end |
#country ⇒ String
Returns The company’s primary mailing address information.
125 126 127 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 125 def country @country end |
#created ⇒ Date-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.
137 138 139 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 137 def created @created end |
#default_currency_code ⇒ String
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).
89 90 91 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 89 def default_currency_code @default_currency_code end |
#duns_number ⇒ String
Returns The Dun and Bradstreet number for this company, if known.
149 150 151 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 149 def duns_number @duns_number end |
#email_address ⇒ String
Returns The company email address.
165 166 167 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 165 def email_address @email_address end |
#erp_key ⇒ String
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).
69 70 71 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 69 def erp_key @erp_key end |
#external_reference ⇒ String
Returns An external reference that identifies the Company from the originating ERP system, separate from the ErpKey.
169 170 171 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 169 def external_reference @external_reference end |
#fax_number ⇒ String
Returns The main fax number of this company.
133 134 135 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 133 def fax_number @fax_number end |
#is_active ⇒ Boolean
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.
85 86 87 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 85 def is_active @is_active end |
#modified ⇒ Date-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.
141 142 143 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 141 def modified @modified end |
#on_match_action ⇒ UpdateAction
Returns Indicates what action to take when a sync model has been found during the sync process.
65 66 67 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 65 def on_match_action @on_match_action end |
#parent_company_erp_key ⇒ String
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.
81 82 83 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 81 def parent_company_erp_key @parent_company_erp_key end |
#phone_number ⇒ String
Returns The main phone number of this company.
129 130 131 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 129 def phone_number @phone_number end |
#postal_code ⇒ String
Returns The company’s primary mailing address information.
121 122 123 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 121 def postal_code @postal_code end |
#preferred_delivery_method ⇒ String
Returns Indicates the preferred invoice delivery method. Examples include Print, Email, Fax.
161 162 163 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 161 def preferred_delivery_method @preferred_delivery_method end |
#primary_contact_erp_key ⇒ String
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.
97 98 99 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 97 def primary_contact_erp_key @primary_contact_erp_key end |
#state_region ⇒ String
Returns The company’s primary mailing address information.
117 118 119 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 117 def state_region @state_region end |
#tax_id ⇒ String
Returns The company’s Tax ID number for the appropriate government for this company.
145 146 147 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 145 def tax_id @tax_id end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
173 174 175 176 177 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 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 173 def as_json(={}) { '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, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
207 208 209 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 207 def to_json(*) "[#{as_json(*).to_json(*)}]" end |