papierkram_api_client 0.2.0 → 0.2.2

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
2
  SHA256:
3
- metadata.gz: c428355fa2303fe4086587e47b981b46eac42c498ea84cb2ada942b8b926e1d1
4
- data.tar.gz: 63f9f3524d98be430356ebc7e19bc344a0e388f9b99c71dcd4303a7427fd0635
3
+ metadata.gz: c711543eff8d01b4052e9de92dc9d3a4f436107c71c9944ab63d5943d28d73a9
4
+ data.tar.gz: 156999ce0d5031096ee95cf034849bc7f3b7bf29c3321daec47cd75f228391b7
5
5
  SHA512:
6
- metadata.gz: c4a0d1e8ae94400e56919997bd82daa69cec0ee3b3e6c26d0525e952c6f075238effe6a589c7217c4d89658ec7e2c41c61159b06362898cf4aed7c7f50399103
7
- data.tar.gz: b9abc76a4a14af64eaaa07f98e925a164b1474c40e4a618830966c269c3bccb4f28d8334a07b1ea4672b295e6f3d1ef6808bbbae6147bef4b211b0776bda200c
6
+ metadata.gz: 0104eda136279d4c82cf0671d1e5c64650f9eeda00a5b26813bd16f85756168747816b68a0a1c576f9a513a10d7e133b99055a9aab75240395ce0cfdc3867f2e
7
+ data.tar.gz: 377a731d8eaadc2016d264390963fcb995673815a35053c5ee9ee3c1bb83b783a77fda9568db2b15149df69f8c752636521bde07009ee773c46c301dd1fa6b50
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  require:
2
2
  - rubocop-minitest
3
+ - rubocop-performance
4
+ - rubocop-rake
3
5
 
4
6
  AllCops:
5
7
  NewCops: enable
@@ -29,3 +31,10 @@ Metrics/ParameterLists:
29
31
  Max: 8
30
32
  Exclude:
31
33
  - "lib/api/v1/**/*"
