payroll_hero-api 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: f019ac0f37a1ee9d08543de72ee7468ab96eef58
4
- data.tar.gz: a134e2daffa4162cfa8b96d95552f4b9507f2262
3
+ metadata.gz: ff3e33b56f61307b1c5b85e5c4aa23b82264947d
4
+ data.tar.gz: 95204abd47ed1dcade540684df2ee6d9234296f3
5
5
  SHA512:
6
- metadata.gz: c7a6d73beffab078c1a7daeb4daebeca7772f8098a6ab2bf952615e33bd6508b0425b29e164b23860599f1978c3255fed343c946e82b96446caa8a312c7cd6f5
7
- data.tar.gz: afb0ba215721e307b91cbe78f9a53abfff1cb024d2f4122986433fbafcca8a2732f44fbd1239680bd7ab271d2283a20c9985a1d725e4b15936c9921b30168e2d
6
+ metadata.gz: 82609744800bb3fa8a0317b50201edcfb12ee07988e7aab3c1bf924a0dd046926fbba716ac389b87285484dc0786581b4bfc14632fde8ffba61408096592614a
7
+ data.tar.gz: 20663067152c8ead1d1de43d05c927c736d595d2ad1cd68c658b8aef56e43fa235c8910aec02b6a106d996f716d79451680b620ff7f84a40d4539ad83a1626d6
data/CHANGELOG.md CHANGED
@@ -1,41 +1,13 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.2.1](https://github.com/payrollhero/payroll_hero-api/tree/v0.2.1) (2016-01-20)
4
-
5
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.2.0...v0.2.1)
6
-
3
+ ## [v1.0.0](https://github.com/payrollhero/payroll_hero-api/tree/v1.0.0) (2016-04-18)
4
+ - Add api/v4 employees list interface [\#6](https://github.com/payrollhero/payroll_hero-api/pull/6) ([nicosuria](https://github.com/nicosuria))
7
5
  - Add delete leave call. [\#5](https://github.com/payrollhero/payroll_hero-api/pull/5) ([mykola-kyryk](https://github.com/mykola-kyryk))
8
-
9
- ## [v0.2.0](https://github.com/payrollhero/payroll_hero-api/tree/v0.2.0) (2015-12-29)
10
-
11
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.1.4...v0.2.0)
12
-
13
- ## [v0.1.4](https://github.com/payrollhero/payroll_hero-api/tree/v0.1.4) (2015-12-28)
14
-
15
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.1.3...v0.1.4)
16
-
17
6
  - Add v4/permissions [\#4](https://github.com/payrollhero/payroll_hero-api/pull/4) ([mykola-kyryk](https://github.com/mykola-kyryk))
18
-
19
- ## [v0.1.3](https://github.com/payrollhero/payroll_hero-api/tree/v0.1.3) (2015-12-17)
20
-
21
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.1.2...v0.1.3)
22
-
23
- - Feature/add v4 leaves resource [\#2](https://github.com/payrollhero/payroll_hero-api/pull/2) ([nicosuria](https://github.com/nicosuria))
24
-
25
- ## [v0.1.2](https://github.com/payrollhero/payroll_hero-api/tree/v0.1.2) (2015-12-17)
26
-
27
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.1.1...v0.1.2)
28
-
29
7
  - Add pagination params to V4 Employees [\#3](https://github.com/payrollhero/payroll_hero-api/pull/3) ([mykola-kyryk](https://github.com/mykola-kyryk))
30
-
31
- ## [v0.1.1](https://github.com/payrollhero/payroll_hero-api/tree/v0.1.1) (2015-12-07)
32
-
33
- [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v0.1.0...v0.1.1)
34
-
8
+ - Feature/add v4 leaves resource [\#2](https://github.com/payrollhero/payroll_hero-api/pull/2) ([nicosuria](https://github.com/nicosuria))
35
9
  - Api v4 employees resource [\#1](https://github.com/payrollhero/payroll_hero-api/pull/1) ([nicosuria](https://github.com/nicosuria))
36
10
 
37
- ## [v0.1.0](https://github.com/payrollhero/payroll_hero-api/tree/v0.1.0) (2015-11-27)
38
-
39
11
 
40
12
 
41
13
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
@@ -51,6 +51,7 @@ module PayrollHero
51
51
 
52
52
  def error_from(response)
53
53
  klass = {
54
+ 400 => Errors::BadRequest,
54
55
  401 => Errors::Unauthorized,
55
56
  422 => Errors::UnprocessableEntity,
56
57
  500 => Errors::InternalServerError,
@@ -64,7 +65,7 @@ module PayrollHero
64
65
  raise klass.new('unknown', response.body.inspect)
65
66
  end
66
67
  else
67
- raise klass.new('unknown', response.body)
68
+ raise klass.new("unknown: #{response.status}", response.body)
68
69
  end
69
70
  end
70
71
 
@@ -15,6 +15,9 @@ module PayrollHero
15
15
  attr_reader :code
16
16
  end
17
17
 
18
+ class BadRequest < ServerReturnedError
19
+ end
20
+
18
21
  class Unauthorized < ServerReturnedError
19
22
  end
20
23
 
@@ -0,0 +1,34 @@
1
+ module PayrollHero
2
+ module Api
3
+ module V3
4
+
5
+ #AttendanceDays Endpoint
6
+ class AttendanceDays < BaseGroup
7
+ # implements the interface to the AttendanceDays List endpoint
8
+ #
9
+ # @return [Hashie::Mash]
10
+ # @param [Fixnum] page
11
+ # @param [Fixnum] per_page
12
+ # @param [Date] start_date
13
+ # @param [Date] end_date
14
+ # @param [Fixnum] worksite_id
15
+ # @param [Fixnum] excluded_worksite_id
16
+ # @param [Fixnum] employee_id
17
+ def list(page: nil, per_page: nil, start_date: nil, end_date: nil, worksite_id: nil, excluded_worksite_id: nil, employee_id: nil)
18
+ params = {
19
+ page: page,
20
+ per_page: per_page,
21
+ start_date: start_date,
22
+ end_date: end_date,
23
+ worksite_id: worksite_id,
24
+ excluded_worksite_id: excluded_worksite_id,
25
+ employee_id: employee_id,
26
+ }
27
+ remove_nil_values_from!(params)
28
+ client.get("/api/v3/attendance_days", params)
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -1,5 +1,5 @@
1
1
  module PayrollHero
2
2
  module Api
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -16,6 +16,7 @@ module PayrollHero
16
16
  v3: {
17
17
  day_schedules: V3::DaySchedules.new(token),
18
18
  employees: V3::Employees.new(token),
19
+ attendance_days: V3::AttendanceDays.new(token),
19
20
  },
20
21
  v4: {
21
22
  employees: V4::Employees.new(token),
@@ -39,6 +40,7 @@ require_relative 'api/v2/worksites'
39
40
 
40
41
  require_relative 'api/v3/day_schedules'
41
42
  require_relative 'api/v3/employees'
43
+ require_relative 'api/v3/attendance_days'
42
44
 
43
45
  require_relative 'api/v4/employees'
44
46
  require_relative 'api/v4/leaves'
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.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -185,6 +185,7 @@ files:
185
185
  - lib/payroll_hero/api/configuration.rb
186
186
  - lib/payroll_hero/api/errors.rb
187
187
  - lib/payroll_hero/api/v2/worksites.rb
188
+ - lib/payroll_hero/api/v3/attendance_days.rb
188
189
  - lib/payroll_hero/api/v3/day_schedules.rb
189
190
  - lib/payroll_hero/api/v3/employees.rb
190
191
  - lib/payroll_hero/api/v4/employees.rb