bobhr 0.5.17 → 0.5.19

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: 0bfc372aea38224844d0bbb70a15fa25b688724e714836d451d39e9f543c1577
4
- data.tar.gz: 1cabe3c271b8f048c63294a672bf15e03e20bb725d5fe8d7871785f001a42df0
3
+ metadata.gz: 9ea22a54b23deffef8eeea565b355bf7569869725a4ddabe861ad252d6bfefd7
4
+ data.tar.gz: 8d982347ca745e2476dcf3626259e082f45da66f7dc74a100909bb496d7476f0
5
5
  SHA512:
6
- metadata.gz: 15f51d9c32b5f04da13b268f7ef5b08b384fa8f62f139b555ecf1f22f218f7cd8fc2e953457b2507369e122a29cc712ab508990c3b22d4ede96c557a56556da2
7
- data.tar.gz: 73ff2e831eb14fe256bee2016e1afab2b312536795d5b97b597cceb18d6c2ffc72ca39ddc3ee27822132a84bc73475d5c8c4a856c5d89ad0616fbd1f3280a494
6
+ metadata.gz: 8bf89e3742d4da2d31087db199164db0bb0c25c5da783b6d5026fe87f1fc70abc8f0b52c650dc569b725406f607ffb9689da5c944a62b21786c2a8ab625b3cf5
7
+ data.tar.gz: b3a5ce5f2587a09682ddf4c3b643e69bc2a624e6862e7499fa47c5fbbf4d034a983647191db184492176f073104385cd6457b99283a0772b64f1f078838f8f3b
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bob
4
+ module Employee
5
+ class EmploymentHistory < API
6
+ def self.all(employee_id)
7
+ response = get("people/#{employee_id}/employment")
8
+ EmploymentHistoryParser.new(response).work_histories
9
+ end
10
+
11
+ def self.create(employee_id, params)
12
+ post("people/#{employee_id}/employment", params)
13
+ end
14
+
15
+ def self.update(employee_id, employment_entry_id, params)
16
+ put(
17
+ "people/#{employee_id}/employment/#{employment_entry_id}",
18
+ params,
19
+ use_api_key: true
20
+ )
21
+ end
22
+
23
+ def self.remove(employee_id, employment_entry_id)
24
+ delete("people/#{employee_id}/employment/#{employment_entry_id}")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -12,8 +12,12 @@ module Bob
12
12
  post("people/#{employee_id}/equities", params)
13
13
  end
14
14
 
15
+ def self.update(employee_id, entry_id, params)
16
+ put("people/#{employee_id}/equities/#{entry_id}", params)
17
+ end
18
+
15
19
  def self.remove(employee_id, entry_id)
16
- delete("people/#{employee_id}/salaries/#{entry_id}")
20
+ delete("people/#{employee_id}/equities/#{entry_id}")
17
21
  end
18
22
  end
19
23
  end
@@ -3,8 +3,8 @@
3
3
  module Bob
4
4
  module Employee
5
5
  class TimeOff < API
6
- def self.balance(employee_id:, policy_type:, date: )
7
- response = get("timeoff/employees/#{employee_id}/balance", {policyType: policy_type, date: date})
6
+ def self.balance(employee_id:, policy_type:, date:)
7
+ response = get("timeoff/employees/#{employee_id}/balance", { policyType: policy_type, date: date })
8
8
  BaseParser.new(response).fields
9
9
  end
10
10
  end
@@ -8,6 +8,10 @@ module Bob
8
8
  WorkHistoryParser.new(response).work_histories
9
9
  end
10
10
 
11
+ def self.create(employee_id, params)
12
+ post("people/#{employee_id}/work", params)
13
+ end
14
+
11
15
  def self.update(employee_id, work_history_id, params)
12
16
  put(
13
17
  "people/#{employee_id}/work/#{work_history_id}",
@@ -15,6 +19,10 @@ module Bob
15
19
  use_api_key: true
16
20
  )
17
21
  end
22
+
23
+ def self.remove(employee_id, work_history_id)
24
+ delete("people/#{employee_id}/work/#{work_history_id}")
25
+ end
18
26
  end
19
27
  end
20
28
  end
@@ -9,6 +9,7 @@ require_relative 'employee/variable_payments'
9
9
  require_relative 'employee/work_history'
10
10
  require_relative 'employee/lifecycle_history'
11
11
  require_relative 'employee/time_off'
