smile-identity-core 1.0.0 → 1.0.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: a3b6be5ffaad64aa13c654eca628db1437da28d46a1e3d4b3564b373e4132508
4
- data.tar.gz: 1042167bb8981ac85cf0a1dbf466f2b099ca5468b013e62119a322582a879c9c
3
+ metadata.gz: edcf68a6d2595ffaaace47ea75b7a7ef4829072f02ef7095564472261563649a
4
+ data.tar.gz: e6657acf87f95de20366f5a559118bfcea6a58757bfa77a88984b083d44c2fe1
5
5
  SHA512:
6
- metadata.gz: f301a2f41634473bb47393dc5992f30f381a8088250aa2ebfc7739003384c52a37031182fc6e048b78227e990c465659f18fcc0d39bd4efc65ecc48d285325ce
7
- data.tar.gz: ba2e07c8c8f68117f7343bf0949277999a3e48ec770a50bfdd51ab0f98690d4219d2f989bbe436a558a9ca9adc3092607ae427911f2fc68e1233e94c33267f47
6
+ metadata.gz: bc0a67955105b33ca0cd3a287772ec3666a6fc22f1f5ae3c1a0d47f1fc2b70838b830748d7f29d14dde39bc84ce230d4d45028cd40b9c06ae8d419a39ff29654
7
+ data.tar.gz: 7b4afa3dafab637388ffead740accaea4d1ba43327297ca7567a80ad180d60bbf39507e7865071275305b4e781bce1540ec484a4f5c576f3c73293283d175ef1
@@ -39,3 +39,8 @@ Amend the success response when job status is false to be a JSON String containi
39
39
  Add the ID API Class
40
40
  Add the ability to query ID Api from the Web API class
41
41
  Update the documentation
42
+
43
+ ## [1.0.1] - 2019-10-24
44
+ ## Updated
45
+ Remove first_name and last_name validations from id information in Web Api
46
+ Add country, id_number and id_type validations for id information in ID Api
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smile-identity-core (1.0.0)
4
+ smile-identity-core (1.0.1)
5
5
  rubyzip (~> 1.2, >= 1.2.3)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -57,7 +57,11 @@ module SmileIdentityCore
57
57
  raise ArgumentError.new("Please make sure that id_info not empty or nil")
58
58
  end
59
59
 
60
- # maybe do some validation on consistent required fields like id_type and id_number
60
+ [:country, :id_type, :id_number].each do |key|
61
+ unless updated_id_info[key] && !updated_id_info[key].nil? && !updated_id_info[key].empty?
62
+ raise ArgumentError.new("Please make sure that #{key.to_s} is included in the id_info")
63
+ end
64
+ end
61
65
 
62
66
  @id_info = updated_id_info
63
67
  end
@@ -1,3 +1,3 @@
1
1
  module SmileIdentityCore
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -97,6 +97,7 @@ module SmileIdentityCore
97
97
  end
98
98
 
99
99
  @images = images.map { |image| symbolize_keys image }
100
+
100
101
  end
101
102
 
102
103
  def id_info=(id_info)
@@ -118,17 +119,13 @@ module SmileIdentityCore
118
119
  end
119
120
 
120
121
  if updated_id_info[:entered] && updated_id_info[:entered] == 'true'
121
- [:first_name, :last_name, :country, :id_type, :id_number].each do |key|
122
+ [:country, :id_type, :id_number].each do |key|
122
123
  unless id_info[key] && !id_info[key].nil? && !id_info[key].empty?
123
124
  raise ArgumentError.new("Please make sure that #{key.to_s} is included in the id_info")
124
125
  end
125
126
  end
126
127
  end
127
128
 
128
- if updated_id_info[:country] && updated_id_info[:country].upcase == 'NG' && ['PASSPORT', 'VOTER_ID', 'DRIVERS_LICENSE', 'NATIONAL_ID', 'TIN', 'CAC'].include?(updated_id_info[:id_type].upcase) && (!updated_id_info[:dob] || updated_id_info[:dob].empty? || updated_id_info[:dob].nil?)
129
- raise ArgumentError.new("The ID type #{updated_id_info[:id_type]} for #{updated_id_info[:country]} requires a valid dob paramater.")
130
- end
131
-
132
129
  @id_info = updated_id_info
133
130
  end
134
131
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smile-identity-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ridhwana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler