papierkram_api_client 0.3.1 → 0.4.1
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 +2 -1
- data/.rubocop.yml +5 -5
- data/CHANGELOG.md +23 -0
- data/Gemfile +5 -5
- data/Gemfile.lock +36 -32
- data/README.md +462 -19
- data/UPGRADING.md +10 -0
- data/lib/papierkram_api/client.rb +9 -0
- data/lib/papierkram_api/v1/business_intelligence/base.rb +9 -0
- data/lib/papierkram_api/v1/endpoints/contact/companies.rb +54 -3
- data/lib/papierkram_api/v1/endpoints/contact/companies_persons.rb +35 -3
- data/lib/papierkram_api/v1/endpoints/expense/vouchers.rb +150 -0
- data/lib/papierkram_api/v1/endpoints/income/invoices.rb +154 -8
- data/lib/papierkram_api/v1/endpoints/income/payment_terms.rb +30 -0
- data/lib/papierkram_api/v1/endpoints/income/propositions.rb +23 -7
- data/lib/papierkram_api/v1/endpoints/projects.rb +32 -3
- data/lib/papierkram_api/v1/endpoints/tracker/tasks.rb +63 -0
- data/lib/papierkram_api/v1/endpoints/tracker/time_entries.rb +59 -0
- data/lib/papierkram_api_client/version.rb +1 -1
- data/lib/papierkram_api_client.rb +2 -0
- metadata +19 -4
@@ -42,6 +42,65 @@ module PapierkramApi
|
|
42
42
|
http_get("#{@url_api_path}/tracker/time_entries", query)
|
43
43
|
end
|
44
44
|
|
45
|
+
def create(
|
46
|
+
entry_date:,
|
47
|
+
started_at_time:,
|
48
|
+
ended_at_time:,
|
49
|
+
task_id:,
|
50
|
+
user_id:,
|
51
|
+
comments: nil,
|
52
|
+
billable_duration: nil,
|
53
|
+
unbillable: nil
|
54
|
+
)
|
55
|
+
body = {}
|
56
|
+
body[:entry_date] = entry_date
|
57
|
+
body[:started_at_time] = started_at_time
|
58
|
+
body[:ended_at_time] = ended_at_time
|
59
|
+
body[:task] = { id: task_id }
|
60
|
+
body[:user] = { id: user_id }
|
61
|
+
body[:comments] = comments if comments
|
62
|
+
body[:billable_duration] = billable_duration if billable_duration
|
63
|
+
body[:unbillable] = unbillable if unbillable
|
64
|
+
|
65
|
+
http_post("#{@url_api_path}/tracker/time_entries", body)
|
66
|
+
end
|
67
|
+
|
68
|
+
def update_by( # rubocop:disable Metrics/ParameterLists, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
69
|
+
id:,
|
70
|
+
entry_date: nil,
|
71
|
+
started_at_time: nil,
|
72
|
+
ended_at_time: nil,
|
73
|
+
task_id: nil,
|
74
|
+
user_id: nil,
|
75
|
+
comments: nil,
|
76
|
+
billable_duration: nil,
|
77
|
+
unbillable: nil
|
78
|
+
)
|
79
|
+
body = {}
|
80
|
+
body[:entry_date] = entry_date if entry_date
|
81
|
+
body[:started_at_time] = started_at_time if started_at_time
|
82
|
+
body[:ended_at_time] = ended_at_time if ended_at_time
|
83
|
+
body[:task] = { id: task_id } if task_id
|
84
|
+
body[:user] = { id: user_id } if user_id
|
85
|
+
body[:comments] = comments if comments
|
86
|
+
body[:billable_duration] = billable_duration if billable_duration
|
87
|
+
body[:unbillable] = unbillable if unbillable
|
88
|
+
|
89
|
+
http_put("#{@url_api_path}/tracker/time_entries/#{id}", body)
|
90
|
+
end
|
91
|
+
|
92
|
+
def delete_by(id:)
|
93
|
+
http_delete("#{@url_api_path}/tracker/time_entries/#{id}")
|
94
|
+
end
|
95
|
+
|
96
|
+
def archive_by(id:)
|
97
|
+
http_post("#{@url_api_path}/tracker/time_entries/#{id}/archive")
|
98
|
+
end
|
99
|
+
|
100
|
+
def unarchive_by(id:)
|
101
|
+
http_post("#{@url_api_path}/tracker/time_entries/#{id}/unarchive")
|
102
|
+
end
|
103
|
+
|
45
104
|
private
|
46
105
|
|
47
106
|
def validate!(billing_state:, start_time_range_start:, start_time_range_end:)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'faraday'
|
4
|
+
require 'faraday/multipart'
|
4
5
|
require 'httpx/adapters/faraday'
|
5
6
|
require 'forwardable'
|
6
7
|
require 'tempfile'
|
@@ -17,6 +18,7 @@ require_relative 'papierkram_api/v1/endpoints/contact/companies_persons'
|
|
17
18
|
require_relative 'papierkram_api/v1/endpoints/expense/vouchers'
|
18
19
|
require_relative 'papierkram_api/v1/endpoints/income/estimates'
|
19
20
|
require_relative 'papierkram_api/v1/endpoints/income/invoices'
|
21
|
+
require_relative 'papierkram_api/v1/endpoints/income/payment_terms'
|
20
22
|
require_relative 'papierkram_api/v1/endpoints/income/propositions'
|
21
23
|
require_relative 'papierkram_api/v1/endpoints/info'
|
22
24
|
require_relative 'papierkram_api/v1/endpoints/projects'
|
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Neutert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday-multipart
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.4
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: httpx
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -33,7 +47,7 @@ dependencies:
|
|
33
47
|
version: 0.22.5
|
34
48
|
- - "<"
|
35
49
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
50
|
+
version: 1.3.0
|
37
51
|
type: :runtime
|
38
52
|
prerelease: false
|
39
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +57,7 @@ dependencies:
|
|
43
57
|
version: 0.22.5
|
44
58
|
- - "<"
|
45
59
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
60
|
+
version: 1.3.0
|
47
61
|
description: Papierkram API Client, um deine Buchhaltung auf das nächste Level zu
|
48
62
|
bringen.
|
49
63
|
email:
|
@@ -76,6 +90,7 @@ files:
|
|
76
90
|
- lib/papierkram_api/v1/endpoints/expense/vouchers.rb
|
77
91
|
- lib/papierkram_api/v1/endpoints/income/estimates.rb
|
78
92
|
- lib/papierkram_api/v1/endpoints/income/invoices.rb
|
93
|
+
- lib/papierkram_api/v1/endpoints/income/payment_terms.rb
|
79
94
|
- lib/papierkram_api/v1/endpoints/income/propositions.rb
|
80
95
|
- lib/papierkram_api/v1/endpoints/info.rb
|
81
96
|
- lib/papierkram_api/v1/endpoints/projects.rb
|