lockstep_sdk 2022.15.31.1 → 2022.26.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lockstep_sdk/clients/app_enrollments_client.rb +10 -0
- data/lib/lockstep_sdk/clients/companies_client.rb +25 -5
- data/lib/lockstep_sdk/clients/financial_account_client.rb +1 -1
- data/lib/lockstep_sdk/clients/group_accounts_client.rb +46 -0
- data/lib/lockstep_sdk/clients/payment_applications_client.rb +1 -1
- data/lib/lockstep_sdk/clients/provisioning_client.rb +0 -18
- data/lib/lockstep_sdk/clients/reports_client.rb +132 -8
- data/lib/lockstep_sdk/clients/user_accounts_client.rb +12 -0
- data/lib/lockstep_sdk/clients/webhook_rules_client.rb +81 -0
- data/lib/lockstep_sdk/clients/webhooks_client.rb +13 -2
- data/lib/lockstep_sdk/lockstep_api.rb +14 -4
- data/lib/lockstep_sdk/models/action_result_model.rb +52 -0
- data/lib/lockstep_sdk/models/ap_aging_header_info_model.rb +101 -0
- data/lib/lockstep_sdk/models/ap_header_info_model.rb +197 -0
- data/lib/lockstep_sdk/models/ar_aging_header_info_model.rb +18 -0
- data/lib/lockstep_sdk/models/ar_header_info_model.rb +46 -10
- data/lib/lockstep_sdk/models/{customer_details_model.rb → company_details_model.rb} +22 -22
- data/lib/lockstep_sdk/models/{customer_details_payment_model.rb → company_details_payment_model.rb} +3 -3
- data/lib/lockstep_sdk/models/company_model.rb +6 -0
- data/lib/lockstep_sdk/models/company_sync_model.rb +13 -1
- data/lib/lockstep_sdk/models/connector_info_model.rb +18 -0
- data/lib/lockstep_sdk/models/contact_sync_model.rb +2 -2
- data/lib/lockstep_sdk/models/customer_summary_model.rb +36 -0
- data/lib/lockstep_sdk/models/daily_payable_outstanding_report_model.rb +59 -0
- data/lib/lockstep_sdk/models/daily_sales_outstanding_report_model.rb +0 -6
- data/lib/lockstep_sdk/models/dpo_summary_group_total_model.rb +71 -0
- data/lib/lockstep_sdk/models/dpo_summary_model.rb +83 -0
- data/lib/lockstep_sdk/models/error_result.rb +77 -0
- data/lib/lockstep_sdk/models/group_account_model.rb +101 -0
- data/lib/lockstep_sdk/models/invoice_line_sync_model.rb +3 -3
- data/lib/lockstep_sdk/models/invoice_model.rb +7 -1
- data/lib/lockstep_sdk/models/invoice_summary_model.rb +6 -0
- data/lib/lockstep_sdk/models/invoice_sync_model.rb +10 -4
- data/lib/lockstep_sdk/models/payables_coming_due_header_model.rb +77 -0
- data/lib/lockstep_sdk/models/payables_coming_due_model.rb +89 -0
- data/lib/lockstep_sdk/models/payables_coming_due_widget_model.rb +59 -0
- data/lib/lockstep_sdk/models/payables_summary_report_model.rb +77 -0
- data/lib/lockstep_sdk/models/payment_applied_model.rb +6 -0
- data/lib/lockstep_sdk/models/payment_detail_model.rb +7 -1
- data/lib/lockstep_sdk/models/payment_model.rb +2 -2
- data/lib/lockstep_sdk/models/payment_summary_model.rb +45 -9
- data/lib/lockstep_sdk/models/payment_sync_model.rb +2 -2
- data/lib/lockstep_sdk/models/status_model.rb +12 -0
- data/lib/lockstep_sdk/models/sync_entity_result_model.rb +6 -0
- data/lib/lockstep_sdk/models/user_group_model.rb +66 -0
- data/lib/lockstep_sdk/models/vendor_summary_model.rb +143 -0
- data/lib/lockstep_sdk/models/webhook_model.rb +7 -1
- data/lib/lockstep_sdk/models/webhook_rule_model.rb +116 -0
- data/lib/lockstep_sdk/version.rb +1 -1
- metadata +21 -8
- data/lib/lockstep_sdk/models/erp_info_data_model.rb +0 -62
- data/lib/lockstep_sdk/models/trial_balance_report_cell_model.rb +0 -49
- data/lib/lockstep_sdk/models/trial_balance_report_model.rb +0 -79
- data/lib/lockstep_sdk/models/trial_balance_report_row_model.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd5a349eb67e94638b549c030c9f0d14b4949a89678e7ce25569d021002af6f
|
4
|
+
data.tar.gz: 43763005c70106c342563f4de7e628974196db5c437d61b75954041ccb8fe23b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a438f056a6adf07587662642cd9c4180e4e2c7190f995a5b1aa378712ceda3c11fde8b1e129e32e09a68bc233d0aa8c95d61d53bc606e6dde6d6aaffc5ec6d
|
7
|
+
data.tar.gz: 30f50f191c364290777a83ff0416ffeb19b3c096dd3bd1d3cbe3ac03fab01d98dc04368c125959c2b97106f2cde3d097db8c06132806af7e95bebc7b18955d8c
|
@@ -81,6 +81,16 @@ class AppEnrollmentsClient
|
|
81
81
|
@connection.request(:post, path, body, nil)
|
82
82
|
end
|
83
83
|
|
84
|
+
##
|
85
|
+
# Updates the OAuth settings associated with this App Enrollment
|
86
|
+
#
|
87
|
+
# @param id [uuid]
|
88
|
+
# @param body [string]
|
89
|
+
def reconnect_app_enrollment_oauth(id:, body:)
|
90
|
+
path = "/api/v1/AppEnrollments/#{id}/reconnect"
|
91
|
+
@connection.request(:patch, path, body, nil)
|
92
|
+
end
|
93
|
+
|
84
94
|
##
|
85
95
|
# Queries App Enrollments for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.
|
86
96
|
#
|
@@ -122,15 +122,35 @@ class CompaniesClient
|
|
122
122
|
end
|
123
123
|
|
124
124
|
##
|
125
|
-
#
|
125
|
+
# Queries Vendor Summaries for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.
|
126
126
|
#
|
127
|
-
#
|
127
|
+
# 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.
|
128
|
+
#
|
129
|
+
# The Vendor Summary View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the Vendor Summary Model.
|
128
130
|
#
|
129
131
|
# See [Vendors, Customers, and Companies](https://developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
|
130
132
|
#
|
131
|
-
# @param
|
132
|
-
|
133
|
-
|
133
|
+
# @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
134
|
+
# @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
|
135
|
+
# @param order [string] The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight).
|
136
|
+
# @param page_size [int32] The page size for results (default 200, maximum of 10,000)
|
137
|
+
# @param page_number [int32] The page number for results (default 0)
|
138
|
+
def query_vendor_summary(filter:, include_param:, order:, page_size:, page_number:)
|
139
|
+
path = "/api/v1/Companies/views/vendor-summary"
|
140
|
+
params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
141
|
+
@connection.request(:get, path, nil, params)
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Retrieves the Company Details specified by this unique identifier, optionally including nested data sets.
|
146
|
+
#
|
147
|
+
# The Company Detail View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the Company Detail Model.
|
148
|
+
#
|
149
|
+
# See [Vendors, Customers, and Companies](https://developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
|
150
|
+
#
|
151
|
+
# @param id [uuid] The unique Lockstep Platform ID number of this Company; NOT the company's ERP key
|
152
|
+
def retrieve_company_detail(id:)
|
153
|
+
path = "/api/v1/Companies/views/details/#{id}"
|
134
154
|
@connection.request(:get, path, nil, nil)
|
135
155
|
end
|
136
156
|
end
|
@@ -56,7 +56,7 @@ class FinancialAccountClient
|
|
56
56
|
# Deletes the Financial Account referred to by this unique identifier.
|
57
57
|
#
|
58
58
|
# @param id [uuid] The unique Lockstep Platform ID number of the Financial Account to disable; NOT the customer's ERP key
|
59
|
-
def
|
59
|
+
def delete_financial_account(id:)
|
60
60
|
path = "/api/v1/FinancialAccount/#{id}"
|
61
61
|
@connection.request(:delete, path, nil, nil)
|
62
62
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Platform SDK for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Lockstep Network <support@lockstep.io>
|
10
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
11
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
12
|
+
#
|
13
|
+
|
14
|
+
|
15
|
+
require 'awrence'
|
16
|
+
|
17
|
+
class GroupAccountsClient
|
18
|
+
|
19
|
+
##
|
20
|
+
# Initialize the GroupAccountsClient class with an API client instance.
|
21
|
+
# @param connection [LockstepApi] The API client object for this connection
|
22
|
+
def initialize(connection)
|
23
|
+
@connection = connection
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
##
|
28
|
+
# Retrieves group account data for the current user.
|
29
|
+
#
|
30
|
+
def retrieve_group_account_data()
|
31
|
+
path = "/api/v1/GroupAccounts/me"
|
32
|
+
@connection.request(:get, path, nil, nil)
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Updates a group account that matches the specified id with the requested information.
|
37
|
+
#
|
38
|
+
# 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.
|
39
|
+
#
|
40
|
+
# @param id [uuid] The unique ID number of the Group Account to retrieve
|
41
|
+
# @param body [object] A list of changes to apply to this Group Account
|
42
|
+
def update_group_account(id:, body:)
|
43
|
+
path = "/api/v1/GroupAccounts/#{id}"
|
44
|
+
@connection.request(:patch, path, body.to_camelback_keys.to_json, nil)
|
45
|
+
end
|
46
|
+
end
|
@@ -30,7 +30,7 @@ class PaymentApplicationsClient
|
|
30
30
|
# A Payment Application is created by a business who receives a Payment from a customer. A customer may make a single Payment to match an Invoice exactly, a partial Payment for an Invoice, or a single Payment may be made for multiple smaller Invoices. The Payment Application contains information about which Invoices are connected to which Payments and for which amounts.
|
31
31
|
#
|
32
32
|
# @param id [uuid] The unique Lockstep Platform ID number of this Payment Application; NOT the customer's ERP key
|
33
|
-
# @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Invoice
|
33
|
+
# @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Invoice, Payment
|
34
34
|
def retrieve_payment_application(id:, include_param:)
|
35
35
|
path = "/api/v1/PaymentApplications/#{id}"
|
36
36
|
params = {:include => include_param}
|
@@ -24,24 +24,6 @@ class ProvisioningClient
|
|
24
24
|
end
|
25
25
|
|
26
26
|
|
27
|
-
##
|
28
|
-
# Creates a new User or updates an Invited user based on metadata provided by the User during the onboarding process
|
29
|
-
#
|
30
|
-
# @param body [ProvisioningModel] Represents a User and their related metadata
|
31
|
-
def provision_user_account(body:)
|
32
|
-
path = "/api/v1/Provisioning"
|
33
|
-
@connection.request(:post, path, body, nil)
|
34
|
-
end
|
35
|
-
|
36
|
-
##
|
37
|
-
# Updates user, company and group metadata for a User of status 'Onboarding' and finalizes a user's onboarding process by changing the user status to 'Active'
|
38
|
-
#
|
39
|
-
# @param body [ProvisioningFinalizeRequestModel] Represents a User and their related metadata
|
40
|
-
def finalize_user_account_provisioning(body:)
|
41
|
-
path = "/api/v1/Provisioning/finalize"
|
42
|
-
@connection.request(:post, path, body, nil)
|
43
|
-
end
|
44
|
-
|
45
27
|
##
|
46
28
|
# Creates a new account for a developer, sending an email with information on how to access the API.
|
47
29
|
# @param body [DeveloperAccountSubmitModel]
|
@@ -36,6 +36,18 @@ class ReportsClient
|
|
36
36
|
@connection.request(:get, path, nil, params)
|
37
37
|
end
|
38
38
|
|
39
|
+
##
|
40
|
+
# Retrieves a current Payables Summary report for this account.
|
41
|
+
#
|
42
|
+
# The Payables Summary report indicates the amount of payments sent and bills received within a given timeframe. You can use this report to determine the overall balance of money coming into and out of your accounts receivable and accounts payable businesses.
|
43
|
+
#
|
44
|
+
# @param timeframe [int32] Number of days of data to include for the Payables Summary Report (default is 30 days from today)
|
45
|
+
def payables_summary_report(timeframe:)
|
46
|
+
path = "/api/v1/Reports/payables-summary"
|
47
|
+
params = {:timeframe => timeframe}
|
48
|
+
@connection.request(:get, path, nil, params)
|
49
|
+
end
|
50
|
+
|
39
51
|
##
|
40
52
|
# Retrieves a current Daily Sales Outstanding (DSO) report for this account.
|
41
53
|
#
|
@@ -46,6 +58,48 @@ class ReportsClient
|
|
46
58
|
@connection.request(:get, path, nil, nil)
|
47
59
|
end
|
48
60
|
|
61
|
+
##
|
62
|
+
# Retrieves a current Days Payable Outstanding (DPO) report for this account.
|
63
|
+
#
|
64
|
+
# Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.
|
65
|
+
#
|
66
|
+
def days_payable_outstanding()
|
67
|
+
path = "/api/v1/Reports/daily-payable-outstanding"
|
68
|
+
@connection.request(:get, path, nil, nil)
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Retrieves payable amount due for 4 time buckets (Today, 7 Days from Today, 14 Days from Today, and 30 Days from Today).
|
73
|
+
#
|
74
|
+
def payables_coming_due()
|
75
|
+
path = "/api/v1/Reports/payables-coming-due"
|
76
|
+
@connection.request(:get, path, nil, nil)
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Payables coming due represents the amount of cash required to pay vendor bills based on the due dates of the bills. Each bucket represents total amount due within the time period based on open Payables as of today.
|
81
|
+
#
|
82
|
+
# @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
83
|
+
# @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
|
84
|
+
# @param order [string] The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight).
|
85
|
+
# @param page_size [int32] The page size for results (default 200, maximum of 10,000)
|
86
|
+
# @param page_number [int32] The page number for results (default 0)
|
87
|
+
def payables_coming_due_summary(filter:, include_param:, order:, page_size:, page_number:)
|
88
|
+
path = "/api/v1/Reports/payables-coming-due-summary"
|
89
|
+
params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
90
|
+
@connection.request(:get, path, nil, params)
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Retrieves total number of vendors, bills, the total amount outstanding, for a group.
|
95
|
+
#
|
96
|
+
# @param report_date [date-time] The date the outstanding values are calculated on. Should be either the current day, 7 days after the current day, 14 days after the current day, or 30 days after the current day.
|
97
|
+
def payables_coming_due_header(report_date:)
|
98
|
+
path = "/api/v1/Reports/payables-coming-due-header"
|
99
|
+
params = {:reportDate => report_date}
|
100
|
+
@connection.request(:get, path, nil, params)
|
101
|
+
end
|
102
|
+
|
49
103
|
##
|
50
104
|
# Retrieves a current Risk Rate report for this account.
|
51
105
|
#
|
@@ -67,6 +121,17 @@ class ReportsClient
|
|
67
121
|
@connection.request(:get, path, nil, params)
|
68
122
|
end
|
69
123
|
|
124
|
+
##
|
125
|
+
# Retrieves AP header information up to the date specified.
|
126
|
+
#
|
127
|
+
# @param report_date [date] The date of the report.
|
128
|
+
# @param company_id [uuid] Include a company to get AP data for a specific company, leave as null to include all Companies.
|
129
|
+
def accounts_payable_header(report_date:, company_id:)
|
130
|
+
path = "/api/v1/Reports/ap-header"
|
131
|
+
params = {:reportDate => report_date, :companyId => company_id}
|
132
|
+
@connection.request(:get, path, nil, params)
|
133
|
+
end
|
134
|
+
|
70
135
|
##
|
71
136
|
# The Aging Report contains information about the total dollar value of invoices broken down by their age. Last default or specified bucket treated as a catch all bucket for values that fit in that bucket or beyond.
|
72
137
|
#
|
@@ -81,9 +146,10 @@ class ReportsClient
|
|
81
146
|
# @param currency_code [string] Currency aging buckets are converted to (all aging data returned without currency conversion if no currency is specified)
|
82
147
|
# @param currency_provider [string] Currency provider currency rates should be returned from to convert aging amounts to (default Lockstep currency provider used if no data provider specified)
|
83
148
|
# @param buckets [int32] Customized buckets used for aging calculations (default buckets [0,30,60,90,120,180] will be used if buckets not specified)
|
84
|
-
|
149
|
+
# @param ap_report [boolean] A boolean to turn on AP Aging reports
|
150
|
+
def invoice_aging_report(company_id:, recalculate:, currency_code:, currency_provider:, buckets:, ap_report:)
|
85
151
|
path = "/api/v1/Reports/aging"
|
86
|
-
params = {:CompanyId => company_id, :Recalculate => recalculate, :CurrencyCode => currency_code, :CurrencyProvider => currency_provider, :Buckets => buckets}
|
152
|
+
params = {:CompanyId => company_id, :Recalculate => recalculate, :CurrencyCode => currency_code, :CurrencyProvider => currency_provider, :Buckets => buckets, :ApReport => ap_report}
|
87
153
|
@connection.request(:get, path, nil, params)
|
88
154
|
end
|
89
155
|
|
@@ -97,6 +163,16 @@ class ReportsClient
|
|
97
163
|
@connection.request(:get, path, nil, nil)
|
98
164
|
end
|
99
165
|
|
166
|
+
##
|
167
|
+
# Retrieves AP Aging Header information report broken down by aging bucket.
|
168
|
+
#
|
169
|
+
# The AP Aging Header report contains aggregated information about the `TotalBillsPastDue`, `TotalVendors`, and their respective `PercentageOfTotalAp` grouped by their aging `ReportBucket`.
|
170
|
+
#
|
171
|
+
def accounts_payable_aging_header()
|
172
|
+
path = "/api/v1/Reports/ap-aging-header"
|
173
|
+
@connection.request(:get, path, nil, nil)
|
174
|
+
end
|
175
|
+
|
100
176
|
##
|
101
177
|
# Retrieves Attachment Header information for the requested companyId.
|
102
178
|
#
|
@@ -114,9 +190,10 @@ class ReportsClient
|
|
114
190
|
#
|
115
191
|
# @param start_date [date-time] The start date of the report
|
116
192
|
# @param end_date [date-time] The end date of the report
|
117
|
-
|
193
|
+
# @param app_enrollment_id [uuid] The app enrollment id of the app enrollment whose data will be used.
|
194
|
+
def trial_balance_report(start_date:, end_date:, app_enrollment_id:)
|
118
195
|
path = "/api/v1/Reports/trial-balance"
|
119
|
-
params = {:startDate => start_date, :endDate => end_date}
|
196
|
+
params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id}
|
120
197
|
@connection.request(:get, path, nil, params)
|
121
198
|
end
|
122
199
|
|
@@ -125,14 +202,15 @@ class ReportsClient
|
|
125
202
|
#
|
126
203
|
# @param start_date [date-time] The start date of the report
|
127
204
|
# @param end_date [date-time] The end date of the report
|
205
|
+
# @param app_enrollment_id [uuid] The app enrollment id of the app enrollment whose data will be used.
|
128
206
|
# @param column_option [string] The desired column splitting of the report data. An empty string or anything unrecognized will result in only totals being displayed. Options are as follows: By Period - a column for every month/fiscal period within the reporting dates Quarterly - a column for every quarter within the reporting dates Annually - a column for every year within the reporting dates
|
129
207
|
# @param display_depth [ReportDepth] The desired row splitting of the report data. For Income Statements, the minimum report depth is 1. Options are as follows: 1 - combine all accounts by their category 2 - combine all accounts by their subcategory 3 - display all accounts
|
130
208
|
# @param comparison_period [string] Add a column for historical data with the following options and use showCurrencyDifference and/or show percentageDifference to display a comparison of that historical data to the report period. Options are as follows (note for YTD the data will be compared as a percentage of YTD and showCurrencyDifference and showPercentageDifference should not be used): "PP" - previous period (will show the previous quarter or year if Quarterly or Annually is chosen for columnOption) "PY" - previous year (the same date range as the report, but for the year prior) "YTD" - year to date (the current financial year to the current period)
|
131
209
|
# @param show_currency_difference [boolean] A boolean to turn on a currency based difference between the reporting period and the comparison period.
|
132
210
|
# @param show_percentage_difference [boolean] A boolean to turn on a percent based difference between the reporting period and the comparison period.
|
133
|
-
def income_statement_report(start_date:, end_date:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
|
211
|
+
def income_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
|
134
212
|
path = "/api/v1/Reports/income-statement"
|
135
|
-
params = {:startDate => start_date, :endDate => end_date, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
|
213
|
+
params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
|
136
214
|
@connection.request(:get, path, nil, params)
|
137
215
|
end
|
138
216
|
|
@@ -141,14 +219,60 @@ class ReportsClient
|
|
141
219
|
#
|
142
220
|
# @param start_date [date-time] The start date of the report
|
143
221
|
# @param end_date [date-time] The end date of the report
|
222
|
+
# @param app_enrollment_id [uuid] The app enrollment id of the app enrollment whose data will be used.
|
144
223
|
# @param column_option [string] The desired column splitting of the report data. An empty string or anything unrecognized will result in only totals being displayed. Options are as follows: By Period - a column for every month/fiscal period within the reporting dates Quarterly - a column for every quarter within the reporting dates Annually - a column for every year within the reporting dates
|
145
224
|
# @param display_depth [ReportDepth] The desired row splitting of the report data. For Balance Sheets, the minimum report depth is 1. Options are as follows: 1 - combine all accounts by their category 2 - combine all accounts by their subcategory 3 - display all accounts
|
146
225
|
# @param comparison_period [string] Add a column for historical data with the following options and use showCurrencyDifference and/or show percentageDifference to display a comparison of that historical data to the report period. "PP" - previous period (will show the previous quarter or year if Quarterly or Annually is chosen for columnOption) "PY" - previous year (the same date range as the report, but for the year prior)
|
147
226
|
# @param show_currency_difference [boolean] A boolean to turn on a currency based difference between the reporting period and the comparison period.
|
148
227
|
# @param show_percentage_difference [boolean] A boolean to turn on a percent based difference between the reporting period and the comparison period.
|
149
|
-
def balance_sheet_report(start_date:, end_date:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
|
228
|
+
def balance_sheet_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
|
150
229
|
path = "/api/v1/Reports/balance-sheet"
|
151
|
-
params = {:startDate => start_date, :endDate => end_date, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
|
230
|
+
params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
|
231
|
+
@connection.request(:get, path, nil, params)
|
232
|
+
end
|
233
|
+
|
234
|
+
##
|
235
|
+
# Generates a cash flow statement for the given time range.
|
236
|
+
#
|
237
|
+
# @param start_date [date-time] The start date of the report
|
238
|
+
# @param end_date [date-time] The end date of the report
|
239
|
+
# @param app_enrollment_id [uuid] The app enrollment id of the app enrollment whose data will be used.
|
240
|
+
# @param column_option [string] The desired column splitting of the report data. An empty string or anything unrecognized will result in only totals being displayed. Options are as follows: By Period - a column for every month/fiscal period within the reporting dates Quarterly - a column for every quarter within the reporting dates Annually - a column for every year within the reporting dates
|
241
|
+
# @param display_depth [ReportDepth] The desired row splitting of the report data. Options are as follows: 0 - combine all accounts by their classification 1 - combine all accounts by their category 2 - combine all accounts by their subcategory 3 - display all accounts
|
242
|
+
def cash_flow_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:)
|
243
|
+
path = "/api/v1/Reports/cash-flow-statement"
|
244
|
+
params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth}
|
245
|
+
@connection.request(:get, path, nil, params)
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# Retrieves a summary for each vendor that includes a count of their outstanding bills, the total amount outstanding, and their daily payable outstanding value.
|
250
|
+
#
|
251
|
+
# Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.
|
252
|
+
#
|
253
|
+
# 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.
|
254
|
+
#
|
255
|
+
# @param report_date [date-time] The date the outstanding values are calculated on. Should be either the current day or the end of a previous quarter.
|
256
|
+
# @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
257
|
+
# @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
|
258
|
+
# @param order [string] The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight).
|
259
|
+
# @param page_size [int32] The page size for results (default 200, maximum of 10,000)
|
260
|
+
# @param page_number [int32] The page number for results (default 0)
|
261
|
+
def days_payable_outstanding_summary(report_date:, filter:, include_param:, order:, page_size:, page_number:)
|
262
|
+
path = "/api/v1/Reports/daily-payable-outstanding-summary"
|
263
|
+
params = {:reportDate => report_date, :filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
264
|
+
@connection.request(:get, path, nil, params)
|
265
|
+
end
|
266
|
+
|
267
|
+
##
|
268
|
+
# Retrieves total number of vendors, bills, the total amount outstanding, and the daily payable outstanding value for a group.
|
269
|
+
#
|
270
|
+
# Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.
|
271
|
+
#
|
272
|
+
# @param report_date [date-time] The date the outstanding values are calculated on. Should be either the current day or the end of a previous quarter.
|
273
|
+
def days_payable_outstanding_summary_total(report_date:)
|
274
|
+
path = "/api/v1/Reports/daily-payable-outstanding-summary-total"
|
275
|
+
params = {:reportDate => report_date}
|
152
276
|
@connection.request(:get, path, nil, params)
|
153
277
|
end
|
154
278
|
end
|
@@ -121,4 +121,16 @@ class UserAccountsClient
|
|
121
121
|
params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
122
122
|
@connection.request(:get, path, nil, params)
|
123
123
|
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# Change the active GroupKey of the calling user.
|
127
|
+
#
|
128
|
+
# 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.
|
129
|
+
#
|
130
|
+
# @param group_key [uuid]
|
131
|
+
def change_user_group(group_key:)
|
132
|
+
path = "/api/v1/UserAccounts/change-group"
|
133
|
+
params = {:groupKey => group_key}
|
134
|
+
@connection.request(:post, path, nil, params)
|
135
|
+
end
|
124
136
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Platform SDK for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Lockstep Network <support@lockstep.io>
|
10
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
11
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
12
|
+
#
|
13
|
+
|
14
|
+
|
15
|
+
require 'awrence'
|
16
|
+
|
17
|
+
class WebhookRulesClient
|
18
|
+
|
19
|
+
##
|
20
|
+
# Initialize the WebhookRulesClient class with an API client instance.
|
21
|
+
# @param connection [LockstepApi] The API client object for this connection
|
22
|
+
def initialize(connection)
|
23
|
+
@connection = connection
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
##
|
28
|
+
# Retrieves the Webhook Rule specified by this unique identifier.
|
29
|
+
#
|
30
|
+
# @param id [uuid] The unique Lockstep Platform ID number of this Webhook Rule
|
31
|
+
def retrieve_webhook_rule(id:)
|
32
|
+
path = "/api/v1/WebhookRules/#{id}"
|
33
|
+
@connection.request(:get, path, nil, nil)
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# Updates a webhook rule that matches the specified id with the requested information.
|
38
|
+
#
|
39
|
+
# 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.
|
40
|
+
#
|
41
|
+
# @param id [uuid] The unique Lockstep Platform ID number of the Webhook Rule to update.
|
42
|
+
# @param body [object] A list of changes to apply to this Webhook Rule
|
43
|
+
def update_webhook_rule(id:, body:)
|
44
|
+
path = "/api/v1/WebhookRules/#{id}"
|
45
|
+
@connection.request(:patch, path, body.to_camelback_keys.to_json, nil)
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Deletes the Webhook Rule referred to by this unique identifier.
|
50
|
+
#
|
51
|
+
# @param id [uuid] The unique Lockstep Platform ID number of the Webhook Rule to delete.
|
52
|
+
def delete_webhook_rule(id:)
|
53
|
+
path = "/api/v1/WebhookRules/#{id}"
|
54
|
+
@connection.request(:delete, path, nil, nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Creates one or more webhook rules from a given model.
|
59
|
+
#
|
60
|
+
# @param body [WebhookRuleModel] The Webhook Rules to create
|
61
|
+
def create_webhook_rules(body:)
|
62
|
+
path = "/api/v1/WebhookRules"
|
63
|
+
@connection.request(:post, path, body, nil)
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Queries Webhook Rules for this account using the specified filtering, sorting, and pagination rules requested.
|
68
|
+
#
|
69
|
+
# 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.
|
70
|
+
#
|
71
|
+
# @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
72
|
+
# @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
|
73
|
+
# @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
74
|
+
# @param page_size [int32] The page size for results (default 200). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
75
|
+
# @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
76
|
+
def query_webhook_rules(filter:, include_param:, order:, page_size:, page_number:)
|
77
|
+
path = "/api/v1/WebhookRules/query"
|
78
|
+
params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
79
|
+
@connection.request(:get, path, nil, params)
|
80
|
+
end
|
81
|
+
end
|
@@ -78,12 +78,13 @@ class WebhooksClient
|
|
78
78
|
# 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.
|
79
79
|
#
|
80
80
|
# @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
81
|
+
# @param include_param [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collection: WebhookRules
|
81
82
|
# @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
82
83
|
# @param page_size [int32] The page size for results (default 200). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
83
84
|
# @param page_number [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight)
|
84
|
-
def query_webhooks(filter:, order:, page_size:, page_number:)
|
85
|
+
def query_webhooks(filter:, include_param:, order:, page_size:, page_number:)
|
85
86
|
path = "/api/v1/Webhooks/query"
|
86
|
-
params = {:filter => filter, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
87
|
+
params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
|
87
88
|
@connection.request(:get, path, nil, params)
|
88
89
|
end
|
89
90
|
|
@@ -100,4 +101,14 @@ class WebhooksClient
|
|
100
101
|
params = {:filter => filter, :select => select, :pageSize => page_size, :pageNumber => page_number}
|
101
102
|
@connection.request(:get, path, nil, params)
|
102
103
|
end
|
104
|
+
|
105
|
+
##
|
106
|
+
#
|
107
|
+
#
|
108
|
+
# @param webhook_id [uuid] The unique Lockstep Platform ID number of this Webhook
|
109
|
+
# @param webhook_history_id [uuid] The unique Lockstep Platform ID number of the Webhook History to be retried. Note: the webhook history supplied must have a isSuccessful status of false to be retried.
|
110
|
+
def retry_failed_webhook_history(webhook_id:, webhook_history_id:)
|
111
|
+
path = "/api/v1/Webhooks/#{webhookId}/history/#{webhookHistoryId}/retry"
|
112
|
+
@connection.request(:get, path, nil, nil)
|
113
|
+
end
|
103
114
|
end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
# @author Lockstep Network <support@lockstep.io>
|
10
10
|
# Manish Narayan B S <manish.n@lockstep.io>, Rishi Rajkumar Jawahar <rjawahar@lockstep.io>
|
11
11
|
# @copyright 2021-2022 Lockstep, Inc.
|
12
|
-
# @version 2022.
|
12
|
+
# @version 2022.26.12
|
13
13
|
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
14
14
|
#
|
15
15
|
|
@@ -21,7 +21,7 @@ require 'socket'
|
|
21
21
|
project_root = File.dirname(File.absolute_path(__FILE__))
|
22
22
|
Dir.glob(project_root + '/clients/*') {|file| require file}
|
23
23
|
|
24
|
-
module
|
24
|
+
module lockstep_sdk
|
25
25
|
class LockstepApi
|
26
26
|
|
27
27
|
##
|
@@ -100,6 +100,10 @@ module Lockstep_sdk
|
|
100
100
|
# @return [FinancialYearSettingsClient] Client object for FinancialYearSettings endpoints
|
101
101
|
attr_accessor :financial_year_settings
|
102
102
|
|
103
|
+
##
|
104
|
+
# @return [GroupAccountsClient] Client object for GroupAccounts endpoints
|
105
|
+
attr_accessor :group_accounts
|
106
|
+
|
103
107
|
##
|
104
108
|
# @return [InvoiceHistoryClient] Client object for InvoiceHistory endpoints
|
105
109
|
attr_accessor :invoice_history
|
@@ -148,6 +152,10 @@ module Lockstep_sdk
|
|
148
152
|
# @return [UserRolesClient] Client object for UserRoles endpoints
|
149
153
|
attr_accessor :user_roles
|
150
154
|
|
155
|
+
##
|
156
|
+
# @return [WebhookRulesClient] Client object for WebhookRules endpoints
|
157
|
+
attr_accessor :webhook_rules
|
158
|
+
|
151
159
|
##
|
152
160
|
# @return [WebhooksClient] Client object for Webhooks endpoints
|
153
161
|
attr_accessor :webhooks
|
@@ -158,7 +166,7 @@ module Lockstep_sdk
|
|
158
166
|
#
|
159
167
|
# @param env [string] Either "sbx", "prd", or the URI of the server, ending in a slash (/)
|
160
168
|
def initialize(env)
|
161
|
-
@version = "2022.
|
169
|
+
@version = "2022.26.12.0"
|
162
170
|
@env = case env
|
163
171
|
when "sbx"
|
164
172
|
"https://api.sbx.lockstep.io/"
|
@@ -186,6 +194,7 @@ module Lockstep_sdk
|
|
186
194
|
@financial_account = FinancialAccountClient.new(self)
|
187
195
|
@financial_account_balance_history = FinancialAccountBalanceHistoryClient.new(self)
|
188
196
|
@financial_year_settings = FinancialYearSettingsClient.new(self)
|
197
|
+
@group_accounts = GroupAccountsClient.new(self)
|
189
198
|
@invoice_history = InvoiceHistoryClient.new(self)
|
190
199
|
@invoices = InvoicesClient.new(self)
|
191
200
|
@leads = LeadsClient.new(self)
|
@@ -198,6 +207,7 @@ module Lockstep_sdk
|
|
198
207
|
@sync = SyncClient.new(self)
|
199
208
|
@user_accounts = UserAccountsClient.new(self)
|
200
209
|
@user_roles = UserRolesClient.new(self)
|
210
|
+
@webhook_rules = WebhookRulesClient.new(self)
|
201
211
|
@webhooks = WebhooksClient.new(self)
|
202
212
|
end
|
203
213
|
|
@@ -262,7 +272,7 @@ module Lockstep_sdk
|
|
262
272
|
request["Accept"] = 'application/json'
|
263
273
|
request["Content-Type"] = 'application/*+json'
|
264
274
|
request["SdkType"] = 'Ruby'
|
265
|
-
request["SdkVersion"] = '2022.
|
275
|
+
request["SdkVersion"] = '2022.26.12.0'
|
266
276
|
request["MachineName"] = Socket.gethostname
|
267
277
|
request.body = body
|
268
278
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Lockstep Platform SDK for Ruby
|
3
|
+
#
|
4
|
+
# (c) 2021-2022 Lockstep, Inc.
|
5
|
+
#
|
6
|
+
# For the full copyright and license information, please view the LICENSE
|
7
|
+
# file that was distributed with this source code.
|
8
|
+
#
|
9
|
+
# @author Lockstep Network <support@lockstep.io>
|
10
|
+
# @copyright 2021-2022 Lockstep, Inc.
|
11
|
+
# @link https://github.com/Lockstep-Network/lockstep-sdk-ruby
|
12
|
+
#
|
13
|
+
|
14
|
+
|
15
|
+
require 'json'
|
16
|
+
|
17
|
+
module LockstepSdk
|
18
|
+
|
19
|
+
##
|
20
|
+
# Represents the result of an action.
|
21
|
+
#
|
22
|
+
# In the Lockstep API, an Action is returned when an API call does not produce any data
|
23
|
+
# but does produce messages that can be useful in understanding what work was performed.
|
24
|
+
# You may use the messages text to display user visible error messages or the results of
|
25
|
+
# various operations.
|
26
|
+
class ActionResultModel
|
27
|
+
|
28
|
+
##
|
29
|
+
# Initialize the ActionResultModel using the provided prototype
|
30
|
+
def initialize(params = {})
|
31
|
+
@messages = params.dig(:messages)
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# @return [String] If the API call produced messages, this element will contain a list of user-visible text strings that contain information about what work occurred in the API.
|
36
|
+
attr_accessor :messages
|
37
|
+
|
38
|
+
##
|
39
|
+
# @return [object] This object as a JSON key-value structure
|
40
|
+
def as_json(options={})
|
41
|
+
{
|
42
|
+
'messages' => @messages,
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# @return [String] This object converted to a JSON string
|
48
|
+
def to_json(*options)
|
49
|
+
"[#{as_json(*options).to_json(*options)}]"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|