Skip to content

Commit

Permalink
feat:add more job types to flutter enum (#66)
Browse files Browse the repository at this point in the history
* feat:add more job types to flutter enum

* feat: update changelog
  • Loading branch information
JNdhlovu authored Apr 25, 2024
1 parent 72e76de commit 0311bad
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 10.0.10

* Add missing jobtype enums for Flutter

## 10.0.9

* Bump iOS to 10.0.11 (https://github.com/smileidentity/ios/releases/tag/v10.0.11)
Expand Down
8 changes: 8 additions & 0 deletions android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,19 @@ fun convertNonNullMapToNullable(map: Map<String, String>): Map<String?, String?>
fun FlutterJobType.toRequest() = when (this) {
FlutterJobType.ENHANCEDKYC -> JobType.EnhancedKyc
FlutterJobType.DOCUMENTVERIFICATION -> JobType.DocumentVerification
FlutterJobType.BIOMETRICKYC -> JobType.BiometricKyc
FlutterJobType.ENHANCEDDOCUMENTVERIFICATION -> JobType.EnhancedDocumentVerification
FlutterJobType.SMARTSELFIEENROLLMENT -> JobType.SmartSelfieEnrollment
FlutterJobType.SMARTSELFIEAUTHENTICATION -> JobType.SmartSelfieAuthentication
}

fun JobType.toResponse() = when (this) {
JobType.EnhancedKyc -> FlutterJobType.ENHANCEDKYC
JobType.DocumentVerification -> FlutterJobType.DOCUMENTVERIFICATION
JobType.BiometricKyc -> FlutterJobType.BIOMETRICKYC
JobType.EnhancedDocumentVerification -> FlutterJobType.ENHANCEDDOCUMENTVERIFICATION
JobType.SmartSelfieEnrollment -> FlutterJobType.SMARTSELFIEENROLLMENT
JobType.SmartSelfieAuthentication -> FlutterJobType.SMARTSELFIEAUTHENTICATION
else -> TODO("Not yet implemented")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class SmileFlutterError (

enum class FlutterJobType(val raw: Int) {
ENHANCEDKYC(0),
DOCUMENTVERIFICATION(1);
DOCUMENTVERIFICATION(1),
BIOMETRICKYC(2),
ENHANCEDDOCUMENTVERIFICATION(3),
SMARTSELFIEENROLLMENT(4),
SMARTSELFIEAUTHENTICATION(5);

companion object {
fun ofRaw(raw: Int): FlutterJobType? {
Expand Down
16 changes: 16 additions & 0 deletions ios/Classes/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ extension FlutterJobType {
return JobType.enhancedKyc
case .documentVerification:
return JobType.documentVerification
case .biometricKyc:
return JobType.biometricKyc
case .enhancedDocumentVerification:
return JobType.enhancedDocumentVerification
case .smartSelfieEnrollment:
return JobType.smartSelfieEnrollment
case .smartSelfieAuthentication:
return JobType.smartSelfieAuthentication
}
}
}
Expand All @@ -64,6 +72,14 @@ extension JobType {
return FlutterJobType.enhancedKyc
case .documentVerification:
return FlutterJobType.documentVerification
case .biometricKyc:
return FlutterJobType.biometricKyc
case .enhancedDocumentVerification:
return FlutterJobType.enhancedDocumentVerification
case .smartSelfieEnrollment:
return FlutterJobType.smartSelfieEnrollment
case .smartSelfieAuthentication:
return FlutterJobType.smartSelfieAuthentication
default: fatalError("Not yet supported")
}
}
Expand Down
4 changes: 4 additions & 0 deletions ios/Classes/SmileIDMessages.g.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ private func nilOrValue<T>(_ value: Any?) -> T? {
enum FlutterJobType: Int {
case enhancedKyc = 0
case documentVerification = 1
case biometricKyc = 2
case enhancedDocumentVerification = 3
case smartSelfieEnrollment = 4
case smartSelfieAuthentication = 5
}

enum FlutterImageType: Int {
Expand Down
4 changes: 4 additions & 0 deletions lib/smileid_messages.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ PlatformException _createConnectionError(String channelName) {
enum FlutterJobType {
enhancedKyc,
documentVerification,
biometricKyc,
enhancedDocumentVerification,
smartSelfieEnrollment,
smartSelfieAuthentication,
}

enum FlutterImageType {
Expand Down
2 changes: 1 addition & 1 deletion pigeon/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:pigeon/pigeon.dart';
swiftOptions: SwiftOptions(),
dartPackageName: 'smileid',
))
enum FlutterJobType { enhancedKyc, documentVerification }
enum FlutterJobType { enhancedKyc, documentVerification, biometricKyc, enhancedDocumentVerification, smartSelfieEnrollment,smartSelfieAuthentication }

/// Custom values specific to partners can be placed in [extras]
class FlutterPartnerParams {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: smile_id
description: The Official Smile ID Flutter SDK
version: 10.0.9
version: 10.0.10
homepage: "https://usesmileid.com"

environment:
Expand Down

0 comments on commit 0311bad

Please sign in to comment.