fakturoid 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 13408620e57d00ed4c3b02ebc8392aaab9303f2d
4
- data.tar.gz: 13bf87848a84b604ce66b8a893d05b99d6e9469f
2
+ SHA256:
3
+ metadata.gz: 2cae22776ba1f641b53df7971a9fff3638dd72d12cd8b5cdaf9119fe50fe6bbd
4
+ data.tar.gz: 8f419fd25dfca96f55350b7191b558901066686b13abaec8dbdd24b40edeca6b
5
5
  SHA512:
6
- metadata.gz: 3770f3fd6fb0a8c4d7c7c5e2cb7e8b3e53cc9f1dfbce8ee93dec9a729cad72323945f26755611bdbf41e36f5e399bebd4f7146f82fdbaedec6fdaf7f999ba03a
7
- data.tar.gz: 6c07e2d652036287fba9c3a3025abb7a4ed34a827d16d5fddc830af845bdbabd2961a874890674217d6fd4044eca1c42e5fb72935e616b6bb40d992ee6350c0e
6
+ metadata.gz: 0d811acd5330902725beee5c17be2def9ac46a5818669e0a95003603aceca34239f93bbb07bc9d90f57f55aed027f5de2fa0bc5bd04eab3ef232d9f2024e69d5
7
+ data.tar.gz: 2554b7dd7c746b2eb08ddc3374f70ee5854d0f9e211a8974c96ff663c78032b1314843a8386ef0314bc9c315fdbef0608921b4f2ac2dcf78c59a03cda15f83e9
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.6.3
6
+ environment:
7
+ TZ: /usr/share/zoneinfo/Europe/Prague
8
+ steps:
9
+ - checkout
10
+ - run:
11
+ name: Install gems
12
+ command: bundle install --path=vendor/bundle --jobs=4 --retry=3
13
+ - run:
14
+ name: Run tests
15
+ command: bundle exec rake test
@@ -1 +1 @@
1
- 2.4.3
1
+ 2.6.3
@@ -1,3 +1,17 @@
1
+ ## 0.3.0
2
+
3
+ - Add support for `variable_symbol` and `bank_account_id` param in invoice `fire` method.
4
+
5
+ ```ruby
6
+ Fakturoid::Client::Invoice.fire(1234, 'pay', paid_at: '2017-07-03', paid_amount: '100.23', variable_symbol: '12345678', bank_account_id: 123)
7
+ ```
8
+
9
+ - Add support for `paid_on`, `paid_amount`, `variable_symbol` and `bank_account_id` params in expense `fire` method.
10
+
11
+ ```ruby
12
+ Fakturoid::Client::Expense.fire(1234, 'pay', paid_on: '2017-07-03', paid_amount: '100.23', variable_symbol: '12345678', bank_account_id: 123)
13
+ ```
14
+
1
15
  ## 0.2.1
2
16
 
3
17
  - Add support for `paid_amount` param in invoice `fire` method.
