tsubaiso-sdk 1.2.13 → 1.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tsubaiso_sdk.rb +61 -9
- data/test/tsubaiso_sdk/test_bank_reason_master.rb +6 -3
- data/test/tsubaiso_sdk/test_petty_cash_reason_master.rb +4 -2
- data/test/tsubaiso_sdk/test_reimbursements.rb +31 -25
- data/test/tsubaiso_sdk/test_sale.rb +8 -8
- data/test/tsubaiso_sdk/test_staff_data.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 190ada7308dbe9ef0fbd7d9245add49b5e370c8463cf28b0f5f1c66de06344f2
|
4
|
+
data.tar.gz: a801abe86bda0ebb6a6e53494cdb8b2fa8359aa42ed1772372bf6aeda51fbf99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1057dca0e8b4a14ea1d3d84371e80b31bda705bc839de7c228eaa0c4fe9629095004627f28b36f1e5971b2bbb194a0f8e0d548ec490f934d163535a8bb4e7ae
|
7
|
+
data.tar.gz: 2b66206d8105661ec555975c2d84a634ab13a99e561a8543d9fd07fe9f5112d0106505c06221a73570c741e0389957bf677b1b59ca9823f28318576f4d1e218a
|
data/lib/tsubaiso_sdk.rb
CHANGED
@@ -15,6 +15,7 @@ class TsubaisoSDK
|
|
15
15
|
def initialize(options = {})
|
16
16
|
@base_url = options[:base_url] || 'https://tsubaiso.net'
|
17
17
|
@access_token = options[:access_token] || "Fake_Token"
|
18
|
+
@http_option = options[:http_option] || {}
|
18
19
|
end
|
19
20
|
|
20
21
|
def list_bank_account_masters
|
@@ -166,6 +167,14 @@ class TsubaisoSDK
|
|
166
167
|
api_request(uri, 'POST', params)
|
167
168
|
end
|
168
169
|
|
170
|
+
def setup_account_assignments
|
171
|
+
params = {
|
172
|
+
'format' => 'json',
|
173
|
+
}
|
174
|
+
uri = URI.parse(@base_url + '/account_assignments/initial_setup')
|
175
|
+
api_request(uri, 'POST', params)
|
176
|
+
end
|
177
|
+
|
169
178
|
def index_api_history
|
170
179
|
params = { 'format' => 'json' }
|
171
180
|
uri = URI.parse(@base_url + '/api_histories/index')
|
@@ -617,6 +626,7 @@ class TsubaisoSDK
|
|
617
626
|
'is_valid' => options[:is_valid],
|
618
627
|
'memo' => options[:memo],
|
619
628
|
'account_code' => options[:account_code],
|
629
|
+
'bank_reason_taxes' => options[:bank_reason_taxes],
|
620
630
|
'format' => 'json'
|
621
631
|
}
|
622
632
|
uri = URI.parse(@base_url + '/bank_reason_masters/create')
|
@@ -750,7 +760,8 @@ class TsubaisoSDK
|
|
750
760
|
'corporate_master_type' => options[:corporate_master_type],
|
751
761
|
'email_to' => options[:email_to],
|
752
762
|
'name' => options[:name],
|
753
|
-
'freeze_login' => options[:freeze_login]
|
763
|
+
'freeze_login' => options[:freeze_login],
|
764
|
+
'not_personalize_account' => options[:not_personalize_account]
|
754
765
|
}
|
755
766
|
uri = URI.parse(@base_url + '/corporate_masters/create')
|
756
767
|
api_request(uri, 'POST', params)
|
@@ -899,7 +910,8 @@ class TsubaisoSDK
|
|
899
910
|
'is_valid' => options[:is_valid],
|
900
911
|
'memo' => options[:memo],
|
901
912
|
'port_type' => options[:port_type],
|
902
|
-
'sort_number' => options[:sort_number]
|
913
|
+
'sort_number' => options[:sort_number],
|
914
|
+
'reason_taxes_onestr' => options[:reason_taxes_onestr],
|
903
915
|
}
|
904
916
|
uri = URI.parse(@base_url + '/petty_cash_reason_masters/create')
|
905
917
|
api_request(uri, 'POST', params)
|
@@ -1012,7 +1024,8 @@ class TsubaisoSDK
|
|
1012
1024
|
:dc,
|
1013
1025
|
:is_valid,
|
1014
1026
|
:memo,
|
1015
|
-
:account_code
|
1027
|
+
:account_code,
|
1028
|
+
:bank_reason_taxes
|
1016
1029
|
]
|
1017
1030
|
|
1018
1031
|
params = create_parameters(candidate_keys,options)
|
@@ -1144,7 +1157,8 @@ class TsubaisoSDK
|
|
1144
1157
|
:is_valid,
|
1145
1158
|
:memo,
|
1146
1159
|
:port_type,
|
1147
|
-
:sort_number
|
1160
|
+
:sort_number,
|
1161
|
+
:reason_taxes_onestr
|
1148
1162
|
]
|
1149
1163
|
params = create_parameters(candidate_keys,options)
|
1150
1164
|
params['format'] = 'json'
|
@@ -1398,17 +1412,50 @@ class TsubaisoSDK
|
|
1398
1412
|
api_request(uri, 'POST', params)
|
1399
1413
|
end
|
1400
1414
|
|
1415
|
+
def create_reimbursement_reason_masters(options)
|
1416
|
+
params = {
|
1417
|
+
'format' => 'json',
|
1418
|
+
'reason_code' => options[:reason_code],
|
1419
|
+
'reason_name' => options[:reason_name],
|
1420
|
+
'dc' => options[:dc],
|
1421
|
+
'account_code' => options[:account_code],
|
1422
|
+
'sort_number' => options[:sort_number],
|
1423
|
+
'is_valid' => options[:is_valid],
|
1424
|
+
'memo' => options[:memo],
|
1425
|
+
'port_type' => options[:port_type],
|
1426
|
+
'reimbursement_reason_taxes' => options[:reimbursement_reason_taxes],
|
1427
|
+
}
|
1428
|
+
uri = URI.parse(@base_url + '/reimbursement_reason_masters/create')
|
1429
|
+
api_request(uri, 'POST', params)
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
def update_reimbursement_reason_masters(id, options)
|
1433
|
+
params = {
|
1434
|
+
'format' => 'json',
|
1435
|
+
'sort_number' => options[:sort_number],
|
1436
|
+
'reason_code' => options[:reason_code],
|
1437
|
+
'reason_name' => options[:reason_name],
|
1438
|
+
'dc' => options[:dc],
|
1439
|
+
"account_code" => options[:account_code],
|
1440
|
+
'is_valid' => options[:is_valid],
|
1441
|
+
'memo' => options[:memo],
|
1442
|
+
'port_type' => options[:port_type],
|
1443
|
+
}
|
1444
|
+
uri = URI.parse(@base_url + "/reimbursement_reason_masters/update/#{id}")
|
1445
|
+
api_request(uri, 'POST', params)
|
1446
|
+
end
|
1447
|
+
|
1401
1448
|
def list_users
|
1402
1449
|
params = { 'format' => 'json' }
|
1403
1450
|
uri = URI.parse(@base_url + '/users/list')
|
1404
1451
|
api_request(uri, 'GET', params)
|
1405
1452
|
end
|
1406
1453
|
|
1407
|
-
def list_depts
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
end
|
1454
|
+
# def list_depts
|
1455
|
+
# params = { 'format' => 'json' }
|
1456
|
+
# uri = URI.parse(@base_url + '/depts/list/')
|
1457
|
+
# api_request(uri, 'GET', params)
|
1458
|
+
# end
|
1412
1459
|
|
1413
1460
|
def update_system_managements(options)
|
1414
1461
|
params = {
|
@@ -1442,6 +1489,7 @@ class TsubaisoSDK
|
|
1442
1489
|
'enable' => options[:enable],
|
1443
1490
|
'name' => options[:name],
|
1444
1491
|
'description' => options[:description],
|
1492
|
+
'no' => options[:no]
|
1445
1493
|
}
|
1446
1494
|
uri = URI.parse(@base_url + '/ar_segment_masters/create')
|
1447
1495
|
api_request(uri, 'POST', params)
|
@@ -1455,6 +1503,7 @@ class TsubaisoSDK
|
|
1455
1503
|
'enable' => options[:enable],
|
1456
1504
|
'name' => options[:name],
|
1457
1505
|
'description' => options[:description],
|
1506
|
+
'no' => options[:no],
|
1458
1507
|
}
|
1459
1508
|
uri = URI.parse(@base_url + '/ap_segment_masters/create')
|
1460
1509
|
api_request(uri, 'POST', params)
|
@@ -1900,6 +1949,9 @@ class TsubaisoSDK
|
|
1900
1949
|
|
1901
1950
|
def api_request(uri, http_verb, params)
|
1902
1951
|
http = Net::HTTP.new(uri.host, uri.port)
|
1952
|
+
http.open_timeout = @http_option[:open_timeout] if @http_option[:open_timeout]
|
1953
|
+
http.read_timeout = @http_option[:read_timeout] if @http_option[:read_timeout]
|
1954
|
+
|
1903
1955
|
initheader = { 'Content-Type' => 'application/json' }
|
1904
1956
|
http.use_ssl = true if @base_url =~ /^https/
|
1905
1957
|
if http_verb == 'GET'
|
@@ -12,7 +12,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
12
12
|
dc: "d",
|
13
13
|
is_valid: 0,
|
14
14
|
memo: "This reason has been created form API",
|
15
|
-
account_code: 1
|
15
|
+
account_code: 1,
|
16
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
16
17
|
}
|
17
18
|
|
18
19
|
@bank_reason_master_2 = {
|
@@ -22,7 +23,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
22
23
|
dc: "c",
|
23
24
|
is_valid: 0,
|
24
25
|
memo: "This reason has been created form API2",
|
25
|
-
account_code: 1
|
26
|
+
account_code: 1,
|
27
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
26
28
|
}
|
27
29
|
|
28
30
|
@bank_reason_master_3 = {
|
@@ -32,7 +34,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
32
34
|
dc: "d",
|
33
35
|
is_valid: 0,
|
34
36
|
memo: "This reason has been created form API3",
|
35
|
-
account_code: 1
|
37
|
+
account_code: 1,
|
38
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
36
39
|
}
|
37
40
|
|
38
41
|
super("bank_reason_masters")
|
@@ -13,7 +13,8 @@ class PettyCashReasonMaster < Minitest::Test
|
|
13
13
|
is_valid: '0',
|
14
14
|
memo: 'this is test before update',
|
15
15
|
port_type: '0',
|
16
|
-
sort_number: '0'
|
16
|
+
sort_number: '0',
|
17
|
+
reason_taxes_onestr: '免税・簡易・本則/国内/1/3001/210'
|
17
18
|
}
|
18
19
|
|
19
20
|
@petty_cash_reason_master_2 = {
|
@@ -24,7 +25,8 @@ class PettyCashReasonMaster < Minitest::Test
|
|
24
25
|
is_valid: "0",
|
25
26
|
memo: "This is Test reason.",
|
26
27
|
port_type: "0",
|
27
|
-
sort_number: "0"
|
28
|
+
sort_number: "0",
|
29
|
+
reason_taxes_onestr: "免税・簡易・本則/国内/1/3001/210"
|
28
30
|
}
|
29
31
|
super("petty_cash_reason_masters")
|
30
32
|
end
|
@@ -5,18 +5,44 @@ class ReimbursementsTest < Minitest::Test
|
|
5
5
|
include CommonSetupAndTeardown
|
6
6
|
|
7
7
|
def setup
|
8
|
+
txhash = {}
|
9
|
+
txhash[:transaction_timestamp] = '2016-03-01'
|
10
|
+
txhash[:price_value] = 20000
|
11
|
+
txhash[:reason_code] = 'CONFERENCE_EXPENSES_SGA'
|
12
|
+
txhash[:dc] = 'd'
|
13
|
+
txhash[:brief] = '会議費'
|
14
|
+
txhash[:memo] = 'memo'
|
15
|
+
txhash[:tax_type] = '租税公課'
|
16
|
+
|
8
17
|
@reimbursement_1 = {
|
9
18
|
applicant: 'Irfan',
|
10
19
|
application_term: '2016-03-01',
|
11
20
|
staff_code: 'EP2000',
|
12
|
-
memo: 'aaaaaaaa'
|
21
|
+
memo: 'aaaaaaaa',
|
22
|
+
dept_code: 'SETSURITSU',
|
23
|
+
applicant_staff_code: 'EP2001',
|
24
|
+
pay_date: '2016-02-01'
|
13
25
|
}
|
14
26
|
|
15
27
|
@reimbursement_2 = {
|
16
28
|
applicant: 'Matsuno',
|
17
29
|
application_term: '2016-03-01',
|
18
30
|
staff_code: 'EP2000',
|
19
|
-
memo: 'aaaaaaaa'
|
31
|
+
memo: 'aaaaaaaa',
|
32
|
+
dept_code: 'SETSURITSU',
|
33
|
+
applicant_staff_code: 'EP2001',
|
34
|
+
pay_date: '2016-02-01'
|
35
|
+
}
|
36
|
+
|
37
|
+
@reimbursement_3 = {
|
38
|
+
applicant: 'Matsuno',
|
39
|
+
application_term: '2016-03-01',
|
40
|
+
staff_code: 'EP2000',
|
41
|
+
memo: 'aaaaaaaa',
|
42
|
+
dept_code: 'SETSURITSU',
|
43
|
+
applicant_staff_code: 'EP2001',
|
44
|
+
pay_date: '2016-02-01',
|
45
|
+
transactions: txhash
|
20
46
|
}
|
21
47
|
super("reimbursements")
|
22
48
|
end
|
@@ -61,30 +87,10 @@ class ReimbursementsTest < Minitest::Test
|
|
61
87
|
end
|
62
88
|
|
63
89
|
def test_create_reimbursement_and_transactions
|
64
|
-
|
65
|
-
applicant: 'Matsuno',
|
66
|
-
application_term: '2016-03-01',
|
67
|
-
staff_code: 'EP2000',
|
68
|
-
memo: 'aaaaaaaa',
|
69
|
-
pay_date: '2020-1-13',
|
70
|
-
applicant_staff_code: 'test_applicant_code',
|
71
|
-
transactions: [
|
72
|
-
{
|
73
|
-
transaction_timestamp: '2020-1-1',
|
74
|
-
price_value: 1000,
|
75
|
-
reason_code: 'SUPPLIES'
|
76
|
-
}
|
77
|
-
]
|
78
|
-
}
|
79
|
-
|
80
|
-
reimbursement = @api.create_reimbursement(request)
|
90
|
+
reimbursement = @api.create_reimbursement(@reimbursement_3)
|
81
91
|
assert_equal 200, reimbursement[:status].to_i, reimbursement.inspect
|
82
|
-
assert_equal
|
83
|
-
assert_equal
|
84
|
-
assert_equal request_body[:applicant_staff_code], reimbursement[:json][:applicant_staff_code]
|
92
|
+
assert_equal @reimbursement_3[:applicant], reimbursement[:json][:applicant]
|
93
|
+
assert_equal @reimbursement_3[:pay_date], reimbursement[:json][:pay_date]
|
85
94
|
|
86
|
-
reimbursement_transactions = @api.list_reimbursement_transactions(reimbursement[:json][:id])
|
87
|
-
assert_equal 200, reimbursement_transactions[:status].to_i, reimbursement_transactions.inspect
|
88
|
-
assert_equal 1, reimbursement_transactions[:json].size
|
89
95
|
end
|
90
96
|
end
|
@@ -75,14 +75,14 @@ class SaleTest < Minitest::Test
|
|
75
75
|
assert(sales_list[:json].none? { |x| x[:id] == september_sale_id })
|
76
76
|
end
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
78
|
+
def test_update_sale
|
79
|
+
sale = @api.create_sale(@sale_201608)
|
80
|
+
options = {
|
81
|
+
id: sale[:json][:id].to_i,
|
82
|
+
price_including_tax: 25_000,
|
83
|
+
memo: 'Updated memo',
|
84
|
+
data_partner: { id_code: "100" }
|
85
|
+
}
|
86
86
|
|
87
87
|
updated_sale = @api.update_sale(options)
|
88
88
|
assert_equal 200, updated_sale[:status].to_i, updated_sale[:json]
|
@@ -58,14 +58,14 @@ class StaffDataTest < Minitest::Test
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_update_staff_data
|
61
|
+
staff_id = 0
|
61
62
|
options = {
|
62
|
-
staff_id: 0,
|
63
63
|
value: 'Programmer'
|
64
64
|
}
|
65
65
|
|
66
|
-
updated_staff_data = @api.update_staff_data(options)
|
66
|
+
updated_staff_data = @api.update_staff_data(staff_id,options)
|
67
67
|
assert_equal 200, updated_staff_data[:status].to_i, updated_staff_data.inspect
|
68
|
-
assert_equal
|
68
|
+
assert_equal staff_id, updated_staff_data[:json][:id].to_i
|
69
69
|
assert_equal 'Programmer', updated_staff_data[:json][:value]
|
70
70
|
end
|
71
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tsubaiso-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tsubaiso, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.3.26
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: SDK for the Tsubaiso API
|