finapps 5.0.46 → 5.3.0

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: 4501dd349460d436671d161a817432d9336cdb1722d2465baef3d65a7bb4d10f
4
- data.tar.gz: cea911d0e0449e505aa4fd6229f0ca446fc45519a69b8955f22e8789a5b94132
3
+ metadata.gz: 7ba6fe462a4a44f6516aaec7bd31adb52ceffa7e7adabff632ec00d866e684f7
4
+ data.tar.gz: 792139e441b48b337df42d97973dbf4529d01d7317eb4249c8f868aaffbb1680
5
5
  SHA512:
6
- metadata.gz: e4e89f43a67412901a05f0cd420973e7c87d2e14fb86191b966ca2381d2af0ee8de1df43a3db2b1a3b2b22df616eab186c49fde9f2373f156e9f8e5f3cbdfad7
7
- data.tar.gz: bac2c749e5c60e123dfb02d5d767b1e8930ae9ef2178a3c9e1be6aff2fa55c596b12d9e64817c228839eb0c1b7aab1a9534ecabee90f1ab5ab667c0d87257910
6
+ metadata.gz: 6babd0b0fd8d3a567c9f5197673f2a3b7770128c2c688053777af68e02584a456de2f653b7df3eedf66b4f811a8a23da56e38fbe7f781c04bfcb1d22a8020624
7
+ data.tar.gz: 17549ec59b21bf9f5a995d25ea87df1068d7067d7f8814dd214ef7521c7b1687d2ece6e78764d0df14a19e473fb8b3f6023f1e3546003aafbaf38d4ff1c35b23
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
@@ -0,0 +1,47 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ push:
5
+ paths-ignore:
6
+ - ".github/**"
7
+ - ".VERSION"
8
+ pull_request:
9
+ paths-ignore:
10
+ - ".github/**"
11
+ - ".VERSION"
12
+ jobs:
13
+ tests:
14
+ if: "!contains(github.event.head_commit.message, 'skip ci')"
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ fail-fast: true
19
+
20
+ steps:
21
+ - name: Checkout source code
22
+ uses: actions/checkout@v2
23
+
24
+ - name: Install required ruby
25
+ uses: ruby/setup-ruby@v1
26
+
27
+ - name: Setup cache key and directory for gems cache
28
+ uses: actions/cache@v2
29
+ with:
30
+ path: vendor/bundle
31
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
32
+ restore-keys: |
33
+ ${{ runner.os }}-gems-
34
+
35
+ - name: Bundle install
36
+ run: |
37
+ bundle config path vendor/bundle
38
+ bundle config set jobs 4
39
+ bundle config set retry 3
40
+ bundle install
41
+
42
+ - name: Run rubocop
43
+ run: |
44
+ bundle exec rubocop --parallel
45
+
46
+ - name: Run tests
47
+ run: bundle exec rspec
@@ -2,53 +2,53 @@ name: Bump version and Release
2
2
  on:
3
3
  release:
4
4
  types: [published]
5
-
5
+
6
6
  jobs:
7
7
  release:
8
8
  runs-on: ubuntu-latest
9
9
  strategy:
10
10
  fail-fast: true
11
11
 
12
- steps:
13
- - uses: actions/checkout@master
14
- with:
15
- persist-credentials: false
16
- fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
12
+ steps:
13
+ - name: Checkout source code
14
+ uses: actions/checkout@v2
15
+ with:
16
+ persist-credentials: false
17
+ fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
18
+
19
+ - name: Install required ruby version
20
+ uses: ruby/setup-ruby@v1
21
+
22
+ - name: Get version from latest tag
23
+ id: get_version
24
+ uses: battila7/get-version-action@v2
25
+
26
+ - name: Bump version
27
+ run: |
28
+ gem install -N gem-release
29
+ git config --local user.email "action@github.com"
30
+ git config --local user.name "GitHub Action"
31
+ gem bump --skip-ci --version ${{ steps.get_version.outputs.version-without-v }}
17
32
 
