paylocity_web_service 0.1.2 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 785d1989802a97490574f7527a260c0c3e3a1d598301421cc74630525cc4f0a4
4
- data.tar.gz: f1323abd22825eacf39dc03c3f1abc20ef2994f89b811f3295a73f2b0f5d936b
3
+ metadata.gz: 33f09a98ae188a34663ec0cebb9f794cf7047fd30450554c96e9bc96aa4f878b
4
+ data.tar.gz: 1463dad0fec22d676864f791b4526ea2e696d1741d462435a1b3648525243dbf
5
5
  SHA512:
6
- metadata.gz: 7b0d6ed1aa48cbf529597a210c519916b2b2b44f38c0f82848909c404fef3cf4d6fee9aa0f5fe33779c2a499fd7d820a80906e112187a24d6d9736a543266a12
7
- data.tar.gz: 94882dbd2970de70dd7552ccc133f0ca03e8bc2d43d2be95e845dbec2796e25a136281599265ec313f1ec4927c2e592ba5b29dd72a81166ef3deca11b0e19c6f
6
+ metadata.gz: b1e62adc3cf74ac566588e02874a2ca991a204266fbedaa2c4cf20d5098ac653c40ee66b2af1eecd1849db2b07ba324d57a58d0a38d1ff9bf8ad732d6c5aa27e
7
+ data.tar.gz: 1f14ab469633028556a3c58714c15acf4c64d6e7e63b91d5479e11a8421d496cf4dee75d98a0a5c881e359b14d1d2ae5844b76f053b01dd869b48df86fbc3ee7
data/.gitignore CHANGED
@@ -7,5 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
 
10
+ Gemfile.lock
11
+
10
12
  # rspec failure tracking
11
13
  .rspec_status
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gemspec
8
8
  # The following gems are required for local development and will not be included by `gem install mygem` or `bundle add mygem`.
9
9
  group :development, :test do
10
10
  gem 'awesome_print', require: 'ap'
11
- gem 'pry-byebug'
11
+ gem 'pry'
12
12
  gem 'rubocop'
13
13
  gem 'rake'
14
14
  gem 'bundler'
@@ -10,7 +10,7 @@ module PaylocityWebService
10
10
  end
11
11
 
12
12
  def self.write(key, value, expires_in = 3600 )
13
- expires_at = (Time.now.to_i + expires_in) - 60
13
+ expires_at = (Time.now.to_i + expires_in.to_i) - 60
14
14
  store[key] = { value: value, expires_at: expires_at}
15
15
  end
16
16
 
@@ -1,16 +1,16 @@
1
1
  module PaylocityWebService
2
2
  class Client
3
3
  module Companies
4
- CodeResources = %W(costcenter1 costcenter2 costcenter3 deductions earnings taxes paygrade positions)
4
+ CodeResources = %W(costCenter1 costCenter2 costCenter3 deductions earnings taxes paygrade positions)
5
5
 
6
6
  def company_schema
7
7
  get("/api/v2/companies/#{company_id}/openapi")
8
8
  end
9
9
 
10
10
  # Available Code Resources:
11
- # - costcenter1
12
- # - costcenter2
13
- # - costcenter3
11
+ # - costCenter1
12
+ # - costCenter2
13
+ # - costCenter3
14
14
  # - deductions
15
15
  # - earnings
16
16
  # - taxes
@@ -23,6 +23,15 @@ module PaylocityWebService
23
23
  def code_resources
24
24
  CodeResources
25
25
  end
26
+
27
+ # Paylocity hasn't provide a way to check the connectivity of the API, we have to fire a request to check it.
28
+ def company_connected?
29
+ return true if company_codes('costCenter1').status == 200
30
+ return true if company_schema.code == 200
31
+ false
32
+ rescue => e
33
+ false
34
+ end
26
35
  end
27
36
  end
28
37
  end
@@ -1,8 +1,8 @@
1
1
  module PaylocityWebService
2
2
  class Client
3
3
  module Credentials
4
- def create_client_credential
5
- post("/api/v2/credentials/secrets")
4
+ def create_client_credential(options={})
5
+ post("/api/v2/credentials/secrets", options)
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,9 @@
1
+ module PaylocityWebService
2
+ class Client
3
+ module Onboardings
4
+ def onboard_employee(options={})
5
+ post("/api/v1/companies/#{company_id}/onboarding/employees", options)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -5,6 +5,7 @@ require 'paylocity_web_service/error'
5
5
  require 'paylocity_web_service/client/companies'
6
6
  require 'paylocity_web_service/client/employees'
7
7
  require 'paylocity_web_service/client/credentials'
8
+ require 'paylocity_web_service/client/onboardings'
8
9
 
9
10
  module PaylocityWebService
10
11
  class Client
@@ -15,6 +16,7 @@ module PaylocityWebService
15
16
  include PaylocityWebService::Client::Employees
16
17
  include PaylocityWebService::Client::Companies
17
18
  include PaylocityWebService::Client::Credentials
19
+ include PaylocityWebService::Client::Onboardings
18
20
 
19
21
  def initialize(options={})
20
22
  options = PaylocityWebService.options.merge(options)
@@ -96,7 +96,7 @@ module PaylocityWebService
96
96
  conn.request :retry, max: 2
97
97
  conn.request :json
98
98
 
99
- conn.use PaylocityWebService::Middleware::Response::RaiseError
99
+ # conn.use PaylocityWebService::Middleware::Response::RaiseError
100
100
  conn.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/
101
101
  end
102
102
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaylocityWebService
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paylocity_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Lv
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-15 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: faraday
@@ -64,6 +64,7 @@ files:
64
64
  - lib/paylocity_web_service/client/companies.rb
65
65
  - lib/paylocity_web_service/client/credentials.rb
66
66
  - lib/paylocity_web_service/client/employees.rb
67
+ - lib/paylocity_web_service/client/onboardings.rb
67
68
  - lib/paylocity_web_service/configuration.rb
68
69
  - lib/paylocity_web_service/connection.rb
69
70
  - lib/paylocity_web_service/encryption.rb