tsubaiso-sdk 1.2.12 → 1.2.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ab0090c36f342bd373de2eae64dcb501dc728cf500b4bfd7ff4c2ef2483cfb
4
- data.tar.gz: 1ae4c0635a0debc2e331f51f2a9f2369c3efd3845cddec767105d1eecb011ff2
3
+ metadata.gz: ec41b4df9639ca7f338fbb1a004f8411c90d7c48be7fb8b89cd876cf63ed5254
4
+ data.tar.gz: eb4b3ef1927418867425f11bdbcdff76437cbe8cd477089d5076480f7756a829
5
5
  SHA512:
6
- metadata.gz: f0d7ca2a29d15722668a24d183f4e7147be4758f91ce04b09e20a45ca497f690c12f38a5e659b38c75bc4165a16881c65a4157d0fc9dc7c3b639244c139cfd4e
7
- data.tar.gz: 84be4f0d1ef8cec0f0b0d8b51c162d314965b2235b310ab6b7a2684370b1fac4380d07e5fbdc8da898db55fe64043350b3815d3f46b7a19f3a82e846a0fa0277
6
+ metadata.gz: b86e3df1e6c9993d99a21afd233deafef7f5944c65883d1be17deda047f3c649fec65110ebf05b4d2b5b1114aa5f22a12618c18479d4c2fbd5124209bdfdec1b
7
+ data.tar.gz: '089fce1bd0be1a320af5b970b229d066e1ffeb1324b1dab4227b4f03bb06c03c3a8814e0a21be4cd81ec90f92b457a8f955830ad8e5bb6d4f8563cbe63d582b9'
data/lib/tsubaiso_sdk.rb CHANGED
@@ -681,6 +681,8 @@ class TsubaisoSDK
681
681
  'port_type' => options[:port_type],
682
682
  'tag_list' => options[:tag_list],
683
683
  'data_partner' => options[:data_partner],
684
+ 'scheduled_pay_method' => options[:scheduled_pay_method],
685
+ 'scheduled_pay_interface_id' => options[:scheduled_pay_interface_id],
684
686
  'format' => 'json'
685
687
  }
686
688
  uri = URI.parse(@base_url + '/ap_payments/create')
@@ -701,6 +703,8 @@ class TsubaisoSDK
701
703
  'tag_list' => options[:tag_list],
702
704
  'data_partner' => options[:data_partner],
703
705
  'key' => options[:key],
706
+ 'scheduled_pay_method' => options[:scheduled_pay_method],
707
+ 'scheduled_pay_interface_id' => options[:scheduled_pay_interface_id],
704
708
  'format' => 'json'
705
709
  }
706
710
  uri = URI.parse(@base_url + '/ap_payments/find_or_create')
@@ -1605,8 +1609,9 @@ class TsubaisoSDK
1605
1609
  api_request(uri, 'GET', params)
1606
1610
  end
1607
1611
 
1608
- def list_ap_cashflow_schedule(year, month)
1612
+ def list_ap_cashflow_schedule(year, month, options = {})
1609
1613
  params = { 'format' => 'json' }
1614
+ params['pay_method'] = options[:pay_method] if options
1610
1615
  uri = URI.parse(@base_url + "/ap_reports/list_cashflow_schedule/#{year}/#{month}")
1611
1616
  api_request(uri, 'GET', params)
1612
1617
  end
@@ -1857,6 +1862,31 @@ class TsubaisoSDK
1857
1862
  api_request(uri, 'POST', params)
1858
1863
  end
1859
1864
 
1865
+ def list_corporate_data(options)
1866
+ candidate_keys = [
1867
+ :code
1868
+ ]
1869
+ params = create_parameters(candidate_keys, options)
1870
+ uri = URI.parse(@base_url + "/corporate_data/list")
1871
+ api_request(uri, 'GET', params)
1872
+ end
1873
+
1874
+ # options: id: 会社基本情報Id, data: Base64エンコードデータ, filename: ファイル名, contenttype: Content-Type
1875
+ # id で指定した corporate_datum が存在している必要があります。
1876
+ # その corporate_datum の corporate_datum_master の input_type が 'image' である必要があります。
1877
+ # 既存の添付ファイルは削除されて差し替えられます。
1878
+ def update_attachment_to_corporate_data(options)
1879
+ candidate_keys = [
1880
+ :id,
1881
+ :data,
1882
+ :filename,
1883
+ :contenttype
1884
+ ]
1885
+ params = create_parameters(candidate_keys, options)
1886
+ uri = URI.parse(@base_url + '/corporate_data/update_attachment')
1887
+ api_request(uri, 'POST', params)
1888
+ end
1889
+
1860
1890
  private
1861
1891
 
1862
1892
 
@@ -0,0 +1,47 @@
1
+ require 'minitest/autorun'
2
+ require_relative './common_setup_and_teardown.rb'
3
+
4
+ class ApReportTest < Minitest::Test
5
+ include CommonSetupAndTeardown
6
+
7
+ def setup
8
+ super("ap_reports")
9
+ end
10
+
11
+ def test_list_ap_cashflow_schedule
12
+ url = @api.instance_variable_get(:@base_url) + "/ap_reports/list_cashflow_schedule/2019/12"
13
+
14
+ request_headers = {
15
+ 'Accept'=>'*/*',
16
+ 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
17
+ 'Content-Type'=>'application/json',
18
+ 'User-Agent'=>'Ruby',
19
+ "Access-Token" => @api.instance_variable_get(:@access_token)
20
+ }
21
+
22
+ req_fixture_path = "test/stubbings/fixtures/ap_reports_list_cashflow_schedule_request.json"
23
+ req_stubs = JSON.load(File.read(req_fixture_path))
24
+ req_stubs.each do |params|
25
+ params.merge!(format: 'json')
26
+ end
27
+
28
+ response_body = {}
29
+
30
+ stub_request(:get, url)
31
+ .with({ headers: request_headers }.merge({ body: req_stubs[0] }))
32
+ .to_return({ status: 200 }.merge( { body: response_body.to_json } ))
33
+
34
+ # Without pay_method option parameters
35
+ schedule_list = @api.list_ap_cashflow_schedule(2019, 12)
36
+ assert_equal 200, schedule_list[:status].to_i, schedule_list.inspect
37
+
38
+ stub_request(:get, url)
39
+ .with({ headers: request_headers }.merge({ body: req_stubs[1] }))
40
+ .to_return({ status: 200 }.merge( { body: response_body.to_json } ))
41
+
42
+ # With pay_method option parameters
43
+ schedule_list_with_opts = @api.list_ap_cashflow_schedule(2019, 12,
44
+ { :pay_method => 'BANK_FB' })
45
+ assert_equal 200, schedule_list_with_opts[:status].to_i, schedule_list_with_opts.inspect
46
+ end
47
+ end
@@ -17,7 +17,9 @@ class PurchaseTest < Minitest::Test
17
17
  memo: '',
18
18
  tax_code: 1007,
19
19
  port_type: 1,
20
- data_partner: { link_url: 'www.example.com/3', id_code: '3', partner_code: 'Example' }
20
+ data_partner: { link_url: 'www.example.com/3', id_code: '3', partner_code: 'Example' },
21
+ scheduled_pay_method: 'BANK_FB',
22
+ scheduled_pay_interface_id: 2
21
23
  }
22
24
 
23
25
  @purchase_201609 = {
@@ -83,7 +85,9 @@ class PurchaseTest < Minitest::Test
83
85
  id: purchase[:json][:id].to_i,
84
86
  price_including_tax: 50_000,
85
87
  memo: 'Updated memo',
86
- data_partner: { id_code: '300' }
88
+ data_partner: { id_code: '300' },
89
+ scheduled_pay_method: 'BANK_AUTOMATIC',
90
+ scheduled_pay_interface_id: 1
87
91
  }
88
92
 
89
93
  updated_purchase = @api.update_purchase(options)
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.12
4
+ version: 1.2.13
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-02-28 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -65,6 +65,7 @@ files:
65
65
  - test/test_tsubaiso_api.rb
66
66
  - test/tsubaiso_sdk/common_setup_and_teardown.rb
67
67
  - test/tsubaiso_sdk/test_ap_reason_masters.rb
68
+ - test/tsubaiso_sdk/test_ap_report.rb
68
69
  - test/tsubaiso_sdk/test_api_history.rb
69
70
  - test/tsubaiso_sdk/test_ar_reason_masters.rb
70
71
  - test/tsubaiso_sdk/test_bank_account.rb