paychex_api 0.0.27 → 0.0.28

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: 80908e4ea91b324968a085282b9501e1214f26d769539b31b864760c60b11348
4
- data.tar.gz: 37243af47110f52b2a99f341786571f968586f14f7376f79a2376c0e7f00551f
3
+ metadata.gz: 64d05e8b83a00fd01ba8934f109fc66bcbe1dc92937fed269e100c5557093eef
4
+ data.tar.gz: fb87588d4e5d234b72c5c048553de5b9e9d6a756d863398e1d8dc6792f2286a5
5
5
  SHA512:
6
- metadata.gz: 28abd7d530e0b7a6b87ed50fa4f30c42a9a1b89f157ab9f3bc7539069c1194258e8c0dc111a95ecd5ea39e09f1e2d73abbf5d82bbf51a513117f7edac74dc446
7
- data.tar.gz: 666be9cfe70c0ebeca346609dd6a99eddffd411f19ff96494e0356123631d948bce77c209df52a5e82785e9d40b46cb0a02b6ca4289c7ffab90f34f0e44196a1
6
+ metadata.gz: d873ee94a663cec68f5ab81e440c2fa1271a4abb3e6f7869e6c0de175ed2b62096346cc6dbee8ea5d83002a4dc9ae598488247fe838826a5b55e829a383de5af
7
+ data.tar.gz: b7a19e1dd16e36dccab4d12934ee678dcd77fef51dca440252dcdaec5ad66b9d2e58c0983a296b18c4a3da483c9c35ecfb119a1121c1b2e2bfc8d51c0b11aa89
@@ -10,7 +10,7 @@ jobs:
10
10
  - name: Setup Ruby # Step 2 (we gave the name 'Setup Ruby' to this step)
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 2.7.3
13
+ ruby-version: 3.2.2
14
14
  - name: Install bundle and gems # Step 4
15
15
  run: |
16
16
  gem update --system
data/.rubocop.yml CHANGED
@@ -22,3 +22,5 @@ Metrics/MethodLength:
22
22
  - spec/**/*
23
23
  Naming/AccessorMethodName:
24
24
  Enabled: false
25
+ Gemspec/RequiredRubyVersion:
26
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paychex_api (0.0.27)
4
+ paychex_api (0.0.28)
5
5
  faraday (~> 0.17.3)
6
6
  faraday_middleware (>= 0.12.2)
7
7
  footrest (>= 0.5.1)
@@ -9,62 +9,73 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.0.3)
12
+ activesupport (7.1.3.2)
13
+ base64
14
+ bigdecimal
13
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ connection_pool (>= 2.2.5)
17
+ drb
14
18
  i18n (>= 1.6, < 2)
15
19
  minitest (>= 5.1)
20
+ mutex_m
16
21
  tzinfo (~> 2.0)
17
- addressable (2.7.0)
18
- public_suffix (>= 2.0.2, < 5.0)
19
- ast (2.4.1)
22
+ addressable (2.8.6)
23
+ public_suffix (>= 2.0.2, < 6.0)
24
+ ast (2.4.2)
25
+ base64 (0.2.0)
26
+ bigdecimal (3.1.6)
20
27
  byebug (11.1.3)
21
28
  coderay (1.1.3)
22
- concurrent-ruby (1.1.10)
23
- crack (0.4.3)
24
- safe_yaml (~> 1.0.0)
25
- diff-lcs (1.4.4)
26
- docile (1.3.2)
27
- faraday (0.17.5)
29
+ concurrent-ruby (1.2.3)
30
+ connection_pool (2.4.1)
31
+ crack (1.0.0)
32
+ bigdecimal
33
+ rexml
34
+ diff-lcs (1.5.1)
35
+ docile (1.4.0)
36
+ drb (2.2.1)
37
+ faraday (0.17.6)
28
38
  multipart-post (>= 1.2, < 3)
29
39
  faraday_middleware (0.14.0)