18
- - uses: actions/setup-ruby@v1
19
- with:
20
- ruby-version: '2.6'
21
-
22
- - name: Get version from latest tag
23
- id: get_version
24
- uses: battila7/get-version-action@v2
33
+ - name: Push changes
34
+ uses: ad-m/github-push-action@master
35
+ with:
36
+ # GitHub Actions token does not support pushing to protected branches.
37
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
38
+ #
39
+ # A manually populated`PERSONAL_ACCESS_TOKEN` environment variable
40
+ # with permissions to push to a protected branch must be used.
41
+ # not ideal - keep eyes open for a better solution
42
+ github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
25
43
 
26
- - name: Bump version
27
- run: |
28
- gem install -N gem-release
29
- git config --local user.email "action@github.com"
30
- git config --local user.name "GitHub Action"
31
- gem bump --skip-ci --version ${{ steps.get_version.outputs.version-without-v }}
32
-
33
- - name: Push changes
34
- uses: ad-m/github-push-action@master
35
- with:
36
- # GitHub Actions token does not support pushing to protected branches.
37
- # github_token: ${{ secrets.GITHUB_TOKEN }}
38
- #
39
- # A manually populated`PERSONAL_ACCESS_TOKEN` environment variable
40
- # with permissions to push to a protected branch must be used.
41
- # not ideal - keep eyes open for a better solution
42
- github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43
-
44
- - name: Release gem to rubygems.org
45
- run: |
46
- set +x
47
- mkdir -p ~/.gem
48
- cat << EOF > ~/.gem/credentials
49
- ---
50
- :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
51
- EOF
52
- chmod 0600 ~/.gem/credentials
53
- set -x
54
- gem release
44
+ - name: Release gem to rubygems.org
45
+ run: |
46
+ set +x
47
+ mkdir -p ~/.gem
48
+ cat << EOF > ~/.gem/credentials
49
+ ---
50
+ :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
51
+ EOF
52
+ chmod 0600 ~/.gem/credentials
53
+ set -x
54
+ gem release
data/.rubocop.yml CHANGED
@@ -48,7 +48,7 @@ Metrics/ClassLength:
48
48
  - app/controllers/orders_controller.rb
49
49
  - app/models/order.rb
50
50
  Metrics/BlockLength:
51
- ExcludedMethods: ['describe', 'context']
51
+ IgnoredMethods: ['describe', 'context']
52
52
  Exclude:
53
53
  - config/environments/**/**
54
54
  - Guardfile
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.6.3
1
+ ruby-2.7.2
data/Guardfile CHANGED
@@ -17,7 +17,7 @@
17
17
  #
18
18
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
19
 
20
- # Note: The cmd option is now required due to the increasing number of ways
20
+ # NOTE: The cmd option is now required due to the increasing number of ways
21
21
  # rspec may be run, below are examples of the most common uses.
22
22
  # * bundler: 'bundle exec rspec'
23
23
  # * bundler binstubs: 'bin/rspec'
data/finapps.gemspec CHANGED
@@ -20,19 +20,20 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.10'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.15'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
27
27
  spec.add_development_dependency 'guard', '~> 2.16', '>= 2.16.1'
28
28
  spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
29
29
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
30
- spec.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
31
- spec.add_development_dependency 'rubocop', '~> 0.86', '>= 0.86.0'
32
- spec.add_development_dependency 'rubocop-performance', '~> 1.6', '>= 1.6.1'
33
- spec.add_development_dependency 'rubocop-rspec', '~> 1.40', '>= 1.40.0'
34
- spec.add_development_dependency 'sinatra', '~> 2.0', '>= 2.0.8'
35
- spec.add_development_dependency 'webmock', '~> 3.8', '>= 3.8.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.10', '>= 3.10.0'
31
+ spec.add_development_dependency 'rubocop', '~> 1.9', '>= 1.9.1'
32
+ spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.2'
33
+ spec.add_development_dependency 'rubocop-rake', '~> 0.5', '>= 0.5.1'
34
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.2', '>= 2.2.0'
35
+ spec.add_development_dependency 'sinatra', '~> 2.1', '>= 2.1.0'
36
+ spec.add_development_dependency 'webmock', '~> 3.11', '>= 3.11.2'
36
37
 
