moneybird 0.9.8 → 0.9.9

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: ea6ea233e3e874422aaa04be16868b737a7ca0ca48a018f5503ff7e585c3097b
4
- data.tar.gz: dff514189705123f3d95232a913afc96e0d55d35795baf2c5e40bd42e88897f2
3
+ metadata.gz: bb2e7783bb5c1bd07ba829b99c43d6ca6ea6eb5649d6249078d0280f0d259dab
4
+ data.tar.gz: c8ef2679c43ee7188a36576afa9ccc83104814901913a96ba1d99c29428fe25b
5
5
  SHA512:
6
- metadata.gz: a8b71a1ae20bb85f7e1777e0221188d4fd9728f6984e968c12b12df28c5c91bbd31997f3d6c4597ca50c52b19b0d88bcc9fdc39ebe8569640451e503201231cf
7
- data.tar.gz: 941d51ed4c7067a72cf3c3ae972f9c993fa6bd0f9ce6938cbc226fc5ccfc6d755262d966e24015e8e26dc440666d4c5b1fbe8080879e4d1fd27c255b4fde9fad
6
+ metadata.gz: 225222a355ac19b5f2c0f389093530d9d56dfca297e696b9c94a299b01ac9cf847a917e955e052a1c58895cfcfd3237e9b131a7f5db86d0d7f9b8926145525c9
7
+ data.tar.gz: 551b6160c997ad504335eb3aa383cee559d3b09fde1ea3434e382348d5452f08a09a610ae4af20b8c86c466a1645546c75b6f45dd5a7bcb6bc14a264658b14bc
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "04:00"
8
+ open-pull-requests-limit: 10
9
+
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "daily"
@@ -0,0 +1,23 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ matrix:
12
+ ruby_version: [2.4, 2.5, 2.6]
13
+ steps:
14
+ - uses: actions/checkout@v2.3.4
15
+ - name: Set up Ruby
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby_version }}
19
+ - name: Build and test with Rake
20
+ run: |
21
+ gem install bundler
22
+ bundle install --jobs 4 --retry 3
23
+ bundle exec rake
@@ -58,6 +58,7 @@ require 'moneybird/resource/ledger_account'
58
58
  require 'moneybird/resource/product'
59
59
  require 'moneybird/resource/recurring_sales_invoice' # Depends on generic and invoice resources
60
60
  require 'moneybird/resource/sales_invoice' # Depends on generic and invoice resources
61
+ require 'moneybird/resource/external_sales_invoice'
61
62
  require 'moneybird/resource/synchronization'
62
63
  require 'moneybird/resource/tax_rate'
63
64
  require 'moneybird/resource/webhook'
@@ -92,6 +93,7 @@ require 'moneybird/service/ledger_account'
92
93
  require 'moneybird/service/product'
93
94
  require 'moneybird/service/recurring_sales_invoice'
94
95
  require 'moneybird/service/sales_invoice'
96
+ require 'moneybird/service/external_sales_invoice'
95
97
  require 'moneybird/service/tax_rate'
96
98
  require 'moneybird/service/webhook'
97
99
  require 'moneybird/service/workflow'
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class AuthorizationRequired < StandardError
3
+ class AuthorizationRequired < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class BadRequest < StandardError
3
+ class BadRequest < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class Forbidden < StandardError
3
+ class Forbidden < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class InternalServerError < StandardError
3
+ class InternalServerError < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class MethodNotAllowed < StandardError
3
+ class MethodNotAllowed < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class NotAccepted < StandardError
3
+ class NotAccepted < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class NotFound < StandardError
3
+ class NotFound < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class PaymentRequired < StandardError
3
+ class PaymentRequired < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class TooManyRequests < StandardError
3
+ class TooManyRequests < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Moneybird
2
2
  module HttpError
3
- class UnprocessableEntity < StandardError
3
+ class UnprocessableEntity < Faraday::Error
4
4
  end
5
5
  end
6
6
  end
@@ -18,7 +18,11 @@ module Moneybird
18
18
 
19
19
  def on_complete(response)
20
20
  key = response[:status].to_i
21
- raise ERROR_MAP[key], response if ERROR_MAP.key? key
21
+ raise ERROR_MAP[key], response_values(response) if ERROR_MAP.key? key
22
+ end
23
+
24
+ def response_values(response)
25
+ { status: response.status, headers: response.response_headers, body: response.body }
22
26
  end
23
27
  end
24
28
  end
@@ -24,6 +24,10 @@ module Moneybird::Resource
24
24
  Moneybird::Service::SalesInvoice.new(@client, id)
25
25
  end
26
26
 
27
+ def external_sales_invoices
28
+ Moneybird::Service::ExternalSalesInvoice.new(@client, id)
29
+ end
30
+
27
31
  def recurring_sales_invoices
28
32
  Moneybird::Service::RecurringSalesInvoice.new(@client, id)
29
33
  end
@@ -43,6 +43,8 @@ module Moneybird::Resource
43
43
  sepa_mandate_date
44
44
  sepa_mandate_id
45
45
  sepa_sequence_type
46
+ si_identifier
47
+ si_identifier_type
46
48
  tax_number
47
49
  tax_number_valid
48
50
  tax_number_validated_at
