bobhr 0.5.15 → 0.5.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bob/api/api.rb +1 -1
- data/lib/bob/api/employee/employment_history.rb +28 -0
- data/lib/bob/api/employee/equity_grants.rb +5 -1
- data/lib/bob/api/employee/time_off.rb +12 -0
- data/lib/bob/api/employee/work_history.rb +8 -0
- data/lib/bob/api/employees.rb +11 -0
- data/lib/bob/models/base.rb +2 -2
- data/lib/bob/models/employment_history.rb +6 -0
- data/lib/bob/models.rb +1 -0
- data/lib/bob/parsers/base_parser.rb +4 -0
- data/lib/bob/parsers/employment_history_parser.rb +7 -0
- data/lib/bob/parsers.rb +1 -0
- data/lib/bob/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba27fbf4804e19318ce9f39e7dfe5488955a19b68f337da4407ce52824b71db3
|
4
|
+
data.tar.gz: 82a0ce36154590d31b0ddbd605c20baf31432f94c996c6a0dd90e9b97cf85d60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0a58de9a8c6c7cb8ea9df7baf40393dc49ae84c808573e080dba5a0ffb0f6e2a0cc59506d9845d8d7ab79b9657a38eb7e1427586cd563463f790dd88fbce40
|
7
|
+
data.tar.gz: 6181082e0b3f51da521f108f84735fed2c74cd6656629d1cdd356e69129a8aba279dca52db939720a4cdbbbf037854447dca800abad5158e78c97cfc4a35fc3f
|
data/lib/bob/api/api.rb
CHANGED
@@ -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}/
|
20
|
+
delete("people/#{employee_id}/equities/#{entry_id}")
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bob
|
4
|
+
module Employee
|
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 })
|
8
|
+
BaseParser.new(response).fields
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
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
|
data/lib/bob/api/employees.rb
CHANGED
@@ -8,6 +8,8 @@ require_relative 'employee/documents'
|
|
8
8
|
require_relative 'employee/variable_payments'
|
9
9
|
require_relative 'employee/work_history'
|
10
10
|
require_relative 'employee/lifecycle_history'
|
11
|
+
require_relative 'employee/time_off'
|
12
|
+
require_relative 'employee/employment_history'
|
11
13
|
|
12
14
|
module Bob
|
13
15
|
class Employees < API
|
@@ -16,6 +18,15 @@ module Bob
|
|
16
18
|
EmployeeParser.new(response).employees
|
17
19
|
end
|
18
20
|
|
21
|
+
def self.all_leavers(start_date:, end_date:)
|
22
|
+
all({ includeHumanReadable: true, showInactive: true }).select do |employee|
|
23
|
+
next unless employee.internal.status == 'Inactive' && employee.internal.termination_date.present?
|
24
|
+
|
25
|
+
termination_date = Date.parse(employee.internal.termination_date)
|
26
|
+
(start_date..end_date).include?(termination_date)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
19
30
|
def self.all_people_managers(params = { includeHumanReadable: true })
|
20
31
|
response = get('people', params)
|
21
32
|
EmployeeParser.new(response).managers
|
data/lib/bob/models/base.rb
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
module Models
|
4
4
|
class Base
|
5
|
-
def initialize(raw)
|
5
|
+
def initialize(raw) # rubocop:disable Metrics/AbcSize
|
6
6
|
attributes = Bob::Util.underscorize_hash(raw)
|
7
7
|
|
8
8
|
attributes.each do |k, v|
|
9
|
-
k = "field_#{k}" if k.
|
9
|
+
k = "field_#{k}" if k.instance_of?(String) && k.to_i.positive?
|
10
10
|
instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
|
11
11
|
self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
|
12
12
|
self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
|
data/lib/bob/models.rb
CHANGED
data/lib/bob/parsers.rb
CHANGED
data/lib/bob/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bobhr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lien Van Den Steen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -64,10 +64,12 @@ 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
|
70
71
|
- lib/bob/api/employee/salaries.rb
|
72
|
+
- lib/bob/api/employee/time_off.rb
|
71
73
|
- lib/bob/api/employee/trainings.rb
|
72
74
|
- lib/bob/api/employee/variable_payments.rb
|
73
75
|
- lib/bob/api/employee/work_history.rb
|
@@ -84,6 +86,7 @@ files:
|
|
84
86
|
- lib/bob/models/company_field.rb
|
85
87
|
- lib/bob/models/company_list.rb
|
86
88
|
- lib/bob/models/employee.rb
|
89
|
+
- lib/bob/models/employment_history.rb
|
87
90
|
- lib/bob/models/equity_grant.rb
|
88
91
|
- lib/bob/models/lifecycle_history.rb
|
89
92
|
- lib/bob/models/onboarding_wizard.rb
|
@@ -97,6 +100,7 @@ files:
|
|
97
100
|
- lib/bob/parsers/company_field_parser.rb
|
98
101
|
- lib/bob/parsers/company_list_parser.rb
|
99
102
|
- lib/bob/parsers/employee_parser.rb
|
103
|
+
- lib/bob/parsers/employment_history_parser.rb
|
100
104
|
- lib/bob/parsers/equity_grant_parser.rb
|
101
105
|
- lib/bob/parsers/lifecycle_history_parser.rb
|
102
106
|
- lib/bob/parsers/onboarding_wizard_parser.rb
|
@@ -129,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
133
|
- !ruby/object:Gem::Version
|
130
134
|
version: '0'
|
131
135
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.2.31
|
133
137
|
signing_key:
|
134
138
|
specification_version: 4
|
135
139
|
summary: Ruby gem for Bob API
|