37
38
  spec.extra_rdoc_files = %w[README.md LICENSE.txt]
38
39
  spec.rdoc_options = %w[--line-numbers --inline-source --title finapps-ruby --main README.md]
data/lib/finapps.rb CHANGED
@@ -35,6 +35,7 @@ require 'finapps/rest/esign_templates'
35
35
  require 'finapps/rest/documents_upload_types'
36
36
  require 'finapps/rest/signed_documents_downloads'
37
37
  require 'finapps/rest/documents_orders_notifications'
38
+ require 'finapps/rest/screenings'
38
39
 
39
40
  require 'finapps/rest/plaid/plaid_resources'
40
41
  require 'finapps/rest/plaid/plaid_webhooks'
@@ -37,6 +37,7 @@ module FinApps
37
37
  portfolios_consumers
38
38
  portfolio_reports
39
39
  products
40
+ screenings
40
41
  sessions
41
42
  signed_documents_downloads
42
43
  tenant_settings
@@ -82,7 +83,7 @@ module FinApps
82
83
 
83
84
  def camelize(term)
84
85
  string = term.to_s
85
- string = string.sub(/^[a-z\d]*/) { $&.capitalize }
86
+ string = string.sub(/^[a-z\d]*/) { Regexp.last_match(0).capitalize }
86
87
  string.gsub(%r{(?:_|(/))([a-z\d]*)}) do
87
88
  Regexp.last_match(2).capitalize.to_s
88
89
  end
@@ -62,9 +62,10 @@ module FinApps
62
62
 
63
63
  def with_space_search(term)
64
64
  [
65
- {"email": term},
66
- {"first_name": term},
67
- {"last_name": term}
65
+ {external_id: term},
66
+ {email: term},
67
+ {first_name: term},
68
+ {last_name: term}
68
69
  ]
69
70
  end
70
71
 
@@ -72,8 +73,8 @@ module FinApps
72
73
  search_arr = []
73
74
  if /\s/.match?(term)
74
75
  term.split.each do |t|
75
- search_arr.append("first_name": t)
76
- search_arr.append("last_name": t)
76
+ search_arr.append(first_name: t)
77
+ search_arr.append(last_name: t)
77
78
  end
78
79
  end
79
80
  search_arr
@@ -90,22 +90,21 @@ module FinApps
90
90
  end
91
91
 
92
92
  def with_space_search(term)
93
- [
94
- {"applicant.email": term},
95
- {"applicant.first_name": term},
96
- {"applicant.last_name": term},
97
- {
98
- "reference_no": {
99
- "$regex": "^#{term}", "$options": 'i'
100
- }
101
- }
102
- ]
93
+ [{"applicant.email": term},
94
+ {"applicant.first_name": term},
95
+ {"applicant.last_name": term},
96
+ {"applicant.external_id": term},
97
+ {
98
+ reference_no: {
99
+ "$regex": "^#{term}", "$options": 'i'
100
+ }
101
+ }]
103
102
  end
104
103
 
105
104
  def tag_query(tag)
106
105
  return {} unless tag
107
106
 
108
- {"tag": tag.empty? ? nil : tag}
107
+ {tag: tag.empty? ? nil : tag}
109
108
  end
110
109
 
111
110
  def status_query(status)
@@ -117,7 +116,7 @@ module FinApps
117
116
  def consumer_query(consumer)
118
117
  return {} unless consumer
119
118
 
120
- {"consumer_id": consumer.empty? ? nil : consumer}
119
+ {consumer_id: consumer.empty? ? nil : consumer}
121
120
  end
122
121
  end
123
122
  end
@@ -64,14 +64,14 @@ module FinApps
64
64
  end