34
+
35
+ Metrics/ClassLength:
36
+ CountAsOne:
37
+ - "array"
38
+ - "hash"
39
+ - "heredoc"
40
+ - "method_call"
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.2] - 2023-06-28
4
+
5
+ ### Fixed
6
+
7
+ - [#29](https://github.com/simonneutert/papierkram_api_client/pull/29) Fixing namespaces in tests. [@simonneutert](https://github.com/simonneutert)
8
+
9
+ ### Changed
10
+
11
+ - [#24](https://github.com/simonneutert/papierkram_api_client/pull/24) Changes logo to a red version one, to match the NodeJS sister project. [@simonneutert](https://github.com/simonneutert), [@rabocalypse](https://github.com/rabocalypse)
12
+
13
+ ### Added
14
+
15
+ - [#44](https://github.com/simonneutert/papierkram_api_client/pull/44) Adds CRUD endpoint support for contact companies. [@simonneutert](https://github.com/simonneutert)
16
+ - [#22](https://github.com/simonneutert/papierkram_api_client/pull/22) Factors out VcrSanitizer and adds some more Rubocop goodness. [@simonneutert](https://github.com/simonneutert)
17
+ - [#21](https://github.com/simonneutert/papierkram_api_client/pull/21) Adds more auto-sanitizing in VCR. [@simonneutert](https://github.com/simonneutert)
18
+
19
+ ## [0.2.1] - 2023-04-21
20
+
21
+ ### Added
22
+
23
+ - [#20](https://github.com/simonneutert/papierkram_api_client/pull/20) Adds Banking::Transactions as endpoint with tests. [@simonneutert](https://github.com/simonneutert)
24
+
3
25
  ## [0.2.0] - 2023-04-18
4
26
 
5
27
  Das Namespacing hat sich geändert. Die Klasse `PapierkramApiClient` ist jetzt `PapierkramApi::Client`.
data/Gemfile CHANGED
@@ -5,10 +5,12 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in papierkram_api_client.gemspec
6
6
  gemspec
7
7
 
8
- gem 'minitest', '~> 5.0'
8
+ gem 'minitest', '~> 5.18'
9
9
  gem 'minitest-vcr', '~> 1.4'
10
10
  gem 'pry', '~> 0.14.2'
11
11
  gem 'rake', '~> 13.0'
12
- gem 'rubocop', '~> 1.50'
13
- gem 'rubocop-minitest', '~> 0.30.0'
14
- gem 'vcr', '~> 6.1'
12
+ gem 'rubocop', '~> 1.53', require: false
13
+ gem 'rubocop-minitest', '~> 0.31.0', require: false
14
+ gem 'rubocop-performance', '~> 1.18', require: false
15
+ gem 'rubocop-rake', '~> 0.6.0', require: false
16
+ gem 'vcr', '~> 6.2'
data/Gemfile.lock CHANGED
@@ -1,59 +1,68 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- papierkram_api_client (0.2.0)
4
+ papierkram_api_client (0.2.2)
5
5
  faraday (~> 2.7)
6
- httpx (~> 0.22.5)
6
+ httpx (>= 0.22.5, < 0.25.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
12
  coderay (1.1.3)
13
- faraday (2.7.4)
13
+ faraday (2.7.7)
14
14
  faraday-net_http (>= 2.0, < 3.1)
15
15
  ruby2_keywords (>= 0.0.4)
16
16
  faraday-net_http (3.0.2)
17
17
  http-2-next (0.5.1)
18
- httpx (0.22.5)
18
+ httpx (0.24.0)
19
19
  http-2-next (>= 0.4.1)
20
20
  json (2.6.3)
21
+ language_server-protocol (3.17.0.3)
21
22
  method_source (1.0.0)
22
23
  minispec-metadata (2.0.0)
23
24
  minitest
24
- minitest (5.18.0)
25
+ minitest (5.18.1)
25
26
  minitest-vcr (1.4.0)
26
27
  minispec-metadata (~> 2.0)
27
28
  minitest (>= 4.7.5)
28
29
  vcr (>= 2.9)
29
- parallel (1.22.1)
30
- parser (3.2.2.0)
30
+ parallel (1.23.0)
31
+ parser (3.2.2.3)
31
32
  ast (~> 2.4.1)
33
+ racc
32
34
  pry (0.14.2)
33
35
  coderay (~> 1.1)
34
36
  method_source (~> 1.0)
37
+ racc (1.7.1)
35
38
  rainbow (3.1.1)
36
39
  rake (13.0.6)
37
- regexp_parser (2.8.0)
40
+ regexp_parser (2.8.1)
38
41
  rexml (3.2.5)
39
- rubocop (1.50.2)
42
+ rubocop (1.53.1)
40
43
  json (~> 2.3)
44
+ language_server-protocol (>= 3.17.0)
41
45
  parallel (~> 1.10)
42
- parser (>= 3.2.0.0)
46
+ parser (>= 3.2.2.3)
43
47
  rainbow (>= 2.2.2, < 4.0)
44
48
  regexp_parser (>= 1.8, < 3.0)
45
49
  rexml (>= 3.2.5, < 4.0)
46
50
  rubocop-ast (>= 1.28.0, < 2.0)
47
51
  ruby-progressbar (~> 1.7)
48
52
  unicode-display_width (>= 2.4.0, < 3.0)
49
- rubocop-ast (1.28.0)
53
+ rubocop-ast (1.29.0)
50
54
  parser (>= 3.2.1.0)
51
- rubocop-minitest (0.30.0)
55
+ rubocop-minitest (0.31.0)
52
56
  rubocop (>= 1.39, < 2.0)
57
+ rubocop-performance (1.18.0)
58
+ rubocop (>= 1.7.0, < 2.0)
59
+ rubocop-ast (>= 0.4.0)
60
+ rubocop-rake (0.6.0)
61
+ rubocop (~> 1.0)
53
62
  ruby-progressbar (1.13.0)
54
63
  ruby2_keywords (0.0.5)
55
64
  unicode-display_width (2.4.2)
56
- vcr (6.1.0)
65
+ vcr (6.2.0)
57
66
 
58
67
  PLATFORMS
59
68
  arm64-darwin-22
@@ -61,14 +70,16 @@ PLATFORMS
61
70
  x86_64-linux
62
71
 
63
72
  DEPENDENCIES
64
- minitest (~> 5.0)
73
+ minitest (~> 5.18)
65
74
  minitest-vcr (~> 1.4)
66
75
  papierkram_api_client!
67
76
  pry (~> 0.14.2)
68
77
  rake (~> 13.0)
69
- rubocop (~> 1.50)
70
- rubocop-minitest (~> 0.30.0)
71
- vcr (~> 6.1)
78
+ rubocop (~> 1.53)
79
+ rubocop-minitest (~> 0.31.0)
80
+ rubocop-performance (~> 1.18)
81
+ rubocop-rake (~> 0.6.0)
82
+ vcr (~> 6.2)
72
83
 
73
84
  BUNDLED WITH
74
- 2.4.8
85
+ 2.4.12
data/README.md CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  [![Ruby](https://github.com/simonneutert/papierkram_api_client/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/simonneutert/papierkram_api_client/actions/workflows/main.yml)
4
4
 
5
- Der erste ~~illegale~~ inoffizielle API Client in [Ruby](https://www.ruby-lang.org/de/) für [Papierkram.de](https://www.papierkram.de)!
5
+ Der erste ~~illegale~~ inoffizielle API Client in [Ruby](https://www.ruby-lang.org/de/) für [Papierkram.de](https://www.papierkram.de) als [Gem](https://rubygems.org/gems/papierkram_api_client) in dein Projekt!
6
6
 
7
- ### Hol mehr aus deinen Daten raus! Dieser Client bietet dir bald einige Features im Bereich [Business Intelligence](#business-intelligence)!<!-- omit in toc -->
7
+ <div align="center">
8
+ <img src="logo.svg" alt="PAC Logo, Zunge leckt an Karl Klammer und zieht Daten aus dem Papierkram-Account wie Frosch die Fliege vom Teich" width="300">
9
+ </div>
8
10
 
9
11
  ---
10
12
 
11
- <img src="pac.svg" alt="PAC Logo, Zunge leckt an Karl Klammer und zieht Daten aus dem Papierkram-Account wie Frosch die Fliege vom Teich" width="300">
12
-
13
- Hol dir den [Papierkram API Client](https://rubygems.org/gems/papierkram_api_client) als [Ruby Gem](https://rubygems.org/gems/papierkram_api_client)!
13
+ Hol mehr aus deinen Daten raus! Dieser Client bietet dir bald einige Features im Bereich [Business Intelligence](#business-intelligence)!
14
14
 
15
15
  ---
16
16
 
@@ -26,19 +26,16 @@ Das Gleiche, nur in grün, also für [NodeJS](https://github.com/simonneutert/pa
26
26
 
27
27
  Check das [CHANGELOG.md](CHANGELOG.md), Baby!
28
28
 
29
- Hier geht es zu den offiziellen API Docs
30
- https://DEINE-SUBDOMAIN.papierkram.de/papierkram_api/v1/api-docs/index.html
31
- (wenn du bereits ein Papierkram-Konto hast).
29
+ Hier geht es zu den [offiziellen API Docs](https://demo.papierkram.de/api/v1/api-docs/index.html).
32
30
  Schau bitte dort um alle Rückgabefelder/-werte zu checken, bis ich die Dokumentation hier komplett habe.
33
31
 
34
32
  ---
35
33
 
36
- Ruby client für die Papierkram API (V1).
34
+ ## Aktuell unterstützte Endpunkte der Papierkram API (V1)<!-- omit in toc -->
37
35
 
38
- Aktuell unterstützte Endpunkte / Objekte:
39
36
 
40
37
  - [x] Banking::BankConnection
41
- - [ ] Banking::BankTransaction
38
+ - [x] Banking::BankTransaction
42
39
  - [x] Contact::Company (Unternehmen)
43
40
  - [x] Contact::Company (Kontaktpersonen)
44
41
  - [x] Expense::Voucher (Ausgabe Belege)
@@ -52,11 +49,10 @@ Aktuell unterstützte Endpunkte / Objekte:
52
49
 
53
50
  ## Was, wie, warum?<!-- omit in toc -->
54
51
 
55
- Papierkram.de hat nun endlich eine API Schnittstelle für die Programmierung von eigenen Anwendungen. Die Dokumentation findest du hier: [https://DEINE-SUBDOMAIN.papierkram.de/papierkram_api/v1/api-docs/index.html](https://DEINE-SUBDOMAIN.papierkram.de/papierkram_api/v1/api-docs/index.html). Dieses Projekt soll eine einfache Schnittstelle für die Papierkram API bereitstellen.
52
+ Papierkram.de hat nun eine API Schnittstelle für die Programmierung von eigenen Anwendungen. Die Dokumentation dazu findest du [hier](https://demo.papierkram.de/papierkram_api/v1/api-docs/index.html).
56
53
 
57
54
  Ziele:
58
55
 
59
- - Eine einfache als Gem verfügbare Schnittstelle für die Papierkram API.
60
56
  - Rückgabe von Hashes, Arrays, etc. statt von komplexeren Objekten (der gefürchtete DIY-Ansatz).
61
57
  - Einfach zu testen und zu erweitern.
62
58
 
@@ -73,6 +69,11 @@ Ziele:
73
69
  - [Contact::Company (Unternehmen)](#contactcompany-unternehmen)
74
70
  - [alle Unternehmen](#alle-unternehmen)
75
71
  - [ein Unternehmen](#ein-unternehmen)
72
+ - [erstelle ein Unternehmen](#erstelle-ein-unternehmen)
73
+ - [aktualisiere ein Unternehmen](#aktualisiere-ein-unternehmen)
74
+ - [lösche ein Unternehmen](#lösche-ein-unternehmen)
75
+ - [archiviere ein Unternehmen](#archiviere-ein-unternehmen)
76
+ - [unarchiviere ein Unternehmen](#unarchiviere-ein-unternehmen)
76
77
  - [Contact::Company (Kontaktperson eines Unternehmens)](#contactcompany-kontaktperson-eines-unternehmens)
77
78
  - [alle Kontaktpersonen (eines Unternehmens)](#alle-kontaktpersonen-eines-unternehmens)
78
79
  - [eine Kontaktperson (eines Unternehmens)](#eine-kontaktperson-eines-unternehmens)
@@ -262,7 +263,7 @@ Siehe [Companies](lib/papierkram_api/v1/endpoints/contact/companies.rb) für mö
262
263
  #### alle Unternehmen
263
264
 
264
265
  ```ruby
265
- companies = client.contact.companies.all
266
+ companies = client.contact_companies.all
266
267
  puts companies.headers
267
268
  puts companies.body
268
269
  ```
@@ -270,7 +271,56 @@ puts companies.body
270
271
  #### ein Unternehmen
271
272
 
272
273
  ```ruby
273
- company = client.contact.companies.by(id: 1)
274
+ company = client.contact_companies.by(id: 1)
275
+ puts company.headers
276
+ puts company.body
277
+ ```
278
+
279
+ #### erstelle ein Unternehmen
280
+
281
+ ```ruby
282
+ # supplier
283
+ company = client.contact_companies.create_supplier(name: 'Test GmbH')
284
+ puts company.headers
285
+ puts company.body
286
+
287
+ # customer
288
+ company = client.contact_companies.create_customer(name: 'Test GmbH')
289
+ puts company.headers
290
+ puts company.body
291
+ ```
292
+
293
+ Siehe [Companies#create_customer](lib/papierkram_api/v1/endpoints/contact/companies.rb) und [Companies#create_supplier](lib/papierkram_api/v1/endpoints/contact/companies.rb) für mögliche Parameter.
294
+
295
+ #### aktualisiere ein Unternehmen
296
+
297
+ ```ruby
298
+ company = client.contact_companies
299
+ .update_by(id: 1, attributes: { name: 'Test GmbH' })
300
+ puts company.headers
301
+ puts company.body
302
+ ```
303
+
304
+ #### lösche ein Unternehmen
305
+
306
+ ```ruby
307
+ company = client.contact_companies.delete_by(id: 1)
308
+ puts company.headers
309
+ puts company.body
310
+ ```
311
+
312
+ #### archiviere ein Unternehmen
313
+
314
+ ```ruby
315
+ company = client.contact_companies.archive_by(id: 1)
316
+ puts company.headers
317
+ puts company.body
318
+ ```
319
+
320
+ #### unarchiviere ein Unternehmen
321
+
322
+ ```ruby
323
+ company = client.contact_companies.unarchive_by(id: 1)
274
324
  puts company.headers
275
325
  puts company.body
276
326
  ```
@@ -31,56 +31,68 @@ module PapierkramApi
31
31
  end
32
32
 
33
33
  def business_intelligence
34
- @business_intelligence ||= PapierkramApi::V1::BusinessIntelligence::Base.new
34
+ @business_intelligence ||=
35
+ PapierkramApi::V1::BusinessIntelligence::Base.new
35
36
  end
36
37
 
37
38
  def banking_bank_connections
38
- @banking_bank_connections ||= PapierkramApi::V1::Endpoints::Banking::BankConnections.new(@client)
39
+ @banking_bank_connections ||=
40
+ PapierkramApi::V1::Endpoints::Banking::BankConnections.new(@client)
39
41
  end
40
42
 
41
43
  def banking_transactions
42
- raise ArgumentError, 'not implemented'
43
- # @banking_transactions ||= PapierkramApi::V1::Banking::Transactions.new(@client)
44
+ @banking_transactions ||=
45
+ PapierkramApi::V1::Endpoints::Banking::Transactions.new(@client)
44
46
  end
45
47
 
46
48
  def contact_companies
47
- @contact_companies ||= PapierkramApi::V1::Endpoints::Contact::Companies.new(@client)
49
+ @contact_companies ||=
50
+ PapierkramApi::V1::Endpoints::Contact::Companies.new(@client)
48
51
  end
49
52
 
50
53
  def contact_companies_persons
51
- @contact_companies_persons ||= PapierkramApi::V1::Endpoints::Contact::CompaniesPersons.new(@client)
54
+ @contact_companies_persons ||=
55
+ PapierkramApi::V1::Endpoints::Contact::CompaniesPersons.new(@client)
52
56
  end
53
57
 
54
58
  def expense_vouchers
55
- @expense_vouchers ||= PapierkramApi::V1::Endpoints::Expense::Vouchers.new(@client)
59
+ @expense_vouchers ||=
60
+ PapierkramApi::V1::Endpoints::Expense::Vouchers.new(@client)
56
61
  end
57
62
 
58
63
  def income_estimates
59
- @income_estimates ||= PapierkramApi::V1::Endpoints::Income::Estimates.new(@client)
64
+ @income_estimates ||=
65
+ PapierkramApi::V1::Endpoints::Income::Estimates.new(@client)
60
66
  end
61
67
 
62
68
  def income_invoices
63
- @income_invoices ||= PapierkramApi::V1::Endpoints::Income::Invoices.new(@client)
69
+ @income_invoices ||=
70
+ PapierkramApi::V1::Endpoints::Income::Invoices.new(@client)
64
71
  end
65
72
 
66
73
  def income_propositions
67
- @income_propositions ||= PapierkramApi::V1::Endpoints::Income::Propositions.new(@client)
74
+ @income_propositions ||=
75
+ PapierkramApi::V1::Endpoints::Income::Propositions.new(@client)
68
76
  end
69
77
 
70
78
  def info
71
- @info ||= PapierkramApi::V1::Endpoints::Info.new(@client)
79
+ @info ||=
80
+ PapierkramApi::V1::Endpoints::Info.new(@client)
72
81
  end
73
82
 
74
83
  def projects
75
- @projects ||= PapierkramApi::V1::Endpoints::Projects.new(@client)
84
+ @projects ||=
85
+ PapierkramApi::V1::Endpoints::Projects.new(@client)
76
86
  end
77
87
 
78
88
  def tracker_tasks
79
- @tracker_tasks ||= PapierkramApi::V1::Endpoints::Tracker::Tasks.new(@client)
89
+ @tracker_tasks ||=
90
+ PapierkramApi::V1::Endpoints::Tracker::Tasks.new(@client)
80
91
  end
81
92
 
82
93
  def tracker_time_entries
83
- @tracker_time_entries ||= PapierkramApi::V1::Endpoints::Tracker::TimeEntries.new(@client)
94
+ @tracker_time_entries ||=
95
+ PapierkramApi::V1::Endpoints::Tracker::TimeEntries.new(@client)
84
96
  end
85
97
 
86
98
  private
@@ -18,11 +18,9 @@ module PapierkramApi
18
18
  return {} if expense_vouchers.is_a?(Array) && expense_vouchers.empty?
19
19
 
20
20
  validate_expense_vouchers!(expense_vouchers)
21
- if block_given?
22
- results(expense_vouchers, &block)
23
- else
24
- results(expense_vouchers)
25
- end
21
+ return results(expense_vouchers, &block) if block
22
+
23
+ results(expense_vouchers)
26
24
  end
27
25
 
28
26
  private
@@ -5,13 +5,25 @@ module PapierkramApi
5
5
  module Endpoints
6
6
  module Banking
7
7
  # This class is responsible for all the API calls related to banking transactions.
8
- class Transactions
8
+ class Transactions < PapierkramApi::V1::Endpoints::Base
9
9
  def by(id:)
10
- # wip
10
+ get("#{@url_api_path}/banking/transactions/#{id}")
11
11
  end
12
12
 
13
- def all
14
- # wip
13
+ def all(bank_connection_id:,
14
+ page: 1,
15
+ page_size: 100,
16
+ order_by: nil,
17
+ order_direction: nil)
18
+ query = {
19
+ bank_connection_id: bank_connection_id,
20
+ page: page,
21
+ page_size: page_size
22
+ }
23
+ query[:order_by] = order_by if order_by
24
+ query[:order_direction] = order_direction if order_direction
25
+
26
+ get("#{@url_api_path}/banking/transactions", query)
15
27
  end
16
28
  end
17
29
  end
@@ -23,6 +23,143 @@ module PapierkramApi
23
23
 
24
24
  get("#{@url_api_path}/contact/companies", query)
25
25
  end
26
+
27
+ def create_supplier( # rubocop:disable Metrics/ParameterLists
28
+ name:,
29
+ phone: nil,
30
+ fax: nil,
31
+ email: nil,
32
+ delivery_method: nil,
33
+ ust_idnr: nil,
34
+ website: nil,
35
+ twitter: nil,
36
+ postal_street: nil,
37
+ postal_city: nil,
38
+ postal_zip: nil,
39
+ postal_country: nil,
40
+ physical_street: nil,
41
+ physical_city: nil,
42
+ physical_zip: nil,
43
+ physical_country: nil,
44
+ bank_blz: nil,
45
+ bank_institute: nil,
46
+ bank_account_no: nil,
47
+ bank_bic: nil,
48
+ bank_iban: nil,
49
+ notes: nil,
50
+ color: nil
51
+ )
52
+
53
+ body = {
54
+ contact_type: :supplier,
55
+ name: name,
56
+ phone: phone,
57
+ fax: fax,
58
+ email: email,
59
+ delivery_method: delivery_method,
60
+ ust_idnr: ust_idnr,
61
+ website: website,
62
+ twitter: twitter,
63
+ postal_street: postal_street,
64
+ postal_city: postal_city,
65
+ postal_zip: postal_zip,
66
+ postal_country: postal_country,
67
+ physical_street: physical_street,
68
+ physical_city: physical_city,
69
+ physical_zip: physical_zip,
70
+ physical_country: physical_country,
71
+ bank_blz: bank_blz,
72
+ bank_institute: bank_institute,
73
+ bank_account_no: bank_account_no,
74
+ bank_bic: bank_bic,
75
+ bank_iban: bank_iban,
76
+ notes: notes,
77
+ color: color
78
+ }
79
+
80
+ post("#{@url_api_path}/contact/companies", body)
81
+ end
82
+
83
+ def create_customer( # rubocop:disable Metrics/ParameterLists
84
+ name:,
85
+ phone: nil,
86
+ fax: nil,
87
+ email: nil,
88
+ delivery_method: nil,
89
+ ust_idnr: nil,
90
+ website: nil,
91
+ twitter: nil,
92
+ postal_street: nil,
93
+ postal_city: nil,
94
+ postal_zip: nil,
95
+ postal_country: nil,
96
+ physical_street: nil,
97
+ physical_city: nil,
98
+ physical_zip: nil,
99
+ physical_country: nil,
100
+ bank_blz: nil,
101
+ bank_institute: nil,
102
+ bank_account_no: nil,
103
+ bank_bic: nil,
104
+ bank_iban: nil,
105
+ notes: nil,
106
+ color: nil
107
+ )
108
+
109
+ body = {
110
+ contact_type: :customer,
111
+ name: name,
112
+ phone: phone,
113
+ fax: fax,
114
+ email: email,
115
+ delivery_method: delivery_method,
116
+ ust_idnr: ust_idnr,
117
+ website: website,
118
+ twitter: twitter,
119
+ postal_street: postal_street,
120
+ postal_city: postal_city,
121
+ postal_zip: postal_zip,
122
+ postal_country: postal_country,
123
+ physical_street: physical_street,
124
+ physical_city: physical_city,
125
+ physical_zip: physical_zip,
126
+ physical_country: physical_country,
127
+ bank_blz: bank_blz,
128
+ bank_institute: bank_institute,
129
+ bank_account_no: bank_account_no,
130
+ bank_bic: bank_bic,
131
+ bank_iban: bank_iban,
132
+ notes: notes,
133
+ color: color
134
+ }
135
+
136
+ post("#{@url_api_path}/contact/companies", body)
137
+ end
138
+
139
+ def update_by(id:, attributes: {})
140
+ raise ArgumentError, 'id must be an Integer' unless id.is_a?(Integer)
141
+ raise ArgumentError, 'attributes must be a Hash' unless attributes.is_a?(Hash)
142
+
143
+ put("#{@url_api_path}/contact/companies/#{id}", attributes)
144
+ end
145
+
146
+ def delete_by(id:)
147
+ raise ArgumentError, 'id must be an Integer' unless id.is_a?(Integer)
148
+
149
+ delete("#{@url_api_path}/contact/companies/#{id}")
150
+ end
151
+
152
+ def archive_by(id:)
153
+ raise ArgumentError, 'id must be an Integer' unless id.is_a?(Integer)
154
+
155
+ post("#{@url_api_path}/contact/companies/#{id}/archive")
156
+ end
157
+
158
+ def unarchive_by(id:)
159
+ raise ArgumentError, 'id must be an Integer' unless id.is_a?(Integer)
160
+
161
+ post("#{@url_api_path}/contact/companies/#{id}/unarchive")
162
+ end
26
163
  end
27
164
  end
28
165
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PapierkramApiClient
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.2'
5
5
  end
data/logo.svg ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 1798 623" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <path d="M172,70.1L172,15.1L13.4,15.1L13.4,610.9L172,610.9L172,363C191.2,399.4 229.1,423 282.7,423C375.5,423 449.1,346.6 449.1,216.6C449.1,86.6 375.5,10.1 282.7,10.1C229.1,10.1 191.2,33.7 172,70.1ZM288.4,216.6C288.4,260.9 262.7,284.4 229.8,284.4C197,284.4 171.2,260.9 171.2,216.6C171.2,172.3 197,148.7 229.8,148.7C262.7,148.7 288.4,172.3 288.4,216.6Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
5
+ <path d="M267,276C245.9,276 228.9,258.9 228.9,237.9C228.9,216.8 245.9,199.8 267,199.8C288.1,199.8 305.1,216.8 305.1,237.9C305.1,258.9 288.1,276 267,276Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
6
+ <path d="M474.9,217.6C474.9,347.6 548.5,424 641.4,424C694.9,424 733.5,400.4 752.8,364L752.8,419L910.7,419L910.7,16.1L752.8,16.1L752.8,71.1C733.5,34.7 694.9,11.1 641.4,11.1C548.5,11.1 474.9,87.6 474.9,217.6ZM752.8,217.6C752.8,261.9 727.1,285.4 694.2,285.4C661.4,285.4 635.6,261.9 635.6,217.6C635.6,173.3 661.4,149.7 694.2,149.7C727.1,149.7 752.8,173.3 752.8,217.6Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
7
+ <path d="M734,275.8C713,275.8 695.9,258.8 695.9,237.7C695.9,216.6 713,199.6 734,199.6C755.1,199.6 772.1,216.6 772.1,237.7C772.1,258.8 755.1,275.8 734,275.8Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
8
+ <path d="M977.7,267.6L974,252.8C974,252.8 1501.5,168.6 1656.8,178.1C1744.4,183.4 1741.7,220.8 1683.5,215C1558.8,202.7 977.7,267.6 977.7,267.6Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
9
+ <path d="M935.2,217.6C935.2,346.1 1020.2,424 1140.9,424C1244.5,424 1322.4,362.6 1341.6,256.8L1173.8,256.8C1168.1,276.1 1157.4,288.3 1137.4,288.3C1113.1,288.3 1095.9,266.1 1095.9,217.6C1095.9,169 1113.1,146.8 1137.4,146.8C1157.4,146.8 1168.1,159 1173.8,178.3L1341.6,178.3C1322.4,72.6 1244.5,11.1 1140.9,11.1C1020.2,11.1 935.2,89 935.2,217.6ZM1211.4,137.8C1190.3,137.8 1173.3,120.8 1173.3,99.7C1173.3,78.7 1190.3,61.6 1211.4,61.6C1232.5,61.6 1249.5,78.7 1249.5,99.7C1249.5,120.8 1232.5,137.8 1211.4,137.8Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
10
+ <path d="M1213.8,123.6C1201.9,123.6 1192.4,114 1192.4,102.1C1192.4,90.3 1201.9,80.7 1213.8,80.7C1225.6,80.7 1235.2,90.3 1235.2,102.1C1235.2,114 1225.6,123.6 1213.8,123.6Z" style="fill:rgb(204,52,45);fill-rule:nonzero;"/>
11
+ <path d="M1747.4,90.9L1690.9,129C1686.83,131.6 1684.2,135.367 1683,140.3C1681.87,144.9 1682.4,149.167 1684.6,153.1C1686.73,156.967 1689.9,159.4 1694.1,160.4C1698.63,161.533 1702.9,160.7 1706.9,157.9L1746.8,131.1C1747.47,130.633 1747.87,130.067 1748,129.4C1748.2,128.533 1747.73,127.033 1746.6,124.9C1745.4,122.767 1744.4,121.6 1743.6,121.4C1743,121.267 1742.37,121.4 1741.7,121.8L1701.8,148.7C1700.07,149.767 1698.37,150.1 1696.7,149.7C1695.23,149.3 1694.13,148.467 1693.4,147.2C1692.67,145.867 1692.5,144.4 1692.9,142.8C1693.37,140.867 1694.4,139.333 1696,138.2L1752.5,100.1C1756.63,97.367 1760.8,96.5 1765,97.5C1768.27,98.3 1770.7,100.133 1772.3,103C1773.9,105.933 1774.27,109.167 1773.4,112.7C1772.27,117.3 1769.67,121 1765.6,123.8L1690,174.6C1685.07,177.867 1679.9,178.867 1674.5,177.6C1669.03,176.267 1664.87,173.1 1662,168.1C1659.13,163.1 1658.43,157.6 1659.9,151.6C1661.3,145.933 1664.5,141.367 1669.5,137.9L1728.6,98.2C1729.2,97.733 1729.6,97.133 1729.8,96.4C1730,95.533 1729.53,94.067 1728.4,92C1727.27,89.867 1726.27,88.7 1725.4,88.5C1724.8,88.367 1724.17,88.533 1723.5,89L1664.6,128.6C1657.2,133.6 1652.43,140.533 1650.3,149.4C1648.17,158.333 1649.2,166.567 1653.4,174.1C1657.6,181.633 1663.8,186.4 1672,188.4C1680,190.333 1687.73,188.833 1695.2,183.9L1770.7,133C1777.17,128.667 1781.33,122.7 1783.2,115.1C1784.8,108.567 1784.1,102.6 1781.1,97.2C1778.1,91.733 1773.6,88.3 1767.6,86.9C1760.53,85.167 1753.8,86.5 1747.4,90.9Z" style="fill:rgb(5,169,244);fill-rule:nonzero;"/>
12
+ </svg>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: papierkram_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Neutert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: httpx
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.22.5
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 0.25.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 0.22.5
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.25.0
41
47
  description: Papierkram API Client, um deine Buchhaltung auf das nächste Level zu
42
48
  bringen.
43
49
  email:
@@ -50,6 +56,7 @@ files:
50
56
  - ".gitignore"
51
57
  - ".rubocop"
52
58
  - ".rubocop.yml"
59
+ - ".tool-versions"
53
60
  - CHANGELOG.md
54
61
  - Gemfile
55
62
  - Gemfile.lock
@@ -78,6 +85,7 @@ files:
78
85
  - lib/papierkram_api/v1/validators/expense_voucher.rb
79
86
  - lib/papierkram_api_client.rb
80
87
  - lib/papierkram_api_client/version.rb
88
+ - logo.svg
81
89
  - pac.svg
82
90
  - sig/papierkram_api_client.rbs
83
91
  homepage: https://github.com/simonneutert/papierkram_api_client
@@ -103,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
111
  - !ruby/object:Gem::Version
104
112
  version: '0'
105
113
  requirements: []
106
- rubygems_version: 3.4.8
114
+ rubygems_version: 3.4.14
107
115
  signing_key:
108
116
  specification_version: 4
109
117
  summary: Papierkram API Client