bobhr 0.5.9 → 0.5.12

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: ffda2d8bd0f7e6ea7a53b1a8f92fe6c247fa3702737960c2f84a9bd2e2f28942
4
- data.tar.gz: ad09a4e4594864444610990d6d78c0c4581770f189c31f34220afa3da514ee2a
3
+ metadata.gz: 46e31c984fb6ebd3191f5385250b2d2dcf0267175c1d1dd239bf40bfd08d7f5c
4
+ data.tar.gz: 643b945a85c2ae4d69a461bb222a5c8cb59e2e52439fbbad5cd945306caa8a40
5
5
  SHA512:
6
- metadata.gz: e6f747a56836825f25805490d6f83050c1b9dd86ad983231719791a05206cb069686ede379cca34e7f6acd6a0b8723e5c176a1b0715c3b0ace57b41e6a5abd29
7
- data.tar.gz: ea9aba347455c16c27a74d174046b1899253b856457b87026b9353dda13d63ee4b78cb4b9b8852df184fa29a650fcb6bc2edbcc045889e410c5598db08033e5a
6
+ metadata.gz: f86a5485c37a86b93d82fe90aea221432437d788149a4113e125ce5ab72bb7909d63e02fa34656ca40842ed6312a152f98bd72735b317f35cdc45ae8b0142da6
7
+ data.tar.gz: 813ffce4e29a67b615423977b29a479161d61e5c7cf7a93bd68bacc70783a0e8761cb390e8ccb18ae1f6237314fac4e5907b791dccc347f69822360064ebbef5
@@ -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
@@ -7,6 +7,7 @@ require_relative 'employee/equity_grants'
7
7
  require_relative 'employee/documents'
8
8
  require_relative 'employee/variable_payments'
9
9
  require_relative 'employee/work_history'
10
+ require_relative 'employee/lifecycle_history'
10
11
 
11
12
  module Bob
12
13
  class Employees < API
@@ -47,15 +47,15 @@ module Models
47
47
  end
48
48
 
49
49
  def manager
50
- work.reports_to
50
+ work&.reports_to
51
51
  end
52
52
 
53
53
  def has_second_level_manager?
54
- work.second_level_manager.present?
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.second_level_manager)
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.manager
66
+ second_level_manager&.manager
67
67
  end
68
68
 
69
69
  def has_fourth_level_manager?
70
- second_level_manager.work.second_level_manager.present?
70
+ second_level_manager.work&.second_level_manager.present?
71
71
  end
72
72
 
73
73
  def fourth_level_manager
74
- second_level_manager.second_level_manager
74
+ second_level_manager&.second_level_manager
75
75
  end
76
76
 
77
77
  def cost_center
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class LifecycleHistory < Models::Base
5
+ end
6
+ end
@@ -3,7 +3,8 @@
3
3
  module Models
4
4
  class TimeOff < Models::Base
5
5
  def employee
6
- @employee ||= Bob::Employees.find(employee_id)
6
+ identification = email.present? ? email : employee_id
7
+ @employee ||= Bob::Employees.find(identification)
7
8
  end
8
9
 
9
10
  def parental_leave?
data/lib/bob/models.rb CHANGED
@@ -11,3 +11,4 @@ require_relative 'models/company_list'
11
11
  require_relative 'models/company_field'
12
12
  require_relative 'models/onboarding_wizard'
13
13
  require_relative 'models/work_history'
14
+ require_relative 'models/lifecycle_history'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class LifecycleHistoryParser < BaseParser
4
+ def lifecycle_histories
5
+ json_response['values'].map { |attributes| Models::LifecycleHistory.new(attributes) }
6
+ end
7
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  class OnboardingWizardParser < BaseParser
4
4
  def wizards
5
- json_response['values'].map { |attributes| Models::OnboardingWizard.new(attributes) }
5
+ json_response['wizards'].map { |attributes| Models::OnboardingWizard.new(attributes) }
6
6
  end
7
7
  end
data/lib/bob/parsers.rb CHANGED
@@ -11,3 +11,4 @@ require_relative 'parsers/company_list_parser'
11
11
  require_relative 'parsers/company_field_parser'
12
12
  require_relative 'parsers/onboarding_wizard_parser'
13
13
  require_relative 'parsers/work_history_parser'
14
+ require_relative 'parsers/lifecycle_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.9'
4
+ VERSION = '0.5.12'
5
5
  end
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.9
4
+ version: 0.5.12
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-05-20 00:00:00.000000000 Z
11
+ date: 2022-06-08 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