bobhr 0.5.30 → 0.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bob/api/api.rb +3 -1
- data/lib/bob/api/employee/custom_tables.rb +20 -0
- data/lib/bob/api/employees.rb +14 -0
- data/lib/bob/models/table.rb +6 -0
- data/lib/bob/models.rb +1 -0
- data/lib/bob/parsers/table_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: 29fe6ef3d705dfdcb583e4ebf400ee9e3b3957fc504fd2516e7048d9ef62f4b2
|
|
4
|
+
data.tar.gz: fc2b40de9306ae742ae22cae4e83b2e789164aea5f148f414807b07bb790eb11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d68b24386672b1235fb822d91249ab8263d95fd8d3edefd70e56f4dd427aa37cb7680a8466ca825882734ab7ebabb5762e1170585bef7c0bf5c89b87976c9dd
|
|
7
|
+
data.tar.gz: f05383c71f9ef8077fedccc8f0fa6d4ec1283c43801f340960c7006a8220bca0f240163487135a457b51cc87025f65d8158356e7a71c93cfd91c2d9b383ed053
|
data/lib/bob/api/api.rb
CHANGED
|
@@ -26,6 +26,8 @@ module Bob
|
|
|
26
26
|
params.to_json,
|
|
27
27
|
authorization_header(use_api_key: use_api_key).merge(content_headers)
|
|
28
28
|
)
|
|
29
|
+
rescue RestClient::BadRequest => e
|
|
30
|
+
p e
|
|
29
31
|
response.code
|
|
30
32
|
end
|
|
31
33
|
|
|
@@ -53,7 +55,7 @@ module Bob
|
|
|
53
55
|
|
|
54
56
|
def self.delete(endpoint)
|
|
55
57
|
url = build_url(endpoint)
|
|
56
|
-
response = RestClient.delete(url)
|
|
58
|
+
response = RestClient.delete(url, authorization_header)
|
|
57
59
|
response.code
|
|
58
60
|
end
|
|
59
61
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bob
|
|
4
|
+
module Employee
|
|
5
|
+
class CustomTables < API
|
|
6
|
+
def self.rows(employee_id, table_id)
|
|
7
|
+
response = get("people/custom-tables/#{employee_id}/#{table_id}")
|
|
8
|
+
TableParser.new(response).rows
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.add_row(employee_id, table_id, row_data)
|
|
12
|
+
post("people/custom-tables/#{employee_id}/#{table_id}", {values: row_data})
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.remove_row(employee_id, table_id, row_id)
|
|
16
|
+
delete("people/custom-tables/#{employee_id}/#{table_id}/#{row_id}")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/bob/api/employees.rb
CHANGED
|
@@ -10,6 +10,7 @@ require_relative 'employee/work_history'
|
|
|
10
10
|
require_relative 'employee/lifecycle_history'
|
|
11
11
|
require_relative 'employee/time_off'
|
|
12
12
|
require_relative 'employee/employment_history'
|
|
13
|
+
require_relative 'employee/custom_tables'
|
|
13
14
|
|
|
14
15
|
module Bob
|
|
15
16
|
class Employees < API
|
|
@@ -42,6 +43,19 @@ module Bob
|
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
|
|
46
|
+
def self.all_anniversaries_this_month
|
|
47
|
+
current_month = Date.current.month
|
|
48
|
+
|
|
49
|
+
all.select do |employee|
|
|
50
|
+
# Don't process employees that have an internal term date
|
|
51
|
+
internal_term_date = Date.parse(employee.internal.termination_date)
|
|
52
|
+
next if internal_term_date.present?
|
|
53
|
+
|
|
54
|
+
parsed_start_date = Date.parse(employee.start_date)
|
|
55
|
+
parsed_start_date.month == current_month
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
45
59
|
def self.all_people_managers(params = { includeHumanReadable: true })
|
|
46
60
|
response = get('people', params)
|
|
47
61
|
EmployeeParser.new(response).managers
|
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.32
|
|
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-
|
|
11
|
+
date: 2023-07-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -63,6 +63,7 @@ files:
|
|
|
63
63
|
- README.md
|
|
64
64
|
- lib/bob.rb
|
|
65
65
|
- lib/bob/api/api.rb
|
|
66
|
+
- lib/bob/api/employee/custom_tables.rb
|
|
66
67
|
- lib/bob/api/employee/documents.rb
|
|
67
68
|
- lib/bob/api/employee/employment_history.rb
|
|
68
69
|
- lib/bob/api/employee/equity_grants.rb
|
|
@@ -92,6 +93,7 @@ files:
|
|
|
92
93
|
- lib/bob/models/lifecycle_history.rb
|
|
93
94
|
- lib/bob/models/onboarding_wizard.rb
|
|
94
95
|
- lib/bob/models/salary.rb
|
|
96
|
+
- lib/bob/models/table.rb
|
|
95
97
|
- lib/bob/models/time_off.rb
|
|
96
98
|
- lib/bob/models/training.rb
|
|
97
99
|
- lib/bob/models/variable_payment.rb
|
|
@@ -106,6 +108,7 @@ files:
|
|
|
106
108
|
- lib/bob/parsers/lifecycle_history_parser.rb
|
|
107
109
|
- lib/bob/parsers/onboarding_wizard_parser.rb
|
|
108
110
|
- lib/bob/parsers/salary_parser.rb
|
|
111
|
+
- lib/bob/parsers/table_parser.rb
|
|
109
112
|
- lib/bob/parsers/time_off_parser.rb
|
|
110
113
|
- lib/bob/parsers/training_parser.rb
|
|
111
114
|
- lib/bob/parsers/variable_payment_parser.rb
|