payroll_hero-api 1.2.3 → 1.2.7

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
- SHA1:
3
- metadata.gz: c09a45b3c150f9796f908a366d889710ffaed9bf
4
- data.tar.gz: a9e91ad965b9c417f4cd320312fa6e3b7b3bab37
2
+ SHA256:
3
+ metadata.gz: 77e5710d27a5a6ac5f19f076937de2ece85b1bfdc2fa34a929251e80c74c435e
4
+ data.tar.gz: b28de20d36dfda6895afe6f5845bb54a21b1e2bc92c8de379fa64fdace19ef21
5
5
  SHA512:
6
- metadata.gz: 67baddf9a9b1242ca61438213d63243ee411732f7f7c2a5bc5608bdb51b0b2b9c9bb593645f9f6c8bcacc9bf5f2b13bdf4f3c5d90172dad450133ec004aaf6ab
7
- data.tar.gz: 3bde3d1fa6b4a85322f6fac25e4e2b59c60f6d4ca40d29c543eaef2473659f8bc67772c1ba7780ff2ffe8d272c30a1191591335a0a852f33007af0bf906cb200
6
+ metadata.gz: 6e8332d4e084e98d1860fa66733e1222ae7a641c614d43340eca6f0e6ca1c89e2b8b1997c1950322874ae950a71864dc7685753e4bf4e2719c7d7e523f93b845
7
+ data.tar.gz: e9a4c5d54984b0fc3dff6a48d24a4e4eb5714ba1708c9c7cb11085a6ed4a8a285270cb8a74dfa3f0a30ac901e4c3c5341b83ca6a0a4665084d92080be8851ca9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.2.7](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.7) (2021-12-16)
4
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.6...v1.2.7)
5
+
6
+ ## [v1.2.6](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.6) (2017-12-04)
7
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.5...v1.2.6)
8
+
9
+ ## [v1.2.5](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.5) (2017-11-09)
10
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.4...v1.2.5)
11
+
12
+ ## [v1.2.4](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.4) (2017-11-09)
13
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.3...v1.2.4)
14
+
15
+ ## [v1.2.3](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.3) (2017-09-19)
16
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.2...v1.2.3)
17
+
18
+ ## [v1.2.2](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.2) (2017-09-19)
19
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.1...v1.2.2)
20
+
3
21
  ## [v1.2.1](https://github.com/payrollhero/payroll_hero-api/tree/v1.2.1) (2016-09-21)
4
22
  [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.0...v1.2.1)
5
23
 
@@ -27,4 +45,4 @@
27
45
 
28
46
 
29
47
 
30
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
48
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
@@ -9,17 +9,18 @@ module PayrollHero
9
9
  # @param [Array|Symbol] only - Attribute names to be included on the response
10
10
  # @param [Array|Symbol] except - Attribute names to be excluded on the response
11
11
  # @param [Array|Symbol] include - Association names to be included in the response
12
- def list(only: [], except: [], include: [], page: nil, per_page: nil)
13
- params = {
14
- only: Array(only),
15
- except: Array(except),
16
- include: Array(include),
17
- page: page,
18
- per_page: per_page,
19
- }
12
+ def list(only: [], except: [], include: [], page: nil, per_page: nil, **params)
13
+ combined_params = params.merge(
14
+ remove_empty_values_from!(
15
+ only: Array(only),
16
+ except: Array(except),
17
+ include: Array(include),
18
+ page: page,
19
+ per_page: per_page
20
+ )
21
+ )
20
22
 
21
- remove_empty_values_from!(params)
22
- client.get("/api/v4/employees", params)
23
+ client.get "/api/v4/employees", combined_params
23
24
  end
24
25
 
25
26
  # implements the interface to get a single Employee record
@@ -29,8 +30,8 @@ module PayrollHero
29
30
  # @param [Array|Symbol] only - Attribute names to be included on the response
30
31
  # @param [Array|Symbol] except - Attribute names to be excluded on the response
31
32
  # @param [Array|Symbol] include - Association names to be included in the response
32
- def get(id, only: nil, except: nil, include: nil)
33
- fetch(id, only: only, except: except, include: include)
33
+ def get(id, only: nil, except: nil, include: nil, **params)
34
+ fetch id, only: only, except: except, include: include, **params
34
35
  end
35
36
 
36
37
  # Implements the interface to get a list of the API token owner's subordinates
@@ -40,8 +41,8 @@ module PayrollHero
40
41
  # @param [Array|Symbol] only - Attribute names to be included on the response
41
42
  # @param [Array|Symbol] except - Attribute names to be excluded on the response
42
43
  # @param [Array|Symbol] include - Association names to be included in the response
43
- def subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil)
44
- fetch("#{id}/subordinates", only: only, except: except, include: include, page: page, per_page: per_page)
44
+ def subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil, **params)
45
+ fetch "#{id}/subordinates", only: only, except: except, include: include, page: page, per_page: per_page, **params
45
46
  end
46
47
 
47
48
  # Implements the interface to get a list of the API token owner's superiors
@@ -51,22 +52,32 @@ module PayrollHero
51
52
  # @param [Array|Symbol] only - Attribute names to be included on the response
52
53
  # @param [Array|Symbol] except - Attribute names to be excluded on the response
53
54
  # @param [Array|Symbol] include - Association names to be included in the response
54
- def superiors(id, only: [], except: [], include: [], page: nil, per_page: nil)
55
- fetch("#{id}/superiors", only: only, except: except, include: include, page: page, per_page: per_page)
55
+ def superiors(id, only: [], except: [], include: [], page: nil, per_page: nil, **params)
56
+ fetch"#{id}/superiors", only: only, except: except, include: include, page: page, per_page: per_page, **params
57
+ end
58
+
59
+ # Final Pay Feature: Convert all applicable leaves to work time
60
+ # only,except,include and paging params don't apply here as it's a write call
61
+ # expected attributes[Hash]: { leaves: [ { name: 'Vacation', number_of_days: 28.0 },...] }
62
+
63
+ def convert_leaves(id, attributes)
64
+ client.put "/api/v4/employees/#{id}/convert_leaves", attributes
56
65
  end
57
66
 
58
67
  private
59
68
 
60
- def fetch(identifier, only:, except:, include:, page: nil, per_page: nil)
61
- params = {
62
- only: Array(only),
63
- except: Array(except),
64
- include: Array(include),
65
- page: page,
66
- per_page: per_page,
67
- }
68
- remove_empty_values_from!(params)
69
- client.get("/api/v4/employees/#{identifier}", params)
69
+ def fetch(identifier, only:, except:, include:, page: nil, per_page: nil, **params)
70
+ combined_params = params.merge(
71
+ remove_empty_values_from!(
72
+ only: Array(only),
73
+ except: Array(except),
74
+ include: Array(include),
75
+ page: page,
76
+ per_page: per_page
77
+ )
78
+ )
79
+
80
+ client.get "/api/v4/employees/#{identifier}", combined_params
70
81
  end
71
82
  end
72
83
  end
@@ -11,8 +11,8 @@ module PayrollHero
11
11
  client.post("/api/v4/leaves", attributes)
12
12
  end
13
13
 
14
- def destroy(id)
15
- client.delete("/api/v4/leaves/#{id}")
14
+ def destroy(id, **params)
15
+ client.delete("/api/v4/leaves/#{id}", params)
16
16
  end
17
17
  end
18
18
  end
@@ -3,8 +3,8 @@ module PayrollHero
3
3
  module V4
4
4
  # Permissions Endpoint
5
5
  class Permissions < BaseGroup
6
- def list
7
- client.get("/api/v4/permissions")
6
+ def list(**params)
7
+ client.get("/api/v4/permissions", params)
8
8
  end
9
9
  end
10
10
  end
@@ -3,24 +3,34 @@ module PayrollHero
3
3
  module V4
4
4
  class ScheduleEvents < BaseGroup
5
5
 
6
- def list(time_zone: nil, start_time: nil, end_time: nil, start_date: nil, end_date: nil, employee_ids: [],
7
- worksite_ids: [], excluded_worksite_ids: nil, shared_events: nil, page: nil, per_page: nil)
8
- params = {
9
- time_zone: time_zone,
10
- start_time: start_time,
11
- end_time: end_time,
12
- start_date: start_date,
13
- end_date: end_date,
14
- employee_ids: employee_ids,
15
- worksite_ids: worksite_ids,
16
- excluded_worksite_ids: excluded_worksite_ids,
17
- shared_events: shared_events,
18
- page: page,
19
- per_page: per_page
20
- }
6
+ def list(
7
+ time_zone: nil,
8
+ start_time: nil,
9
+ end_time: nil,
10
+ start_date: nil,
11
+ end_date: nil,
12
+ employee_ids: [],
13
+ worksite_ids: [],
14
+ excluded_worksite_ids: nil,
15
+ shared_events: nil,
16
+ page: nil,
17
+ per_page: nil,
18
+ **params
19
+ )
20
+ combined_params = params.merge time_zone: time_zone,
21
+ start_time: start_time,
22
+ end_time: end_time,
23
+ start_date: start_date,
24
+ end_date: end_date,
25
+ employee_ids: employee_ids,
26
+ worksite_ids: worksite_ids,
27
+ excluded_worksite_ids: excluded_worksite_ids,
28
+ shared_events: shared_events,
29
+ page: page,
30
+ per_page: per_page
21
31
 
22
- remove_nil_values_from!(params)
23
- client.get('/api/v4/schedule_events', params)
32
+ remove_nil_values_from! combined_params
33
+ client.get '/api/v4/schedule_events', combined_params
24
34
  end
25
35
 
26
36
  end
@@ -2,8 +2,8 @@ module PayrollHero
2
2
  module Api
3
3
  module V4
4
4
  class Shifts < BaseGroup
5
- def list
6
- client.get('/api/v4/shifts')
5
+ def list(**params)
6
+ client.get '/api/v4/shifts', params
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  module PayrollHero
2
2
  module Api
3
- VERSION = "1.2.3"
3
+ VERSION = "1.2.7"
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_runtime_dependency 'hashie'
25
25
  spec.add_runtime_dependency 'retries'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.9'
27
+ spec.add_development_dependency 'bundler'
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rspec'
30
30
  spec.add_development_dependency 'vcr'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payroll_hero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-20 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.9'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.9'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -215,8 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  - !ruby/object:Gem::Version
216
216
  version: '0'
217
217
  requirements: []
218
- rubyforge_project:
219
- rubygems_version: 2.5.1
218
+ rubygems_version: 3.0.9
220
219
  signing_key:
221
220
  specification_version: 4
222
221
  summary: Ruby API Client for PayrollHero Apis