peoplegroup-connectors 0.4.3 → 0.4.4

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: d7ea0fb60cf8904acdc70b3536b57e6fa800bdde94114c77c0dc4e1d58247812
4
- data.tar.gz: 027d82d51fb70dd1be04a0ba6c31c04ca9e350a9f82543e006729a37b106127f
3
+ metadata.gz: 875eee7e11b5eea661399acfc18892af9224590a0fca33fe035c75b1b9d11086
4
+ data.tar.gz: 86d63380901e3fab0465783f8cab2a8a9266e9af93382daa0703fd81ba348a2c
5
5
  SHA512:
6
- metadata.gz: 94591f8aeea81ea77cfe2d5027f534b19ce21185f2dc6724b693098da67e9e4c0bc769e90c647a082a3a50b2632fae118e21312110941eb7970c5d5ff615b1b9
7
- data.tar.gz: c7c7f69af5baa0951c0dcf308a1eb5ab2d03407d668724016b26d668328a3ec432d64de2432d8acf04f7207cd7fb20f00f94da25fe59e4b0d779e97d5c2816b6
6
+ metadata.gz: ca0cd16d1e76c94535d5431bc8a433029f19be7887a618ab533d4a0c6bfcd36cf75f56533178ee1f386eb4ab08de10a016020071d76673733b04835064003aac
7
+ data.tar.gz: 8a953028dacf48c6df31923f8b256d86667277d43c7986341efe18c1cb0c394d1d8925345add7567dc800c06fd3039b9948525cca109a71fd5437ac9f47b51c5
@@ -80,6 +80,12 @@ module PeopleGroup
80
80
  @client.applications(application_id)
81
81
  end
82
82
 
83
+ def has_active_application?(candidate_id)
84
+ candidate(candidate_id)&.[]('applications')&.any? { |application| application['status'] == 'active' }
85
+ rescue RestClient::NotFound
86
+ nil # return nil if candidate could not be found
87
+ end
88
+
83
89
  private
84
90
 
85
91
  def hired_non_active?(candidate)
@@ -269,8 +269,8 @@ module PeopleGroup
269
269
  @workday.departments
270
270
  end
271
271
 
272
- def eligibility_status(employee_number)
273
- @workday.eligibility_status(employee_number)
272
+ def eligibility_status(eid, salary_min, salary_max)
273
+ @workday.eligibility_status(eid, salary_min, salary_max)
274
274
  end
275
275
  end
276
276
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PeopleGroup
4
4
  module Connectors
5
- VERSION = '0.4.3'
5
+ VERSION = '0.4.4'
6
6
  end
7
7
  end
@@ -35,8 +35,13 @@ module PeopleGroup
35
35
  @workers ||= safe_report(report_name: ENV['WORKDAY_WORKERS_REPORT'])
36
36
  end
37
37
 
38
- def eligibility_status(employee_number)
39
- safe_report(report_name: ENV['WORKDAY_ELIGIBILITY_REPORT'], params: { Employee_ID: employee_number })&.first
38
+ def eligibility_status(employee_number, salary_min, salary_max)
39
+ params = {
40
+ Employee_ID: employee_number,
41
+ Salary_Min: salary_min,
42
+ Salary_Max: salary_max
43
+ }
44
+ safe_report(report_name: ENV['WORKDAY_ELIGIBILITY_REPORT'], params: params)&.first
40
45
  end
41
46
 
42
47
  # Grabs manager history for the specified team member or all team members.
@@ -87,8 +92,10 @@ module PeopleGroup
87
92
  # @param [Hash] args
88
93
  def safe_report(**args)
89
94
  report(**args)
95
+ rescue RestClient::InternalServerError => e
96
+ pp "Encountered an error when accessing report from Workday.\nArgs: #{args}"
97
+ raise e
90
98
  rescue StandardError => e
91
- # TODO add common Workday errors here.
92
99
  raise e
93
100
  end
94
101
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peoplegroup-connectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
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-05-15 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab