bobhr 0.5.17 → 0.5.18

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: 0bfc372aea38224844d0bbb70a15fa25b688724e714836d451d39e9f543c1577
4
- data.tar.gz: 1cabe3c271b8f048c63294a672bf15e03e20bb725d5fe8d7871785f001a42df0
3
+ metadata.gz: ba27fbf4804e19318ce9f39e7dfe5488955a19b68f337da4407ce52824b71db3
4
+ data.tar.gz: 82a0ce36154590d31b0ddbd605c20baf31432f94c996c6a0dd90e9b97cf85d60
5
5
  SHA512:
6
- metadata.gz: 15f51d9c32b5f04da13b268f7ef5b08b384fa8f62f139b555ecf1f22f218f7cd8fc2e953457b2507369e122a29cc712ab508990c3b22d4ede96c557a56556da2
7
- data.tar.gz: 73ff2e831eb14fe256bee2016e1afab2b312536795d5b97b597cceb18d6c2ffc72ca39ddc3ee27822132a84bc73475d5c8c4a856c5d89ad0616fbd1f3280a494
6
+ metadata.gz: 5c0a58de9a8c6c7cb8ea9df7baf40393dc49ae84c808573e080dba5a0ffb0f6e2a0cc59506d9845d8d7ab79b9657a38eb7e1427586cd563463f790dd88fbce40
7
+ data.tar.gz: 6181082e0b3f51da521f108f84735fed2c74cd6656629d1cdd356e69129a8aba279dca52db939720a4cdbbbf037854447dca800abad5158e78c97cfc4a35fc3f
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bob
4
+ module Employee
5
+ class EmploymentHistory < API
6
+ def self.all(employee_id)
7
+ response = get("people/#{employee_id}/employment")
8
+ EmploymentHistoryParser.new(response).work_histories
9
+ end
10
+
11
+ def self.create(employee_id, params)
12
+ post("people/#{employee_id}/employment", params)
13
+ end
14
+
15
+ def self.update(employee_id, employment_entry_id, params)
16
+ put(
17
+ "people/#{employee_id}/employment/#{employment_entry_id}",
18
+ params,
19
+ use_api_key: true
20
+ )
21
+ end
22
+
23
+ def self.remove(employee_id, employment_entry_id)
24
+ delete("people/#{employee_id}/employment/#{employment_entry_id}")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -12,8 +12,12 @@ module Bob
12
12
  post("people/#{employee_id}/equities", params)
13
13
  end
14
14
 
15
+ def self.update(employee_id, entry_id, params)
16
+ put("people/#{employee_id}/equities/#{entry_id}", params)
17
+ end
18
+
15
19
  def self.remove(employee_id, entry_id)
16
- delete("people/#{employee_id}/salaries/#{entry_id}")
20
+ delete("people/#{employee_id}/equities/#{entry_id}")
17
21
  end
18
22
  end
19
23
  end
@@ -3,8 +3,8 @@
3
3
  module Bob
4
4
  module Employee
5
5
  class TimeOff < API
6
- def self.balance(employee_id:, policy_type:, date: )
7
- response = get("timeoff/employees/#{employee_id}/balance", {policyType: policy_type, date: date})
6
+ def self.balance(employee_id:, policy_type:, date:)
7
+ response = get("timeoff/employees/#{employee_id}/balance", { policyType: policy_type, date: date })
8
8
  BaseParser.new(response).fields
9
9
  end
10
10
  end
@@ -8,6 +8,10 @@ module Bob
8
8
  WorkHistoryParser.new(response).work_histories
9
9
  end
10
10
 
11
+ def self.create(employee_id, params)
12
+ post("people/#{employee_id}/work", params)
13
+ end
14
+
11
15
  def self.update(employee_id, work_history_id, params)
12
16
  put(
13
17
  "people/#{employee_id}/work/#{work_history_id}",
@@ -15,6 +19,10 @@ module Bob
15
19
  use_api_key: true
16
20
  )
17
21
  end
22
+
23
+ def self.remove(employee_id, work_history_id)
24
+ delete("people/#{employee_id}/work/#{work_history_id}")
25
+ end
18
26
  end
19
27
  end
20
28
  end
@@ -9,6 +9,7 @@ require_relative 'employee/variable_payments'
9
9
  require_relative 'employee/work_history'
10
10
  require_relative 'employee/lifecycle_history'
11
11
  require_relative 'employee/time_off'
12
+ require_relative 'employee/employment_history'
12
13
 
13
14
  module Bob
14
15
  class Employees < API
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class EmploymentHistory < Models::Base
5
+ end
6
+ end
data/lib/bob/models.rb CHANGED
@@ -12,3 +12,4 @@ require_relative 'models/company_field'
12
12
  require_relative 'models/onboarding_wizard'
13
13
  require_relative 'models/work_history'
14
14
  require_relative 'models/lifecycle_history'
15
+ require_relative 'models/employment_history'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EmploymentHistoryParser < BaseParser
4
+ def employment_histories
5
+ json_response['values'].map { |attributes| Models::EmploymentHistory.new(attributes) }
6
+ end
7
+ end
data/lib/bob/parsers.rb CHANGED
@@ -12,3 +12,4 @@ require_relative 'parsers/company_field_parser'
12
12
  require_relative 'parsers/onboarding_wizard_parser'
13
13
  require_relative 'parsers/work_history_parser'
14
14
  require_relative 'parsers/lifecycle_history_parser'
15
+ require_relative 'parsers/employment_history_parser'
data/lib/bob/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bob
4
- VERSION = '0.5.17'
4
+ VERSION = '0.5.18'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bobhr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.17
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lien Van Den Steen
@@ -64,6 +64,7 @@ files:
64
64
  - lib/bob.rb
65
65
  - lib/bob/api/api.rb
66
66
  - lib/bob/api/employee/documents.rb
67
+ - lib/bob/api/employee/employment_history.rb
67
68
  - lib/bob/api/employee/equity_grants.rb
68
69
  - lib/bob/api/employee/invites.rb
69
70
  - lib/bob/api/employee/lifecycle_history.rb
@@ -85,6 +86,7 @@ files:
85
86
  - lib/bob/models/company_field.rb
86
87
  - lib/bob/models/company_list.rb
87
88
  - lib/bob/models/employee.rb
89
+ - lib/bob/models/employment_history.rb
88
90
  - lib/bob/models/equity_grant.rb
89
91
  - lib/bob/models/lifecycle_history.rb
90
92
  - lib/bob/models/onboarding_wizard.rb
@@ -98,6 +100,7 @@ files:
98
100
  - lib/bob/parsers/company_field_parser.rb
99
101
  - lib/bob/parsers/company_list_parser.rb
100
102
  - lib/bob/parsers/employee_parser.rb
103
+ - lib/bob/parsers/employment_history_parser.rb
101
104
  - lib/bob/parsers/equity_grant_parser.rb
102
105
  - lib/bob/parsers/lifecycle_history_parser.rb
103
106
  - lib/bob/parsers/onboarding_wizard_parser.rb