@@ -0,0 +1,61 @@
1
+ module Moneybird::Resource
2
+ class ExternalSalesInvoice
3
+ include Moneybird::Resource
4
+ extend Moneybird::Resource::ClassMethods
5
+
6
+ has_attributes %i(
7
+ id
8
+ administration_id
9
+ contact_id
10
+ contact
11
+ date
12
+ state
13
+ due_date
14
+ reference
15
+ entry_number
16
+ origin
17
+ source
18
+ source_url
19
+ currency
20
+ paid_at
21
+ created_at
22
+ updated_at
23
+ version
24
+ details
25
+ payments
26
+ notes
27
+ attachments
28
+ events
29
+ tax_totals
30
+ total_paid
31
+ total_unpaid
32
+ total_unpaid_base
33
+ prices_are_incl_tax
34
+ total_price_excl_tax
35
+ total_price_excl_tax_base
36
+ total_price_incl_tax
37
+ total_price_incl_tax_base
38
+ )
39
+
40
+ def notes=(notes)
41
+ @notes ||= notes.map{ |note| Moneybird::Resource::Generic::Note.build(note) }
42
+ end
43
+
44
+ def contact=(attributes)
45
+ @contact = Moneybird::Resource::Contact.build(attributes)
46
+ end
47
+
48
+ def payments=(payments)
49
+ payment_data = payments.map{ |payment| Moneybird::Resource::Invoice::Payment.build(payment) }
50
+ @payments = Moneybird::Service::Payment.new(client, administration_id, preloaded_data: payment_data, invoice_id: id)
51
+ end
52
+
53
+ def details=(line_items)
54
+ @details = line_items.map{ |line_item| Moneybird::Resource::Invoice::Details.build(line_item) }
55
+ end
56
+
57
+ def events=(events)
58
+ @events ||= events.map{ |event| Moneybird::Resource::Generic::Event.build(event) }
59
+ end
60
+ end
61
+ end
@@ -14,6 +14,7 @@ module Moneybird::Resource::Invoice
14
14
  period
15
15
  price
16
16
  product_id
17
+ project_id
17
18
  row_order
18
19
  tax_rate_id
19
20
  tax_report_reference
@@ -16,6 +16,7 @@ module Moneybird::Resource::Invoice
16
16
  payment_transaction_id
17
17
  price
18
18
  price_base
19
+ transaction_identifier
19
20
  updated_at
20
21
  user_id
21
22
  )
@@ -0,0 +1,20 @@
1
+ module Moneybird::Service
2
+ class ExternalSalesInvoice
3
+ include Moneybird::Traits::AdministrationService
4
+ include Moneybird::Traits::Service
5
+ include Moneybird::Traits::Find
6
+ include Moneybird::Traits::FindAll
7
+ include Moneybird::Traits::Save
8
+ include Moneybird::Traits::Delete
9
+
10
+ private
11
+
12
+ def resource_class
13
+ Moneybird::Resource::ExternalSalesInvoice
14
+ end
15
+
16
+ def path
17
+ "#{administration_id}/external_sales_invoices"
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Moneybird
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
3
3
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "link_header", "~> 0.0.8"
26
26
 
27
27
  spec.add_development_dependency "bundler", [">= 1.11", "< 3.0"]
28
- spec.add_development_dependency "rake", "~> 12.3"
28
+ spec.add_development_dependency "rake", "~> 13.0"
29
29
  spec.add_development_dependency "codeclimate-test-reporter"
30
30
  spec.add_development_dependency "minitest"
31
31
  spec.add_development_dependency "webmock", "~> 3.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moneybird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten van Vliet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '12.3'
95
+ version: '13.0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '12.3'
102
+ version: '13.0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: codeclimate-test-reporter
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,8 @@ extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
152
  - ".codeclimate.yml"
153
+ - ".github/dependabot.yml"
154
+ - ".github/workflows/ruby.yml"
153
155
  - ".gitignore"
154
156
  - ".kick"
155
157
  - ".rspec"
@@ -187,6 +189,7 @@ files:
187
189
  - lib/moneybird/resource/documents/receipt.rb
188
190
  - lib/moneybird/resource/documents/typeless_document.rb
189
191
  - lib/moneybird/resource/estimate.rb
192
+ - lib/moneybird/resource/external_sales_invoice.rb
190
193
  - lib/moneybird/resource/financial_account.rb
191
194
  - lib/moneybird/resource/financial_mutation.rb
192
195
  - lib/moneybird/resource/generic/event.rb
@@ -211,6 +214,7 @@ files:
211
214
  - lib/moneybird/service/documents/receipt.rb
212
215
  - lib/moneybird/service/documents/typeless_document.rb
213
216
  - lib/moneybird/service/estimate.rb
217
+ - lib/moneybird/service/external_sales_invoice.rb
214
218
  - lib/moneybird/service/financial_account.rb
215
219
  - lib/moneybird/service/financial_mutation.rb
216
220
  - lib/moneybird/service/identity.rb
@@ -253,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
257
  - !ruby/object:Gem::Version
254
258
  version: '0'
255
259
  requirements: []
256
- rubygems_version: 3.0.2
260
+ rubygems_version: 3.0.3
257
261
  signing_key:
258
262
  specification_version: 4
259
263
  summary: Library to interface with Moneybird API