ka-ching-client 0.1.0 → 0.2.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
2
  SHA256:
3
- metadata.gz: 2e16582171eb9b2444e49108b7aa5e5510f8d1b161083c246e4f0ef3d7b4403e
4
- data.tar.gz: a35cf46ed2c2cd17ca08c18807b3e2b1467b426e33cfddd4fa60a23a4d488aa5
3
+ metadata.gz: 6d21504fd6fba444a7181caffae081ca69ba4474d6560f765054a117a7ae37cf
4
+ data.tar.gz: 469d2e8cc8a200c561707ce1b9ba4f4a0b40ed4f7fd30b1267444d6c5e40d77e
5
5
  SHA512:
6
- metadata.gz: 7ccca54c865747187c51e8b89a11b78fbb91296e3a60a3ded4a17df30b443e0d055963f782538f9c7e1e871135ecfc94eca94ffc8b7ea0868b05ccf6939a3d80
7
- data.tar.gz: c7effcd12a68700eeec10a980983aa2e1bda4ee86bb7b0f37902429e8cb6e62a62411b605213077029c1d04f347e97325d4d75323f768c1841f8f15501321ea9
6
+ metadata.gz: c6936213efd58b765f085f3f8ed663c4b6b03eff0d2d1001a9d7a07fe5ff868be6e5aaa01a74dd7d9f567d7fc4e231f3d8f280bbf7b2393f502db561345afe2b
7
+ data.tar.gz: b69b366c3439ec9d5c8d0144a7bfb78a4404495a74f03bfd6f0167a906e14ac71efd1dedbafb9757e34d456c467e0d1f9a3b143667b213f372bfd1d4538c73a1
data/CHANGELOG.md CHANGED
@@ -5,4 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased] - yyyy-mm-dd
8
+ ## [0.2.0] - 2023-06-20
9
+
10
+ - [#6](https://github.com/simonneutert/ka-ching-client/pull/6) tests endpoints for lockings to backend API `active`/`inactive` - [@simonneutert](https://github.com/simonneutert).
11
+ - [#5](https://github.com/simonneutert/ka-ching-client/pull/5) adjusts endpoints for lockings to backend API - [@simonneutert](https://github.com/simonneutert).
12
+ - [#2](https://github.com/simonneutert/ka-ching-backend/pull/2) changes attribute/column from `realized` to `realized_at` [@simonneutert](https://github.com/simonneutert).
13
+ - [#1](https://github.com/simonneutert/ka-ching-client/pull/1) fixes entry in Readme after gem release - [simonneutert](https://github.com/simonneutert).
14
+
15
+ ## [0.1.0] - 2023-06-12
16
+
17
+ Initial release.
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :development, :test do
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'
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ka-ching-client (0.1.0)
4
+ ka-ching-client (0.2.0)
5
5
  faraday (~> 2.7.4)
6
- httpx (>= 0.22.4, < 0.24.0)
6
+ httpx (>= 0.22.4, < 0.25.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -24,7 +24,7 @@ GEM
24
24
  faraday-net_http (3.0.2)
25
25
  hashdiff (1.0.1)
26
26
  http-2-next (0.5.1)
27
- httpx (0.23.4)
27
+ httpx (0.24.0)
28
28
  http-2-next (>= 0.4.1)
29
29
  jaro_winkler (1.5.6)
30
30
  json (2.6.3)
@@ -33,13 +33,17 @@ GEM
33
33
  kramdown-parser-gfm (1.1.0)
34
34
  kramdown (~> 2.0)
35
35
  method_source (1.0.0)
36
+ mini_portile2 (2.8.2)
36
37
  minispec-metadata (2.0.0)
37
38
  minitest
38
- minitest (5.18.0)
39
+ minitest (5.18.1)
39
40
  minitest-vcr (1.4.0)
40
41
  minispec-metadata (~> 2.0)
41
42
  minitest (>= 4.7.5)
42
43
  vcr (>= 2.9)
44
+ nokogiri (1.15.2)
45
+ mini_portile2 (~> 2.8.2)
46
+ racc (~> 1.4)
43
47
  nokogiri (1.15.2-arm64-darwin)
44
48
  racc (~> 1.4)
45
49
  nokogiri (1.15.2-x86_64-linux)
@@ -107,11 +111,12 @@ GEM
107
111
 
108
112
  PLATFORMS
109
113
  arm64-darwin-22
114
+ ruby
110
115
  x86_64-linux
111
116
 
112
117
  DEPENDENCIES
113
118
  ka-ching-client!
114
- minitest (~> 5.0)
119
+ minitest (~> 5.18)
115
120
  minitest-vcr (~> 1.4)
116
121
  pry (~> 0.14.2)
117
122
  rake (~> 13.0)
data/README.md CHANGED
@@ -20,16 +20,16 @@ KaChing::Client is a Ruby API client for the [KaChing Backend project / simonneu
20
20
  - [unlock!](#unlock)
21
21
  - [all paginated](#all-paginated)
22
22
  - [of\_year](#of_year)
23
- - [of\_year\_month](#of_year_month)
24
- - [of\_year\_month\_day](#of_year_month_day)
23
+ - [active](#active)
24
+ - [inactive](#inactive)
25
25
  - [AuditLogs](#auditlogs)
26
26
  - [of\_year](#of_year-1)
27
- - [of\_year\_month](#of_year_month-1)
28
- - [of\_year\_month\_day](#of_year_month_day-1)
27
+ - [of\_year\_month](#of_year_month)
28
+ - [of\_year\_month\_day](#of_year_month_day)
29
29
  - [Tenants](#tenants)
30
30
  - [all](#all)
31
- - [active](#active)
32
- - [inactive](#inactive)
31
+ - [active](#active-1)
32
+ - [inactive](#inactive-1)
33
33
  - [Admin](#admin)
34
34
  - [details](#details)
35
35
  - [create!](#create)
@@ -40,8 +40,6 @@ KaChing::Client is a Ruby API client for the [KaChing Backend project / simonneu
40
40
 
41
41
  ## Installation
42
42
 
43
- TODO: Replace `ka-ching-client` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
44
-
45
43
  Install the gem and add to the application's Gemfile by executing:
46
44
 
47
45
  $ bundle add ka-ching-client
@@ -189,7 +187,7 @@ Get all lockings for a tenant paginated.
189
187
  res = client.v1.lockings.all(
190
188
  tenant_account_id: 'testuser_1',
191
189
  page: 1,
192
- per_page: 10
190
+ per_page: 10,
193
191
  )
194
192
  ```
195
193
 
@@ -201,28 +199,25 @@ Get lockings for a tenant by year.
201
199
  res = client.v1.lockings.of_year(tenant_account_id: 'testuser_1', year: 2019)
202
200
  ```
203
201
 
204
- #### of_year_month
202
+ #### active
205
203
 
206
- Get lockings for a tenant by year and month.
204
+ Get active lockings for a tenant for a year.
207
205
 
208
206
  ```ruby
209
- res = client.v1.lockings.of_year(
207
+ res = client.v1.lockings.active(
210
208
  tenant_account_id: 'testuser_1',
211
209
  year: 2019,
212
- month: 11
213
210
  )
214
211
  ```
215
212
 
216
- #### of_year_month_day
213
+ #### inactive
217
214
 
218
- Get lockings for a tenant by year, month and day.
215
+ Get inactive lockings for a tenant for a year.
219
216
 
220
217
  ```ruby
221
- res = client.v1.lockings.of_year(
218
+ res = client.v1.lockings.inactive(
222
219
  tenant_account_id: 'testuser_1',
223
220
  year: 2019,
224
- month: 11,
225
- day: 21
226
221
  )
227
222
  ```
228
223
 
data/UPGRADING.md ADDED
@@ -0,0 +1,8 @@
1
+ # Upgrading ka-ching-client
2
+
3
+ ## 0.1.0 to 0.2.0
4
+
5
+ ### Changes
6
+
7
+ * [#5](https://github.com/simonneutert/ka-ching-client/pull/5) Endpoints for lockings do not support `of_year_month` and `of_year_month_day` anymore. Therefor `active` and `inactive` were added to `Lockings` endpoints.
8
+ - [#1](https://github.com/simonneutert/ka-ching-client/pull/1) attribute/column was `realized` and is from now on `realized_at`.
@@ -94,33 +94,25 @@ module KaChing
94
94
  JSON.parse(res.body)
95
95
  end
96
96
 
97
- #
98
- # Get all lockings for a given year in month
99
- #
100
- # @yield [Faraday::Response] The response from the server
101
- # @return [Hash]
102
- #
103
- def of_year_month(tenant_account_id:, year:, month:, page: 1, per_page: 100)
104
- res = get(build_url(tenant_account_id: tenant_account_id),
105
- { year: year, month: month, page: page, per_page: per_page }) do |req|
97
+ def active(tenant_account_id:, year: nil, page: 1, per_page: 100)
98
+ params = { page: page, per_page: per_page }
99
+ body_params = { active: 'true' }
100
+ body_params.merge!({ year: year }) if year
101
+ res = get(build_url(tenant_account_id: tenant_account_id), params) do |req|
106
102
  req.headers['Content-Type'] = 'application/json'
107
- req.body = { year: year, month: month }.to_json
103
+ req.body = body_params.to_json
108
104
  end
109
105
  yield res if block_given?
110
106
  JSON.parse(res.body)
111
107
  end
112
108
 
113
- #
114
- # Get all lockings for a given year in month at day
115
- #
116
- # @yield [Faraday::Response] The response from the server
117
- # @return [Hash]
118
- #
119
- def of_year_month_day(tenant_account_id:, year:, month:, day:)
120
- res = get(build_url(tenant_account_id: tenant_account_id).to_s,
121
- { year: year, month: month, day: day, page: page, per_page: per_page }) do |req|
109
+ def inactive(tenant_account_id:, year: nil, page: 1, per_page: 100)
110
+ params = { page: page, per_page: per_page }
111
+ body_params = { inactive: 'true' }
112
+ body_params.merge!({ year: year }) if year
113
+ res = get(build_url(tenant_account_id: tenant_account_id), params) do |req|
122
114
  req.headers['Content-Type'] = 'application/json'
123
- req.body = { year: year, month: month, day: day }.to_json
115
+ req.body = body_params.to_json
124
116
  end
125
117
  yield res if block_given?
126
118
  JSON.parse(res.body)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KaChing
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ka-ching-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
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-12 00:00:00.000000000 Z
11
+ date: 2023-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 0.22.4
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: 0.24.0
36
+ version: 0.25.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.22.4
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.24.0
46
+ version: 0.25.0
47
47
  description: This gem is a client for the ka-ching API.
48
48
  email:
49
49
  - simonneutert@users.noreply.github.com
@@ -61,6 +61,7 @@ files:
61
61
  - LICENSE.txt
62
62
  - README.md
63
63
  - Rakefile
64
+ - UPGRADING.md
64
65
  - lib/ka-ching-client.rb
65
66
  - lib/ka_ching/api_client.rb
66
67
  - lib/ka_ching/api_v1/admin.rb
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubygems_version: 3.4.13
98
+ rubygems_version: 3.4.14
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: This gem is a client for the ka-ching API.