data/README.md CHANGED
@@ -79,31 +79,31 @@ For the list of all returned user fields see the [Users API documentation](http:
79
79
  To get all subjects run (Subjects are paginated by 20 per page):
80
80
 
81
81
  ```ruby
82
- response = Fakturoid::Client::Subject.all page: 2
82
+ response = Fakturoid::Client::Subject.all(page: 2)
83
83
  ```
84
84
 
85
85
  Fulltext search subjects:
86
86
 
87
87
  ```ruby
88
- response = Fakturoid::Client::Subject.search 'Client name'
88
+ response = Fakturoid::Client::Subject.search('Client name')
89
89
  ```
90
90
 
91
91
  To find one subject use:
92
92
 
93
93
  ```ruby
94
- response = Fakturoid::Client::Subject.find subject_id
94
+ response = Fakturoid::Client::Subject.find(subject_id)
95
95
  ```
96
96
 
97
97
  You can create new subject with:
98
98
 
99
99
  ```ruby
100
- response = Fakturoid::Client::Subject.create name: 'New client'
100
+ response = Fakturoid::Client::Subject.create(name: 'New client')
101
101
  ```
102
102
 
103
103
  To update subject use following code:
104
104
 
105
105
  ```ruby
106
- response = Fakturoid::Client::Subject.update subject_id, name: 'Updated client'
106
+ response = Fakturoid::Client::Subject.update(subject_id, name: 'Updated client')
107
107
  ```
108
108
 
109
109
  Delete subject:
@@ -119,25 +119,25 @@ For the list of all subject fields and options see the [Subjects API documentati
119
119
  To get all invoices run (Invoices are paginated by 20 per page):
120
120
 
121
121
  ```ruby
122
- response = Fakturoid::Client::Invoice.all page: 2
122
+ response = Fakturoid::Client::Invoice.all(page: 2)
123
123
  ```
124
124
 
125
125
  Fulltext search invoices:
126
126
 
127
127
  ```ruby
128
- response = Fakturoid::Client::Invoice.search 'Client name'
128
+ response = Fakturoid::Client::Invoice.search('Client name')
129
129
  ```
130
130
 
131
131
  To find one invoice use:
132
132
 
133
133
  ```ruby
134
- response = Fakturoid::Client::Invoice.find invoice_id
134
+ response = Fakturoid::Client::Invoice.find(invoice_id)
135
135
  ```
136
136
 
137
137
  To download invoice in PDF format you can use following code:
138
138
 
139
139
  ```ruby
140
- response = Fakturoid::Client::Invoice.download_pdf invoice_id
140
+ response = Fakturoid::Client::Invoice.download_pdf(invoice_id)
141
141
 
142
142
  File.open '/path/to/file.pdf', 'w' do |f|
143
143
  f.write response.body
@@ -159,13 +159,13 @@ invoice = {
159
159
  }
160
160
  ]
161
161
  }
162
- response = Fakturoid::Client::Invoice.create invoice
162
+ response = Fakturoid::Client::Invoice.create(invoice)
163
163
  ```
164
164
 
165
165
  Invoice actions (eg. pay invoice):
166
166
 
167
167
  ```ruby
168
- response = Fakturoid::Client::Invoice.fire invoice_id, 'pay'
168
+ response = Fakturoid::Client::Invoice.fire(invoice_id, 'pay')
169
169
  ```
170
170
 
171
171
  Send invoice with customized message (for more information see [the API Documentation](http://docs.fakturoid.apiary.io/#messages)):
@@ -185,13 +185,13 @@ response.status_code # => 201
185
185
  To update invoice use following code:
186
186
 
187
187
  ```ruby
188
- response = Fakturoid::Client::Invoice.update invoice_id, number: '2015-0015'
188
+ response = Fakturoid::Client::Invoice.update(invoice_id, number: '2015-0015')
189
189
  ```
190
190
 
191
191
  Delete invoice:
192
192
 
193
193
  ```ruby
194
- response = Fakturoid::Client::Invoice.delete invoice_id
194
+ response = Fakturoid::Client::Invoice.delete(invoice_id)
195
195
  ```
196
196
 
197
197
  For the list of all invoice fields and options see the [Invoices API documentation](http://docs.fakturoid.apiary.io/#invoices)
@@ -6,7 +6,7 @@ require 'fakturoid/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fakturoid"
8
8
  s.version = Fakturoid::VERSION
9
- s.authors = ["Eda Riedl", "Lukáš Konarovský"]
9
+ s.authors = ["Eda Riedl", "Lukáš Konarovský", "Oldřich Vetešník"]
10
10
  s.email = ["podpora@fakturoid.cz"]
11
11
  s.summary = %q{Ruby client for web based invoicing service www.fakturoid.cz}
12
12
  s.description = %q{Ruby client for web based invoicing service www.fakturoid.cz}
@@ -17,9 +17,12 @@ module Fakturoid
17
17
  get_request('expenses/search.json', request_params: { query: query })
18
18
  end
19
19
 
20
- def self.fire(id, event)
20
+ def self.fire(id, event, params = {})
21
+ request_params = permit_params(params, :paid_on, :paid_amount, :variable_symbol, :bank_account_id) || {}
22
+ request_params[:event] = event
23
+
21
24
  validate_numerical_id(id)
22
- post_request("expenses/#{id}/fire.json", request_params: { event: event })
25
+ post_request("expenses/#{id}/fire.json", request_params: request_params)
23
26
  end
24
27
 
25
28
  def self.create(payload = {})
@@ -35,7 +35,7 @@ module Fakturoid
35
35
  end
36
36
 
37
37
  def self.fire(id, event, params = {})
38
- request_params = permit_params(params, :paid_at, :paid_amount) || {}
38
+ request_params = permit_params(params, :paid_at, :paid_amount, :variable_symbol, :bank_account_id) || {}
39
39
  request_params[:event] = event
40
40
 
41
41
  validate_numerical_id(id)
@@ -19,6 +19,7 @@ module Fakturoid
19
19
  http_connection = connection(params)
20
20
  response = http_connection.send(method) do |req|
21
21
  req.url path, request_params
22
+ req.headers['X-Client-Env'] = "Ruby #{RUBY_VERSION}"
22
23
  req.body = MultiJson.dump(params[:payload]) if params.key?(:payload)
23
24
  end
24
25
  Response.new(response, caller, method)
@@ -1,3 +1,3 @@
1
1
  module Fakturoid
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakturoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eda Riedl
8
8
  - Lukáš Konarovský
9
+ - Oldřich Vetešník
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2018-04-24 00:00:00.000000000 Z
13
+ date: 2019-08-13 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: multi_json
@@ -130,6 +131,7 @@ executables: []
130
131
  extensions: []
131
132
  extra_rdoc_files: []
132
133
  files:
134
+ - ".circleci/config.yml"
133
135
  - ".gitignore"
134
136
  - ".rubocop.yml"
135
137
  - ".ruby-version"
@@ -188,8 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
190
  - !ruby/object:Gem::Version
189
191
  version: '0'
190
192
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.6.14
193
+ rubygems_version: 3.0.3
193
194
  signing_key:
194
195
  specification_version: 4
195
196
  summary: Ruby client for web based invoicing service www.fakturoid.cz