30
40
  faraday (>= 0.7.4, < 1.0)
31
- footrest (0.5.3)
41
+ footrest (0.5.5)
32
42
  activesupport (>= 3.0.0)
33
43
  faraday (>= 0.9.0, < 1)
34
44
  link_header (>= 0.0.7)
35
- gergich (1.2.0)
45
+ gergich (1.2.3)
36
46
  httparty (~> 0.17)
37
47
  sqlite3 (~> 1.4)
38
- hashdiff (1.0.1)
39
- httparty (0.18.1)
40
- mime-types (~> 3.0)
48
+ hashdiff (1.1.0)
49
+ httparty (0.21.0)
50
+ mini_mime (>= 1.0.0)
41
51
  multi_xml (>= 0.5.2)
42
- i18n (1.10.0)
52
+ i18n (1.14.4)
43
53
  concurrent-ruby (~> 1.0)
44
54
  link_header (0.0.8)
45
55
  method_source (1.0.0)
46
- mime-types (3.3.1)
47
- mime-types-data (~> 3.2015)
48
- mime-types-data (3.2020.0512)
49
- minitest (5.16.2)
56
+ mini_mime (1.1.5)
57
+ minitest (5.22.2)
50
58
  multi_xml (0.6.0)
51
- multipart-post (2.2.3)
52
- mustermann (1.1.1)
59
+ multipart-post (2.4.0)
60
+ mustermann (2.0.2)
53
61
  ruby2_keywords (~> 0.0.1)
54
- parallel (1.19.2)
55
- parser (2.7.1.4)
62
+ mutex_m (0.2.0)
63
+ parallel (1.24.0)
64
+ parser (3.3.0.5)
56
65
  ast (~> 2.4.1)
57
- pry (0.13.1)
66
+ racc
67
+ pry (0.14.2)
58
68
  coderay (~> 1.1)
59
69
  method_source (~> 1.0)
60
- public_suffix (4.0.5)
61
- rack (2.2.3)
62
- rack-protection (2.0.8.1)
70
+ public_suffix (5.0.4)
71
+ racc (1.7.3)
72
+ rack (2.2.8.1)
73
+ rack-protection (2.2.4)
63
74
  rack
64
- rainbow (3.0.0)
65
- rake (13.0.1)
66
- regexp_parser (1.7.1)
67
- rexml (3.2.4)
75
+ rainbow (3.1.1)
76
+ rake (13.1.0)
77
+ regexp_parser (2.9.0)
78
+ rexml (3.2.6)
68
79
  rspec (2.99.0)
69
80
  rspec-core (~> 2.99.0)
70
81
  rspec-expectations (~> 2.99.0)
@@ -73,41 +84,42 @@ GEM
73
84
  rspec-expectations (2.99.2)
74
85
  diff-lcs (>= 1.1.3, < 2.0)
75
86
  rspec-mocks (2.99.4)
76
- rubocop (0.88.0)
87
+ rubocop (0.93.1)
77
88
  parallel (~> 1.10)
78
- parser (>= 2.7.1.1)
89
+ parser (>= 2.7.1.5)
79
90
  rainbow (>= 2.2.2, < 4.0)
80
- regexp_parser (>= 1.7)
91
+ regexp_parser (>= 1.8)
81
92
  rexml
82
- rubocop-ast (>= 0.1.0, < 1.0)
93
+ rubocop-ast (>= 0.6.0)
83
94
  ruby-progressbar (~> 1.7)
84
95
  unicode-display_width (>= 1.4.0, < 2.0)
85
- rubocop-ast (0.2.0)
86
- parser (>= 2.7.0.1)
87
- ruby-progressbar (1.10.1)
88
- ruby2_keywords (0.0.2)
89
- safe_yaml (1.0.5)
90
- simplecov (0.18.5)
96
+ rubocop-ast (1.31.2)
97
+ parser (>= 3.3.0.4)
98
+ ruby-progressbar (1.13.0)
99
+ ruby2_keywords (0.0.5)
100
+ simplecov (0.22.0)
91
101
  docile (~> 1.1)