65
65
 
66
66
  def search_query(term)
67
- {"last_name": term}
67
+ {last_name: term}
68
68
  end
69
69
 
70
70
  def role_query(role)
71
71
  if role.is_a?(Array)
72
- {"role": {"$in": role.map(&:to_i)}}
72
+ {role: {"$in": role.map(&:to_i)}}
73
73
  else
74
- {"role": role.to_i}
74
+ {role: role.to_i}
75
75
  end
76
76
  end
77
77
  end
@@ -81,7 +81,7 @@ module FinApps
81
81
  end
82
82
 
83
83
  def search_query_object(term)
84
- [{"public_id": {"$regex": "^#{term}", "$options": 'i'}},
84
+ [{public_id: {"$regex": "^#{term}", "$options": 'i'}},
85
85
  {"assignment.last_name": term},
86
86
  {"applicant.first_name": term},
87
87
  {"applicant.last_name": term},
@@ -95,9 +95,9 @@ module FinApps
95
95
  def status_query(status)
96
96
  if status
97
97
  if status.is_a?(Array)
98
- {"status": {"$in": status.map(&:to_i)}}
98
+ {status: {"$in": status.map(&:to_i)}}
99
99
  else
100
- {"status": status.to_i}
100
+ {status: status.to_i}
101
101
  end
102
102
  else
103
103
  {}
@@ -115,7 +115,7 @@ module FinApps
115
115
 
116
116
  def consumer_query(consumer)
117
117
  if consumer
118
- {"consumer_id": consumer.empty? ? nil : consumer}
118
+ {consumer_id: consumer.empty? ? nil : consumer}
119
119
  else
120
120
  {}
121
121
  end
@@ -125,8 +125,8 @@ module FinApps
125
125
  if !search_term && !nil_or_empty?(relation)
126
126
  {
127
127
  "$or": [
128
- {"public_id": {"$in": relation}},
129
- {"original_order_id": {"$in": relation}}
128
+ {public_id: {"$in": relation}},
129
+ {original_order_id: {"$in": relation}}
130
130
  ]
131
131
  }
132
132
  else
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../utils/query_builder'
4
+
5
+ module FinApps
6
+ module REST
7
+ class Screenings < FinAppsCore::REST::Resources # :nodoc:
8
+ include FinApps::Utils::QueryBuilder
9
+
10
+ def show(id)
11
+ not_blank(id, :session_id)
12
+
13
+ path = "#{end_point}/#{ERB::Util.url_encode(id)}/resume"
14
+ super(nil, path)
15
+ end
16
+
17
+ def last(consumer_id)
18
+ not_blank(consumer_id, :consumer_id)
19
+
20
+ path = "#{end_point}/#{ERB::Util.url_encode(consumer_id)}/consumer"
21
+ send_request_for_id path, :get, nil
22
+ end
23
+
24
+ def create(params)
25
+ not_blank(params, :params)
26
+ super params
27
+ end
28
+
29
+ def list(params = nil)
30
+ return super if params.nil?
31
+ fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
32
+
33
+ super build_query_path(end_point, params)
34
+ end
35
+
36
+ def update(id, params)
37
+ not_blank(id, :session_id)
38
+ not_blank(params, :params)
39
+
40
+ path = "#{end_point}/#{ERB::Util.url_encode(id)}"
41
+ super params, path
42
+ end
43
+
44
+ def destroy(id)
45
+ not_blank(id, :session_id)
46
+
47
+ super
48
+ end
49
+
50
+ private
51
+
52
+ def build_filter(params)
53
+ search_query(params[:searchTerm])
54
+ end
55
+
56
+ def search_query(term)
57
+ return {} unless term
58
+
59
+ query = search_query_object(term)
60
+ {"$or": query}
61
+ end
62
+
63
+ def search_query_object(term)
64
+ [
65
+ {"consumer.public_id": term},
66
+ {"consumer.email": term}
67
+ ]
68
+ end
69
+ end
70
+ end
71
+ end