Class: LockstepSdk::BatchSyncModel
- Inherits:
-
Object
- Object
- LockstepSdk::BatchSyncModel
- Defined in:
- lib/lockstep_sdk/models/batch_sync_model.rb
Overview
A BatchSyncModel contains a collection of records to load into the Lockstep Platform. Data contained in this batch will be merged with your existing data. Each record will be matched with existing data inside the Lockstep Platform using the [Identity Column](developer.lockstep.io/docs/identity-columns) rules. Any record that represents a new AppEnrollmentId+ErpKey will be inserted. A record that matches an existing AppEnrollmentId+ErpKey will be updated, but only if the data has changed.
A Sync process permits either a complete data file or a partial / delta data file. Lockstep recommends using a sliding time window to avoid the risk of clock skew errors that might accidentally omit records. Best practice is to run a Sync process daily, and to export all data that has changed in the past 48 hours.
Instance Attribute Summary collapse
-
#companies ⇒ CompanySyncModel
A list of Company records to merge with your Lockstep Platform data.
-
#contacts ⇒ ContactSyncModel
A list of Contact records to merge with your Lockstep Platform data.
-
#credit_memo_applications ⇒ CreditMemoAppliedSyncModel
A list of CreditMemoApplied records to merge with your Lockstep Platform data.
-
#custom_fields ⇒ CustomFieldSyncModel
A list of CustomField records to merge with your Lockstep Platform data.
-
#financial_account_balance_histories ⇒ FinancialAccountBalanceHistorySyncModel
A list of FinancialAccountBalanceHistory records to merge with your Lockstep Platform data.
-
#financial_accounts ⇒ FinancialAccountSyncModel
A list of FinancialAccount records to merge with your Lockstep Platform data.
-
#financial_year_settings ⇒ FinancialYearSettingSyncModel
A list of FinancialYearSetting records to merge with your Lockstep Platform data.
-
#invoice_lines ⇒ InvoiceLineSyncModel
A list of InvoiceLine records to merge with your Lockstep Platform data.
-
#invoices ⇒ InvoiceSyncModel
A list of Invoice records to merge with your Lockstep Platform data.
-
#payment_applications ⇒ PaymentAppliedSyncModel
A list of PaymentApplied records to merge with your Lockstep Platform data.
-
#payments ⇒ PaymentSyncModel
A list of Payment records to merge with your Lockstep Platform data.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ BatchSyncModel
constructor
Initialize the BatchSyncModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ BatchSyncModel
Initialize the BatchSyncModel using the provided prototype
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 33 def initialize(params = {}) @companies = params.dig(:companies) @contacts = params.dig(:contacts) @credit_memo_applications = params.dig(:credit_memo_applications) @invoices = params.dig(:invoices) @invoice_lines = params.dig(:invoice_lines) @custom_fields = params.dig(:custom_fields) @payments = params.dig(:payments) @payment_applications = params.dig(:payment_applications) @financial_year_settings = params.dig(:financial_year_settings) @financial_accounts = params.dig(:financial_accounts) @financial_account_balance_histories = params.dig(:financial_account_balance_histories) end |
Instance Attribute Details
#companies ⇒ CompanySyncModel
Returns A list of Company records to merge with your Lockstep Platform data.
49 50 51 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 49 def companies @companies end |
#contacts ⇒ ContactSyncModel
Returns A list of Contact records to merge with your Lockstep Platform data.
53 54 55 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 53 def contacts @contacts end |
#credit_memo_applications ⇒ CreditMemoAppliedSyncModel
Returns A list of CreditMemoApplied records to merge with your Lockstep Platform data.
57 58 59 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 57 def credit_memo_applications @credit_memo_applications end |
#custom_fields ⇒ CustomFieldSyncModel
Returns A list of CustomField records to merge with your Lockstep Platform data.
69 70 71 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 69 def custom_fields @custom_fields end |
#financial_account_balance_histories ⇒ FinancialAccountBalanceHistorySyncModel
Returns A list of FinancialAccountBalanceHistory records to merge with your Lockstep Platform data.
89 90 91 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 89 def financial_account_balance_histories @financial_account_balance_histories end |
#financial_accounts ⇒ FinancialAccountSyncModel
Returns A list of FinancialAccount records to merge with your Lockstep Platform data.
85 86 87 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 85 def financial_accounts @financial_accounts end |
#financial_year_settings ⇒ FinancialYearSettingSyncModel
Returns A list of FinancialYearSetting records to merge with your Lockstep Platform data.
81 82 83 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 81 def financial_year_settings @financial_year_settings end |
#invoice_lines ⇒ InvoiceLineSyncModel
Returns A list of InvoiceLine records to merge with your Lockstep Platform data.
65 66 67 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 65 def invoice_lines @invoice_lines end |
#invoices ⇒ InvoiceSyncModel
Returns A list of Invoice records to merge with your Lockstep Platform data.
61 62 63 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 61 def invoices @invoices end |
#payment_applications ⇒ PaymentAppliedSyncModel
Returns A list of PaymentApplied records to merge with your Lockstep Platform data.
77 78 79 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 77 def payment_applications @payment_applications end |
#payments ⇒ PaymentSyncModel
Returns A list of Payment records to merge with your Lockstep Platform data.
73 74 75 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 73 def payments @payments end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 93 def as_json(={}) { 'companies' => @companies, 'contacts' => @contacts, 'creditMemoApplications' => @credit_memo_applications, 'invoices' => @invoices, 'invoiceLines' => @invoice_lines, 'customFields' => @custom_fields, 'payments' => @payments, 'paymentApplications' => @payment_applications, 'financialYearSettings' => @financial_year_settings, 'financialAccounts' => @financial_accounts, 'financialAccountBalanceHistories' => @financial_account_balance_histories, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
111 112 113 |
# File 'lib/lockstep_sdk/models/batch_sync_model.rb', line 111 def to_json(*) "[#{as_json(*options).to_json(*options)}]" end |