92
102
  simplecov-html (~> 0.11)
93
- simplecov-html (0.12.2)
94
- sinatra (2.0.8.1)
95
- mustermann (~> 1.0)
96
- rack (~> 2.0)
97
- rack-protection (= 2.0.8.1)
103
+ simplecov_json_formatter (~> 0.1)
104
+ simplecov-html (0.12.3)
105
+ simplecov_json_formatter (0.1.4)
106
+ sinatra (2.2.4)
107
+ mustermann (~> 2.0)
108
+ rack (~> 2.2)
109
+ rack-protection (= 2.2.4)
98
110
  tilt (~> 2.0)
99
- sqlite3 (1.4.2)
100
- tilt (2.0.10)
101
- tzinfo (2.0.4)
111
+ sqlite3 (1.7.2-arm64-darwin)
112
+ tilt (2.3.0)
113
+ tzinfo (2.0.6)
102
114
  concurrent-ruby (~> 1.0)
103
- unicode-display_width (1.7.0)
104
- webmock (3.8.3)
105
- addressable (>= 2.3.6)
115
+ unicode-display_width (1.8.0)
116
+ webmock (3.23.0)
117
+ addressable (>= 2.8.0)
106
118
  crack (>= 0.3.2)
107
119
  hashdiff (>= 0.4.0, < 2.0.0)
108
120
 
109
121
  PLATFORMS
110
- ruby
122
+ arm64-darwin-22
111
123
 
112
124
  DEPENDENCIES
113
125
  bundler (>= 1.0)
@@ -123,4 +135,4 @@ DEPENDENCIES
123
135
  webmock (>= 1.22)
124
136
 
125
137
  BUNDLED WITH
126
- 2.3.8
138
+ 2.4.22
@@ -22,6 +22,14 @@ module PaychexAPI
22
22
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}#{WORKERS_PATH}", params)
23
23
  end
24
24
 
25
+ def get_company_locations(company_id, params = {})
26
+ get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_PATH}", params)
27
+ end
28
+
29
+ def get_company_location(company_id, location_id, params = {})
30
+ get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_PATH}/#{location_id}", params)
31
+ end
32
+
25
33
  def get_company_by_display_id(display_id, params = {})
26
34
  params = params.merge(displayid: display_id)
27
35
  get("#{API_PATH}#{COMPANIES_PATH}", params)
@@ -32,6 +32,7 @@ module PaychexAPI
32
32
  OAUTH_TOKEN_PATH = '/auth/oauth/v2/token'.freeze
33
33
  USERS_PATH = '/users'.freeze
34
34
  PURCHASES_PATH = '/purchases'.freeze
35
+ LOCATIONS_PATH = '/locations'.freeze
35
36
 
36
37
  attr_reader :authorization
37
38
 
@@ -1,3 +1,3 @@
1
1
  module PaychexAPI
2
- VERSION = '0.0.27'.freeze unless defined?(PaychexAPI::VERSION)
2
+ VERSION = '0.0.28'.freeze unless defined?(PaychexAPI::VERSION)
3
3
  end
data/paychex_api.gemspec CHANGED
@@ -3,8 +3,8 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
3
3
  require 'paychex_api/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.authors = ['Jay Shaffer']
7
- gem.email = ['jshaffer@instructure.com']
6
+ gem.authors = ['Cody Tanner']
7
+ gem.email = ['cody.tanner@getbridge.com']
8
8
  gem.description = 'Interface for interacting with the paychex enterprise API'
9
9
  gem.summary = 'Paychex API'
10
10
  gem.homepage = ''