12
+ require_relative 'employee/employment_history'
12
13
 
13
14
  module Bob
14
15
  class Employees < API
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bob
4
+ module MetaData
5
+ class TimeOffPolicies < API
6
+ def self.all
7
+ get('timeoff/policy-types')['policyTypes']
8
+ end
9
+
10
+ def self.find(policy_name)
11
+ response = get("timeoff/policies", { policyName: policy_name })
12
+ BaseParser.new(response).fields
13
+ end
14
+
15
+ def self.names_for(policy_name)
16
+ get("timeoff/policies/names", { policyTypeName: policy_name })['policies']
17
+ end
18
+ end
19
+ end
20
+ end
@@ -2,3 +2,4 @@
2
2
 
3
3
  require_relative 'metadata/company_lists'
4
4
  require_relative 'metadata/company_fields'
5
+ require_relative 'metadata/time_off_policies'
@@ -10,6 +10,8 @@ module Models
10
10
  instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
11
11
  self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
12
12
  self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
13
+ rescue NameError
14
+ next
13
15
  end
14
16
  end
15
17
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class EmploymentHistory < Models::Base
5
+ end
6
+ end
data/lib/bob/models.rb CHANGED
@@ -12,3 +12,4 @@ require_relative 'models/company_field'
12
12
  require_relative 'models/onboarding_wizard'
13
13
  require_relative 'models/work_history'
14
14
  require_relative 'models/lifecycle_history'
15
+ require_relative 'models/employment_history'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EmploymentHistoryParser < BaseParser
4
+ def employment_histories
5
+ json_response['values'].map { |attributes| Models::EmploymentHistory.new(attributes) }
6
+ end
7
+ end
data/lib/bob/parsers.rb CHANGED
@@ -12,3 +12,4 @@ require_relative 'parsers/company_field_parser'
12
12
  require_relative 'parsers/onboarding_wizard_parser'
13
13
  require_relative 'parsers/work_history_parser'
14
14
  require_relative 'parsers/lifecycle_history_parser'
15
+ require_relative 'parsers/employment_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.17'
4
+ VERSION = '0.5.19'
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.17
4
+ version: 0.5.19
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-08-03 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -64,6 +64,7 @@ files:
64
64
  - lib/bob.rb
65
65
  - lib/bob/api/api.rb
66
66
  - lib/bob/api/employee/documents.rb
67
+ - lib/bob/api/employee/employment_history.rb
67
68
  - lib/bob/api/employee/equity_grants.rb
68
69
  - lib/bob/api/employee/invites.rb
69
70
  - lib/bob/api/employee/lifecycle_history.rb
@@ -76,6 +77,7 @@ files:
76
77
  - lib/bob/api/metadata.rb
77
78
  - lib/bob/api/metadata/company_fields.rb
78
79
  - lib/bob/api/metadata/company_lists.rb
80
+ - lib/bob/api/metadata/time_off_policies.rb
79
81
  - lib/bob/api/onboarding_wizards.rb
80
82
  - lib/bob/api/reports.rb
81
83
  - lib/bob/api/time_off.rb
@@ -85,6 +87,7 @@ files:
85
87
  - lib/bob/models/company_field.rb
86
88
  - lib/bob/models/company_list.rb
87
89
  - lib/bob/models/employee.rb
90
+ - lib/bob/models/employment_history.rb
88
91
  - lib/bob/models/equity_grant.rb
89
92
  - lib/bob/models/lifecycle_history.rb
90
93
  - lib/bob/models/onboarding_wizard.rb
@@ -98,6 +101,7 @@ files:
98
101
  - lib/bob/parsers/company_field_parser.rb
99
102
  - lib/bob/parsers/company_list_parser.rb
100
103
  - lib/bob/parsers/employee_parser.rb
104
+ - lib/bob/parsers/employment_history_parser.rb
101
105
  - lib/bob/parsers/equity_grant_parser.rb
102
106
  - lib/bob/parsers/lifecycle_history_parser.rb
103
107
  - lib/bob/parsers/onboarding_wizard_parser.rb
@@ -130,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
134
  - !ruby/object:Gem::Version
131
135
  version: '0'
132
136
  requirements: []
133
- rubygems_version: 3.2.31
137
+ rubygems_version: 3.3.7
134
138
  signing_key:
135
139
  specification_version: 4
136
140
  summary: Ruby gem for Bob API