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_status ⇒ String
An optional field including status codes.
-
#company_type ⇒ String
This field indicates the type of company.
-
#country ⇒ String
The company’s primary mailing address information This will be validated by the /api/v1/countries data set.
-
#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.
-
#erp_key ⇒ String
This is the primary key of the Company record.
-
#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.
-
#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.
-
#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
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
#address1 ⇒ String
Returns 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 |
#address2 ⇒ String
Returns 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 |
#address3 ⇒ String
Returns 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_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.
152 153 154 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 152 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.
156 157 158 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 156 def ar_email_address @ar_email_address end |
#city ⇒ String
Returns 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_url ⇒ String
Returns 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_name ⇒ String
Returns 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_status ⇒ String
Returns 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_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`.
72 73 74 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 72 def company_type @company_type end |
#country ⇒ String
Returns 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 |
#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.
136 137 138 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 136 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). This will be validated by the /api/v1/currencies data set.
88 89 90 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 88 def default_currency_code @default_currency_code end |
#duns_number ⇒ String
Returns 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_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).
64 65 66 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 64 def erp_key @erp_key end |
#fax_number ⇒ String
Returns 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_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.
84 85 86 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 84 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.
140 141 142 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 140 def modified @modified 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.
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_number ⇒ String
Returns 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_code ⇒ String
Returns 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_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.
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_region ⇒ String
Returns 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_id ⇒ String
Returns 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.
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(={}) { '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.
191 192 193 |
# File 'lib/lockstep_sdk/models/company_sync_model.rb', line 191 def to_json(*) "[#{as_json(*).to_json(*)}]" end |