bobhr 0.5.10 → 0.5.13
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 +4 -5
- data/lib/bob/api/employee/documents.rb +2 -2
- data/lib/bob/api/employee/lifecycle_history.rb +12 -0
- data/lib/bob/api/employees.rb +1 -0
- data/lib/bob/models/employee.rb +6 -6
- data/lib/bob/models/lifecycle_history.rb +6 -0
- data/lib/bob/models/time_off.rb +2 -1
- data/lib/bob/models.rb +1 -0
- data/lib/bob/parsers/lifecycle_history_parser.rb +7 -0
- data/lib/bob/parsers.rb +1 -0
- data/lib/bob/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6833af093ceefa5ffbd4f56748c4cacc0abc6a9eef88a42fcf1b1ad5d00a171
|
4
|
+
data.tar.gz: 863f017eb7bccf7904c060b140b5fd2c4cfbaa43b5533d4631974623342c052d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6683be064cc627dcfe6c8bb136870cbb71231034475d1b178f2a46c42944527d16371c17b24ffcdc06a84f82cc72ced0387209b12efb68bdb66de6276f9a5821
|
7
|
+
data.tar.gz: b09ee6b29014ace8b434520c914c87994b2980c0da369fdb134aeb9c995c4db4e3e844945f1f969de4cbe315738d5101da0121d204932ae02159ed4bf3fe6ab1
|
data/lib/bob/api/api.rb
CHANGED
@@ -34,20 +34,19 @@ module Bob
|
|
34
34
|
response.code
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.post_file(endpoint,
|
37
|
+
def self.post_file(endpoint, file_path)
|
38
38
|
url = build_url(endpoint)
|
39
39
|
payload = {
|
40
40
|
multipart: true,
|
41
|
-
file:
|
41
|
+
file: File.new(file_path)
|
42
42
|
}
|
43
43
|
|
44
44
|
headers = {
|
45
|
-
|
45
|
+
Accept: 'application/json',
|
46
|
+
'Content-Type': 'multipart/form-data',
|
46
47
|
Authorization: "Basic #{Base64.strict_encode64("#{Bob.access_user_name}:#{Bob.access_token}")}"
|
47
48
|
}
|
48
49
|
response = RestClient.post(url, payload, headers)
|
49
|
-
binding.break
|
50
|
-
p response
|
51
50
|
response.code
|
52
51
|
end
|
53
52
|
|
@@ -11,8 +11,8 @@ module Bob
|
|
11
11
|
post("docs/people/#{employee_id}/confidential", params, use_api_key: true)
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.upload_public_document(employee_id,
|
15
|
-
post_file("docs/people/#{employee_id}/shared/upload",
|
14
|
+
def self.upload_public_document(employee_id, file_path)
|
15
|
+
post_file("docs/people/#{employee_id}/shared/upload", file_path)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bob
|
4
|
+
module Employee
|
5
|
+
class LifecycleHistory < API
|
6
|
+
def self.all(employee_id)
|
7
|
+
response = get("people/#{employee_id}/lifecycle")
|
8
|
+
LifecycleHistoryParser.new(response).lifecycle_histories
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/bob/api/employees.rb
CHANGED
data/lib/bob/models/employee.rb
CHANGED
@@ -47,15 +47,15 @@ module Models
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def manager
|
50
|
-
work
|
50
|
+
work&.reports_to
|
51
51
|
end
|
52
52
|
|
53
53
|
def has_second_level_manager?
|
54
|
-
work
|
54
|
+
work&.second_level_manager.present?
|
55
55
|
end
|
56
56
|
|
57
57
|
def second_level_manager
|
58
|
-
@second_level_manager ||= Bob::Employees.find(work
|
58
|
+
@second_level_manager ||= Bob::Employees.find(work&.second_level_manager)
|
59
59
|
end
|
60
60
|
|
61
61
|
def has_third_level_manager?
|
@@ -63,15 +63,15 @@ module Models
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def third_level_manager
|
66
|
-
second_level_manager
|
66
|
+
second_level_manager&.manager
|
67
67
|
end
|
68
68
|
|
69
69
|
def has_fourth_level_manager?
|
70
|
-
second_level_manager.work
|
70
|
+
second_level_manager.work&.second_level_manager.present?
|
71
71
|
end
|
72
72
|
|
73
73
|
def fourth_level_manager
|
74
|
-
second_level_manager
|
74
|
+
second_level_manager&.second_level_manager
|
75
75
|
end
|
76
76
|
|
77
77
|
def cost_center
|
data/lib/bob/models/time_off.rb
CHANGED
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.13
|
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-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- lib/bob/api/employee/documents.rb
|
67
67
|
- lib/bob/api/employee/equity_grants.rb
|
68
68
|
- lib/bob/api/employee/invites.rb
|
69
|
+
- lib/bob/api/employee/lifecycle_history.rb
|
69
70
|
- lib/bob/api/employee/salaries.rb
|
70
71
|
- lib/bob/api/employee/trainings.rb
|
71
72
|
- lib/bob/api/employee/variable_payments.rb
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- lib/bob/models/company_list.rb
|
85
86
|
- lib/bob/models/employee.rb
|
86
87
|
- lib/bob/models/equity_grant.rb
|
88
|
+
- lib/bob/models/lifecycle_history.rb
|
87
89
|
- lib/bob/models/onboarding_wizard.rb
|
88
90
|
- lib/bob/models/salary.rb
|
89
91
|
- lib/bob/models/time_off.rb
|
@@ -96,6 +98,7 @@ files:
|
|
96
98
|
- lib/bob/parsers/company_list_parser.rb
|
97
99
|
- lib/bob/parsers/employee_parser.rb
|
98
100
|
- lib/bob/parsers/equity_grant_parser.rb
|
101
|
+
- lib/bob/parsers/lifecycle_history_parser.rb
|
99
102
|
- lib/bob/parsers/onboarding_wizard_parser.rb
|
100
103
|
- lib/bob/parsers/salary_parser.rb
|
101
104
|
- lib/bob/parsers/time_off_parser.rb
|