@@ -10,7 +10,7 @@ extension NSDictionary {
1010 testLambdaUrl: ( self [ " testLambdaUrl " ] as? String ) !
1111 )
1212 }
13-
13+
1414 func toAuthenticationRequest( ) -> AuthenticationRequest ? {
1515 guard let jobTypeValue = self [ " jobType " ] as? Int ,
1616 let jobType = JobType ( rawValue: jobTypeValue) ,
@@ -19,11 +19,11 @@ extension NSDictionary {
1919 else {
2020 return nil
2121 }
22-
22+
2323 let country = self [ " country " ] as? String
2424 let idType = self [ " idType " ] as? String
2525 let updateEnrolledImage = self [ " updateEnrolledImage " ] as? Bool
26-
26+
2727 return AuthenticationRequest (
2828 jobType: jobType,
2929 updateEnrolledImage: updateEnrolledImage,
@@ -33,7 +33,7 @@ extension NSDictionary {
3333 idType: idType
3434 )
3535 }
36-
36+
3737 func toPrepUploadRequest( ) -> PrepUploadRequest ? {
3838 guard let partnerParamsDict = self [ " partnerParams " ] as? NSDictionary ,
3939 let partnerParams = partnerParamsDict. toPartnerParams ( ) ,
@@ -44,49 +44,51 @@ extension NSDictionary {
4444 else {
4545 return nil
4646 }
47-
47+ let allowNewEnroll = self [ " allowNewEnroll " ] as? Bool ?? false
48+
4849 return PrepUploadRequest (
4950 partnerParams: partnerParams,
5051 callbackUrl: callbackUrl,
52+ allowNewEnroll: allowNewEnroll,
5153 partnerId: partnerId,
5254 sourceSdk: self [ " sourceSdk " ] as? String ?? " ios (react-native) " ,
5355 timestamp: timestamp,
5456 signature: signature
5557 )
5658 }
57-
59+
5860 func toUploadRequest( ) -> UploadRequest ? {
5961 guard let imagesArray = self [ " images " ] as? [ NSDictionary ] else {
6062 return nil
6163 }
6264 let images = imagesArray. compactMap { $0. toUploadImageInfo ( ) }
6365 let idInfo = ( self [ " idInfo " ] as? NSDictionary ) ? . toIdInfo ( )
64-
66+
6567 return UploadRequest (
6668 images: images,
6769 idInfo: idInfo
6870 )
6971 }
70-
72+
7173 func toUploadImageInfo( ) -> UploadImageInfo ? {
7274 guard let imageTypeIdValue = self [ " imageTypeId " ] as? String ,
7375 let imageTypeId = ImageType ( rawValue: imageTypeIdValue) ,
7476 let imageName = self [ " imageName " ] as? String
7577 else {
7678 return nil
7779 }
78-
80+
7981 return UploadImageInfo (
8082 imageTypeId: imageTypeId,
8183 fileName: imageName
8284 )
8385 }
84-
86+
8587 func toIdInfo( ) -> IdInfo ? {
8688 guard let country = self [ " country " ] as? String else {
8789 return nil
8890 }
89-
91+
9092 let idType = self [ " idType " ] as? String
9193 let idNumber = self [ " idNumber " ] as? String
9294 let firstName = self [ " firstName " ] as? String
@@ -95,7 +97,7 @@ extension NSDictionary {
9597 let dob = self [ " dob " ] as? String
9698 let bankCode = self [ " bankCode " ] as? String
9799 let entered = self [ " entered " ] as? Bool
98-
100+
99101 return IdInfo (
100102 country: country,
101103 idType: idType,
@@ -108,7 +110,7 @@ extension NSDictionary {
108110 entered: entered
109111 )
110112 }
111-
113+
112114 func toConsentInfo( ) -> ConsentInformation {
113115 let consentGrantedDate = self [ " consentGrantedDate " ] as? String ?? getCurrentIsoTimestamp ( )
114116 let personalDetailsConsentGranted = self [ " personalDetailsConsentGranted " ] as? Bool ?? false
@@ -121,7 +123,7 @@ extension NSDictionary {
121123 documentInformationConsentGranted: documentInfoConsentGranted
122124 )
123125 }
124-
126+
125127 func toEnhancedKycRequest( ) -> EnhancedKycRequest ? {
126128 guard let country = self [ " country " ] as? String ,
127129 let idType = self [ " idType " ] as? String ,
@@ -140,7 +142,7 @@ extension NSDictionary {
140142 else {
141143 return nil
142144 }
143-
145+
144146 let consentInfo : ConsentInformation
145147 if let consentInformation = self [ " consentInformation " ] as? NSDictionary {
146148 consentInfo = consentInformation. toConsentInfo ( )
@@ -152,7 +154,7 @@ extension NSDictionary {
152154 documentInformationConsentGranted: false
153155 )
154156 }
155-
157+
156158 return EnhancedKycRequest (
157159 country: country,
158160 idType: idType,
@@ -171,7 +173,7 @@ extension NSDictionary {
171173 signature: signature
172174 )
173175 }
174-
176+
175177 func toJobStatusRequest( ) -> JobStatusRequest ? {
176178 guard let userId = self [ " userId " ] as? String ,
177179 let jobId = self [ " jobId " ] as? String ,
@@ -183,7 +185,7 @@ extension NSDictionary {
183185 else {
184186 return nil
185187 }
186-
188+
187189 return JobStatusRequest (
188190 userId: userId,
189191 jobId: jobId,
@@ -194,22 +196,22 @@ extension NSDictionary {
194196 signature: signature
195197 )
196198 }
197-
199+
198200 func toProductsConfigRequest( ) -> ProductsConfigRequest ? {
199201 guard let partnerId = self [ " partnerId " ] as? String ,
200202 let timestamp = self [ " timestamp " ] as? String ,
201203 let signature = self [ " signature " ] as? String
202204 else {
203205 return nil
204206 }
205-
207+
206208 return ProductsConfigRequest (
207209 timestamp: timestamp,
208210 signature: signature,
209211 partnerId: partnerId
210212 )
211213 }
212-
214+
213215 func toPartnerParams( ) -> PartnerParams ? {
214216 guard let country = self [ " country " ] as? String else {
215217 return nil
@@ -242,7 +244,7 @@ extension Dictionary where Key == String, Value == Any {
242244 }
243245 return jsonCompatibleDict
244246 }
245-
247+
246248 private func convertToJSONCompatible( _ value: Any ) -> Any {
247249 switch value {
248250 case let url as URL :
0 commit comments