Skip to content

Commit

Permalink
feat: update document types (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
Merculiar authored Dec 16, 2024
1 parent 7b792aa commit 018314f
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import 'package:kyc_client_dart/kyc_client_dart.dart';

enum DocumentType {
bvn('BVN', 'BVN'),
nin('NIN', 'NIN'),
ninV2('NIN V2', 'NIN_V2'),
ninSlip('NIN SLIP', 'NIN_SLIP'),
driversLicense('Driver\'s License', 'DRIVERS_LICENSE'),
voterId('Voter ID', 'VOTER_ID');

const DocumentType(this.name, this.value);
Expand All @@ -16,19 +11,12 @@ enum DocumentType {

extension DocumentTypeExtension on DocumentType {
IdType toIdType() => switch (this) {
DocumentType.bvn ||
DocumentType.nin ||
DocumentType.ninV2 ||
DocumentType.ninSlip =>
IdType.other,
DocumentType.driversLicense => IdType.driverLicense,
DocumentType.voterId => IdType.voterId,
};
}

extension IdTypeExtension on IdType {
DocumentType? toDocumentType() => switch (this) {
IdType.driverLicense => DocumentType.driversLicense,
IdType.voterId => DocumentType.voterId,
// ignore: avoid-wildcard-cases-with-enums, check if needed
_ => null,
Expand Down

0 comments on commit 018314f

Please sign in to comment.