lockstep_sdk 2022.4.32.0 → 2022.6.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lockstep_sdk/clients/activities_client.rb +0 -1
- data/lib/lockstep_sdk/clients/api_keys_client.rb +0 -1
- data/lib/lockstep_sdk/clients/app_enrollments_client.rb +0 -1
- data/lib/lockstep_sdk/clients/applications_client.rb +0 -1
- data/lib/lockstep_sdk/clients/attachments_client.rb +2 -2
- data/lib/lockstep_sdk/clients/code_definitions_client.rb +0 -1
- data/lib/lockstep_sdk/clients/companies_client.rb +0 -1
- data/lib/lockstep_sdk/clients/contacts_client.rb +0 -1
- data/lib/lockstep_sdk/clients/credit_memo_applied_client.rb +0 -1
- data/lib/lockstep_sdk/clients/currencies_client.rb +0 -1
- data/lib/lockstep_sdk/clients/custom_field_definitions_client.rb +0 -1
- data/lib/lockstep_sdk/clients/custom_field_values_client.rb +0 -1
- data/lib/lockstep_sdk/clients/definitions_client.rb +0 -1
- data/lib/lockstep_sdk/clients/emails_client.rb +0 -1
- data/lib/lockstep_sdk/clients/invoice_history_client.rb +0 -1
- data/lib/lockstep_sdk/clients/invoices_client.rb +0 -1
- data/lib/lockstep_sdk/clients/leads_client.rb +0 -1
- data/lib/lockstep_sdk/clients/notes_client.rb +0 -1
- data/lib/lockstep_sdk/clients/payment_applications_client.rb +0 -1
- data/lib/lockstep_sdk/clients/payments_client.rb +0 -1
- data/lib/lockstep_sdk/clients/provisioning_client.rb +0 -5
- data/lib/lockstep_sdk/clients/reports_client.rb +0 -1
- data/lib/lockstep_sdk/clients/status_client.rb +0 -1
- data/lib/lockstep_sdk/clients/sync_client.rb +15 -2
- data/lib/lockstep_sdk/clients/user_accounts_client.rb +0 -1
- data/lib/lockstep_sdk/clients/user_roles_client.rb +0 -1
- data/lib/lockstep_sdk/clients/webhooks_client.rb +91 -0
- data/lib/lockstep_sdk/lockstep_api.rb +8 -3
- data/lib/lockstep_sdk/models/activity_model.rb +0 -1
- data/lib/lockstep_sdk/models/activity_stream_item_model.rb +0 -1
- data/lib/lockstep_sdk/models/activity_xref_model.rb +0 -1
- data/lib/lockstep_sdk/models/aging_model.rb +0 -1
- data/lib/lockstep_sdk/models/api_key_model.rb +0 -1
- data/lib/lockstep_sdk/models/app_enrollment_custom_field_model.rb +0 -1
- data/lib/lockstep_sdk/models/app_enrollment_model.rb +0 -1
- data/lib/lockstep_sdk/models/application_model.rb +0 -1
- data/lib/lockstep_sdk/models/ar_aging_header_info_model.rb +0 -1
- data/lib/lockstep_sdk/models/ar_header_info_model.rb +0 -1
- data/lib/lockstep_sdk/models/at_risk_invoice_summary_model.rb +0 -1
- data/lib/lockstep_sdk/models/attachment_header_info_model.rb +0 -1
- data/lib/lockstep_sdk/models/attachment_model.rb +12 -1
- data/lib/lockstep_sdk/models/batch_sync_model.rb +99 -0
- data/lib/lockstep_sdk/models/bulk_currency_conversion_model.rb +0 -1
- data/lib/lockstep_sdk/models/cashflow_report_model.rb +0 -1
- data/lib/lockstep_sdk/models/code_definition_model.rb +0 -1
- data/lib/lockstep_sdk/models/company_model.rb +0 -1
- data/lib/lockstep_sdk/models/company_sync_model.rb +195 -0
- data/lib/lockstep_sdk/models/connector_info_model.rb +0 -1
- data/lib/lockstep_sdk/models/contact_model.rb +0 -1
- data/lib/lockstep_sdk/models/contact_sync_model.rb +177 -0
- data/lib/lockstep_sdk/models/country_model.rb +0 -1
- data/lib/lockstep_sdk/models/credit_memo_applied_model.rb +6 -7
- data/lib/lockstep_sdk/models/credit_memo_applied_sync_model.rb +99 -0
- data/lib/lockstep_sdk/models/credit_memo_invoice_model.rb +0 -1
- data/lib/lockstep_sdk/models/currency_model.rb +0 -1
- data/lib/lockstep_sdk/models/currency_rate_model.rb +0 -1
- data/lib/lockstep_sdk/models/custom_field_definition_model.rb +0 -1
- data/lib/lockstep_sdk/models/custom_field_sync_model.rb +97 -0
- data/lib/lockstep_sdk/models/custom_field_value_model.rb +0 -1
- data/lib/lockstep_sdk/models/customer_details_model.rb +0 -1
- data/lib/lockstep_sdk/models/customer_details_payment_model.rb +0 -1
- data/lib/lockstep_sdk/models/customer_summary_model.rb +0 -1
- data/lib/lockstep_sdk/models/daily_sales_outstanding_report_model.rb +0 -1
- data/lib/lockstep_sdk/models/developer_account_submit_model.rb +0 -1
- data/lib/lockstep_sdk/models/email_model.rb +0 -1
- data/lib/lockstep_sdk/models/erp_info_data_model.rb +0 -1
- data/lib/lockstep_sdk/models/erp_info_model.rb +0 -1
- data/lib/lockstep_sdk/models/erp_model.rb +0 -1
- data/lib/lockstep_sdk/models/invite_data_model.rb +0 -1
- data/lib/lockstep_sdk/models/invite_model.rb +0 -1
- data/lib/lockstep_sdk/models/invite_submit_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_address_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_history_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_line_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_line_sync_model.rb +303 -0
- data/lib/lockstep_sdk/models/invoice_model.rb +5 -6
- data/lib/lockstep_sdk/models/invoice_payment_detail_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_summary_model.rb +0 -1
- data/lib/lockstep_sdk/models/invoice_sync_model.rb +369 -0
- data/lib/lockstep_sdk/models/lead_model.rb +0 -1
- data/lib/lockstep_sdk/models/note_model.rb +0 -1
- data/lib/lockstep_sdk/models/payment_applied_model.rb +3 -4
- data/lib/lockstep_sdk/models/payment_applied_sync_model.rb +99 -0
- data/lib/lockstep_sdk/models/payment_detail_header_model.rb +0 -1
- data/lib/lockstep_sdk/models/payment_detail_model.rb +0 -1
- data/lib/lockstep_sdk/models/payment_model.rb +7 -8
- data/lib/lockstep_sdk/models/payment_summary_model.rb +0 -1
- data/lib/lockstep_sdk/models/payment_sync_model.rb +147 -0
- data/lib/lockstep_sdk/models/provisioning_finalize_request_model.rb +0 -1
- data/lib/lockstep_sdk/models/provisioning_model.rb +0 -1
- data/lib/lockstep_sdk/models/provisioning_response_model.rb +0 -1
- data/lib/lockstep_sdk/models/risk_rate_model.rb +0 -1
- data/lib/lockstep_sdk/models/state_model.rb +0 -1
- data/lib/lockstep_sdk/models/status_model.rb +0 -1
- data/lib/lockstep_sdk/models/sync_entity_result_model.rb +0 -1
- data/lib/lockstep_sdk/models/sync_request_model.rb +10 -4
- data/lib/lockstep_sdk/models/sync_submit_model.rb +10 -3
- data/lib/lockstep_sdk/models/transfer_owner_model.rb +0 -1
- data/lib/lockstep_sdk/models/transfer_owner_submit_model.rb +0 -1
- data/lib/lockstep_sdk/models/uri_model.rb +49 -0
- data/lib/lockstep_sdk/models/user_account_model.rb +0 -1
- data/lib/lockstep_sdk/models/user_role_model.rb +0 -1
- data/lib/lockstep_sdk/models/webhook_model.rb +137 -0
- data/lib/lockstep_sdk/version.rb +1 -1
- metadata +14 -2
@@ -0,0 +1,99 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Software Development Kit for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Ted Spence <tspence@lockstep.io>
|
10
|
+
# @author Manish Narayan B S <manish.n@lockstep.io>
|
11
|
+
# @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
|
12
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
13
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
14
|
+
#
|
15
|
+
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module LockstepSdk
|
20
|
+
|
21
|
+
##
|
22
|
+
# A BatchSyncModel contains a collection of records to load into the Lockstep Platform. Data contained
|
23
|
+
# in this batch will be merged with your existing data. Each record will be matched with existing data inside
|
24
|
+
# the Lockstep Platform using the [Identity Column](https://developer.lockstep.io/docs/identity-columns) rules.
|
25
|
+
# Any record that represents a new AppEnrollmentId+ErpKey will be inserted. A record that matches an existing
|
26
|
+
# AppEnrollmentId+ErpKey will be updated, but only if the data has changed.
|
27
|
+
#
|
28
|
+
# A Sync process permits either a complete data file or a partial / delta data file. Lockstep recommends
|
29
|
+
# using a sliding time window to avoid the risk of clock skew errors that might accidentally omit records.
|
30
|
+
# Best practice is to run a Sync process daily, and to export all data that has changed in the past 48 hours.
|
31
|
+
class BatchSyncModel
|
32
|
+
|
33
|
+
##
|
34
|
+
# Initialize the BatchSyncModel using the provided prototype
|
35
|
+
def initialize(params = {})
|
36
|
+
@companies = params.dig(:companies)
|
37
|
+
@contacts = params.dig(:contacts)
|
38
|
+
@credit_memo_applications = params.dig(:credit_memo_applications)
|
39
|
+
@invoices = params.dig(:invoices)
|
40
|
+
@invoice_lines = params.dig(:invoice_lines)
|
41
|
+
@custom_fields = params.dig(:custom_fields)
|
42
|
+
@payments = params.dig(:payments)
|
43
|
+
@payment_applications = params.dig(:payment_applications)
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# @return [CompanySyncModel] A list of Company records to merge with your Lockstep Platform data
|
48
|
+
attr_accessor :companies
|
49
|
+
|
50
|
+
##
|
51
|
+
# @return [ContactSyncModel] A list of Contact records to merge with your Lockstep Platform data
|
52
|
+
attr_accessor :contacts
|
53
|
+
|
54
|
+
##
|
55
|
+
# @return [CreditMemoAppliedSyncModel] A list of CreditMemoApplied records to merge with your Lockstep Platform data
|
56
|
+
attr_accessor :credit_memo_applications
|
57
|
+
|
58
|
+
##
|
59
|
+
# @return [InvoiceSyncModel] A list of Invoice records to merge with your Lockstep Platform data
|
60
|
+
attr_accessor :invoices
|
61
|
+
|
62
|
+
##
|
63
|
+
# @return [InvoiceLineSyncModel] A list of InvoiceLine records to merge with your Lockstep Platform data
|
64
|
+
attr_accessor :invoice_lines
|
65
|
+
|
66
|
+
##
|
67
|
+
# @return [CustomFieldSyncModel] A list of CustomField records to merge with your Lockstep Platform data
|
68
|
+
attr_accessor :custom_fields
|
69
|
+
|
70
|
+
##
|
71
|
+
# @return [PaymentSyncModel] A list of Payment records to merge with your Lockstep Platform data
|
72
|
+
attr_accessor :payments
|
73
|
+
|
74
|
+
##
|
75
|
+
# @return [PaymentAppliedSyncModel] A list of PaymentApplied records to merge with your Lockstep Platform data
|
76
|
+
attr_accessor :payment_applications
|
77
|
+
|
78
|
+
##
|
79
|
+
# @return [object] This object as a JSON key-value structure
|
80
|
+
def as_json(options={})
|
81
|
+
{
|
82
|
+
'companies' => @companies,
|
83
|
+
'contacts' => @contacts,
|
84
|
+
'creditMemoApplications' => @credit_memo_applications,
|
85
|
+
'invoices' => @invoices,
|
86
|
+
'invoiceLines' => @invoice_lines,
|
87
|
+
'customFields' => @custom_fields,
|
88
|
+
'payments' => @payments,
|
89
|
+
'paymentApplications' => @payment_applications,
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# @return [String] This object converted to a JSON string
|
95
|
+
def to_json(*options)
|
96
|
+
"[#{as_json(*options).to_json(*options)}]"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Software Development Kit for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Ted Spence <tspence@lockstep.io>
|
10
|
+
# @author Manish Narayan B S <manish.n@lockstep.io>
|
11
|
+
# @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
|
12
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
13
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
14
|
+
#
|
15
|
+
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module LockstepSdk
|
20
|
+
|
21
|
+
##
|
22
|
+
# The CompanySyncModel represents information coming into Lockstep from an external financial system or other
|
23
|
+
# enterprise resource planning system. To import data from an external system, convert your original data into
|
24
|
+
# the CompanySyncModel format and call the [Upload Sync File API](https://developer.lockstep.io/reference/post_api-v1-sync-zip).
|
25
|
+
# This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep
|
26
|
+
# platform.
|
27
|
+
#
|
28
|
+
# Once imported, this record will be available in the Lockstep API as a [CompanyModel](https://developer.lockstep.io/docs/companymodel).
|
29
|
+
#
|
30
|
+
# For more information on writing your own connector, see [Connector Data](https://developer.lockstep.io/docs/connector-data).
|
31
|
+
class CompanySyncModel
|
32
|
+
|
33
|
+
##
|
34
|
+
# Initialize the CompanySyncModel using the provided prototype
|
35
|
+
def initialize(params = {})
|
36
|
+
@erp_key = params.dig(:erp_key)
|
37
|
+
@company_name = params.dig(:company_name)
|
38
|
+
@company_type = params.dig(:company_type)
|
39
|
+
@company_status = params.dig(:company_status)
|
40
|
+
@parent_company_erp_key = params.dig(:parent_company_erp_key)
|
41
|
+
@is_active = params.dig(:is_active)
|
42
|
+
@default_currency_code = params.dig(:default_currency_code)
|
43
|
+
@company_logo_url = params.dig(:company_logo_url)
|
44
|
+
@primary_contact_erp_key = params.dig(:primary_contact_erp_key)
|
45
|
+
@address1 = params.dig(:address1)
|
46
|
+
@address2 = params.dig(:address2)
|
47
|
+
@address3 = params.dig(:address3)
|
48
|
+
@city = params.dig(:city)
|
49
|
+
@state_region = params.dig(:state_region)
|
50
|
+
@postal_code = params.dig(:postal_code)
|
51
|
+
@country = params.dig(:country)
|
52
|
+
@phone_number = params.dig(:phone_number)
|
53
|
+
@fax_number = params.dig(:fax_number)
|
54
|
+
@created = params.dig(:created)
|
55
|
+
@modified = params.dig(:modified)
|
56
|
+
@tax_id = params.dig(:tax_id)
|
57
|
+
@duns_number = params.dig(:duns_number)
|
58
|
+
@ap_email_address = params.dig(:ap_email_address)
|
59
|
+
@ar_email_address = params.dig(:ar_email_address)
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# @return [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](https://developer.lockstep.io/docs/identity-columns).
|
64
|
+
attr_accessor :erp_key
|
65
|
+
|
66
|
+
##
|
67
|
+
# @return [String] A friendly, short name of the company.
|
68
|
+
attr_accessor :company_name
|
69
|
+
|
70
|
+
##
|
71
|
+
# @return [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
|
+
attr_accessor :company_type
|
73
|
+
|
74
|
+
##
|
75
|
+
# @return [String] Either `Active` or `Inactive`.
|
76
|
+
attr_accessor :company_status
|
77
|
+
|
78
|
+
##
|
79
|
+
# @return [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
|
+
attr_accessor :parent_company_erp_key
|
81
|
+
|
82
|
+
##
|
83
|
+
# @return [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
|
+
attr_accessor :is_active
|
85
|
+
|
86
|
+
##
|
87
|
+
# @return [String] The default currency code for transactions related to this company. For a list of currency codes, see [Query Currencies](https://developer.lockstep.io/reference/get_api-v1-definitions-currencies). This will be validated by the /api/v1/currencies data set
|
88
|
+
attr_accessor :default_currency_code
|
89
|
+
|
90
|
+
##
|
91
|
+
# @return [Uri] The URL of this company's logo, if known.
|
92
|
+
attr_accessor :company_logo_url
|
93
|
+
|
94
|
+
##
|
95
|
+
# @return [String] The `ErpKey` of the primary contact for this company. This value should match the `ErpKey` value of the [Importing Contacts](https://developer.lockstep.io/docs/importing-contacts) record for the contact table.
|
96
|
+
attr_accessor :primary_contact_erp_key
|
97
|
+
|
98
|
+
##
|
99
|
+
# @return [String] The company's primary mailing address information
|
100
|
+
attr_accessor :address1
|
101
|
+
|
102
|
+
##
|
103
|
+
# @return [String] The company's primary mailing address information
|
104
|
+
attr_accessor :address2
|
105
|
+
|
106
|
+
##
|
107
|
+
# @return [String] The company's primary mailing address information
|
108
|
+
attr_accessor :address3
|
109
|
+
|
110
|
+
##
|
111
|
+
# @return [String] The company's primary mailing address information
|
112
|
+
attr_accessor :city
|
113
|
+
|
114
|
+
##
|
115
|
+
# @return [String] The company's primary mailing address information
|
116
|
+
attr_accessor :state_region
|
117
|
+
|
118
|
+
##
|
119
|
+
# @return [String] The company's primary mailing address information
|
120
|
+
attr_accessor :postal_code
|
121
|
+
|
122
|
+
##
|
123
|
+
# @return [String] The company's primary mailing address information This will be validated by the /api/v1/countries data set
|
124
|
+
attr_accessor :country
|
125
|
+
|
126
|
+
##
|
127
|
+
# @return [Tel] The main phone number of this company.
|
128
|
+
attr_accessor :phone_number
|
129
|
+
|
130
|
+
##
|
131
|
+
# @return [Tel] The main fax number of this company.
|
132
|
+
attr_accessor :fax_number
|
133
|
+
|
134
|
+
##
|
135
|
+
# @return [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
|
+
attr_accessor :created
|
137
|
+
|
138
|
+
##
|
139
|
+
# @return [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
|
+
attr_accessor :modified
|
141
|
+
|
142
|
+
##
|
143
|
+
# @return [String] The company's Tax ID number for the appropriate government for this company.
|
144
|
+
attr_accessor :tax_id
|
145
|
+
|
146
|
+
##
|
147
|
+
# @return [String] The Dun and Bradstreet number for this company, if known.
|
148
|
+
attr_accessor :duns_number
|
149
|
+
|
150
|
+
##
|
151
|
+
# @return [Email] 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
|
+
attr_accessor :ap_email_address
|
153
|
+
|
154
|
+
##
|
155
|
+
# @return [Email] 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
|
+
attr_accessor :ar_email_address
|
157
|
+
|
158
|
+
##
|
159
|
+
# @return [object] This object as a JSON key-value structure
|
160
|
+
def as_json(options={})
|
161
|
+
{
|
162
|
+
'erpKey' => @erp_key,
|
163
|
+
'companyName' => @company_name,
|
164
|
+
'companyType' => @company_type,
|
165
|
+
'companyStatus' => @company_status,
|
166
|
+
'parentCompanyErpKey' => @parent_company_erp_key,
|
167
|
+
'isActive' => @is_active,
|
168
|
+
'defaultCurrencyCode' => @default_currency_code,
|
169
|
+
'companyLogoUrl' => @company_logo_url,
|
170
|
+
'primaryContactErpKey' => @primary_contact_erp_key,
|
171
|
+
'address1' => @address1,
|
172
|
+
'address2' => @address2,
|
173
|
+
'address3' => @address3,
|
174
|
+
'city' => @city,
|
175
|
+
'stateRegion' => @state_region,
|
176
|
+
'postalCode' => @postal_code,
|
177
|
+
'country' => @country,
|
178
|
+
'phoneNumber' => @phone_number,
|
179
|
+
'faxNumber' => @fax_number,
|
180
|
+
'created' => @created,
|
181
|
+
'modified' => @modified,
|
182
|
+
'taxId' => @tax_id,
|
183
|
+
'dunsNumber' => @duns_number,
|
184
|
+
'apEmailAddress' => @ap_email_address,
|
185
|
+
'arEmailAddress' => @ar_email_address,
|
186
|
+
}
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] This object converted to a JSON string
|
191
|
+
def to_json(*options)
|
192
|
+
"[#{as_json(*options).to_json(*options)}]"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,177 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Software Development Kit for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Ted Spence <tspence@lockstep.io>
|
10
|
+
# @author Manish Narayan B S <manish.n@lockstep.io>
|
11
|
+
# @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
|
12
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
13
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
14
|
+
#
|
15
|
+
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module LockstepSdk
|
20
|
+
|
21
|
+
##
|
22
|
+
# The ContactSyncModel represents information coming into Lockstep from an external financial system or other
|
23
|
+
# enterprise resource planning system. To import data from an external system, convert your original data into
|
24
|
+
# the ContactSyncModel format and call the [Upload Sync File API](https://developer.lockstep.io/reference/post_api-v1-sync-zip).
|
25
|
+
# This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep
|
26
|
+
# platform.
|
27
|
+
#
|
28
|
+
# Once imported, this record will be available in the Lockstep API as a [ContactModel](https://developer.lockstep.io/docs/contactmodel).
|
29
|
+
#
|
30
|
+
# For more information on writing your own connector, see [Connector Data](https://developer.lockstep.io/docs/connector-data).
|
31
|
+
class ContactSyncModel
|
32
|
+
|
33
|
+
##
|
34
|
+
# Initialize the ContactSyncModel using the provided prototype
|
35
|
+
def initialize(params = {})
|
36
|
+
@erp_key = params.dig(:erp_key)
|
37
|
+
@company_erp_key = params.dig(:company_erp_key)
|
38
|
+
@contact_name = params.dig(:contact_name)
|
39
|
+
@contact_code = params.dig(:contact_code)
|
40
|
+
@title = params.dig(:title)
|
41
|
+
@role_code = params.dig(:role_code)
|
42
|
+
@email_address = params.dig(:email_address)
|
43
|
+
@phone = params.dig(:phone)
|
44
|
+
@fax = params.dig(:fax)
|
45
|
+
@address1 = params.dig(:address1)
|
46
|
+
@address2 = params.dig(:address2)
|
47
|
+
@address3 = params.dig(:address3)
|
48
|
+
@city = params.dig(:city)
|
49
|
+
@state_region = params.dig(:state_region)
|
50
|
+
@postal_code = params.dig(:postal_code)
|
51
|
+
@country_code = params.dig(:country_code)
|
52
|
+
@is_active = params.dig(:is_active)
|
53
|
+
@webpage_url = params.dig(:webpage_url)
|
54
|
+
@picture_url = params.dig(:picture_url)
|
55
|
+
@created = params.dig(:created)
|
56
|
+
@modified = params.dig(:modified)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# @return [String] This is the primary key of the Contact record. For this field, you should use whatever the contact'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 contact records in a database, whatever the primary key for the contact table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns).
|
61
|
+
attr_accessor :erp_key
|
62
|
+
|
63
|
+
##
|
64
|
+
# @return [String] The original primary key or unique ID of the company to which this contact belongs. This value should match the [Company ErpKey](https://developer.lockstep.io/docs/importing-companies#erpkey) field on the [CompanySyncModel](https://developer.lockstep.io/docs/importing-companies).
|
65
|
+
attr_accessor :company_erp_key
|
66
|
+
|
67
|
+
##
|
68
|
+
# @return [String] The name of the contact.
|
69
|
+
attr_accessor :contact_name
|
70
|
+
|
71
|
+
##
|
72
|
+
# @return [String] A friendly human-readable code that describes this Contact.
|
73
|
+
attr_accessor :contact_code
|
74
|
+
|
75
|
+
##
|
76
|
+
# @return [String] The title of the contact.
|
77
|
+
attr_accessor :title
|
78
|
+
|
79
|
+
##
|
80
|
+
# @return [String] The role code for the contact.
|
81
|
+
attr_accessor :role_code
|
82
|
+
|
83
|
+
##
|
84
|
+
# @return [Email] The email address of the contact.
|
85
|
+
attr_accessor :email_address
|
86
|
+
|
87
|
+
##
|
88
|
+
# @return [String] The phone number of the contact.
|
89
|
+
attr_accessor :phone
|
90
|
+
|
91
|
+
##
|
92
|
+
# @return [String] The fax number of the contact.
|
93
|
+
attr_accessor :fax
|
94
|
+
|
95
|
+
##
|
96
|
+
# @return [String] The mailing address information for this contact.
|
97
|
+
attr_accessor :address1
|
98
|
+
|
99
|
+
##
|
100
|
+
# @return [String] The mailing address information for this contact.
|
101
|
+
attr_accessor :address2
|
102
|
+
|
103
|
+
##
|
104
|
+
# @return [String] The mailing address information for this contact.
|
105
|
+
attr_accessor :address3
|
106
|
+
|
107
|
+
##
|
108
|
+
# @return [String] The mailing address information for this contact.
|
109
|
+
attr_accessor :city
|
110
|
+
|
111
|
+
##
|
112
|
+
# @return [String] The mailing address information for this contact.
|
113
|
+
attr_accessor :state_region
|
114
|
+
|
115
|
+
##
|
116
|
+
# @return [String] The mailing address information for this contact.
|
117
|
+
attr_accessor :postal_code
|
118
|
+
|
119
|
+
##
|
120
|
+
# @return [String] The mailing address information for this contact. This will be validated by the /api/v1/countries data set
|
121
|
+
attr_accessor :country_code
|
122
|
+
|
123
|
+
##
|
124
|
+
# @return [Boolean] True if this contact is considered "active".
|
125
|
+
attr_accessor :is_active
|
126
|
+
|
127
|
+
##
|
128
|
+
# @return [Uri] A webpage URL for more information about this contact.
|
129
|
+
attr_accessor :webpage_url
|
130
|
+
|
131
|
+
##
|
132
|
+
# @return [Uri] If available, the URL of a photograph that shows this contact.
|
133
|
+
attr_accessor :picture_url
|
134
|
+
|
135
|
+
##
|
136
|
+
# @return [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.
|
137
|
+
attr_accessor :created
|
138
|
+
|
139
|
+
##
|
140
|
+
# @return [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.
|
141
|
+
attr_accessor :modified
|
142
|
+
|
143
|
+
##
|
144
|
+
# @return [object] This object as a JSON key-value structure
|
145
|
+
def as_json(options={})
|
146
|
+
{
|
147
|
+
'erpKey' => @erp_key,
|
148
|
+
'companyErpKey' => @company_erp_key,
|
149
|
+
'contactName' => @contact_name,
|
150
|
+
'contactCode' => @contact_code,
|
151
|
+
'title' => @title,
|
152
|
+
'roleCode' => @role_code,
|
153
|
+
'emailAddress' => @email_address,
|
154
|
+
'phone' => @phone,
|
155
|
+
'fax' => @fax,
|
156
|
+
'address1' => @address1,
|
157
|
+
'address2' => @address2,
|
158
|
+
'address3' => @address3,
|
159
|
+
'city' => @city,
|
160
|
+
'stateRegion' => @state_region,
|
161
|
+
'postalCode' => @postal_code,
|
162
|
+
'countryCode' => @country_code,
|
163
|
+
'isActive' => @is_active,
|
164
|
+
'webpageUrl' => @webpage_url,
|
165
|
+
'pictureUrl' => @picture_url,
|
166
|
+
'created' => @created,
|
167
|
+
'modified' => @modified,
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# @return [String] This object converted to a JSON string
|
173
|
+
def to_json(*options)
|
174
|
+
"[#{as_json(*options).to_json(*options)}]"
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
@@ -10,7 +10,6 @@
|
|
10
10
|
# @author Manish Narayan B S <manish.n@lockstep.io>
|
11
11
|
# @author Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
|
12
12
|
# @copyright 2021-2022 Lockstep, Inc.
|
13
|
-
# @version 2022.4
|
14
13
|
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
15
14
|
#
|
16
15
|
|
@@ -58,11 +57,11 @@ module LockstepSdk
|
|
58
57
|
attr_accessor :group_key
|
59
58
|
|
60
59
|
##
|
61
|
-
# @return [Uuid] The
|
60
|
+
# @return [Uuid] The Lockstep ID of the Invoice to which this credit memo was applied. This Invoice's outstanding balance was reduced by the value of the field `CreditMemoAppliedAmount` on the date `ApplyToInvoiceDate`. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The `InvoiceErpKey` is the Lockstep Platform ID number of Invoice `PO1000578`.
|
62
61
|
attr_accessor :invoice_id
|
63
62
|
|
64
63
|
##
|
65
|
-
# @return [Uuid] The
|
64
|
+
# @return [Uuid] The Lockstep ID of the Invoice of type "Credit Memo" that was consumed in this payment application event. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The `CreditMemoInvoiceId` is the Lockstep Platform ID number of Invoice `CM000123`.
|
66
65
|
attr_accessor :credit_memo_invoice_id
|
67
66
|
|
68
67
|
##
|
@@ -74,11 +73,11 @@ module LockstepSdk
|
|
74
73
|
attr_accessor :entry_number
|
75
74
|
|
76
75
|
##
|
77
|
-
# @return [Date-time]
|
76
|
+
# @return [Date-time] The date on which this credit memo was applied to the Invoice represented by `InvoiceId`.
|
78
77
|
attr_accessor :apply_to_invoice_date
|
79
78
|
|
80
79
|
##
|
81
|
-
# @return [Double]
|
80
|
+
# @return [Double] The amount of the credit memo that was applied to the Invoice represented by `InvoiceId`.
|
82
81
|
attr_accessor :credit_memo_applied_amount
|
83
82
|
|
84
83
|
##
|
@@ -110,11 +109,11 @@ module LockstepSdk
|
|
110
109
|
attr_accessor :notes
|
111
110
|
|
112
111
|
##
|
113
|
-
# @return [CustomFieldDefinitionModel] All definitions attached to this applied Credit Memo. To retrieve this collection, specify `
|
112
|
+
# @return [CustomFieldDefinitionModel] All definitions attached to this applied Credit Memo. To retrieve this collection, specify `CustomFields` in the "Include" parameter for your query.
|
114
113
|
attr_accessor :custom_field_definitions
|
115
114
|
|
116
115
|
##
|
117
|
-
# @return [CustomFieldValueModel] All values attached to this Credit Memo. To retrieve this collection, specify `
|
116
|
+
# @return [CustomFieldValueModel] All values attached to this Credit Memo. To retrieve this collection, specify `CustomFields` in the "Include" parameter for your query.
|
118
117
|
attr_accessor :custom_field_values
|
119
118
|
|
120
119
|
##
|