bobhr 0.5.28 → 0.5.30

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: 517aaa5bb5c24baa4d78f669c1e6ffe70aa3d2024bd5307384ce45d7ff606092
4
- data.tar.gz: a0fd0d5e69441b3fb531abe3a69f71df15505345192168069ff7370f03c151e7
3
+ metadata.gz: af0ce519ead83ac6e4a359e0d019e2e2861e6da21f77acdd4a1659396a2b0956
4
+ data.tar.gz: a723f5aaa8a16f7a59e8685308a79eca951971fbd013a1674a2b5db02516f5f7
5
5
  SHA512:
6
- metadata.gz: eda0b5d8399ebf9792ec68a06dd6997cd94a3402460bd0cd78576a0462a3124c72df22f82ac3f5b841d2e02460677d6f4ee7cbcdba8c4e4186123257e8182151
7
- data.tar.gz: 27c3aa148f7bc244f7cedced5c84a1c77defe68e5cbe8828dc1cd13d3ac54418f4f1c50247c19caae8d140cc69d27ee9685b8c5dd892ce2f8bc4cbf405311137
6
+ metadata.gz: 55cb85f2e257e413e8b68a207bbff01068f1dfb3a9422e1fbda4892a7d4353b1279570f1b9446ffeb36933cbca37f2f9a9197e71889e34bdc603942028dc63c4
7
+ data.tar.gz: edee5c4022ef1f61ba4642f4ba1328b71febda69d9ca686345ed408f75939310c6b986dec84f721f81606142d70513e3980ba9d1a052a36284f3d7f188aa3792
@@ -20,9 +20,24 @@ module Bob
20
20
 
21
21
  def self.all_leavers(start_date:, end_date:)
22
22
  all({ includeHumanReadable: true, showInactive: true }).select do |employee|
23
+
23
24
  next unless employee.internal.status == 'Inactive' && employee.internal.termination_date.present?
24
25
 
25
- termination_date = Date.parse(employee.internal.termination_date)
26
+ # Don't process employees that left before the period we are looking into
27
+ internal_term_date = Date.parse(employee.internal.termination_date)
28
+ next if internal_term_date.before?(start_date)
29
+
30
+ # Need to fetch lifecycle statuses, as garden leavers have left before the actual internal term date
31
+ lifecycle_statuses = Bob::Employee::LifecycleHistory.all(employee.id)
32
+ garden_leave_status = lifecycle_statuses.find { |status| status.status == 'garden leave' }
33
+
34
+ if garden_leave_status
35
+ lifecycle_statuses = Bob::Employee::LifecycleHistory.all(employee.id)
36
+ garden_leave_status = lifecycle_statuses.find { |status| status.status == 'garden leave' }
37
+ termination_date = Date.parse(garden_leave_status.effective_date)
38
+ end
39
+
40
+ termination_date ||= Date.parse(employee.internal.termination_date)
26
41
  (start_date..end_date).include?(termination_date)
27
42
  end
28
43
  end
@@ -27,7 +27,7 @@ module Models
27
27
  end
28
28
 
29
29
  def entity
30
- human_readable.work.custom_columns.column_1633980105047
30
+ human_readable.work.custom_columns&.column_1633980105047
31
31
  end
32
32
 
33
33
  def city
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.28'
4
+ VERSION = '0.5.30'
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.28
4
+ version: 0.5.30
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: 2023-02-28 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json