papierkram_api_client 0.2.3 → 0.2.4
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 +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/papierkram_api/v1/endpoints/contact/companies.rb +52 -54
- data/lib/papierkram_api/v1/endpoints/contact/companies_persons.rb +14 -15
- data/lib/papierkram_api/v1/endpoints/income/propositions.rb +12 -13
- data/lib/papierkram_api/v1/endpoints/projects.rb +18 -18
- data/lib/papierkram_api_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 149edeeed9ee09d36a1c017a9a831eb00dcf347c507d89b37c498bef24ff87f6
|
4
|
+
data.tar.gz: 48e326b8fc0c92af833e8e928daba56ca0b8f9d28e3d2490af07ffad5cf317de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc5b3801503c34095ae1cad9695e78eb749ba8b1c65f2704978bda859640f8e342339aaa1a7b0354a672be2433366bee7436ec6d57b42eaa560216dde9f025e8
|
7
|
+
data.tar.gz: 669678b6e1cc39a506c95ad3d05ab705acbc3ee51f0377ef682ad06b7b1b0daacceb58b8c3da7a9e692f7d7960a7faeac51e2af11c9d79be3d735feb26b31304
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
[0.2.4] - 2023-06-30
|
4
|
+
|
5
|
+
#### Fixed
|
6
|
+
|
7
|
+
- [#48](https://github.com/simonneutert/papierkram_api_client/pull/48) Arguments weren't truly optional when possible. [@simonneutert](https://github.com/simonneutert)
|
8
|
+
|
3
9
|
[0.2.3] - 2023-06-29
|
4
10
|
|
5
11
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -24,7 +24,7 @@ module PapierkramApi
|
|
24
24
|
get("#{@url_api_path}/contact/companies", query)
|
25
25
|
end
|
26
26
|
|
27
|
-
def create_supplier( # rubocop:disable Metrics/ParameterLists
|
27
|
+
def create_supplier( # rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
28
28
|
name:,
|
29
29
|
phone: nil,
|
30
30
|
fax: nil,
|
@@ -50,37 +50,36 @@ module PapierkramApi
|
|
50
50
|
color: nil
|
51
51
|
)
|
52
52
|
|
53
|
-
body = {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}
|
53
|
+
body = {}
|
54
|
+
body[:contact_type] = 'supplier'
|
55
|
+
body[:name] = name
|
56
|
+
body[:phone] = phone if phone
|
57
|
+
body[:fax] = fax if fax
|
58
|
+
body[:email] = email if email
|
59
|
+
body[:delivery_method] = delivery_method if delivery_method
|
60
|
+
body[:ust_idnr] = ust_idnr if ust_idnr
|
61
|
+
body[:website] = website if website
|
62
|
+
body[:twitter] = twitter if twitter
|
63
|
+
body[:postal_street] = postal_street if postal_street
|
64
|
+
body[:postal_city] = postal_city if postal_city
|
65
|
+
body[:postal_zip] = postal_zip if postal_zip
|
66
|
+
body[:postal_country] = postal_country if postal_country
|
67
|
+
body[:physical_street] = physical_street if physical_street
|
68
|
+
body[:physical_city] = physical_city if physical_city
|
69
|
+
body[:physical_zip] = physical_zip if physical_zip
|
70
|
+
body[:physical_country] = physical_country if physical_country
|
71
|
+
body[:bank_blz] = bank_blz if bank_blz
|
72
|
+
body[:bank_institute] = bank_institute if bank_institute
|
73
|
+
body[:bank_account_no] = bank_account_no if bank_account_no
|
74
|
+
body[:bank_bic] = bank_bic if bank_bic
|
75
|
+
body[:bank_iban] = bank_iban if bank_iban
|
76
|
+
body[:notes] = notes if notes
|
77
|
+
body[:color] = color if color
|
79
78
|
|
80
79
|
post("#{@url_api_path}/contact/companies", body)
|
81
80
|
end
|
82
81
|
|
83
|
-
def create_customer( # rubocop:disable Metrics/ParameterLists
|
82
|
+
def create_customer( # rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
84
83
|
name:,
|
85
84
|
phone: nil,
|
86
85
|
fax: nil,
|
@@ -106,32 +105,31 @@ module PapierkramApi
|
|
106
105
|
color: nil
|
107
106
|
)
|
108
107
|
|
109
|
-
body = {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
108
|
+
body = {}
|
109
|
+
body[:contact_type] = 'customer'
|
110
|
+
body[:name] = name
|
111
|
+
body[:phone] = phone if phone
|
112
|
+
body[:fax] = fax if fax
|
113
|
+
body[:email] = email if email
|
114
|
+
body[:delivery_method] = delivery_method if delivery_method
|
115
|
+
body[:ust_idnr] = ust_idnr if ust_idnr
|
116
|
+
body[:website] = website if website
|
117
|
+
body[:twitter] = twitter if twitter
|
118
|
+
body[:postal_street] = postal_street if postal_street
|
119
|
+
body[:postal_city] = postal_city if postal_city
|
120
|
+
body[:postal_zip] = postal_zip if postal_zip
|
121
|
+
body[:postal_country] = postal_country if postal_country
|
122
|
+
body[:physical_street] = physical_street if physical_street
|
123
|
+
body[:physical_city] = physical_city if physical_city
|
124
|
+
body[:physical_zip] = physical_zip if physical_zip
|
125
|
+
body[:physical_country] = physical_country if physical_country
|
126
|
+
body[:bank_blz] = bank_blz if bank_blz
|
127
|
+
body[:bank_institute] = bank_institute if bank_institute
|
128
|
+
body[:bank_account_no] = bank_account_no if bank_account_no
|
129
|
+
body[:bank_bic] = bank_bic if bank_bic
|
130
|
+
body[:bank_iban] = bank_iban if bank_iban
|
131
|
+
body[:notes] = notes if notes
|
132
|
+
body[:color] = color if color
|
135
133
|
|
136
134
|
post("#{@url_api_path}/contact/companies", body)
|
137
135
|
end
|
@@ -22,7 +22,7 @@ module PapierkramApi
|
|
22
22
|
get("#{@url_api_path}/contact/companies/#{company_id}/persons", query)
|
23
23
|
end
|
24
24
|
|
25
|
-
def create( # rubocop:disable Metrics/ParameterLists
|
25
|
+
def create( # rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
26
26
|
company_id:,
|
27
27
|
first_name:,
|
28
28
|
last_name:,
|
@@ -37,20 +37,19 @@ module PapierkramApi
|
|
37
37
|
skype: nil,
|
38
38
|
comment: nil
|
39
39
|
)
|
40
|
-
body = {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
40
|
+
body = {}
|
41
|
+
body[:first_name] = first_name
|
42
|
+
body[:last_name] = last_name
|
43
|
+
body[:title] = title if title
|
44
|
+
body[:salutation] = salutation if salutation
|
45
|
+
body[:position] = position if position
|
46
|
+
body[:department] = department if department
|
47
|
+
body[:email] = email if email
|
48
|
+
body[:phone] = phone if phone
|
49
|
+
body[:mobile] = mobile if mobile
|
50
|
+
body[:fax] = fax if fax
|
51
|
+
body[:skype] = skype if skype
|
52
|
+
body[:comment] = comment if comment
|
54
53
|
|
55
54
|
post("#{@url_api_path}/contact/companies/#{company_id}/persons", body)
|
56
55
|
end
|
@@ -21,24 +21,23 @@ module PapierkramApi
|
|
21
21
|
time_unit: nil,
|
22
22
|
proposition_type: nil,
|
23
23
|
price: nil,
|
24
|
-
vat_rate:
|
24
|
+
vat_rate: nil
|
25
25
|
)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
26
|
+
|
27
|
+
body = {}
|
28
|
+
body[:name] = name
|
29
|
+
body[:article_no] = article_no
|
30
|
+
body[:description] = description if description
|
31
|
+
body[:time_unit] = time_unit if time_unit
|
32
|
+
body[:proposition_type] = proposition_type if proposition_type
|
33
|
+
body[:price] = price if price
|
34
|
+
body[:vat_rate] = vat_rate if vat_rate
|
35
|
+
|
35
36
|
post("#{@url_api_path}/income/propositions", body)
|
36
37
|
end
|
37
38
|
|
38
39
|
def update_by(id:, attributes: {})
|
39
|
-
attributes[:vat_rate]
|
40
|
-
attributes[:vat_rate] ||= ''
|
41
|
-
if attributes[:vat_rate].empty? || !attributes[:vat_rate].include?('%')
|
40
|
+
if attributes[:vat_rate] && (attributes[:vat_rate].empty? || !attributes[:vat_rate].include?('%'))
|
42
41
|
raise ArgumentError, 'vat_rate must be a percentage and include a % sign'
|
43
42
|
end
|
44
43
|
|
@@ -21,7 +21,7 @@ module PapierkramApi
|
|
21
21
|
get("#{@url_api_path}/projects", query)
|
22
22
|
end
|
23
23
|
|
24
|
-
def create( # rubocop:disable Metrics/ParameterLists
|
24
|
+
def create( # rubocop:disable Metrics/ParameterLists, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
25
25
|
name:,
|
26
26
|
customer_id:,
|
27
27
|
description: nil,
|
@@ -33,24 +33,24 @@ module PapierkramApi
|
|
33
33
|
budget_time: nil,
|
34
34
|
budget_time_unit: nil,
|
35
35
|
color: nil,
|
36
|
-
default_proposition:
|
37
|
-
team_members:
|
36
|
+
default_proposition: nil,
|
37
|
+
team_members: nil
|
38
38
|
)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
39
|
+
|
40
|
+
body = {}
|
41
|
+
body[:name] = name
|
42
|
+
body[:customer] = { id: customer_id }
|
43
|
+
body[:description] = description if description
|
44
|
+
body[:start_date] = start_date if start_date
|
45
|
+
body[:end_date] = end_date if end_date
|
46
|
+
body[:flagged] = flagged if flagged
|
47
|
+
body[:budget_type] = budget_type if budget_type
|
48
|
+
body[:budget_money] = budget_money if budget_money
|
49
|
+
body[:budget_time] = budget_time if budget_time
|
50
|
+
body[:budget_time_unit] = budget_time_unit if budget_time_unit
|
51
|
+
body[:color] = color if color
|
52
|
+
body[:default_proposition] = default_proposition if default_proposition
|
53
|
+
body[:team_members] = team_members if team_members
|
54
54
|
|
55
55
|
post("#{@url_api_path}/projects", body)
|
56
56
|
end
|
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.
|
4
|
+
version: 0.2.4
|
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-06-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|