@@ -0,0 +1,17 @@
1
+ {
2
+ "content": [
3
+ {
4
+ "locationId": "1040011892857651",
5
+ "name": "Location_110207",
6
+ "address": {
7
+ "streetLineOne": "886 Queen Avenue",
8
+ "streetLineTwo": "866 Euclid Gate",
9
+ "city": "Buffalo",
10
+ "postalCode": "14202",
11
+ "countrySubdivisionCode": "NY",
12
+ "countryCode": "US"
13
+ }
14
+ }
15
+ ],
16
+ "links": []
17
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "metadata": {
3
+ "contentItemCount": 6
4
+ },
5
+ "content": [
6
+ {
7
+ "locationId": "1040011892857651",
8
+ "name": "Location_110207",
9
+ "address": {
10
+ "streetLineOne": "886 Queen Avenue",
11
+ "streetLineTwo": "866 Euclid Gate",
12
+ "city": "Buffalo",
13
+ "postalCode": "14202",
14
+ "countrySubdivisionCode": "NY",
15
+ "countryCode": "US"
16
+ }
17
+ },
18
+ {
19
+ "locationId": "1040011892857657",
20
+ "name": "Location_830745",
21
+ "address": {
22
+ "streetLineOne": "540 Cardinal Court",
23
+ "streetLineTwo": "347 Jackson Trail",
24
+ "city": "Bridgeport",
25
+ "postalCode": "06601",
26
+ "countrySubdivisionCode": "CT",
27
+ "countryCode": "US"
28
+ }
29
+ },
30
+ {
31
+ "locationId": "1040011892857681",
32
+ "name": "Location_965274",
33
+ "address": {
34
+ "streetLineOne": "700 Sixth Street",
35
+ "streetLineTwo": "948 Cypress Circle",
36
+ "city": "Portsmouth",
37
+ "postalCode": "03802",
38
+ "countrySubdivisionCode": "NH",
39
+ "countryCode": "US"
40
+ }
41
+ },
42
+ {
43
+ "locationId": "1040011892857669",
44
+ "name": "Location_933960",
45
+ "address": {
46
+ "streetLineOne": "91 Orchard Freeway",
47
+ "streetLineTwo": "386 Second Court",
48
+ "city": "Bangor",
49
+ "postalCode": "04402",
50
+ "countrySubdivisionCode": "ME",
51
+ "countryCode": "US"
52
+ }
53
+ },
54
+ {
55
+ "locationId": "1040011892857675",
56
+ "name": "Location_223814",
57
+ "address": {
58
+ "streetLineOne": "696 Bridle Highway",
59
+ "streetLineTwo": "238 Standish Heights",
60
+ "city": "Boston",
61
+ "postalCode": "02113",
62
+ "countrySubdivisionCode": "MA",
63
+ "countryCode": "US"
64
+ }
65
+ },
66
+ {
67
+ "locationId": "1040011892857663",
68
+ "name": "Location_882082",
69
+ "address": {
70
+ "streetLineOne": "367 Tanglewood Bay",
71
+ "streetLineTwo": "739 Nineth Freeway",
72
+ "city": "Burlington",
73
+ "postalCode": "05401",
74
+ "countrySubdivisionCode": "VT",
75
+ "countryCode": "US"
76
+ }
77
+ }
78
+ ],
79
+ "links": []
80
+ }
@@ -31,6 +31,16 @@ describe PaychexAPI::Client::Companies do
31
31
  expect(response.first['workerId']).to(eq('00Z5V9BTIHRQF2CF7BTH'))
32
32
  end
33
33
 
34
+ it 'should get company locations' do
35
+ response = @client.get_company_locations(1)
36
+ expect(response.first['locationId']).to(eq('1040011892857651'))
37
+ end
38
+
39
+ it 'should get a company location' do
40
+ response = @client.get_company_location(1, 1)
41
+ expect(response.first['locationId']).to(eq('1040011892857651'))
42
+ end
43
+
34
44
  it 'should get company associations with association type' do
35
45
  response = @client.get_company_associations_by_regex_type(1, /LMS.*/)
36
46
  expect(response.first['associations'].length).to(eq(1))
