Skip to content

Commit ad57ae4

Browse files
committed
Add 2.9.0 update
1 parent d4ed2e7 commit ad57ae4

18 files changed

+1267
-204
lines changed

.vs/slnx.sqlite

0 Bytes
Binary file not shown.

lib/avatax/client/advancedrules.rb

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ class Client
33
module AdvancedRules
44

55

6+
# Copy an existing advanced rule to a new environment
7+
#
8+
#
9+
# @param ruleId [String]
10+
# @param model [Object]
11+
# @return [Object]
12+
def copy_advanced_rule(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/copy"
13+
put(path, model) end
14+
15+
# Create an advanced rule
16+
#
17+
#
18+
# @param model [Object] The advanced rule you wish to create
19+
# @return [Object]
20+
def create_advanced_rule(model) path = "/api/v2/advancedrules/rules"
21+
post(path, model) end
22+
623
# Create a lookup file for a company
724
#
825
#
@@ -13,6 +30,24 @@ module AdvancedRules
1330
def create_company_lookup_file(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
1431
post(path, model) end
1532

33+
# Create a rule execution for a company
34+
#
35+
#
36+
# @param accountId [Integer] The ID of the account for the company
37+
# @param companyId [Integer] The ID of the company for which the rule execution is to be created
38+
# @param model [Object] The rule execution you wish to create
39+
# @return [Object]
40+
def create_company_rule_execution(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions"
41+
post(path, model) end
42+
43+
# Delete an advanced rule that is not in use by a company
44+
#
45+
#
46+
# @param ruleId [String] The ID of the advanced rule to be deleted
47+
# @return [ErrorDetail[]]
48+
def delete_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}"
49+
delete(path) end
50+
1651
# Delete a lookup file
1752
#
1853
#
@@ -22,6 +57,51 @@ def create_company_lookup_file(accountId, companyId, model) path = "/api/
2257
def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
2358
delete(path) end
2459

60+
# Delete a rule execution
61+
#
62+
#
63+
# @param accountId [Integer] The ID of the account for the company the rule execution is for
64+
# @param ruleExecutionId [String] The unique ID/GUID for the rule execution to be deleted
65+
# @return [ErrorDetail[]]
66+
def delete_rule_execution(accountId, ruleExecutionId) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
67+
delete(path) end
68+
69+
# Get an advanced rule by rule ID
70+
#
71+
#
72+
# @param ruleId [String] The ID of the rule to retrieve
73+
# @return [Object]
74+
def get_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}"
75+
get(path) end
76+
77+
# Get an advanced rule by name
78+
#
79+
#
80+
# @param name [String] The name of the rule to retrieve
81+
# @return [Object]
82+
def get_advanced_rule_by_name(name) path = "/api/v2/advancedrules/rules/name/#{name}"
83+
get(path) end
84+
85+
# Retrieve an advanced rule's customer data schema for a company
86+
#
87+
#
88+
# @param ruleId [String] The ID of the advance rule for which the schema is requested
89+
# @param accountId [Integer] The ID of the account of the requesting user
90+
# @param companyId [Integer] The ID of the company of the requesting user
91+
# @return [Object]
92+
def get_advanced_rule_customer_data_schema(ruleId, accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/rules/#{ruleId}/schema"
93+
get(path) end
94+
95+
# List all advanced rules
96+
#
97+
#
98+
# @param fullDetails [Boolean] Retrieve detailed advanced rule properties (limited to tech support level)
99+
# @param includeTest [Boolean] Include test rules
100+
# @param includeSystemRules [Boolean] Include rules used to retrieve enumerated values
101+
# @return [FetchResult]
102+
def get_advanced_rules(options={}) path = "/api/v2/advancedrules/rules"
103+
get(path, options) end
104+
25105
# Get audit records by account id and date range.
26106
#
27107
#
@@ -32,6 +112,14 @@ def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accou
32112
def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
33113
get(path) end
34114

115+
# Retrieve companies that have an advanced rule configured in its rule execution configuration
116+
#
117+
#
118+
# @param ruleId [String] he ID of the advance rule for which companies are requested
119+
# @return [FetchResult]
120+
def get_companies_using_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}/companies"
121+
get(path) end
122+
35123
# Get the lookup files for a company
36124
#
37125
#
@@ -41,6 +129,16 @@ def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advanc
41129
def get_company_lookup_files(accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
42130
get(path) end
43131

132+
# Get the rule executions for a company
133+
#
134+
#
135+
# @param accountId [Integer] The account ID for the company
136+
# @param companyId [Integer] The ID of the company for which to retrieve rule executions
137+
# @param effectiveDate [DateTime] Optional date which the rule executions should be effective
138+
# @return [FetchResult]
139+
def get_company_rule_executions(accountId, companyId, options={}) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions"
140+
get(path, options) end
141+
44142
# Get a lookup file for an accountId and companyLookupFileId
45143
#
46144
#
@@ -50,6 +148,52 @@ def get_company_lookup_files(accountId, companyId) path = "/api/v2/advanc
50148
def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
51149
get(path) end
52150

151+
# Get a rule execution for an accountId and ruleExecutionId
152+
#
153+
#
154+
# @param accountId [Integer] The ID of the account for the rule execution
155+
# @param ruleExecutionId [String] The unique ID/GUID of the rule execution to return
156+
# @return [Object]
157+
def get_rule_execution(accountId, ruleExecutionId) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
158+
get(path) end
159+
160+
# Update an advanced rule
161+
#
162+
# Creates a new version of the advanced rule
163+
# @param ruleId [String] The ID of the advanced rule to be updated
164+
# @param model [Object] The new values for the advanced rule
165+
# @return [Object]
166+
def update_advanced_rule(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}"
167+
put(path, model) end
168+
169+
# Set rule approved or unapproved
170+
#
171+
#
172+
# @param ruleId [String] The ID of the advanced rule to change the approved state
173+
# @param model [Object] The value to set approved state
174+
# @return [Object]
175+
def update_advanced_rule_approval(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/approve"
176+
post(path, model) end
177+
178+
# Set rule visible or not visible for an account
179+
#
180+
#
181+
# @param ruleId [String]
182+
# @param model [Object]
183+
# @return [Object]
184+
def update_advanced_rule_visibility(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/visible"
185+
put(path, model) end
186+
187+
# Change the rule execution order for a company
188+
#
189+
#
190+
# @param accountId [Integer] The ID of the account for the company the rule execution is for
191+
# @param companyId [Integer] The ID of the company for which the rule execution order is being modified
192+
# @param model [Object] A list of rule execution IDs for the company indicating the new execution order
193+
# @return [FetchResult]
194+
def update_company_rule_execution_order(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions/order"
195+
post(path, model) end
196+
53197
# Update a lookup file
54198
#
55199
#
@@ -59,6 +203,16 @@ def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts
59203
# @return [Object]
60204
def update_lookup_file(accountId, id, model) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
61205
put(path, model) end
206+
207+
# Update a rule execution
208+
#
209+
#
210+
# @param accountId [Integer] The ID of the account for the company the rule execution is for
211+
# @param ruleExecutionId [String] The unique ID/GUID of the rule execution to be updated
212+
# @param model [Object] The new values to update the rule execution
213+
# @return [Object]
214+
def update_rule_execution(accountId, ruleExecutionId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
215+
put(path, model) end
62216
end
63217
end
64218
end

lib/avatax/client/companies.rb

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,29 @@ def company_initialize(model) path = "/api/v2/companies/initialize"
101101
def create_companies(model) path = "/api/v2/companies"
102102
post(path, model) end
103103

104+
# Add parameters to a company.
105+
#
106+
# Add parameters to a company.
107+
#
108+
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
109+
#
110+
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
111+
#
112+
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
113+
#
114+
# To see available parameters for this company, call `/api/v2/definitions/parameters?$filter=attributeType eq Company`
115+
#
116+
# Some parameters are only available for use if you have subscribed to specific AvaTax services. To see which parameters you are able to use, add the query parameter "$showSubscribed=true" to the parameter definition call above.
117+
#
118+
# ### Security Policies
119+
#
120+
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
121+
# @param companyId [Integer] The ID of the company that owns this company parameter.
122+
# @param model [CompanyParameterDetailModel[]] The company parameters you wish to create.
123+
# @return [CompanyParameterDetailModel[]]
124+
def create_company_parameters(companyId, model) path = "/api/v2/companies/#{companyId}/parameters"
125+
post(path, model) end
126+
104127
# Request managed returns funding setup for a company
105128
#
106129
# This API is available by invitation only.
@@ -136,6 +159,24 @@ def create_funding_request(id, model) path = "/api/v2/companies/#{id}/fun
136159
def delete_company(id) path = "/api/v2/companies/#{id}"
137160
delete(path) end
138161

162+
# Delete a single company parameter
163+
#
164+
# Delete a parameter of a company.
165+
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
166+
#
167+
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
168+
#
169+
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
170+
#
171+
# ### Security Policies
172+
#
173+
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
174+
# @param companyId [Integer] The company id
175+
# @param id [Integer] The parameter id
176+
# @return [ErrorDetail[]]
177+
def delete_company_parameter(companyId, id) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
178+
delete(path) end
179+
139180
# Check the funding configuration of a company
140181
#
141182
# This API is available by invitation only.
@@ -217,6 +258,25 @@ def get_company(id, options={}) path = "/api/v2/companies/#{id}"
217258
def get_company_configuration(id) path = "/api/v2/companies/#{id}/configuration"
218259
get(path) end
219260

261+
# Retrieve a single company parameter
262+
#
263+
# Retrieves a single parameter of a company.
264+
#
265+
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
266+
#
267+
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
268+
#
269+
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
270+
#
271+
# ### Security Policies
272+
#
273+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
274+
# @param companyId [Integer]
275+
# @param id [Integer]
276+
# @return [Object]
277+
def get_company_parameter_detail(companyId, id) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
278+
get(path) end
279+
220280
# Get this company's filing status
221281
#
222282
# Retrieve the current filing status of this company.
@@ -241,6 +301,31 @@ def get_company_configuration(id) path = "/api/v2/companies/#{id}/configu
241301
def get_filing_status(id) path = "/api/v2/companies/#{id}/filingstatus"
242302
get(path) end
243303

304+
# Retrieve parameters for a company
305+
#
306+
# Retrieve all parameters of a company.
307+
#
308+
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
309+
#
310+
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
311+
#
312+
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
313+
#
314+
# Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
315+
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
316+
#
317+
# ### Security Policies
318+
#
319+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
320+
# @param companyId [Integer] The company id
321+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* name, unit
322+
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
323+
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
324+
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
325+
# @return [FetchResult]
326+
def list_company_parameter_details(companyId, options={}) path = "/api/v2/companies/#{companyId}/parameters"
327+
get(path, options) end
328+
244329
# Check managed returns funding status for a company
245330
#
246331
# This API is available by invitation only.
@@ -348,6 +433,26 @@ def set_company_configuration(id, model) path = "/api/v2/companies/#{id}/
348433
# @return [Object]
349434
def update_company(id, model) path = "/api/v2/companies/#{id}"
350435
put(path, model) end
436+
437+
# Update a company parameter
438+
#
439+
# Update a parameter of a company.
440+
#
441+
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
442+
#
443+
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
444+
#
445+
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
446+
#
447+
# ### Security Policies
448+
#
449+
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
450+
# @param companyId [Integer] The company id.
451+
# @param id [Integer] The company parameter id
452+
# @param model [Object] The company parameter object you wish to update.
453+
# @return [Object]
454+
def update_company_parameter_detail(companyId, id, model) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
455+
put(path, model) end
351456
end
352457
end
353458
end

0 commit comments

Comments
 (0)