diff --git a/Gemfile.lock b/Gemfile.lock index 37a9590..2c9d1fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - LockstepSdk (2023.28.10.0) + LockstepSdk (2023.40.72.0) awrence GEM diff --git a/lib/lockstep_sdk/clients/applications_client.rb b/lib/lockstep_sdk/clients/applications_client.rb index 064842c..a8d0afc 100644 --- a/lib/lockstep_sdk/clients/applications_client.rb +++ b/lib/lockstep_sdk/clients/applications_client.rb @@ -32,7 +32,7 @@ def initialize(connection) # See [Applications and Enrollments](https://developer.lockstep.io/docs/applications-and-enrollments) for more information. # # @param id [uuid] The unique ID number of the Application to retrieve - # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Notes, Attachments, CustomFields + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Notes, Attachments, CustomFields, Enrollments def retrieve_application(id:, include_param:) path = "/api/v1/Applications/#{id}" params = {:include => include_param} @@ -91,7 +91,7 @@ def create_applications(body:) # See [Applications and Enrollments](https://developer.lockstep.io/docs/applications-and-enrollments) for more information. # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) - # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Notes, Attachments, CustomFields + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Notes, Attachments, CustomFields, Enrollments # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param page_size [int32] The page size for results (default 250, maximum of 500). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) diff --git a/lib/lockstep_sdk/clients/companies_client.rb b/lib/lockstep_sdk/clients/companies_client.rb index e766ca2..26266de 100644 --- a/lib/lockstep_sdk/clients/companies_client.rb +++ b/lib/lockstep_sdk/clients/companies_client.rb @@ -156,6 +156,20 @@ def query_vendor_summary(filter:, include_param:, order:, page_size:, page_numbe @connection.request(:get, path, nil, params) end + ## + # See [Vendors, Customers, and Companies](https://developer.lockstep.io/docs/companies-customers-and-vendors) for more information. + # + # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available but may be offered in the future + # @param order [string] The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight). + # @param page_size [int32] The page size for results (default 250, maximum of 500) + # @param page_number [int32] The page number for results (default 0) + def query_magic_link_summary(filter:, include_param:, order:, page_size:, page_number:) + path = "/api/v1/Companies/views/magic-link-summary" + params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} + @connection.request(:get, path, nil, params) + end + ## # Retrieves the Company Details specified by this unique identifier, optionally including nested data sets. # diff --git a/lib/lockstep_sdk/clients/definitions_client.rb b/lib/lockstep_sdk/clients/definitions_client.rb index 569fee6..5935124 100644 --- a/lib/lockstep_sdk/clients/definitions_client.rb +++ b/lib/lockstep_sdk/clients/definitions_client.rb @@ -30,6 +30,7 @@ def initialize(connection) # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. # # Your program may want to show a list of countries. The ISO maintains a list of countries called [ISO3166](https://www.iso.org/iso-3166-country-codes.html). For convenience, this list is available in the API. + # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available, but may be offered in the future. # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) @@ -47,6 +48,7 @@ def query_countries(filter:, include_param:, order:, page_size:, page_number:) # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. # # Your app may wish to make use of a reference list that contains names and attributes for all ISO-4217 defined currency codes. This information is provided via a query endpoint so that you can use this API to provide a user selection screen. + # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available, but may be offered in the future. # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) @@ -64,6 +66,7 @@ def query_currencies(filter:, include_param:, order:, page_size:, page_number:) # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. # # Your app may wish to make use of a reference list that contains names and codes for all states in the United States. This information is provided for the United States since many financial systems require mailing addresses that use codes for states. + # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available, but may be offered in the future. # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) @@ -81,6 +84,7 @@ def query_states(filter:, include_param:, order:, page_size:, page_number:) # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. # # Lockstep provides a list of financial systems that may be useful as a selection screen that allows customers to select from a list. You can query these items by name or attributes and use this data source to help users complete a selection. + # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available, but may be offered in the future. # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) diff --git a/lib/lockstep_sdk/clients/invoices_client.rb b/lib/lockstep_sdk/clients/invoices_client.rb index a685b30..e67357a 100644 --- a/lib/lockstep_sdk/clients/invoices_client.rb +++ b/lib/lockstep_sdk/clients/invoices_client.rb @@ -30,7 +30,7 @@ def initialize(connection) # An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the `CompanyId` field, and the recipient of the invoice is identified by the `CustomerId` field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP "key" that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the `TotalAmount` and the `OutstandingBalanceAmount` may be different. # # @param id [uuid] The unique Lockstep Platform ID number of this invoice; NOT the customer's ERP key - # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Addresses, Lines, Payments, Notes, Attachments, Company, Customer, CustomFields, CreditMemos + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Addresses, Lines, Payments, Notes, Attachments, Company, Customer, CustomFields, CreditMemos, WorkflowStatuses def retrieve_invoice(id:, include_param:) path = "/api/v1/Invoices/#{id}" params = {:include => include_param} @@ -60,15 +60,29 @@ def delete_invoice(id:) @connection.request(:delete, path, nil, nil) end + ## + # Retrieves the Invoice Workflow Status Histories specified by the unique identifier of the Invoice. + # + # An Invoice Workflow Status History represents a prior Workflow Status that was assigned to an Invoice. + # + # @param id [uuid] The unique Accounting Data Service Platform ID number of the Invoice. + def retrieve_invoice_workflow_status_histories(id:) + path = "/api/v1/Invoices/#{id}/workflow-status-history" + @connection.request(:get, path, nil, nil) + end + ## # Creates one or more Invoices within this account and returns the records as created. # # An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the `CompanyId` field, and the recipient of the invoice is identified by the `CustomerId` field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP "key" that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the `TotalAmount` and the `OutstandingBalanceAmount` may be different. # - # @param body [InvoiceModel] The Invoices to create - def create_invoices(body:) + # @param customer_company_id [uuid] The ID of the customer company. Only to be used with the UBL file upload multipart/form-data option. + # @param filename [File] The full path of a file to upload to the API + # @param body [InvoiceModel] Upload a UBL file or provide an InvoiceModel array + def create_invoices(customer_company_id:, filename:, body:) path = "/api/v1/Invoices" - @connection.request(:post, path, body, nil) + params = {:customerCompanyId => customer_company_id} + @connection.request(:post, path, body, params) end ## @@ -90,7 +104,7 @@ def delete_invoices(body:) # An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the `CompanyId` field, and the recipient of the invoice is identified by the `CustomerId` field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP "key" that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the `TotalAmount` and the `OutstandingBalanceAmount` may be different. # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) - # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Addresses, Lines, Payments, Notes, Attachments, Company, Customer, CustomFields, CreditMemos + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Addresses, Lines, Payments, Notes, Attachments, Company, Customer, CustomFields, CreditMemos, WorkflowStatuses # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param page_size [int32] The page size for results (default 250, maximum of 500). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) @@ -109,7 +123,7 @@ def query_invoices(filter:, include_param:, order:, page_size:, page_number:) # # Xero supports AR Invoices, AP Invoices, AR Credit Memos, and AP Credit Memos. # - # Sage 50 supports AR Invoices and AR Credit Memos. + # For other ERPs, the supported types will depend on the synced data. # # @param id [uuid] The unique Lockstep Platform ID number of this invoice; NOT the customer's ERP key def retrieve_invoice_pdf(id:) @@ -117,6 +131,23 @@ def retrieve_invoice_pdf(id:) @connection.request(:get, path, nil, nil) end + ## + # Checks for whether a PDF file for this invoice exists if it is of one of the supported invoice types and has been synced using an app enrollment to one of the supported apps. + # + # Sage Intacct supports AR Invoices. + # + # QuickBooks Online supports AR Invoices, and AR Credit Memos. + # + # Xero supports AR Invoices, AP Invoices, AR Credit Memos, and AP Credit Memos. + # + # For other ERPs, the supported types will depend on the synced data. + # + # @param id [uuid] The unique Lockstep Platform ID number of this invoice; NOT the customer's ERP key + def check_invoice_pdf(id:) + path = "/api/v1/Invoices/#{id}/pdf" + @connection.request(:head, path, nil, nil) + end + ## # Queries Invoices for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. Display the results using the Invoice Summary View format. # diff --git a/lib/lockstep_sdk/clients/journal_entries_client.rb b/lib/lockstep_sdk/clients/journal_entries_client.rb new file mode 100644 index 0000000..dd5c585 --- /dev/null +++ b/lib/lockstep_sdk/clients/journal_entries_client.rb @@ -0,0 +1,62 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'awrence' + +class JournalEntriesClient + + ## + # Initialize the JournalEntriesClient class with an API client instance. + # @param connection [LockstepApi] The API client object for this connection + def initialize(connection) + @connection = connection + end + + + ## + # Retrieves the Journal Entry specified by this unique identifier, optionally including nested data sets. + # + # @param id [uuid] The unique Lockstep Platform ID number of this journal entry; NOT the customer's ERP key + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Lines, Attachments + def retrieve_journal_entry(id:, include_param:) + path = "/api/v1/journal-entries/#{id}" + params = {:include => include_param} + @connection.request(:get, path, nil, params) + end + + ## + # Creates one or more Journal Entries within this account and returns the records as created. + # + # @param body [JournalEntryModel] The Journal Entries to create + def create_journal_entries(body:) + path = "/api/v1/journal-entries" + @connection.request(:post, path, body, nil) + end + + ## + # Queries Journal Entries for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. + # + # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. + # + # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Lines, Attachments + # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_size [int32] The page size for results (default 250, maximum of 500). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + def query_journal_entries(filter:, include_param:, order:, page_size:, page_number:) + path = "/api/v1/journal-entries/query" + params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} + @connection.request(:get, path, nil, params) + end +end diff --git a/lib/lockstep_sdk/clients/journal_entry_lines_client.rb b/lib/lockstep_sdk/clients/journal_entry_lines_client.rb new file mode 100644 index 0000000..8bd1aff --- /dev/null +++ b/lib/lockstep_sdk/clients/journal_entry_lines_client.rb @@ -0,0 +1,53 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'awrence' + +class JournalEntryLinesClient + + ## + # Initialize the JournalEntryLinesClient class with an API client instance. + # @param connection [LockstepApi] The API client object for this connection + def initialize(connection) + @connection = connection + end + + + ## + # Retrieves the Journal Entry Line specified by this unique identifier, optionally including nested data sets. + # + # @param id [uuid] The unique Sage Network Platform ID number of this journal entry line; NOT the customer's ERP key + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: JournalEntry + def retrieve_journal_entry_line(id:, include_param:) + path = "/api/v1/journal-entry-lines/#{id}" + params = {:include => include_param} + @connection.request(:get, path, nil, params) + end + + ## + # Queries Journal Entry Lines for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. + # + # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. + # + # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: JournalEntry + # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_size [int32] The page size for results (default 250, maximum of 500). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + def query_journal_entry_lines(filter:, include_param:, order:, page_size:, page_number:) + path = "/api/v1/journal-entry-lines/query" + params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} + @connection.request(:get, path, nil, params) + end +end diff --git a/lib/lockstep_sdk/clients/leads_client.rb b/lib/lockstep_sdk/clients/leads_client.rb index 62a9e13..e88fe08 100644 --- a/lib/lockstep_sdk/clients/leads_client.rb +++ b/lib/lockstep_sdk/clients/leads_client.rb @@ -28,6 +28,7 @@ def initialize(connection) # Creates one or more Leads within the Lockstep platform and returns the records as created. # # A Lead is a person who is interested in the Lockstep platform but needs certain new features in order to use it. If you are interested in the Lockstep platform, you can create a lead with your information and our team will prioritize the feature you need. + # # @param body [LeadModel] The Leads to create def create_leads(body:) path = "/api/v1/Leads" diff --git a/lib/lockstep_sdk/clients/magic_links_client.rb b/lib/lockstep_sdk/clients/magic_links_client.rb index 1d9f992..46bcf41 100644 --- a/lib/lockstep_sdk/clients/magic_links_client.rb +++ b/lib/lockstep_sdk/clients/magic_links_client.rb @@ -46,6 +46,17 @@ def revoke_magic_link(id:) @connection.request(:delete, path, nil, nil) end + ## + # Revokes the bounced magic link with the specified id so it cannot be used to call the API. + # + # Revocation will be received by all servers within five minutes of revocation. API calls made using this magic link after the revocation will fail. A revoked magic link cannot be un-revoked. + # + # @param id [uuid] The unique Lockstep Platform ID number of this magic link + def revoke_bounced_magic_link(id:) + path = "/api/v1/useraccounts/magic-links/#{id}/bounced" + @connection.request(:delete, path, nil, nil) + end + ## # Queries Magic Links for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. # @@ -59,4 +70,15 @@ def query_magic_links(filter:, include_param:, order:, page_size:, page_number:) params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} @connection.request(:get, path, nil, params) end + + ## + # Gets a summary of all magic links created during the specified date range, returns no content if there are no magic links for the specified date range + # + # @param from [date-time] The date that the summary starts from (default one year ago from today) + # @param to [date-time] The date that the summary ends at (default today) + def magic_link_summary(from:, to:) + path = "/api/v1/useraccounts/magic-links/summary" + params = {:from => from, :to => to} + @connection.request(:get, path, nil, params) + end end diff --git a/lib/lockstep_sdk/clients/notes_client.rb b/lib/lockstep_sdk/clients/notes_client.rb index a7b11f3..8f688d3 100644 --- a/lib/lockstep_sdk/clients/notes_client.rb +++ b/lib/lockstep_sdk/clients/notes_client.rb @@ -39,6 +39,20 @@ def retrieve_note(id:, include_param:) @connection.request(:get, path, nil, params) end + ## + # Updates the Note with the unique ID specified. + # + # A note is a customizable text string that can be attached to various account attributes within Lockstep. You can use notes for internal communication, correspondence with clients, or personal reminders. The Note Model represents a note and a number of different metadata attributes related to the creation, storage, and ownership of the note. + # + # See [Extensibility](https://developer.lockstep.io/docs/extensibility) for more information. + # + # @param id [uuid] Note id to be updated + # @param body [object] A list of changes to apply to this Note + def update_note(id:, body:) + path = "/api/v1/Notes/#{id}" + @connection.request(:patch, path, body.to_camelback_keys.to_json, nil) + end + ## # Archives the Note with the unique ID specified. # diff --git a/lib/lockstep_sdk/clients/payments_client.rb b/lib/lockstep_sdk/clients/payments_client.rb index 43db6a7..d9bd8a5 100644 --- a/lib/lockstep_sdk/clients/payments_client.rb +++ b/lib/lockstep_sdk/clients/payments_client.rb @@ -96,12 +96,27 @@ def query_payments(filter:, include_param:, order:, page_size:, page_number:) # # QuickBooks Online supports AR Payments. # + # For other ERPs, the supported types will depend on the synced data. + # # @param id [uuid] The unique Lockstep Platform ID number of this payment; NOT the customer's ERP key def retrieve_payment_pdf(id:) path = "/api/v1/Payments/#{id}/pdf" @connection.request(:get, path, nil, nil) end + ## + # Checks for whether a PDF file for this payment exists if it has been synced using an app enrollment to one of the supported apps. + # + # QuickBooks Online supports AR Payments. + # + # For other ERPs, the supported types will depend on the synced data. + # + # @param id [uuid] The unique Lockstep Platform ID number of this payment; NOT the customer's ERP key + def check_payment_pdf(id:) + path = "/api/v1/Payments/#{id}/pdf" + @connection.request(:head, path, nil, nil) + end + ## # Queries Payments for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. This query endpoint provides extra data about the summary of payment information. # @@ -143,15 +158,4 @@ def query_payment_detail_view(filter:, include_param:, order:, page_size:, page_ params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} @connection.request(:get, path, nil, params) end - - ## - # **This API endpoint is under maintenance and may not function properly.** Schedule an ERP post request for payments. - # - # The payments must be associated with an active app enrollment and have a valid `AppEnrollmentId`. - # - # @param body [InsertPaymentRequestModelErpWriteSyncSubmitModel] The payments to submit to the connected ERP - def write_payments_to_connected_erp(body:) - path = "/api/v1/Payments/erp-write" - @connection.request(:post, path, body, nil) - end end diff --git a/lib/lockstep_sdk/clients/profiles_companies_client.rb b/lib/lockstep_sdk/clients/profiles_companies_client.rb index 8555726..db956e6 100644 --- a/lib/lockstep_sdk/clients/profiles_companies_client.rb +++ b/lib/lockstep_sdk/clients/profiles_companies_client.rb @@ -28,6 +28,7 @@ def initialize(connection) # Retrieves the Public Company Profile specified by the public url slug. # # A Public Company Profile makes available the following information: + # # @param url_slug [string] def retrieve_public_company_profile(url_slug:) path = "/api/v1/profiles/companies/#{urlSlug}" @@ -42,6 +43,7 @@ def retrieve_public_company_profile(url_slug:) # A Public Company Profile makes available the following information: # # + # # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) # @param order [string] The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight). # @param page_size [int32] The page size for results (default 250, maximum of 500) diff --git a/lib/lockstep_sdk/clients/status_client.rb b/lib/lockstep_sdk/clients/status_client.rb index 952b965..1fd536f 100644 --- a/lib/lockstep_sdk/clients/status_client.rb +++ b/lib/lockstep_sdk/clients/status_client.rb @@ -28,8 +28,16 @@ def initialize(connection) # Verifies that your application can successfully call the Lockstep Platform API and returns a successful code regardless of your authentication status or permissions. # # The Ping API can be used to verify that your app is working correctly. The Ping API will always return 200 OK. If you call this API and you receive a code other than 200 OK, you should check your network connectivity. A response code of anything other than 200 means that a routing issue or proxy issue may prevent your application from reaching the Lockstep API + # def ping() path = "/api/v1/Status" @connection.request(:get, path, nil, nil) end + + ## + # Verifies that the specified authentication token is valid and returns a successful code if it is. + def check_authentication() + path = "/api/v1/Status/auth" + @connection.request(:get, path, nil, nil) + end end diff --git a/lib/lockstep_sdk/clients/user_accounts_client.rb b/lib/lockstep_sdk/clients/user_accounts_client.rb index 19550e0..08c54cc 100644 --- a/lib/lockstep_sdk/clients/user_accounts_client.rb +++ b/lib/lockstep_sdk/clients/user_accounts_client.rb @@ -38,7 +38,9 @@ def retrieve_user(id:, include_param:) end ## - # Updates a User that matches the specified id with the requested information. + # Updates a User that matches the specified id with the requested information. The following limitations are applied when updating a user: + # + # Only Group Owners and Admins can change other users.When updating another user, only the role and status can be updated.A user can only change their own status when their current status is Onboarding.A user can never change their own role.Nobody can change the owner's role or status. See the "/transfer-owner" route for changing the owner.A user can change their own personal information. # # The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired. # @@ -77,6 +79,7 @@ def invite_user(body:) # Retrieves invite information for the specified invite token. # # A User represents a person who has the ability to authenticate against the Lockstep Platform and use services such as Lockstep Inbox. A User is uniquely identified by an Azure identity, and each user must have an email address defined within their account. All Users must validate their email to make use of Lockstep platform services. Users may have different privileges and access control rights within the Lockstep Platform. + # # @param code [uuid] The code of the invite def retrieve_invite_data(code:) path = "/api/v1/UserAccounts/invite" diff --git a/lib/lockstep_sdk/clients/workflow_statuses_client.rb b/lib/lockstep_sdk/clients/workflow_statuses_client.rb new file mode 100644 index 0000000..2fff326 --- /dev/null +++ b/lib/lockstep_sdk/clients/workflow_statuses_client.rb @@ -0,0 +1,65 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'awrence' + +class WorkflowStatusesClient + + ## + # Initialize the WorkflowStatusesClient class with an API client instance. + # @param connection [LockstepApi] The API client object for this connection + def initialize(connection) + @connection = connection + end + + + ## + # Retrieves the Workflow Status specified by this unique identifier. + # + # A Workflow Status represents the state for a specific workflow for an entity. A Workflow Status may be generic for common use cases or specific to a set of predefined statuses. + # + # @param id [uuid] The unique ID number of the Workflow Status to retrieve + def retrieve_workflow_status(id:) + path = "/api/v1/workflow-statuses/#{id}" + @connection.request(:get, path, nil, nil) + end + + ## + # Creates one or more Workflow Statuses from a given model. + # + # A Workflow Status represents the state for a specific workflow for an entity. A Workflow Status may be generic for common use cases or specific to a set of predefined statuses. + # + # @param body [WorkflowStatusModel] The Workflow Statuses to create + def create_workflow_statuses(body:) + path = "/api/v1/workflow-statuses" + @connection.request(:post, path, body, nil) + end + + ## + # Queries Workflow Statuses using the specified filtering, sorting, nested fetch, and pagination rules requested. + # + # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Accounting Data Services Developer website. + # + # A Workflow Status represents the state for a specific workflow for an entity. A Workflow Status may be generic for common use cases or specific to a set of predefined statuses. + # + # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_size [int32] The page size for results (default 250, maximum of 500). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + # @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) + def query_workflow_statuses(filter:, order:, page_size:, page_number:) + path = "/api/v1/workflow-statuses/query" + params = {:filter => filter, :order => order, :pageSize => page_size, :pageNumber => page_number} + @connection.request(:get, path, nil, params) + end +end diff --git a/lib/lockstep_sdk/lockstep_api.rb b/lib/lockstep_sdk/lockstep_api.rb index 68d959f..7999456 100644 --- a/lib/lockstep_sdk/lockstep_api.rb +++ b/lib/lockstep_sdk/lockstep_api.rb @@ -9,7 +9,7 @@ # @author Lockstep Network # Manish Narayan B S , Rishi Rajkumar Jawahar # @copyright 2021-2023 Lockstep, Inc. -# @version 2023.28.10 +# @version 2023.40.72 # @link https://github.com/Lockstep-Network/lockstep-sdk-ruby # @@ -120,6 +120,14 @@ class LockstepApi # @return [InvoicesClient] Client object for Invoices endpoints attr_accessor :invoices + ## + # @return [JournalEntriesClient] Client object for JournalEntries endpoints + attr_accessor :journal_entries + + ## + # @return [JournalEntryLinesClient] Client object for JournalEntryLines endpoints + attr_accessor :journal_entry_lines + ## # @return [LeadsClient] Client object for Leads endpoints attr_accessor :leads @@ -192,13 +200,17 @@ class LockstepApi # @return [WebhooksClient] Client object for Webhooks endpoints attr_accessor :webhooks + ## + # @return [WorkflowStatusesClient] Client object for WorkflowStatuses endpoints + attr_accessor :workflow_statuses + ## # Construct a new API client targeting the specified server. # # @param env [string] Either "sbx", "prd", or the URI of the server, ending in a slash (/) def initialize(env) - @version = "2023.28.10.0" + @version = "2023.40.72.0" @env = case env when "sbx" "https://api.sbx.lockstep.io/" @@ -231,6 +243,8 @@ def initialize(env) @invoice_addresses = InvoiceAddressesClient.new(self) @invoice_lines = InvoiceLinesClient.new(self) @invoices = InvoicesClient.new(self) + @journal_entries = JournalEntriesClient.new(self) + @journal_entry_lines = JournalEntryLinesClient.new(self) @leads = LeadsClient.new(self) @magic_links = MagicLinksClient.new(self) @notes = NotesClient.new(self) @@ -249,6 +263,7 @@ def initialize(env) @user_roles = UserRolesClient.new(self) @webhook_rules = WebhookRulesClient.new(self) @webhooks = WebhooksClient.new(self) + @workflow_statuses = WorkflowStatusesClient.new(self) end ## @@ -312,7 +327,7 @@ def request(method, path, body, params) request["Accept"] = 'application/json' request["Content-Type"] = 'application/*+json' request["SdkType"] = 'Ruby' - request["SdkVersion"] = '2023.28.10.0' + request["SdkVersion"] = '2023.40.72.0' request["MachineName"] = Socket.gethostname request.body = body diff --git a/lib/lockstep_sdk/models/application_model.rb b/lib/lockstep_sdk/models/application_model.rb index 9d9566d..ab09aa4 100644 --- a/lib/lockstep_sdk/models/application_model.rb +++ b/lib/lockstep_sdk/models/application_model.rb @@ -49,6 +49,7 @@ def initialize(params = {}) @attachments = params.dig(:attachments) @custom_field_definitions = params.dig(:custom_field_definitions) @custom_field_values = params.dig(:custom_field_values) + @enrollments = params.dig(:enrollments) end ## @@ -123,6 +124,10 @@ def initialize(params = {}) # @return [CustomFieldValueModel] A collection of custom fields linked to this record. To retrieve this collection, specify `CustomFieldValues` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](https://developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Application` and the `ObjectKey` set to the `ApplicationId` for this record. For more information on extensibility, see [linking extensible metadata to objects](https://developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object). attr_accessor :custom_field_values + ## + # @return [AppEnrollmentModel] A collection of app enrollments linked to this record. To retrieve this collection, specify `Enrollments` in the `include` parameter when retrieving data. To create an app enrollment, use the [Create App Enrollment](https://developer.lockstep.io/reference/v1_appenrollments_createappenrollments) endpoint with the `AppId` set to the `ApplicationId` for this record and associated auth connection info for the record. For more information on extensibility, see [Applications and Enrollments](https://developer.lockstep.io/docs/applications-and-enrollments). + attr_accessor :enrollments + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) @@ -145,6 +150,7 @@ def as_json(options={}) 'attachments' => @attachments, 'customFieldDefinitions' => @custom_field_definitions, 'customFieldValues' => @custom_field_values, + 'enrollments' => @enrollments, } end diff --git a/lib/lockstep_sdk/models/batch_sync_model.rb b/lib/lockstep_sdk/models/batch_sync_model.rb index e0c8edf..e8c5431 100644 --- a/lib/lockstep_sdk/models/batch_sync_model.rb +++ b/lib/lockstep_sdk/models/batch_sync_model.rb @@ -45,6 +45,8 @@ def initialize(params = {}) @financial_accounts = params.dig(:financial_accounts) @financial_account_balance_histories = params.dig(:financial_account_balance_histories) @base_currencies = params.dig(:base_currencies) + @journal_entries = params.dig(:journal_entries) + @journal_entry_lines = params.dig(:journal_entry_lines) end ## @@ -103,6 +105,14 @@ def initialize(params = {}) # @return [BaseCurrencySyncModel] A list of BaseCurrency records to merge with your Lockstep Platform data attr_accessor :base_currencies + ## + # @return [JournalEntrySyncModel] A list of JournalEntry records to merge with your Lockstep Platform data + attr_accessor :journal_entries + + ## + # @return [JournalEntryLineSyncModel] A list of JournalEntryLine records to merge with your Lockstep Platform data + attr_accessor :journal_entry_lines + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) @@ -121,6 +131,8 @@ def as_json(options={}) 'financialAccounts' => @financial_accounts, 'financialAccountBalanceHistories' => @financial_account_balance_histories, 'baseCurrencies' => @base_currencies, + 'journalEntries' => @journal_entries, + 'journalEntryLines' => @journal_entry_lines, } end diff --git a/lib/lockstep_sdk/models/company_magic_link_summary_model.rb b/lib/lockstep_sdk/models/company_magic_link_summary_model.rb new file mode 100644 index 0000000..1766d8c --- /dev/null +++ b/lib/lockstep_sdk/models/company_magic_link_summary_model.rb @@ -0,0 +1,131 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # A summary of companies combined with their most recent magic links + class CompanyMagicLinkSummaryModel + + ## + # Initialize the CompanyMagicLinkSummaryModel using the provided prototype + def initialize(params = {}) + @company_id = params.dig(:company_id) + @company_name = params.dig(:company_name) + @company_type = params.dig(:company_type) + @group_key = params.dig(:group_key) + @primary_contact_name = params.dig(:primary_contact_name) + @primary_contact_email_address = params.dig(:primary_contact_email_address) + @point_of_contact = params.dig(:point_of_contact) + @outstanding_amount = params.dig(:outstanding_amount) + @total_open_invoices = params.dig(:total_open_invoices) + @past_due = params.dig(:past_due) + @total_visits = params.dig(:total_visits) + @links_sent = params.dig(:links_sent) + @latest_magic_link_date = params.dig(:latest_magic_link_date) + @latest_magic_link_id = params.dig(:latest_magic_link_id) + @latest_magic_link_status = params.dig(:latest_magic_link_status) + end + + ## + # @return [Uuid] The unique id for this company + attr_accessor :company_id + + ## + # @return [String] The short name of the company. + attr_accessor :company_name + + ## + # @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. * `Company` - This record represents a company that is part of the organization of the account holder. * `Customer` - This record represents a business entity that purchases things from the account holder. * `Group` - Only one record of type `GROUP` exists in each account. Contains your account profile. * `Vendor` - This record represents a business entity that sells things to the account holder. * `Third Party` - This record represents a business entity that is neither a customer nor vendor. * `CustomerVendor` - Both a customer and a vendor. * `CompanyProfile` - Profile for a Company, each Company should have at most 1 profile, used only for Profile Management. + attr_accessor :company_type + + ## + # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys). + attr_accessor :group_key + + ## + # @return [String] The name of the primary contact for this company + attr_accessor :primary_contact_name + + ## + # @return [String] The email of the primary contact for this company + attr_accessor :primary_contact_email_address + + ## + # @return [String] The point of contact for this company + attr_accessor :point_of_contact + + ## + # @return [Int32] The total outstanding amount for this company + attr_accessor :outstanding_amount + + ## + # @return [Int32] The total number of open invoices for this company + attr_accessor :total_open_invoices + + ## + # @return [Int32] The total number of invoices that are past due for this company + attr_accessor :past_due + + ## + # @return [Int32] Total number of visits for all magic links sent for this company + attr_accessor :total_visits + + ## + # @return [Int32] Total number of sent links for this company + attr_accessor :links_sent + + ## + # @return [Date-time] Created date of the most recent magic link made for this company + attr_accessor :latest_magic_link_date + + ## + # @return [Uuid] Id of the most recent magic link made for this company + attr_accessor :latest_magic_link_id + + ## + # @return [MagicLinkStatus] Status of the most recent magic link made for this company + attr_accessor :latest_magic_link_status + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'companyId' => @company_id, + 'companyName' => @company_name, + 'companyType' => @company_type, + 'groupKey' => @group_key, + 'primaryContactName' => @primary_contact_name, + 'primaryContactEmailAddress' => @primary_contact_email_address, + 'pointOfContact' => @point_of_contact, + 'outstandingAmount' => @outstanding_amount, + 'totalOpenInvoices' => @total_open_invoices, + 'pastDue' => @past_due, + 'totalVisits' => @total_visits, + 'linksSent' => @links_sent, + 'latestMagicLinkDate' => @latest_magic_link_date, + 'latestMagicLinkId' => @latest_magic_link_id, + 'latestMagicLinkStatus' => @latest_magic_link_status, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/company_model.rb b/lib/lockstep_sdk/models/company_model.rb index db76b5e..5393688 100644 --- a/lib/lockstep_sdk/models/company_model.rb +++ b/lib/lockstep_sdk/models/company_model.rb @@ -74,6 +74,7 @@ def initialize(params = {}) @service_fabric_org_id = params.dig(:service_fabric_org_id) @service_fabric_company_id = params.dig(:service_fabric_company_id) @company_registration_number = params.dig(:company_registration_number) + @profile_reference_id = params.dig(:profile_reference_id) @notes = params.dig(:notes) @attachments = params.dig(:attachments) @contacts = params.dig(:contacts) @@ -96,7 +97,7 @@ def initialize(params = {}) attr_accessor :erp_key ## - # @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. * `Company` - This record represents a company that is part of the organization of the account holder. * `Customer` - This record represents a business entity that purchases things from the account holder. * `Group` - Only one record of type `GROUP` exists in each account. Contains your account profile. * `Vendor` - This record represents a business entity that sells things to the account holder. * `Third Party` - This record represents a business entity that is neither a customer nor vendor. * `CustomerVendor` - Both a customer and a vendor. + # @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. * `Company` - This record represents a company that is part of the organization of the account holder. * `Customer` - This record represents a business entity that purchases things from the account holder. * `Group` - Only one record of type `GROUP` exists in each account. Contains your account profile. * `Vendor` - This record represents a business entity that sells things to the account holder. * `Third Party` - This record represents a business entity that is neither a customer nor vendor. * `CustomerVendor` - Both a customer and a vendor. * `CompanyProfile` - Profile for a Company, each Company should have at most 1 profile, used only for Profile Management. attr_accessor :company_type ## @@ -271,6 +272,10 @@ def initialize(params = {}) # @return [String] A unique identification number assigned to the company by the national registration office. attr_accessor :company_registration_number + ## + # @return [Uuid] An optional reference to a real company, making this a profile. + attr_accessor :profile_reference_id + ## # @return [NoteModel] A collection of notes linked to this record. To retrieve this collection, specify `Notes` in the `include` parameter when retrieving data. To create a note, use the [Create Note](https://developer.lockstep.io/reference/post_api-v1-notes) endpoint with the `TableKey` to `Company` and the `ObjectKey` set to the `CompanyId` for this record. For more information on extensibility, see [linking extensible metadata to objects](https://developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object). attr_accessor :notes @@ -350,6 +355,7 @@ def as_json(options={}) 'serviceFabricOrgId' => @service_fabric_org_id, 'serviceFabricCompanyId' => @service_fabric_company_id, 'companyRegistrationNumber' => @company_registration_number, + 'profileReferenceId' => @profile_reference_id, 'notes' => @notes, 'attachments' => @attachments, 'contacts' => @contacts, diff --git a/lib/lockstep_sdk/models/company_sync_model.rb b/lib/lockstep_sdk/models/company_sync_model.rb index 21a481c..b7fb75c 100644 --- a/lib/lockstep_sdk/models/company_sync_model.rb +++ b/lib/lockstep_sdk/models/company_sync_model.rb @@ -32,14 +32,17 @@ class CompanySyncModel # Initialize the CompanySyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @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) + @parent_company_network_id = params.dig(:parent_company_network_id) @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) + @primary_contact_network_id = params.dig(:primary_contact_network_id) @address1 = params.dig(:address1) @address2 = params.dig(:address2) @address3 = params.dig(:address3) @@ -65,6 +68,10 @@ def initialize(params = {}) # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @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). attr_accessor :erp_key @@ -81,6 +88,10 @@ def initialize(params = {}) # @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. attr_accessor :parent_company_erp_key + ## + # @return [Uuid] The network id of the parent Company. + attr_accessor :parent_company_network_id + ## # @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. attr_accessor :is_active @@ -97,6 +108,10 @@ def initialize(params = {}) # @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. attr_accessor :primary_contact_erp_key + ## + # @return [Uuid] The network id of the primary Contact. + attr_accessor :primary_contact_network_id + ## # @return [String] The company's primary mailing address information attr_accessor :address1 @@ -178,14 +193,17 @@ def initialize(params = {}) def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'companyName' => @company_name, 'companyType' => @company_type, 'parentCompanyErpKey' => @parent_company_erp_key, + 'parentCompanyNetworkId' => @parent_company_network_id, 'isActive' => @is_active, 'defaultCurrencyCode' => @default_currency_code, 'companyLogoUrl' => @company_logo_url, 'primaryContactErpKey' => @primary_contact_erp_key, + 'primaryContactNetworkId' => @primary_contact_network_id, 'address1' => @address1, 'address2' => @address2, 'address3' => @address3, diff --git a/lib/lockstep_sdk/models/contact_sync_model.rb b/lib/lockstep_sdk/models/contact_sync_model.rb index 6154d8a..74c18fe 100644 --- a/lib/lockstep_sdk/models/contact_sync_model.rb +++ b/lib/lockstep_sdk/models/contact_sync_model.rb @@ -32,8 +32,10 @@ class ContactSyncModel # Initialize the ContactSyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @erp_key = params.dig(:erp_key) @company_erp_key = params.dig(:company_erp_key) + @company_network_id = params.dig(:company_network_id) @contact_name = params.dig(:contact_name) @contact_code = params.dig(:contact_code) @title = params.dig(:title) @@ -59,6 +61,10 @@ def initialize(params = {}) # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @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". As some ERP systems don't maintain a unique key for Contacts, we also support syncing Contacts with ERP keys of the form {prefix}|{index}, for example ContactPrefix|1, ContactPrefix|2 and so on. For this reason, please ensure that your Contact ERP keys don't otherwise contain the '|' symbol or that it is replaced by an alternate symbol if they do. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). attr_accessor :erp_key @@ -67,6 +73,10 @@ def initialize(params = {}) # @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). attr_accessor :company_erp_key + ## + # @return [Uuid] The network id of the related Company. + attr_accessor :company_network_id + ## # @return [String] The name of the contact. attr_accessor :contact_name @@ -148,8 +158,10 @@ def initialize(params = {}) def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'companyErpKey' => @company_erp_key, + 'companyNetworkId' => @company_network_id, 'contactName' => @contact_name, 'contactCode' => @contact_code, 'title' => @title, diff --git a/lib/lockstep_sdk/models/credit_memo_applied_model.rb b/lib/lockstep_sdk/models/credit_memo_applied_model.rb index 4ca0863..c4b58a2 100644 --- a/lib/lockstep_sdk/models/credit_memo_applied_model.rb +++ b/lib/lockstep_sdk/models/credit_memo_applied_model.rb @@ -32,8 +32,8 @@ def initialize(params = {}) @invoice_id = params.dig(:invoice_id) @credit_memo_invoice_id = params.dig(:credit_memo_invoice_id) @erp_key = params.dig(:erp_key) - @erp_write_status = params.dig(:erp_write_status) - @erp_write_status_name = params.dig(:erp_write_status_name) + @erp_update_status = params.dig(:erp_update_status) + @erp_update_action = params.dig(:erp_update_action) @entry_number = params.dig(:entry_number) @apply_to_invoice_date = params.dig(:apply_to_invoice_date) @credit_memo_applied_amount = params.dig(:credit_memo_applied_amount) @@ -72,12 +72,12 @@ def initialize(params = {}) attr_accessor :erp_key ## - # @return [ErpWriteStatuses] Possible statuses for a record that supports ERP write. - attr_accessor :erp_write_status + # @return [ErpUpdateStatus] Possible statuses for a record that supports ERP Update. + attr_accessor :erp_update_status ## - # @return [String] The name of the ErpWriteStatus for this credit memo application - attr_accessor :erp_write_status_name + # @return [ErpUpdateAction] Possible actions for a record that supports ERP Update. + attr_accessor :erp_update_action ## # @return [Int32] Reference number for the applied credit memo. @@ -148,8 +148,8 @@ def as_json(options={}) 'invoiceId' => @invoice_id, 'creditMemoInvoiceId' => @credit_memo_invoice_id, 'erpKey' => @erp_key, - 'erpWriteStatus' => @erp_write_status, - 'erpWriteStatusName' => @erp_write_status_name, + 'erpUpdateStatus' => @erp_update_status, + 'erpUpdateAction' => @erp_update_action, 'entryNumber' => @entry_number, 'applyToInvoiceDate' => @apply_to_invoice_date, 'creditMemoAppliedAmount' => @credit_memo_applied_amount, diff --git a/lib/lockstep_sdk/models/financial_account_model.rb b/lib/lockstep_sdk/models/financial_account_model.rb index bec385a..25db4cf 100644 --- a/lib/lockstep_sdk/models/financial_account_model.rb +++ b/lib/lockstep_sdk/models/financial_account_model.rb @@ -66,7 +66,7 @@ def initialize(params = {}) attr_accessor :name ## - # @return [String] The status of the Financial Account. Possible values are active, inactive, deleted or archived. + # @return [String] The status of the Financial Account. Possible values are Active, Inactive, Deleted or Archived. attr_accessor :status ## diff --git a/lib/lockstep_sdk/models/insert_payment_applied_request_model.rb b/lib/lockstep_sdk/models/insert_payment_applied_request_model.rb deleted file mode 100644 index abe8827..0000000 --- a/lib/lockstep_sdk/models/insert_payment_applied_request_model.rb +++ /dev/null @@ -1,83 +0,0 @@ -# -# Lockstep Platform SDK for Ruby -# -# (c) 2021-2023 Lockstep, Inc. -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. -# -# @author Lockstep Network -# @copyright 2021-2023 Lockstep, Inc. -# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby -# - - -require 'json' - -module LockstepSdk - - ## - # A request to insert a payment application - class InsertPaymentAppliedRequestModel - - ## - # Initialize the InsertPaymentAppliedRequestModel using the provided prototype - def initialize(params = {}) - @payment_applied_id = params.dig(:payment_applied_id) - @invoice_id = params.dig(:invoice_id) - @payment_id = params.dig(:payment_id) - @erp_key = params.dig(:erp_key) - @invoice_erp_key = params.dig(:invoice_erp_key) - @apply_to_invoice_date = params.dig(:apply_to_invoice_date) - @payment_applied_amount = params.dig(:payment_applied_amount) - end - - ## - # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see `ErpKey`. - attr_accessor :payment_applied_id - - ## - # @return [Uuid] The Invoice this payment is applied to. - attr_accessor :invoice_id - - ## - # @return [Uuid] The Payment this application applies from. - attr_accessor :payment_id - - ## - # @return [String] The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value `ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). - attr_accessor :erp_key - - ## - # @return [String] The ERP key of the Invoice this payment is applied to. - attr_accessor :invoice_erp_key - - ## - # @return [Date-time] The date this payment was applied to this invoice. - attr_accessor :apply_to_invoice_date - - ## - # @return [Double] The total amount that was applied to this Invoice from the Payment. - attr_accessor :payment_applied_amount - - ## - # @return [object] This object as a JSON key-value structure - def as_json(options={}) - { - 'paymentAppliedId' => @payment_applied_id, - 'invoiceId' => @invoice_id, - 'paymentId' => @payment_id, - 'erpKey' => @erp_key, - 'invoiceErpKey' => @invoice_erp_key, - 'applyToInvoiceDate' => @apply_to_invoice_date, - 'paymentAppliedAmount' => @payment_applied_amount, - } - end - - ## - # @return [String] This object converted to a JSON string - def to_json(*options) - "[#{as_json(*options).to_json(*options)}]" - end - end -end diff --git a/lib/lockstep_sdk/models/insert_payment_request_model.rb b/lib/lockstep_sdk/models/insert_payment_request_model.rb deleted file mode 100644 index a771f87..0000000 --- a/lib/lockstep_sdk/models/insert_payment_request_model.rb +++ /dev/null @@ -1,179 +0,0 @@ -# -# Lockstep Platform SDK for Ruby -# -# (c) 2021-2023 Lockstep, Inc. -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. -# -# @author Lockstep Network -# @copyright 2021-2023 Lockstep, Inc. -# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby -# - - -require 'json' - -module LockstepSdk - - ## - # A request to insert a new Payment - class InsertPaymentRequestModel - - ## - # Initialize the InsertPaymentRequestModel using the provided prototype - def initialize(params = {}) - @app_enrollment_id = params.dig(:app_enrollment_id) - @payment_id = params.dig(:payment_id) - @company_id = params.dig(:company_id) - @company_erp_key = params.dig(:company_erp_key) - @company_external_reference = params.dig(:company_external_reference) - @erp_key = params.dig(:erp_key) - @payment_type = params.dig(:payment_type) - @tender_type = params.dig(:tender_type) - @memo_text = params.dig(:memo_text) - @payment_date = params.dig(:payment_date) - @post_date = params.dig(:post_date) - @payment_amount = params.dig(:payment_amount) - @unapplied_amount = params.dig(:unapplied_amount) - @currency_code = params.dig(:currency_code) - @reference_code = params.dig(:reference_code) - @is_voided = params.dig(:is_voided) - @in_dispute = params.dig(:in_dispute) - @currency_rate = params.dig(:currency_rate) - @base_currency_payment_amount = params.dig(:base_currency_payment_amount) - @base_currency_unapplied_amount = params.dig(:base_currency_unapplied_amount) - @bank_account_id = params.dig(:bank_account_id) - @group_key = params.dig(:group_key) - @applications = params.dig(:applications) - end - - ## - # @return [Uuid] The AppEnrollmentId of the application to write this record to. - attr_accessor :app_enrollment_id - - ## - # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see `ErpKey`. - attr_accessor :payment_id - - ## - # @return [Uuid] The ID of the company to which this payment belongs. - attr_accessor :company_id - - ## - # @return [String] The ERP key for the company to which this payment belongs. - attr_accessor :company_erp_key - - ## - # @return [String] A additional reference that may be used in the ERP - attr_accessor :company_external_reference - - ## - # @return [String] The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value `ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). - attr_accessor :erp_key - - ## - # @return [String] The type of payment, AR Payment or AP Payment. Recognized PaymentType values are: * `AR Payment` - A payment made by a Customer to the Company * `AP Payment` - A payment made by the Company to a Vendor - attr_accessor :payment_type - - ## - # @return [String] Cash, check, credit card, wire transfer. Recognized TenderType values are: * `Cash` - A cash payment or other direct transfer. * `Check` - A check payment. * `Credit Card` - A payment made via a credit card. * `Wire Transfer` - A payment made via wire transfer from another financial institution. * `Other` - A payment made via another method not listed above. - attr_accessor :tender_type - - ## - # @return [String] Memo or reference text (ex. memo field on a check). - attr_accessor :memo_text - - ## - # @return [Date-time] The date when this payment was received. - attr_accessor :payment_date - - ## - # @return [Date-time] The date when a payment was posted to a ledger. - attr_accessor :post_date - - ## - # @return [Double] Total amount of this payment in it's received currency. - attr_accessor :payment_amount - - ## - # @return [Double] Unapplied balance of this payment in it's received currency. If this amount is nonzero, the field `IsOpen` will be true. - attr_accessor :unapplied_amount - - ## - # @return [String] The ISO 4217 currency code for this payment. For a list of ISO 4217 currency codes, see [Query Currencies](https://developer.lockstep.io/reference/get_api-v1-definitions-currencies). - attr_accessor :currency_code - - ## - # @return [String] Reference code for the payment for the given Erp system. - attr_accessor :reference_code - - ## - # @return [Boolean] Is the payment voided? - attr_accessor :is_voided - - ## - # @return [Boolean] Is the payment in dispute? - attr_accessor :in_dispute - - ## - # @return [Double] The Currency Rate used to get from the account's base currency to the payment amount. - attr_accessor :currency_rate - - ## - # @return [Double] Total amount of this payment in the group's base currency. - attr_accessor :base_currency_payment_amount - - ## - # @return [Double] Unapplied balance of this payment in the group's base currency. If this amount is nonzero, the field `IsOpen` will be true. - attr_accessor :base_currency_unapplied_amount - - ## - # @return [String] The Bank account id for the company to which this payment belongs. - attr_accessor :bank_account_id - - ## - # @return [Uuid] The GroupKey this request belongs to. - attr_accessor :group_key - - ## - # @return [InsertPaymentAppliedRequestModel] All applications this payment is associated with. To retrieve this collection, specify `Applications` in the "Include" parameter for your query. - attr_accessor :applications - - ## - # @return [object] This object as a JSON key-value structure - def as_json(options={}) - { - 'appEnrollmentId' => @app_enrollment_id, - 'paymentId' => @payment_id, - 'companyId' => @company_id, - 'companyErpKey' => @company_erp_key, - 'companyExternalReference' => @company_external_reference, - 'erpKey' => @erp_key, - 'paymentType' => @payment_type, - 'tenderType' => @tender_type, - 'memoText' => @memo_text, - 'paymentDate' => @payment_date, - 'postDate' => @post_date, - 'paymentAmount' => @payment_amount, - 'unappliedAmount' => @unapplied_amount, - 'currencyCode' => @currency_code, - 'referenceCode' => @reference_code, - 'isVoided' => @is_voided, - 'inDispute' => @in_dispute, - 'currencyRate' => @currency_rate, - 'baseCurrencyPaymentAmount' => @base_currency_payment_amount, - 'baseCurrencyUnappliedAmount' => @base_currency_unapplied_amount, - 'bankAccountId' => @bank_account_id, - 'groupKey' => @group_key, - 'applications' => @applications, - } - end - - ## - # @return [String] This object converted to a JSON string - def to_json(*options) - "[#{as_json(*options).to_json(*options)}]" - end - end -end diff --git a/lib/lockstep_sdk/models/insert_payment_request_model_erp_write_sync_submit_model.rb b/lib/lockstep_sdk/models/insert_payment_request_model_erp_write_sync_submit_model.rb deleted file mode 100644 index 86df575..0000000 --- a/lib/lockstep_sdk/models/insert_payment_request_model_erp_write_sync_submit_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# -# Lockstep Platform SDK for Ruby -# -# (c) 2021-2023 Lockstep, Inc. -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. -# -# @author Lockstep Network -# @copyright 2021-2023 Lockstep, Inc. -# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby -# - - -require 'json' - -module LockstepSdk - - ## - # Lockstep.Shared.Models.Sync.ErpWriteSyncSubmitModel`1 represents a request to write back a collection - # of requests to the connected AppEnrollment. - class InsertPaymentRequestModelErpWriteSyncSubmitModel - - ## - # Initialize the InsertPaymentRequestModelErpWriteSyncSubmitModel using the provided prototype - def initialize(params = {}) - @app_enrollment_id = params.dig(:app_enrollment_id) - @requests = params.dig(:requests) - end - - ## - # @return [Uuid] The connected App Enrollment id. - attr_accessor :app_enrollment_id - - ## - # @return [InsertPaymentRequestModel] An array of requests to write back. - attr_accessor :requests - - ## - # @return [object] This object as a JSON key-value structure - def as_json(options={}) - { - 'appEnrollmentId' => @app_enrollment_id, - 'requests' => @requests, - } - end - - ## - # @return [String] This object converted to a JSON string - def to_json(*options) - "[#{as_json(*options).to_json(*options)}]" - end - end -end diff --git a/lib/lockstep_sdk/models/invoice_line_model.rb b/lib/lockstep_sdk/models/invoice_line_model.rb index f1b759b..632f676 100644 --- a/lib/lockstep_sdk/models/invoice_line_model.rb +++ b/lib/lockstep_sdk/models/invoice_line_model.rb @@ -46,8 +46,8 @@ def initialize(params = {}) @modified = params.dig(:modified) @modified_user_id = params.dig(:modified_user_id) @app_enrollment_id = params.dig(:app_enrollment_id) - @erp_write_status = params.dig(:erp_write_status) - @erp_write_status_name = params.dig(:erp_write_status_name) + @erp_update_status = params.dig(:erp_update_status) + @erp_update_action = params.dig(:erp_update_action) @source_modified_date = params.dig(:source_modified_date) @notes = params.dig(:notes) @attachments = params.dig(:attachments) @@ -146,12 +146,12 @@ def initialize(params = {}) attr_accessor :app_enrollment_id ## - # @return [ErpWriteStatuses] Possible statuses for a record that supports ERP write. - attr_accessor :erp_write_status + # @return [ErpUpdateStatus] Possible statuses for a record that supports ERP Update. + attr_accessor :erp_update_status ## - # @return [String] The name of the ErpWriteStatus for this Invoice - attr_accessor :erp_write_status_name + # @return [ErpUpdateAction] Possible actions for a record that supports ERP Update. + attr_accessor :erp_update_action ## # @return [Date-time] The date on which this record was last modified in source ERP. @@ -192,8 +192,8 @@ def as_json(options={}) 'modified' => @modified, 'modifiedUserId' => @modified_user_id, 'appEnrollmentId' => @app_enrollment_id, - 'erpWriteStatus' => @erp_write_status, - 'erpWriteStatusName' => @erp_write_status_name, + 'erpUpdateStatus' => @erp_update_status, + 'erpUpdateAction' => @erp_update_action, 'sourceModifiedDate' => @source_modified_date, 'notes' => @notes, 'attachments' => @attachments, diff --git a/lib/lockstep_sdk/models/invoice_line_sync_model.rb b/lib/lockstep_sdk/models/invoice_line_sync_model.rb index 598fd95..498302b 100644 --- a/lib/lockstep_sdk/models/invoice_line_sync_model.rb +++ b/lib/lockstep_sdk/models/invoice_line_sync_model.rb @@ -32,8 +32,10 @@ class InvoiceLineSyncModel # Initialize the InvoiceLineSyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @erp_key = params.dig(:erp_key) @invoice_erp_key = params.dig(:invoice_erp_key) + @invoice_network_id = params.dig(:invoice_network_id) @line_number = params.dig(:line_number) @product_code = params.dig(:product_code) @description = params.dig(:description) @@ -80,6 +82,10 @@ def initialize(params = {}) # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @return [String] This is the primary key of the Invoice Line 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 invoice line records in a database, whatever the primary key for the invoice line table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). attr_accessor :erp_key @@ -88,6 +94,10 @@ def initialize(params = {}) # @return [String] The original primary key or unique ID of the invoice to which this line belongs. This value should match the [Invoice ErpKey](https://developer.lockstep.io/docs/importing-invoices#erpkey) field on the [InvoiceSyncModel](https://developer.lockstep.io/docs/importing-invoices). attr_accessor :invoice_erp_key + ## + # @return [Uuid] The network id of the parent Invoice. + attr_accessor :invoice_network_id + ## # @return [String] The line number of this line, as defined in the originating ERP or accounting system. You can sort on this number to get the original view of lines within the invoice. attr_accessor :line_number @@ -253,8 +263,10 @@ def initialize(params = {}) def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'invoiceErpKey' => @invoice_erp_key, + 'invoiceNetworkId' => @invoice_network_id, 'lineNumber' => @line_number, 'productCode' => @product_code, 'description' => @description, diff --git a/lib/lockstep_sdk/models/invoice_model.rb b/lib/lockstep_sdk/models/invoice_model.rb index 6fdb2b1..376730a 100644 --- a/lib/lockstep_sdk/models/invoice_model.rb +++ b/lib/lockstep_sdk/models/invoice_model.rb @@ -39,6 +39,8 @@ def initialize(params = {}) @salesperson_name = params.dig(:salesperson_name) @invoice_type_code = params.dig(:invoice_type_code) @invoice_status_code = params.dig(:invoice_status_code) + @workflow_status_id = params.dig(:workflow_status_id) + @workflow_status_notes = params.dig(:workflow_status_notes) @terms_code = params.dig(:terms_code) @special_terms = params.dig(:special_terms) @currency_code = params.dig(:currency_code) @@ -69,9 +71,10 @@ def initialize(params = {}) @base_currency_sales_tax_amount = params.dig(:base_currency_sales_tax_amount) @base_currency_discount_amount = params.dig(:base_currency_discount_amount) @base_currency_outstanding_balance_amount = params.dig(:base_currency_outstanding_balance_amount) - @erp_write_status = params.dig(:erp_write_status) - @erp_write_status_name = params.dig(:erp_write_status_name) + @erp_update_status = params.dig(:erp_update_status) + @erp_update_action = params.dig(:erp_update_action) @source_modified_date = params.dig(:source_modified_date) + @workflow_statuses = params.dig(:workflow_statuses) @addresses = params.dig(:addresses) @lines = params.dig(:lines) @payments = params.dig(:payments) @@ -83,6 +86,7 @@ def initialize(params = {}) @credit_memos = params.dig(:credit_memos) @custom_field_values = params.dig(:custom_field_values) @custom_field_definitions = params.dig(:custom_field_definitions) + @is_einvoice = params.dig(:is_einvoice) end ## @@ -129,6 +133,14 @@ def initialize(params = {}) # @return [String] A code identifying the status of this invoice. Recognized Invoice status codes are: * `Open` - Represents an invoice that is considered open and needs more work to complete * `Closed` - Represents an invoice that is considered closed and resolved attr_accessor :invoice_status_code + ## + # @return [Uuid] The id of the work flow status associated with this invoice. + attr_accessor :workflow_status_id + + ## + # @return [String] A description of the current workflow status of this invoice. + attr_accessor :workflow_status_notes + ## # @return [String] A code identifying the terms given to the purchaser. This field is imported directly from the originating financial system and does not follow a specified format. attr_accessor :terms_code @@ -250,17 +262,21 @@ def initialize(params = {}) attr_accessor :base_currency_outstanding_balance_amount ## - # @return [ErpWriteStatuses] Possible statuses for a record that supports ERP write. - attr_accessor :erp_write_status + # @return [ErpUpdateStatus] Possible statuses for a record that supports ERP Update. + attr_accessor :erp_update_status ## - # @return [String] The name of the ErpWriteStatus for this Invoice - attr_accessor :erp_write_status_name + # @return [ErpUpdateAction] Possible actions for a record that supports ERP Update. + attr_accessor :erp_update_action ## # @return [Date-time] The date on which this record was last modified in source ERP. attr_accessor :source_modified_date + ## + # @return [InvoiceWorkflowStatusHistoryModel] All workflow status histories connected to this invoice. To retrieve this collection, specify `WorkflowStatuses` in the "Include" parameter for your query. + attr_accessor :workflow_statuses + ## # @return [InvoiceAddressModel] All addresses connected to this invoice. To retrieve this collection, specify `Addresses` in the "Include" parameter for your query. attr_accessor :addresses @@ -305,6 +321,10 @@ def initialize(params = {}) # @return [CustomFieldDefinitionModel] A collection of custom fields linked to this record. To retrieve this collection, specify `CustomFieldDefinitions` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](https://developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](https://developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object). attr_accessor :custom_field_definitions + ## + # @return [Boolean] Indicates if the invoice an E-Invoice or not + attr_accessor :is_einvoice + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) @@ -320,6 +340,8 @@ def as_json(options={}) 'salespersonName' => @salesperson_name, 'invoiceTypeCode' => @invoice_type_code, 'invoiceStatusCode' => @invoice_status_code, + 'workflowStatusId' => @workflow_status_id, + 'workflowStatusNotes' => @workflow_status_notes, 'termsCode' => @terms_code, 'specialTerms' => @special_terms, 'currencyCode' => @currency_code, @@ -350,9 +372,10 @@ def as_json(options={}) 'baseCurrencySalesTaxAmount' => @base_currency_sales_tax_amount, 'baseCurrencyDiscountAmount' => @base_currency_discount_amount, 'baseCurrencyOutstandingBalanceAmount' => @base_currency_outstanding_balance_amount, - 'erpWriteStatus' => @erp_write_status, - 'erpWriteStatusName' => @erp_write_status_name, + 'erpUpdateStatus' => @erp_update_status, + 'erpUpdateAction' => @erp_update_action, 'sourceModifiedDate' => @source_modified_date, + 'workflowStatuses' => @workflow_statuses, 'addresses' => @addresses, 'lines' => @lines, 'payments' => @payments, @@ -364,6 +387,7 @@ def as_json(options={}) 'creditMemos' => @credit_memos, 'customFieldValues' => @custom_field_values, 'customFieldDefinitions' => @custom_field_definitions, + 'isEInvoice' => @is_einvoice, } end diff --git a/lib/lockstep_sdk/models/invoice_sync_model.rb b/lib/lockstep_sdk/models/invoice_sync_model.rb index d89a963..518521e 100644 --- a/lib/lockstep_sdk/models/invoice_sync_model.rb +++ b/lib/lockstep_sdk/models/invoice_sync_model.rb @@ -32,9 +32,12 @@ class InvoiceSyncModel # Initialize the InvoiceSyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @erp_key = params.dig(:erp_key) @company_erp_key = params.dig(:company_erp_key) + @company_network_id = params.dig(:company_network_id) @customer_erp_key = params.dig(:customer_erp_key) + @customer_network_id = params.dig(:customer_network_id) @salesperson_name = params.dig(:salesperson_name) @purchase_order_code = params.dig(:purchase_order_code) @reference_code = params.dig(:reference_code) @@ -91,12 +94,18 @@ def initialize(params = {}) @base_currency_sales_tax_amount = params.dig(:base_currency_sales_tax_amount) @base_currency_discount_amount = params.dig(:base_currency_discount_amount) @base_currency_outstanding_balance_amount = params.dig(:base_currency_outstanding_balance_amount) + @is_einvoice = params.dig(:is_einvoice) + @send_immediately = params.dig(:send_immediately) end ## # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @return [String] This is the primary key of the Invoice record. For this field, you should use whatever the invoice'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 invoice records in a database, whatever the primary key for the invoice table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). attr_accessor :erp_key @@ -105,10 +114,18 @@ def initialize(params = {}) # @return [String] The original primary key or unique ID of the company to which this invoice 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). An Invoice has two relationships: The Company and the Customer. The field `CompanyErpKey` identifies the company that created the invoice, and the field `CustomerErpKey` is the customer to whom the invoice was sent. attr_accessor :company_erp_key + ## + # @return [Uuid] The network id of the related Company. + attr_accessor :company_network_id + ## # @return [String] The original primary key or unique ID of the company to which this invoice was sent. 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). An Invoice has two relationships: The Company and the Customer. The field `CompanyErpKey` identifies the company that created the invoice, and the field `CustomerErpKey` is the customer to whom the invoice was sent. attr_accessor :customer_erp_key + ## + # @return [Uuid] The network id of the related Customer. + attr_accessor :customer_network_id + ## # @return [String] The name of the salesperson that wrote this invoice. This is just text, it is not a reference to the "Contacts" table. You will not receive an error if this field does not match a known contact person. attr_accessor :salesperson_name @@ -333,14 +350,25 @@ def initialize(params = {}) # @return [Double] The remaining balance value of this invoice in the erp's base currency. attr_accessor :base_currency_outstanding_balance_amount + ## + # @return [Boolean] True if the invoice is an E-Invoice + attr_accessor :is_einvoice + + ## + # @return [Boolean] True if the E-Invoice should be sent to gov/other recipients immediately + attr_accessor :send_immediately + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'companyErpKey' => @company_erp_key, + 'companyNetworkId' => @company_network_id, 'customerErpKey' => @customer_erp_key, + 'customerNetworkId' => @customer_network_id, 'salespersonName' => @salesperson_name, 'purchaseOrderCode' => @purchase_order_code, 'referenceCode' => @reference_code, @@ -397,6 +425,8 @@ def as_json(options={}) 'baseCurrencySalesTaxAmount' => @base_currency_sales_tax_amount, 'baseCurrencyDiscountAmount' => @base_currency_discount_amount, 'baseCurrencyOutstandingBalanceAmount' => @base_currency_outstanding_balance_amount, + 'isEInvoice' => @is_einvoice, + 'sendImmediately' => @send_immediately, } end diff --git a/lib/lockstep_sdk/models/invoice_workflow_status_history_model.rb b/lib/lockstep_sdk/models/invoice_workflow_status_history_model.rb new file mode 100644 index 0000000..915c132 --- /dev/null +++ b/lib/lockstep_sdk/models/invoice_workflow_status_history_model.rb @@ -0,0 +1,83 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # A Invoice Workflow Status History represents prior workflow statuses of an E-Invoice. + class InvoiceWorkflowStatusHistoryModel + + ## + # Initialize the InvoiceWorkflowStatusHistoryModel using the provided prototype + def initialize(params = {}) + @invoice_workflow_status_history_id = params.dig(:invoice_workflow_status_history_id) + @invoice_id = params.dig(:invoice_id) + @workflow_status_id = params.dig(:workflow_status_id) + @group_key = params.dig(:group_key) + @workflow_status_notes = params.dig(:workflow_status_notes) + @created = params.dig(:created) + @created_user_id = params.dig(:created_user_id) + end + + ## + # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Accounting Data Services platform. + attr_accessor :invoice_workflow_status_history_id + + ## + # @return [Uuid] The invoice ID associated with the invoice workflow status history. + attr_accessor :invoice_id + + ## + # @return [Uuid] The workflow status ID associated with the invoice workflow status history. + attr_accessor :workflow_status_id + + ## + # @return [Uuid] The GroupKey uniquely identifies a single Accounting Data Services Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys). + attr_accessor :group_key + + ## + # @return [String] The notes for the invoice workflow status history. + attr_accessor :workflow_status_notes + + ## + # @return [Date-time] The date that the invoice workflow status history was created. + attr_accessor :created + + ## + # @return [Uuid] The ID of the user who created the invoice workflow status history. + attr_accessor :created_user_id + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'invoiceWorkflowStatusHistoryId' => @invoice_workflow_status_history_id, + 'invoiceId' => @invoice_id, + 'workflowStatusId' => @workflow_status_id, + 'groupKey' => @group_key, + 'workflowStatusNotes' => @workflow_status_notes, + 'created' => @created, + 'createdUserId' => @created_user_id, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/journal_entry_line_model.rb b/lib/lockstep_sdk/models/journal_entry_line_model.rb new file mode 100644 index 0000000..f53722c --- /dev/null +++ b/lib/lockstep_sdk/models/journal_entry_line_model.rb @@ -0,0 +1,179 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # Contains information about a journal entry line + class JournalEntryLineModel + + ## + # Initialize the JournalEntryLineModel using the provided prototype + def initialize(params = {}) + @journal_entry_line_id = params.dig(:journal_entry_line_id) + @journal_entry_id = params.dig(:journal_entry_id) + @group_key = params.dig(:group_key) + @app_enrollment_id = params.dig(:app_enrollment_id) + @erp_key = params.dig(:erp_key) + @financial_account_id = params.dig(:financial_account_id) + @account_number = params.dig(:account_number) + @account_name = params.dig(:account_name) + @debit = params.dig(:debit) + @credit = params.dig(:credit) + @currency_code = params.dig(:currency_code) + @base_debit = params.dig(:base_debit) + @base_credit = params.dig(:base_credit) + @base_currency_code = params.dig(:base_currency_code) + @source_created_user = params.dig(:source_created_user) + @memo = params.dig(:memo) + @dimensions = params.dig(:dimensions) + @created = params.dig(:created) + @created_user_id = params.dig(:created_user_id) + @modified = params.dig(:modified) + @modified_user_id = params.dig(:modified_user_id) + @source_modified_date = params.dig(:source_modified_date) + @journal_entry = params.dig(:journal_entry) + end + + ## + # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see `ErpKey`. + attr_accessor :journal_entry_line_id + + ## + # @return [Uuid] The Journal Entry with which this line is associated. + attr_accessor :journal_entry_id + + ## + # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys). + attr_accessor :group_key + + ## + # @return [Uuid] The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system. + attr_accessor :app_enrollment_id + + ## + # @return [String] The unique ID of this record as it was known in its originating financial system. If this journal entry record was imported from a financial system, it will have the value `ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). + attr_accessor :erp_key + + ## + # @return [Uuid] The Financial Account with which this line is associated. + attr_accessor :financial_account_id + + ## + # @return [String] The unique code/identifier assigned to each account in the chart of accounts. + attr_accessor :account_number + + ## + # @return [String] The name of the account. + attr_accessor :account_name + + ## + # @return [Double] Debit to account. + attr_accessor :debit + + ## + # @return [Double] Credit to account. + attr_accessor :credit + + ## + # @return [String] The transaction currency in which the entry is recorded, especially useful for multi-currency environments. + attr_accessor :currency_code + + ## + # @return [Double] The base currency debit amount for the account. + attr_accessor :base_debit + + ## + # @return [Double] The base currency credit amount for the account. + attr_accessor :base_credit + + ## + # @return [String] The base currency in which the entry is recorded, especially useful for multi-currency environments. + attr_accessor :base_currency_code + + ## + # @return [String] The ERP’s identifier for the user who recorded the journal entry line. + attr_accessor :source_created_user + + ## + # @return [String] A memo related to this line. + attr_accessor :memo + + ## + # @return [Object] Dimensions for this journal entry line. + attr_accessor :dimensions + + ## + # @return [Date-time] The date that the journal entry line was created. + attr_accessor :created + + ## + # @return [Uuid] The ID of the user who created the journal entry line. + attr_accessor :created_user_id + + ## + # @return [Date-time] The date that the journal entry line was last modified. + attr_accessor :modified + + ## + # @return [Uuid] The ID of the user who last modified the journal entry line. + attr_accessor :modified_user_id + + ## + # @return [Date-time] The date on which this record was last modified in source ERP. + attr_accessor :source_modified_date + + ## + # @return [JournalEntryModel] The journal entry for this journal entry line. To retrieve this item, specify `JournalEntry` in the "Include" parameter for your query. + attr_accessor :journal_entry + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'journalEntryLineId' => @journal_entry_line_id, + 'journalEntryId' => @journal_entry_id, + 'groupKey' => @group_key, + 'appEnrollmentId' => @app_enrollment_id, + 'erpKey' => @erp_key, + 'financialAccountId' => @financial_account_id, + 'accountNumber' => @account_number, + 'accountName' => @account_name, + 'debit' => @debit, + 'credit' => @credit, + 'currencyCode' => @currency_code, + 'baseDebit' => @base_debit, + 'baseCredit' => @base_credit, + 'baseCurrencyCode' => @base_currency_code, + 'sourceCreatedUser' => @source_created_user, + 'memo' => @memo, + 'dimensions' => @dimensions, + 'created' => @created, + 'createdUserId' => @created_user_id, + 'modified' => @modified, + 'modifiedUserId' => @modified_user_id, + 'sourceModifiedDate' => @source_modified_date, + 'journalEntry' => @journal_entry, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/journal_entry_line_sync_model.rb b/lib/lockstep_sdk/models/journal_entry_line_sync_model.rb new file mode 100644 index 0000000..097eb11 --- /dev/null +++ b/lib/lockstep_sdk/models/journal_entry_line_sync_model.rb @@ -0,0 +1,151 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # The JournalEntryLineSyncModel 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 JournalEntryLineSyncModel format and call the [Upload Sync File API](https://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 JournalEntryLineModel + # + # For more information on writing your own connector, see [Connector Data](https://developer.lockstep.io/docs/connector-data). + class JournalEntryLineSyncModel + + ## + # Initialize the JournalEntryLineSyncModel using the provided prototype + def initialize(params = {}) + @on_match_action = params.dig(:on_match_action) + @erp_key = params.dig(:erp_key) + @journal_entry_erp_key = params.dig(:journal_entry_erp_key) + @financial_account_erp_key = params.dig(:financial_account_erp_key) + @account_number = params.dig(:account_number) + @account_name = params.dig(:account_name) + @debit = params.dig(:debit) + @credit = params.dig(:credit) + @currency_code = params.dig(:currency_code) + @base_debit = params.dig(:base_debit) + @base_credit = params.dig(:base_credit) + @base_currency_code = params.dig(:base_currency_code) + @source_created_user = params.dig(:source_created_user) + @memo = params.dig(:memo) + @dimensions = params.dig(:dimensions) + @created = params.dig(:created) + @modified = params.dig(:modified) + end + + ## + # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. + attr_accessor :on_match_action + + ## + # @return [String] This is the primary key of the Journal Entry Line record. For this field, you should use whatever the Journal Entry Line'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 Journal Entry Line records in a database, whatever the primary key for the Journal Entry Line table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). + attr_accessor :erp_key + + ## + # @return [String] The original primary key or unique ID of the journal entry to which this line belongs. This value should match the Journal Entry ErpKey field on the JournalEntrySyncModel. + attr_accessor :journal_entry_erp_key + + ## + # @return [String] An optional Financial Account with which this line is associated. This value should match the Financial Account ErpKey field on the FinancialAccountSyncModel. + attr_accessor :financial_account_erp_key + + ## + # @return [String] The unique code/identifier assigned to each account in the chart of accounts. + attr_accessor :account_number + + ## + # @return [String] The name of the account. + attr_accessor :account_name + + ## + # @return [Double] Debit to account. + attr_accessor :debit + + ## + # @return [Double] Credit to account. + attr_accessor :credit + + ## + # @return [String] The transaction currency in which the entry is recorded, especially useful for multi-currency environments. + attr_accessor :currency_code + + ## + # @return [Double] The base currency debit amount for the account. + attr_accessor :base_debit + + ## + # @return [Double] The base currency credit amount for the account. + attr_accessor :base_credit + + ## + # @return [String] The base currency in which the entry is recorded, especially useful for multi-currency environments. + attr_accessor :base_currency_code + + ## + # @return [String] The ERP’s identifier for the user who recorded the journal entry line. + attr_accessor :source_created_user + + ## + # @return [String] A memo related to this line. + attr_accessor :memo + + ## + # @return [Object] A JSON string representing the dimensions for this journal entry line. + attr_accessor :dimensions + + ## + # @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. + attr_accessor :created + + ## + # @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. + attr_accessor :modified + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'onMatchAction' => @on_match_action, + 'erpKey' => @erp_key, + 'journalEntryErpKey' => @journal_entry_erp_key, + 'financialAccountErpKey' => @financial_account_erp_key, + 'accountNumber' => @account_number, + 'accountName' => @account_name, + 'debit' => @debit, + 'credit' => @credit, + 'currencyCode' => @currency_code, + 'baseDebit' => @base_debit, + 'baseCredit' => @base_credit, + 'baseCurrencyCode' => @base_currency_code, + 'sourceCreatedUser' => @source_created_user, + 'memo' => @memo, + 'dimensions' => @dimensions, + 'created' => @created, + 'modified' => @modified, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/journal_entry_model.rb b/lib/lockstep_sdk/models/journal_entry_model.rb new file mode 100644 index 0000000..fd7aa51 --- /dev/null +++ b/lib/lockstep_sdk/models/journal_entry_model.rb @@ -0,0 +1,155 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # Contains information about a journal entry + class JournalEntryModel + + ## + # Initialize the JournalEntryModel using the provided prototype + def initialize(params = {}) + @journal_entry_id = params.dig(:journal_entry_id) + @group_key = params.dig(:group_key) + @app_enrollment_id = params.dig(:app_enrollment_id) + @erp_key = params.dig(:erp_key) + @journal_id = params.dig(:journal_id) + @source = params.dig(:source) + @posting_date = params.dig(:posting_date) + @status = params.dig(:status) + @description = params.dig(:description) + @comment = params.dig(:comment) + @reference_number = params.dig(:reference_number) + @source_posting_date = params.dig(:source_posting_date) + @created = params.dig(:created) + @created_user_id = params.dig(:created_user_id) + @modified = params.dig(:modified) + @modified_user_id = params.dig(:modified_user_id) + @source_modified_date = params.dig(:source_modified_date) + @lines = params.dig(:lines) + @attachments = params.dig(:attachments) + end + + ## + # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see `ErpKey`. + attr_accessor :journal_entry_id + + ## + # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys). + attr_accessor :group_key + + ## + # @return [Uuid] The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system. + attr_accessor :app_enrollment_id + + ## + # @return [String] The unique ID of this record as it was known in its originating financial system. If this journal entry record was imported from a financial system, it will have the value `ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). + attr_accessor :erp_key + + ## + # @return [String] The ERP’s identifier for this journal entry, usually has meaning to the user. May be the same value of the ERP Key. + attr_accessor :journal_id + + ## + # @return [JournalEntrySource] Possible sources for a Journal Entry. + attr_accessor :source + + ## + # @return [Date-time] The UTC date and time when this journal entry was posted. + attr_accessor :posting_date + + ## + # @return [JournalEntryStatus] Possible statuses for a Journal Entry. + attr_accessor :status + + ## + # @return [String] A brief description explaining the purpose of the journal entry. + attr_accessor :description + + ## + # @return [String] An additional comment related to the entry. + attr_accessor :comment + + ## + # @return [String] Any reference number or identifier associated with the entry, such as an invoice number or purchase order. + attr_accessor :reference_number + + ## + # @return [Date-time] The raw posting date from the source. + attr_accessor :source_posting_date + + ## + # @return [Date-time] The date that the journal entry was created. + attr_accessor :created + + ## + # @return [Uuid] The ID of the user who created the journal entry. + attr_accessor :created_user_id + + ## + # @return [Date-time] The date that the journal entry was last modified. + attr_accessor :modified + + ## + # @return [Uuid] The ID of the user who last modified the journal entry. + attr_accessor :modified_user_id + + ## + # @return [Date-time] The date on which this record was last modified in source ERP. + attr_accessor :source_modified_date + + ## + # @return [JournalEntryLineModel] All lines attached to this journal entry. To retrieve this collection, specify `Lines` in the "Include" parameter for your query. + attr_accessor :lines + + ## + # @return [AttachmentModel] A collection of attachments linked to this record. To retrieve this collection, specify `Attachments` in the `include` parameter when retrieving data. To create an attachment, use the [Upload Attachment](https://developer.lockstep.io/reference/post_api-v1-attachments) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](https://developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object). + attr_accessor :attachments + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'journalEntryId' => @journal_entry_id, + 'groupKey' => @group_key, + 'appEnrollmentId' => @app_enrollment_id, + 'erpKey' => @erp_key, + 'journalId' => @journal_id, + 'source' => @source, + 'postingDate' => @posting_date, + 'status' => @status, + 'description' => @description, + 'comment' => @comment, + 'referenceNumber' => @reference_number, + 'sourcePostingDate' => @source_posting_date, + 'created' => @created, + 'createdUserId' => @created_user_id, + 'modified' => @modified, + 'modifiedUserId' => @modified_user_id, + 'sourceModifiedDate' => @source_modified_date, + 'lines' => @lines, + 'attachments' => @attachments, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/journal_entry_sync_model.rb b/lib/lockstep_sdk/models/journal_entry_sync_model.rb new file mode 100644 index 0000000..f985a55 --- /dev/null +++ b/lib/lockstep_sdk/models/journal_entry_sync_model.rb @@ -0,0 +1,115 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # The JournalEntrySyncModel 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 JournalEntrySyncModel format and call the [Upload Sync File API](https://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 JournalEntryModel + # + # For more information on writing your own connector, see [Connector Data](https://developer.lockstep.io/docs/connector-data). + class JournalEntrySyncModel + + ## + # Initialize the JournalEntrySyncModel using the provided prototype + def initialize(params = {}) + @on_match_action = params.dig(:on_match_action) + @erp_key = params.dig(:erp_key) + @journal_id = params.dig(:journal_id) + @source = params.dig(:source) + @status = params.dig(:status) + @description = params.dig(:description) + @comment = params.dig(:comment) + @reference_number = params.dig(:reference_number) + @source_posting_date = params.dig(:source_posting_date) + @created = params.dig(:created) + @modified = params.dig(:modified) + end + + ## + # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. + attr_accessor :on_match_action + + ## + # @return [String] This is the primary key of the Journal Entry record. For this field, you should use whatever the Journal Entry'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 Journal Entry records in a database, whatever the primary key for the Journal Entry table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). + attr_accessor :erp_key + + ## + # @return [String] The ERP’s identifier for this journal entry, usually has meaning to the user. May be the same value of the ERP Key. + attr_accessor :journal_id + + ## + # @return [JournalEntrySource] Possible sources for a Journal Entry. + attr_accessor :source + + ## + # @return [JournalEntryStatus] Possible statuses for a Journal Entry. + attr_accessor :status + + ## + # @return [String] A brief description explaining the purpose of the journal entry. + attr_accessor :description + + ## + # @return [String] An additional comment related to the entry. + attr_accessor :comment + + ## + # @return [String] Any reference number or identifier associated with the entry, such as an invoice number or purchase order. + attr_accessor :reference_number + + ## + # @return [Date-time] The raw posting date from the source. + attr_accessor :source_posting_date + + ## + # @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. + attr_accessor :created + + ## + # @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. + attr_accessor :modified + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'onMatchAction' => @on_match_action, + 'erpKey' => @erp_key, + 'journalId' => @journal_id, + 'source' => @source, + 'status' => @status, + 'description' => @description, + 'comment' => @comment, + 'referenceNumber' => @reference_number, + 'sourcePostingDate' => @source_posting_date, + 'created' => @created, + 'modified' => @modified, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/magic_link_model.rb b/lib/lockstep_sdk/models/magic_link_model.rb index 8b06fe1..d997888 100644 --- a/lib/lockstep_sdk/models/magic_link_model.rb +++ b/lib/lockstep_sdk/models/magic_link_model.rb @@ -38,6 +38,8 @@ def initialize(params = {}) @accounting_profile_id = params.dig(:accounting_profile_id) @magic_link_url = params.dig(:magic_link_url) @user = params.dig(:user) + @visits = params.dig(:visits) + @status = params.dig(:status) end ## @@ -100,6 +102,14 @@ def initialize(params = {}) # @return [UserAccountModel] The user associated with this magic link. To retrieve this item, specify `User` in the "Include" parameter for your query. attr_accessor :user + ## + # @return [Int32] The number of visits to this Magic Link + attr_accessor :visits + + ## + # @return [MagicLinkStatus] Possible statuses for a Magic Link. + attr_accessor :status + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) @@ -119,6 +129,8 @@ def as_json(options={}) 'accountingProfileId' => @accounting_profile_id, 'magicLinkUrl' => @magic_link_url, 'user' => @user, + 'visits' => @visits, + 'status' => @status, } end diff --git a/lib/lockstep_sdk/models/magic_link_summary_model.rb b/lib/lockstep_sdk/models/magic_link_summary_model.rb new file mode 100644 index 0000000..dae996f --- /dev/null +++ b/lib/lockstep_sdk/models/magic_link_summary_model.rb @@ -0,0 +1,65 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # A historic summary of all magic links sent in a given group + class MagicLinkSummaryModel + + ## + # Initialize the MagicLinkSummaryModel using the provided prototype + def initialize(params = {}) + @group_key = params.dig(:group_key) + @total_count = params.dig(:total_count) + @total_bounced = params.dig(:total_bounced) + @total_visited = params.dig(:total_visited) + end + + ## + # @return [Uuid] Group that the summary is for + attr_accessor :group_key + + ## + # @return [Int32] Total number of magic links sent + attr_accessor :total_count + + ## + # @return [Int32] Total number of magic links that failed to send + attr_accessor :total_bounced + + ## + # @return [Int32] Total number of visits across all magic links + attr_accessor :total_visited + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'groupKey' => @group_key, + 'totalCount' => @total_count, + 'totalBounced' => @total_bounced, + 'totalVisited' => @total_visited, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/models/note_model.rb b/lib/lockstep_sdk/models/note_model.rb index eadc1b0..da2fe9d 100644 --- a/lib/lockstep_sdk/models/note_model.rb +++ b/lib/lockstep_sdk/models/note_model.rb @@ -37,6 +37,8 @@ def initialize(params = {}) @is_archived = params.dig(:is_archived) @created = params.dig(:created) @created_user_id = params.dig(:created_user_id) + @modified = params.dig(:modified) + @modified_user_id = params.dig(:modified_user_id) @created_user_name = params.dig(:created_user_name) @app_enrollment_id = params.dig(:app_enrollment_id) @recipient_name = params.dig(:recipient_name) @@ -78,6 +80,14 @@ def initialize(params = {}) # @return [Uuid] The unique ID of the [UserAccount](https://developer.lockstep.io/docs/useraccountmodel) of the user who created this Note. attr_accessor :created_user_id + ## + # @return [Date-time] The date this note was last modified + attr_accessor :modified + + ## + # @return [Uuid] The ID of the user who last modified this note + attr_accessor :modified_user_id + ## # @return [String] The name of the user who created the note attr_accessor :created_user_name @@ -103,6 +113,8 @@ def as_json(options={}) 'isArchived' => @is_archived, 'created' => @created, 'createdUserId' => @created_user_id, + 'modified' => @modified, + 'modifiedUserId' => @modified_user_id, 'createdUserName' => @created_user_name, 'appEnrollmentId' => @app_enrollment_id, 'recipientName' => @recipient_name, diff --git a/lib/lockstep_sdk/models/payment_applied_model.rb b/lib/lockstep_sdk/models/payment_applied_model.rb index 46befff..1fdd7eb 100644 --- a/lib/lockstep_sdk/models/payment_applied_model.rb +++ b/lib/lockstep_sdk/models/payment_applied_model.rb @@ -31,8 +31,8 @@ def initialize(params = {}) @invoice_id = params.dig(:invoice_id) @payment_id = params.dig(:payment_id) @erp_key = params.dig(:erp_key) - @erp_write_status = params.dig(:erp_write_status) - @erp_write_status_name = params.dig(:erp_write_status_name) + @erp_update_status = params.dig(:erp_update_status) + @erp_update_action = params.dig(:erp_update_action) @entry_number = params.dig(:entry_number) @apply_to_invoice_date = params.dig(:apply_to_invoice_date) @payment_applied_amount = params.dig(:payment_applied_amount) @@ -67,12 +67,12 @@ def initialize(params = {}) attr_accessor :erp_key ## - # @return [ErpWriteStatuses] Possible statuses for a record that supports ERP write. - attr_accessor :erp_write_status + # @return [ErpUpdateStatus] Possible statuses for a record that supports ERP Update. + attr_accessor :erp_update_status ## - # @return [String] The name of the ErpWriteStatus for this payment application - attr_accessor :erp_write_status_name + # @return [ErpUpdateAction] Possible actions for a record that supports ERP Update. + attr_accessor :erp_update_action ## # @return [Int32] The entry number of this payment application. This is often a journal entry number, confirmation code, or other identifying field for this payment application. @@ -127,8 +127,8 @@ def as_json(options={}) 'invoiceId' => @invoice_id, 'paymentId' => @payment_id, 'erpKey' => @erp_key, - 'erpWriteStatus' => @erp_write_status, - 'erpWriteStatusName' => @erp_write_status_name, + 'erpUpdateStatus' => @erp_update_status, + 'erpUpdateAction' => @erp_update_action, 'entryNumber' => @entry_number, 'applyToInvoiceDate' => @apply_to_invoice_date, 'paymentAppliedAmount' => @payment_applied_amount, diff --git a/lib/lockstep_sdk/models/payment_applied_sync_model.rb b/lib/lockstep_sdk/models/payment_applied_sync_model.rb index c5aed9a..c2df424 100644 --- a/lib/lockstep_sdk/models/payment_applied_sync_model.rb +++ b/lib/lockstep_sdk/models/payment_applied_sync_model.rb @@ -32,9 +32,12 @@ class PaymentAppliedSyncModel # Initialize the PaymentAppliedSyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @erp_key = params.dig(:erp_key) @invoice_erp_key = params.dig(:invoice_erp_key) + @invoice_network_id = params.dig(:invoice_network_id) @payment_erp_key = params.dig(:payment_erp_key) + @payment_network_id = params.dig(:payment_network_id) @entry_number = params.dig(:entry_number) @apply_to_invoice_date = params.dig(:apply_to_invoice_date) @payment_applied_amount = params.dig(:payment_applied_amount) @@ -46,6 +49,10 @@ def initialize(params = {}) # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @return [String] This is the primary key of the Payment Application record. For this field, you should use whatever this transaction's unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Since Payment Applications are often considered transactions, a typical value to look for will be the transaction ID number, the payment confirmation number, or some other record of this payment. For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). attr_accessor :erp_key @@ -54,10 +61,18 @@ def initialize(params = {}) # @return [String] This field indicates which Invoice had its balance reduced by applying this payment. In this field, identify the original primary key or unique ID of the Invoice which had its balance reduced. This information lets you track how an invoice was paid. You can identify what proportion of an invoice's balance was paid by which methods by joining this field to Invoices. This value should match the [Invoice ErpKey](https://developer.lockstep.io/docs/importing-invoices#erpkey) field on the [InvoiceSyncModel](https://developer.lockstep.io/docs/importing-invoices). attr_accessor :invoice_erp_key + ## + # @return [Uuid] The network id of the related Invoice. + attr_accessor :invoice_network_id + ## # @return [String] This field indicates which Payment was used to provide the funds for this payment application. In this field, identify the original primary key or unique ID of the Payment that was used for this payment application. This information lets you track how an invoice was paid. You can identify what proportion of an payment's balance was paid by which methods by joining this field to the Payment. This value should match the [Payment ErpKey](https://developer.lockstep.io/docs/importing-payments#erpkey) field on the [PaymentSyncModel](https://developer.lockstep.io/docs/importing-payments). attr_accessor :payment_erp_key + ## + # @return [Uuid] The network id of the related Payment. + attr_accessor :payment_network_id + ## # @return [Int32] The entry number of this payment application. This is often a journal entry number, confirmation code, or other identifying field for this payment application. attr_accessor :entry_number @@ -83,9 +98,12 @@ def initialize(params = {}) def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'invoiceErpKey' => @invoice_erp_key, + 'invoiceNetworkId' => @invoice_network_id, 'paymentErpKey' => @payment_erp_key, + 'paymentNetworkId' => @payment_network_id, 'entryNumber' => @entry_number, 'applyToInvoiceDate' => @apply_to_invoice_date, 'paymentAppliedAmount' => @payment_applied_amount, diff --git a/lib/lockstep_sdk/models/payment_model.rb b/lib/lockstep_sdk/models/payment_model.rb index 04ddd5e..1329364 100644 --- a/lib/lockstep_sdk/models/payment_model.rb +++ b/lib/lockstep_sdk/models/payment_model.rb @@ -33,8 +33,8 @@ def initialize(params = {}) @payment_id = params.dig(:payment_id) @company_id = params.dig(:company_id) @erp_key = params.dig(:erp_key) - @erp_write_status = params.dig(:erp_write_status) - @erp_write_status_name = params.dig(:erp_write_status_name) + @erp_update_status = params.dig(:erp_update_status) + @erp_update_action = params.dig(:erp_update_action) @payment_type = params.dig(:payment_type) @tender_type = params.dig(:tender_type) @is_open = params.dig(:is_open) @@ -82,12 +82,12 @@ def initialize(params = {}) attr_accessor :erp_key ## - # @return [ErpWriteStatuses] Possible statuses for a record that supports ERP write. - attr_accessor :erp_write_status + # @return [ErpUpdateStatus] Possible statuses for a record that supports ERP Update. + attr_accessor :erp_update_status ## - # @return [String] The name of the ErpWriteStatus for this Payment - attr_accessor :erp_write_status_name + # @return [ErpUpdateAction] Possible actions for a record that supports ERP Update. + attr_accessor :erp_update_action ## # @return [String] The type of payment, AR Payment or AP Payment. Recognized PaymentType values are: * `AR Payment` - A payment made by a Customer to the Company * `AP Payment` - A payment made by the Company to a Vendor @@ -209,8 +209,8 @@ def as_json(options={}) 'paymentId' => @payment_id, 'companyId' => @company_id, 'erpKey' => @erp_key, - 'erpWriteStatus' => @erp_write_status, - 'erpWriteStatusName' => @erp_write_status_name, + 'erpUpdateStatus' => @erp_update_status, + 'erpUpdateAction' => @erp_update_action, 'paymentType' => @payment_type, 'tenderType' => @tender_type, 'isOpen' => @is_open, diff --git a/lib/lockstep_sdk/models/payment_model_erp_write_result.rb b/lib/lockstep_sdk/models/payment_model_erp_write_result.rb deleted file mode 100644 index 8787da0..0000000 --- a/lib/lockstep_sdk/models/payment_model_erp_write_result.rb +++ /dev/null @@ -1,77 +0,0 @@ -# -# Lockstep Platform SDK for Ruby -# -# (c) 2021-2023 Lockstep, Inc. -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. -# -# @author Lockstep Network -# @copyright 2021-2023 Lockstep, Inc. -# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby -# - - -require 'json' - -module LockstepSdk - - ## - # Contains results of a write back request - class PaymentModelErpWriteResult - - ## - # Initialize the PaymentModelErpWriteResult using the provided prototype - def initialize(params = {}) - @app_enrollment_id = params.dig(:app_enrollment_id) - @erp_key = params.dig(:erp_key) - @group_key = params.dig(:group_key) - @message = params.dig(:message) - @sync_request_id = params.dig(:sync_request_id) - @results = params.dig(:results) - end - - ## - # @return [Uuid] The id of the connected AppEnrollmentModel - attr_accessor :app_enrollment_id - - ## - # @return [String] The ErpKey for the object written to the Erp if created - attr_accessor :erp_key - - ## - # @return [Uuid] The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys). - attr_accessor :group_key - - ## - # @return [String] An optional message to return with the result - attr_accessor :message - - ## - # @return [Uuid] The id of the SyncRequestModel the requests were added to - attr_accessor :sync_request_id - - ## - # @return [PaymentModel] Results from the ERP write operation - attr_accessor :results - - ## - # @return [object] This object as a JSON key-value structure - def as_json(options={}) - { - 'appEnrollmentId' => @app_enrollment_id, - 'erpKey' => @erp_key, - 'groupKey' => @group_key, - 'message' => @message, - 'syncRequestId' => @sync_request_id, - 'results' => @results, - } - end - - ## - # @return [String] This object converted to a JSON string - def to_json(*options) - "[#{as_json(*options).to_json(*options)}]" - end - end -end diff --git a/lib/lockstep_sdk/models/payment_sync_model.rb b/lib/lockstep_sdk/models/payment_sync_model.rb index baff297..f0e0fd8 100644 --- a/lib/lockstep_sdk/models/payment_sync_model.rb +++ b/lib/lockstep_sdk/models/payment_sync_model.rb @@ -32,8 +32,10 @@ class PaymentSyncModel # Initialize the PaymentSyncModel using the provided prototype def initialize(params = {}) @on_match_action = params.dig(:on_match_action) + @network_id = params.dig(:network_id) @erp_key = params.dig(:erp_key) @company_erp_key = params.dig(:company_erp_key) + @company_network_id = params.dig(:company_network_id) @payment_type = params.dig(:payment_type) @tender_type = params.dig(:tender_type) @is_open = params.dig(:is_open) @@ -58,6 +60,10 @@ def initialize(params = {}) # @return [MatchAction] Indicates what action to take when an existing object has been found during the sync process. attr_accessor :on_match_action + ## + # @return [Uuid] The unique identifier of this object in the Sage Network platform. + attr_accessor :network_id + ## # @return [String] This is the primary key of the Payment record. For this field, you should use whatever the payment'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 payment records in a database, whatever the primary key for the payment table is in the database should be the "ErpKey". For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns). attr_accessor :erp_key @@ -66,6 +72,10 @@ def initialize(params = {}) # @return [String] The original primary key or unique ID of the company to which this payment 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). attr_accessor :company_erp_key + ## + # @return [Uuid] The network id of the related Company. + attr_accessor :company_network_id + ## # @return [String] The type of payment, AR Payment or AP Payment. Recognized PaymentType values are: * `AR Payment` - A payment made by a Customer to the Company * `AP Payment` - A payment made by the Company to a Vendor attr_accessor :payment_type @@ -143,8 +153,10 @@ def initialize(params = {}) def as_json(options={}) { 'onMatchAction' => @on_match_action, + 'networkId' => @network_id, 'erpKey' => @erp_key, 'companyErpKey' => @company_erp_key, + 'companyNetworkId' => @company_network_id, 'paymentType' => @payment_type, 'tenderType' => @tender_type, 'isOpen' => @is_open, diff --git a/lib/lockstep_sdk/models/sync_request_model.rb b/lib/lockstep_sdk/models/sync_request_model.rb index b6955e2..7940e6d 100644 --- a/lib/lockstep_sdk/models/sync_request_model.rb +++ b/lib/lockstep_sdk/models/sync_request_model.rb @@ -54,7 +54,7 @@ def initialize(params = {}) attr_accessor :group_key ## - # @return [String] The status of processing for this SyncRequest. When a SyncRequest is created, it is flagged as `Ready`. When it is picked up for execution, its status moves to `In Progress`. When it is complete, its status will move to `Success` or `Failed`. If another API call cancels the SyncRequest, its status will move to `Cancelled`. * Ready * In Progress * Cancelled * Failed * Success + # @return [String] The status of processing for this SyncRequest. When a SyncRequest is created, it is flagged as `Ready`. While it is in queue waiting to be picked up, its status moves to `Connector`. When it is picked up for execution, its status moves to `In Progress`. When it is complete, its status will move to `Success` or `Failed`. If another API call cancels the SyncRequest, its status will move to `Cancelled`. * Ready * Connector * In Progress * Cancelled * Failed * Success attr_accessor :status_code ## diff --git a/lib/lockstep_sdk/models/transaction_model.rb b/lib/lockstep_sdk/models/transaction_model.rb index 3fb4614..57476ee 100644 --- a/lib/lockstep_sdk/models/transaction_model.rb +++ b/lib/lockstep_sdk/models/transaction_model.rb @@ -41,6 +41,7 @@ def initialize(params = {}) @base_currency_outstanding_amount = params.dig(:base_currency_outstanding_amount) @transaction_detail_count = params.dig(:transaction_detail_count) @supports_erp_pdf_retrieval = params.dig(:supports_erp_pdf_retrieval) + @transaction_customer_id = params.dig(:transaction_customer_id) end ## @@ -111,6 +112,10 @@ def initialize(params = {}) # @return [Boolean] Specific transactions have support for pdf retrieval from their respective erp. When this flag is true, an additional call to Invoices/{id}/pdf or Payments/{id}/pdf can be made to retrieve a pdf directly from the erp. attr_accessor :supports_erp_pdf_retrieval + ## + # @return [Uuid] The customer associated with this transaction + attr_accessor :transaction_customer_id + ## # @return [object] This object as a JSON key-value structure def as_json(options={}) @@ -132,6 +137,7 @@ def as_json(options={}) 'baseCurrencyOutstandingAmount' => @base_currency_outstanding_amount, 'transactionDetailCount' => @transaction_detail_count, 'supportsErpPdfRetrieval' => @supports_erp_pdf_retrieval, + 'transactionCustomerId' => @transaction_customer_id, } end diff --git a/lib/lockstep_sdk/models/workflow_status_model.rb b/lib/lockstep_sdk/models/workflow_status_model.rb new file mode 100644 index 0000000..bc7f957 --- /dev/null +++ b/lib/lockstep_sdk/models/workflow_status_model.rb @@ -0,0 +1,113 @@ +# +# Lockstep Platform SDK for Ruby +# +# (c) 2021-2023 Lockstep, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author Lockstep Network +# @copyright 2021-2023 Lockstep, Inc. +# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby +# + + +require 'json' + +module LockstepSdk + + ## + # A Workflow Status represents the state for a specific workflow for an entity. + class WorkflowStatusModel + + ## + # Initialize the WorkflowStatusModel using the provided prototype + def initialize(params = {}) + @id = params.dig(:id) + @name = params.dig(:name) + @description = params.dig(:description) + @parent_workflow_status_id = params.dig(:parent_workflow_status_id) + @category = params.dig(:category) + @code = params.dig(:code) + @is_notes_required = params.dig(:is_notes_required) + @promote_to_erp = params.dig(:promote_to_erp) + @created = params.dig(:created) + @created_user_id = params.dig(:created_user_id) + @modified = params.dig(:modified) + @modified_user_id = params.dig(:modified_user_id) + end + + ## + # @return [Uuid] The unique ID of this record, automatically assigned by Lockstep when this record is added to the Accounting Data Services platform. + attr_accessor :id + + ## + # @return [String] The name of the workflow status. + attr_accessor :name + + ## + # @return [String] The description explaining the use of the workflow status. + attr_accessor :description + + ## + # @return [Uuid] The prior workflow status ID. + attr_accessor :parent_workflow_status_id + + ## + # @return [String] The category of the workflow status. + attr_accessor :category + + ## + # @return [String] The code of the workflow status. + attr_accessor :code + + ## + # @return [Boolean] Indicates whether notes are required or not. + attr_accessor :is_notes_required + + ## + # @return [Boolean] Indicates whether the status change should be reported to the ERP or not. + attr_accessor :promote_to_erp + + ## + # @return [Date-time] The date that the workflow status was created. + attr_accessor :created + + ## + # @return [Uuid] The ID of the user who created the workflow status. + attr_accessor :created_user_id + + ## + # @return [Date-time] The date that the workflow status was last modified. + attr_accessor :modified + + ## + # @return [Uuid] The ID of the user who last modified the workflow status. + attr_accessor :modified_user_id + + ## + # @return [object] This object as a JSON key-value structure + def as_json(options={}) + { + 'id' => @id, + 'name' => @name, + 'description' => @description, + 'parentWorkflowStatusId' => @parent_workflow_status_id, + 'category' => @category, + 'code' => @code, + 'isNotesRequired' => @is_notes_required, + 'promoteToErp' => @promote_to_erp, + 'created' => @created, + 'createdUserId' => @created_user_id, + 'modified' => @modified, + 'modifiedUserId' => @modified_user_id, + } + end + + ## + # @return [String] This object converted to a JSON string + def to_json(*options) + "[#{as_json(*options).to_json(*options)}]" + end + end +end diff --git a/lib/lockstep_sdk/version.rb b/lib/lockstep_sdk/version.rb index 486f885..31cef50 100644 --- a/lib/lockstep_sdk/version.rb +++ b/lib/lockstep_sdk/version.rb @@ -1,3 +1,3 @@ module LockstepSdk - VERSION = "2023.28.10.0" + VERSION = "2023.40.72.0" end \ No newline at end of file diff --git a/lockstepsdk.gemspec b/lockstepsdk.gemspec index ee29c10..875dfd9 100644 --- a/lockstepsdk.gemspec +++ b/lockstepsdk.gemspec @@ -2,8 +2,8 @@ require_relative "lib/lockstep_sdk/version" Gem::Specification.new do |s| s.name = 'lockstep_sdk' - s.version = '2023.28.10.0' - s.date = '2023-07-13' + s.version = '2023.40.72.0' + s.date = '2023-10-26' s.summary = 'API Client to use the Lockstep Platform API' s.description = 'Allows you to work with the Lockstep Platform API for financial systems automation. The SDK provides rich, context sensitive help and documentation for all methods and objects.'