@@ -21,6 +21,15 @@ class FakePaychex < Sinatra::Base
21
21
  get_json_data 200, 'workers.json'
22
22
  end
23
23
 
24
+ # locations
25
+ get %r{/companies/.*/locations} do
26
+ get_json_data 200, 'company_locations.json'
27
+ end
28
+
29
+ get %r{/companies/.*/locations/\+d+} do
30
+ get_json_data 200, 'company_location.json'
31
+ end
32
+
24
33
  get %r{/workers/\d+/users} do
25
34
  case request.env['HTTP_ACCEPT']
26
35
  when "application/json;profile='http://api.paychex.com/profiles/users/v1'"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
- - Jay Shaffer
7
+ - Cody Tanner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -200,7 +200,7 @@ dependencies:
200
200
  version: 0.5.1
201
201
  description: Interface for interacting with the paychex enterprise API
202
202
  email:
203
- - jshaffer@instructure.com
203
+ - cody.tanner@getbridge.com
204
204
  executables: []
205
205
  extensions: []
206
206
  extra_rdoc_files: []
@@ -234,6 +234,8 @@ files:
234
234
  - spec/fixtures/communications.json
235
235
  - spec/fixtures/companies.json
236
236
  - spec/fixtures/companies_associations.json
237
+ - spec/fixtures/company_location.json
238
+ - spec/fixtures/company_locations.json
237
239
  - spec/fixtures/messages.json
238
240
  - spec/fixtures/organizations.json
239
241
  - spec/fixtures/status.json
@@ -271,31 +273,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
273
  - !ruby/object:Gem::Version
272
274
  version: '0'
273
275
  requirements: []
274
- rubygems_version: 3.1.6
276
+ rubygems_version: 3.4.19
275
277
  signing_key:
276
278
  specification_version: 4
277
279
  summary: Paychex API
278
280
  test_files:
279
- - spec/paychex_api/paychex_api_spec.rb
280
- - spec/paychex_api/client_spec.rb
281
+ - spec/fixtures/association_companies.json
282
+ - spec/fixtures/auth.json
283
+ - spec/fixtures/communications.json
284
+ - spec/fixtures/companies.json
285
+ - spec/fixtures/companies_associations.json
286
+ - spec/fixtures/company_location.json
287
+ - spec/fixtures/company_locations.json
288
+ - spec/fixtures/messages.json
289
+ - spec/fixtures/organizations.json
290
+ - spec/fixtures/status.json
291
+ - spec/fixtures/users.json
292
+ - spec/fixtures/workers.json
281
293
  - spec/paychex_api/api_array_spec.rb
282
- - spec/paychex_api/client/companies_spec.rb
283
294
  - spec/paychex_api/client/associations_spec.rb
295
+ - spec/paychex_api/client/companies_spec.rb
296
+ - spec/paychex_api/client/messages_spec.rb
297
+ - spec/paychex_api/client/notifications_spec.rb
284
298
  - spec/paychex_api/client/purchases_spec.rb
285
299
  - spec/paychex_api/client/statuses_spec.rb
286
300
  - spec/paychex_api/client/users_spec.rb
287
- - spec/paychex_api/client/messages_spec.rb
288
301
  - spec/paychex_api/client/workers_spec.rb
289
- - spec/paychex_api/client/notifications_spec.rb
302
+ - spec/paychex_api/client_spec.rb
303
+ - spec/paychex_api/paychex_api_spec.rb
290
304
  - spec/support/fake_paychex.rb
291
- - spec/fixtures/messages.json
292
- - spec/fixtures/organizations.json
293
- - spec/fixtures/users.json
294
- - spec/fixtures/companies.json
295
- - spec/fixtures/workers.json
296
- - spec/fixtures/auth.json
297
- - spec/fixtures/communications.json
298
- - spec/fixtures/association_companies.json
299
- - spec/fixtures/status.json
300
- - spec/fixtures/companies_associations.json
301
305
  - spec/test_helper.rb