Merge branch 'set-reset-card-pin-and-renew' into fusion-app

This commit is contained in:
2026-04-06 19:44:26 +02:00
39 changed files with 2189 additions and 105 deletions

View File

@@ -31,6 +31,12 @@ class AppRoutes {
'${childWallet(childWalletId)}/extract';
static String editChildProfile(String childWalletId) =>
'${childWallet(childWalletId)}/edit';
static String setCardPin(String childWalletId) =>
'${childWallet(childWalletId)}/set-pin';
static String changeCardPin(String childWalletId) =>
'${childWallet(childWalletId)}/change-pin';
static String renewCard(String childWalletId) =>
'${childWallet(childWalletId)}/renew-card';
static const dashboardActivity = '$dashboard/activity';
static const dashboardNotifications = '$dashboard/notifications';
static const dashboardProfile = '$dashboard/profile';

View File

@@ -706,5 +706,27 @@
"takingPhoto": "Foto wird aufgenommen...",
"errorTakePicture": "Fehler beim Fotografieren",
"errorFetchPhotos": "Fehler beim Abrufen der Fotos",
"errorCall": "Fehler beim Anrufen"
"errorCall": "Fehler beim Anrufen",
"cardPinSet": "PIN festlegen",
"cardPinChange": "PIN ändern",
"cardPinUnblock": "PIN entsperren",
"cardPinSetTitle": "Karten-PIN festlegen",
"cardPinChangeTitle": "Karten-PIN ändern",
"cardPinCurrentStep": "Aktuelle PIN eingeben",
"cardPinNewStep": "Neue PIN eingeben",
"cardPinConfirmStep": "Neue PIN bestätigen",
"cardPinScaStep": "Sicherheits-PIN eingeben",
"cardPinNext": "Weiter",
"cardPinMismatch": "PINs stimmen nicht überein, bitte erneut versuchen",
"cardPinSuccess": "Karten-PIN erfolgreich aktualisiert",
"cardPinError": "Fehler beim Aktualisieren der Karten-PIN",
"cardPinUnblockConfirm": "Möchten Sie die Karten-PIN wirklich entsperren?",
"cardPinUnblockSuccess": "Karten-PIN erfolgreich entsperrt",
"cardPinUnblockError": "Fehler beim Entsperren der Karten-PIN",
"renewCardTitle": "Karte erneuern",
"renewCardConfirm": "Möchten Sie die Karte wirklich erneuern? Eine neue Karte wird ausgestellt.",
"renewCardTokenHint": "Code der neuen Karte eingeben",
"renewCardPinTitle": "Sicherheits-PIN eingeben, um die Karte zu erneuern",
"renewCardSuccess": "Karte erfolgreich erneuert",
"renewCardError": "Fehler beim Erneuern der Karte"
}

View File

@@ -837,5 +837,27 @@
"takingPhoto": "Taking photo...",
"errorTakePicture": "Error taking photo",
"errorFetchPhotos": "Error fetching photos",
"errorCall": "Error making call"
"errorCall": "Error making call",
"cardPinSet": "Set PIN",
"cardPinChange": "Change PIN",
"cardPinUnblock": "Unblock PIN",
"cardPinSetTitle": "Set card PIN",
"cardPinChangeTitle": "Change card PIN",
"cardPinCurrentStep": "Enter current PIN",
"cardPinNewStep": "Enter new PIN",
"cardPinConfirmStep": "Confirm new PIN",
"cardPinScaStep": "Enter your security PIN",
"cardPinNext": "Next",
"cardPinMismatch": "PINs do not match, please try again",
"cardPinSuccess": "Card PIN updated successfully",
"cardPinError": "Error updating card PIN",
"cardPinUnblockConfirm": "Are you sure you want to unblock the card PIN?",
"cardPinUnblockSuccess": "Card PIN unblocked successfully",
"cardPinUnblockError": "Error unblocking card PIN",
"renewCardTitle": "Renew card",
"renewCardConfirm": "Are you sure you want to renew the card? A new card will be issued.",
"renewCardTokenHint": "Enter the new card code",
"renewCardPinTitle": "Enter your security PIN to renew the card",
"renewCardSuccess": "Card renewed successfully",
"renewCardError": "Error renewing card"
}

View File

@@ -835,5 +835,27 @@
"takingPhoto": "Tomando foto...",
"errorTakePicture": "Error al tomar la foto",
"errorFetchPhotos": "Error al obtener las fotos",
"errorCall": "Error al realizar la llamada"
"errorCall": "Error al realizar la llamada",
"cardPinSet": "Establecer PIN",
"cardPinChange": "Cambiar PIN",
"cardPinUnblock": "Desbloquear PIN",
"cardPinSetTitle": "Establecer PIN de tarjeta",
"cardPinChangeTitle": "Cambiar PIN de tarjeta",
"cardPinCurrentStep": "Introduce el PIN actual",
"cardPinNewStep": "Introduce el nuevo PIN",
"cardPinConfirmStep": "Confirma el nuevo PIN",
"cardPinScaStep": "Introduce tu PIN de seguridad",
"cardPinNext": "Siguiente",
"cardPinMismatch": "Los PIN no coinciden, inténtalo de nuevo",
"cardPinSuccess": "PIN de tarjeta actualizado correctamente",
"cardPinError": "Error al actualizar el PIN de tarjeta",
"cardPinUnblockConfirm": "¿Estás seguro de que quieres desbloquear el PIN de la tarjeta?",
"cardPinUnblockSuccess": "PIN de tarjeta desbloqueado correctamente",
"cardPinUnblockError": "Error al desbloquear el PIN de tarjeta",
"renewCardTitle": "Renovar tarjeta",
"renewCardConfirm": "¿Estás seguro de que quieres renovar la tarjeta? Se emitirá una nueva tarjeta.",
"renewCardTokenHint": "Introduce el código de la nueva tarjeta",
"renewCardPinTitle": "Introduce tu PIN de seguridad para renovar la tarjeta",
"renewCardSuccess": "Tarjeta renovada correctamente",
"renewCardError": "Error al renovar la tarjeta"
}

View File

@@ -706,5 +706,27 @@
"takingPhoto": "Prise de photo...",
"errorTakePicture": "Erreur lors de la prise de photo",
"errorFetchPhotos": "Erreur lors de la récupération des photos",
"errorCall": "Erreur lors de l'appel"
"errorCall": "Erreur lors de l'appel",
"cardPinSet": "Définir le PIN",
"cardPinChange": "Changer le PIN",
"cardPinUnblock": "Débloquer le PIN",
"cardPinSetTitle": "Définir le PIN de la carte",
"cardPinChangeTitle": "Changer le PIN de la carte",
"cardPinCurrentStep": "Entrez le PIN actuel",
"cardPinNewStep": "Entrez le nouveau PIN",
"cardPinConfirmStep": "Confirmez le nouveau PIN",
"cardPinScaStep": "Entrez votre PIN de sécurité",
"cardPinNext": "Suivant",
"cardPinMismatch": "Les PIN ne correspondent pas, veuillez réessayer",
"cardPinSuccess": "PIN de la carte mis à jour avec succès",
"cardPinError": "Erreur lors de la mise à jour du PIN de la carte",
"cardPinUnblockConfirm": "Êtes-vous sûr de vouloir débloquer le PIN de la carte ?",
"cardPinUnblockSuccess": "PIN de la carte débloqué avec succès",
"cardPinUnblockError": "Erreur lors du déblocage du PIN de la carte",
"renewCardTitle": "Renouveler la carte",
"renewCardConfirm": "Êtes-vous sûr de vouloir renouveler la carte ? Une nouvelle carte sera émise.",
"renewCardTokenHint": "Entrez le code de la nouvelle carte",
"renewCardPinTitle": "Entrez votre PIN de sécurité pour renouveler la carte",
"renewCardSuccess": "Carte renouvelée avec succès",
"renewCardError": "Erreur lors du renouvellement de la carte"
}

View File

@@ -706,5 +706,27 @@
"takingPhoto": "Scattando foto...",
"errorTakePicture": "Errore durante lo scatto della foto",
"errorFetchPhotos": "Errore durante il recupero delle foto",
"errorCall": "Errore durante la chiamata"
"errorCall": "Errore durante la chiamata",
"cardPinSet": "Imposta PIN",
"cardPinChange": "Cambia PIN",
"cardPinUnblock": "Sblocca PIN",
"cardPinSetTitle": "Imposta il PIN della carta",
"cardPinChangeTitle": "Cambia il PIN della carta",
"cardPinCurrentStep": "Inserisci il PIN attuale",
"cardPinNewStep": "Inserisci il nuovo PIN",
"cardPinConfirmStep": "Conferma il nuovo PIN",
"cardPinScaStep": "Inserisci il tuo PIN di sicurezza",
"cardPinNext": "Avanti",
"cardPinMismatch": "I PIN non corrispondono, riprova",
"cardPinSuccess": "PIN della carta aggiornato con successo",
"cardPinError": "Errore nell'aggiornamento del PIN della carta",
"cardPinUnblockConfirm": "Sei sicuro di voler sbloccare il PIN della carta?",
"cardPinUnblockSuccess": "PIN della carta sbloccato con successo",
"cardPinUnblockError": "Errore nello sblocco del PIN della carta",
"renewCardTitle": "Rinnova carta",
"renewCardConfirm": "Sei sicuro di voler rinnovare la carta? Verrà emessa una nuova carta.",
"renewCardTokenHint": "Inserisci il codice della nuova carta",
"renewCardPinTitle": "Inserisci il tuo PIN di sicurezza per rinnovare la carta",
"renewCardSuccess": "Carta rinnovata con successo",
"renewCardError": "Errore nel rinnovo della carta"
}

View File

@@ -706,5 +706,27 @@
"takingPhoto": "Tirando foto...",
"errorTakePicture": "Erro ao tirar foto",
"errorFetchPhotos": "Erro ao obter fotos",
"errorCall": "Erro ao realizar chamada"
"errorCall": "Erro ao realizar chamada",
"cardPinSet": "Definir PIN",
"cardPinChange": "Alterar PIN",
"cardPinUnblock": "Desbloquear PIN",
"cardPinSetTitle": "Definir PIN do cartão",
"cardPinChangeTitle": "Alterar PIN do cartão",
"cardPinCurrentStep": "Introduza o PIN atual",
"cardPinNewStep": "Introduza o novo PIN",
"cardPinConfirmStep": "Confirme o novo PIN",
"cardPinScaStep": "Introduza o seu PIN de segurança",
"cardPinNext": "Seguinte",
"cardPinMismatch": "Os PINs não coincidem, tente novamente",
"cardPinSuccess": "PIN do cartão atualizado com sucesso",
"cardPinError": "Erro ao atualizar o PIN do cartão",
"cardPinUnblockConfirm": "Tem a certeza de que deseja desbloquear o PIN do cartão?",
"cardPinUnblockSuccess": "PIN do cartão desbloqueado com sucesso",
"cardPinUnblockError": "Erro ao desbloquear o PIN do cartão",
"renewCardTitle": "Renovar cartão",
"renewCardConfirm": "Tem a certeza de que deseja renovar o cartão? Será emitido um novo cartão.",
"renewCardTokenHint": "Introduza o código do novo cartão",
"renewCardPinTitle": "Introduza o seu PIN de segurança para renovar o cartão",
"renewCardSuccess": "Cartão renovado com sucesso",
"renewCardError": "Erro ao renovar o cartão"
}

View File

@@ -840,4 +840,26 @@ class I18n {
static const String errorTakePicture = 'errorTakePicture';
static const String errorFetchPhotos = 'errorFetchPhotos';
static const String errorCall = 'errorCall';
static const String cardPinSet = 'cardPinSet';
static const String cardPinChange = 'cardPinChange';
static const String cardPinUnblock = 'cardPinUnblock';
static const String cardPinSetTitle = 'cardPinSetTitle';
static const String cardPinChangeTitle = 'cardPinChangeTitle';
static const String cardPinCurrentStep = 'cardPinCurrentStep';
static const String cardPinNewStep = 'cardPinNewStep';
static const String cardPinConfirmStep = 'cardPinConfirmStep';
static const String cardPinScaStep = 'cardPinScaStep';
static const String cardPinNext = 'cardPinNext';
static const String cardPinMismatch = 'cardPinMismatch';
static const String cardPinSuccess = 'cardPinSuccess';
static const String cardPinError = 'cardPinError';
static const String cardPinUnblockConfirm = 'cardPinUnblockConfirm';
static const String cardPinUnblockSuccess = 'cardPinUnblockSuccess';
static const String cardPinUnblockError = 'cardPinUnblockError';
static const String renewCardTitle = 'renewCardTitle';
static const String renewCardConfirm = 'renewCardConfirm';
static const String renewCardTokenHint = 'renewCardTokenHint';
static const String renewCardPinTitle = 'renewCardPinTitle';
static const String renewCardSuccess = 'renewCardSuccess';
static const String renewCardError = 'renewCardError';
}

View File

@@ -94,4 +94,27 @@ abstract class TreezorRemoteDatasource {
required String walletId,
required WalletLimitsModel limits,
});
Future<void> setCardPin({
required String walletId,
required String newPin,
required String confirmPin,
required String scaProof,
});
Future<void> changeCardPin({
required String walletId,
required String currentPin,
required String newPin,
required String confirmPin,
required String scaProof,
});
Future<void> unblockCardPin({required String walletId});
Future<void> renewCard({
required String childProfileId,
required String publicToken,
required String scaProof,
});
}

View File

@@ -549,6 +549,91 @@ class TreezorRemoteDatasourceImpl implements TreezorRemoteDatasource {
);
}
}
@override
Future<void> setCardPin({
required String walletId,
required String newPin,
required String confirmPin,
required String scaProof,
}) async {
try {
await _repository.put<void>(
'/wallets/$walletId/card/set-pin',
body: <String, dynamic>{
'newPin': newPin,
'confirmPin': confirmPin,
'scaProof': scaProof,
},
);
} on DioException catch (error) {
throw _mapDioError(
error,
defaultMessage: 'Error in /wallets/$walletId/card/set-pin',
);
}
}
@override
Future<void> changeCardPin({
required String walletId,
required String currentPin,
required String newPin,
required String confirmPin,
required String scaProof,
}) async {
try {
await _repository.put<void>(
'/wallets/$walletId/card/change-pin',
body: <String, dynamic>{
'currentPin': currentPin,
'newPin': newPin,
'confirmPin': confirmPin,
'scaProof': scaProof,
},
);
} on DioException catch (error) {
throw _mapDioError(
error,
defaultMessage: 'Error in /wallets/$walletId/card/change-pin',
);
}
}
@override
Future<void> unblockCardPin({required String walletId}) async {
try {
await _repository.put<void>('/wallets/$walletId/card/unblock-pin');
} on DioException catch (error) {
throw _mapDioError(
error,
defaultMessage: 'Error in /wallets/$walletId/card/unblock-pin',
);
}
}
@override
Future<void> renewCard({
required String childProfileId,
required String publicToken,
required String scaProof,
}) async {
try {
await _repository.put<void>(
'/child-profiles/$childProfileId/renew-card',
body: <String, dynamic>{
'publicToken': publicToken,
'scaProof': scaProof,
},
);
} on DioException catch (error) {
throw _mapDioError(
error,
defaultMessage:
'Error in /child-profiles/$childProfileId/renew-card',
);
}
}
}
Exception _mapDioError(DioException error, {required String defaultMessage}) {

View File

@@ -30,6 +30,7 @@ abstract class ChildProfileModel with _$ChildProfileModel {
required String treezorUserId,
required String address,
required int createdAt,
@Default(false) bool hasCardPin,
}) = _ChildProfileModel;
factory ChildProfileModel.fromJson(Map<String, dynamic> json) =>
@@ -49,6 +50,7 @@ extension ChildProfileModelMapper on ChildProfileModel {
treezorUserId: treezorUserId,
address: address,
createdAt: createdAt,
hasCardPin: hasCardPin,
);
}
}

View File

@@ -293,7 +293,7 @@ as int,
/// @nodoc
mixin _$ChildProfileModel {
String get id; String get deviceIdentificator; String get parentId; String get firstName; String get lastName; int get bornAt; String get walletId; String get treezorUserId; String get address; int get createdAt;
String get id; String get deviceIdentificator; String get parentId; String get firstName; String get lastName; int get bornAt; String get walletId; String get treezorUserId; String get address; int get createdAt; bool get hasCardPin;
/// Create a copy of ChildProfileModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -306,16 +306,16 @@ $ChildProfileModelCopyWith<ChildProfileModel> get copyWith => _$ChildProfileMode
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChildProfileModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChildProfileModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.hasCardPin, hasCardPin) || other.hasCardPin == hasCardPin));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt,hasCardPin);
@override
String toString() {
return 'ChildProfileModel(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt)';
return 'ChildProfileModel(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt, hasCardPin: $hasCardPin)';
}
@@ -326,7 +326,7 @@ abstract mixin class $ChildProfileModelCopyWith<$Res> {
factory $ChildProfileModelCopyWith(ChildProfileModel value, $Res Function(ChildProfileModel) _then) = _$ChildProfileModelCopyWithImpl;
@useResult
$Res call({
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin
});
@@ -343,7 +343,7 @@ class _$ChildProfileModelCopyWithImpl<$Res>
/// Create a copy of ChildProfileModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,Object? hasCardPin = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
@@ -355,7 +355,8 @@ as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nu
as String,treezorUserId: null == treezorUserId ? _self.treezorUserId : treezorUserId // ignore: cast_nullable_to_non_nullable
as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,
as int,hasCardPin: null == hasCardPin ? _self.hasCardPin : hasCardPin // ignore: cast_nullable_to_non_nullable
as bool,
));
}
@@ -440,10 +441,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ChildProfileModel() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
return orElse();
}
@@ -461,10 +462,10 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin) $default,) {final _that = this;
switch (_that) {
case _ChildProfileModel():
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
throw StateError('Unexpected subclass');
}
@@ -481,10 +482,10 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin)? $default,) {final _that = this;
switch (_that) {
case _ChildProfileModel() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
return null;
}
@@ -496,7 +497,7 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
@JsonSerializable()
class _ChildProfileModel implements ChildProfileModel {
const _ChildProfileModel({required this.id, required this.deviceIdentificator, required this.parentId, required this.firstName, required this.lastName, required this.bornAt, required this.walletId, required this.treezorUserId, required this.address, required this.createdAt});
const _ChildProfileModel({required this.id, required this.deviceIdentificator, required this.parentId, required this.firstName, required this.lastName, required this.bornAt, required this.walletId, required this.treezorUserId, required this.address, required this.createdAt, this.hasCardPin = false});
factory _ChildProfileModel.fromJson(Map<String, dynamic> json) => _$ChildProfileModelFromJson(json);
@override final String id;
@@ -509,6 +510,7 @@ class _ChildProfileModel implements ChildProfileModel {
@override final String treezorUserId;
@override final String address;
@override final int createdAt;
@override@JsonKey() final bool hasCardPin;
/// Create a copy of ChildProfileModel
/// with the given fields replaced by the non-null parameter values.
@@ -523,16 +525,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChildProfileModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChildProfileModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.hasCardPin, hasCardPin) || other.hasCardPin == hasCardPin));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt,hasCardPin);
@override
String toString() {
return 'ChildProfileModel(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt)';
return 'ChildProfileModel(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt, hasCardPin: $hasCardPin)';
}
@@ -543,7 +545,7 @@ abstract mixin class _$ChildProfileModelCopyWith<$Res> implements $ChildProfileM
factory _$ChildProfileModelCopyWith(_ChildProfileModel value, $Res Function(_ChildProfileModel) _then) = __$ChildProfileModelCopyWithImpl;
@override @useResult
$Res call({
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin
});
@@ -560,7 +562,7 @@ class __$ChildProfileModelCopyWithImpl<$Res>
/// Create a copy of ChildProfileModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,Object? hasCardPin = null,}) {
return _then(_ChildProfileModel(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
@@ -572,7 +574,8 @@ as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nu
as String,treezorUserId: null == treezorUserId ? _self.treezorUserId : treezorUserId // ignore: cast_nullable_to_non_nullable
as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,
as int,hasCardPin: null == hasCardPin ? _self.hasCardPin : hasCardPin // ignore: cast_nullable_to_non_nullable
as bool,
));
}

View File

@@ -38,6 +38,7 @@ _ChildProfileModel _$ChildProfileModelFromJson(Map<String, dynamic> json) =>
treezorUserId: json['treezorUserId'] as String,
address: json['address'] as String,
createdAt: (json['createdAt'] as num).toInt(),
hasCardPin: json['hasCardPin'] as bool? ?? false,
);
Map<String, dynamic> _$ChildProfileModelToJson(_ChildProfileModel instance) =>
@@ -52,4 +53,5 @@ Map<String, dynamic> _$ChildProfileModelToJson(_ChildProfileModel instance) =>
'treezorUserId': instance.treezorUserId,
'address': instance.address,
'createdAt': instance.createdAt,
'hasCardPin': instance.hasCardPin,
};

View File

@@ -11,6 +11,7 @@ abstract class WalletCardModel with _$WalletCardModel {
required int walletId,
required int userId,
required String status,
@Default(false) bool isPinBlocked,
}) = _WalletCardModel;
factory WalletCardModel.fromJson(Map<String, dynamic> json) =>
@@ -24,6 +25,7 @@ extension WalletCardModelMapper on WalletCardModel {
walletId: walletId,
userId: userId,
status: status,
isPinBlocked: isPinBlocked,
);
}
}

View File

@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$WalletCardModel {
int get cardId; int get walletId; int get userId; String get status;
int get cardId; int get walletId; int get userId; String get status; bool get isPinBlocked;
/// Create a copy of WalletCardModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $WalletCardModelCopyWith<WalletCardModel> get copyWith => _$WalletCardModelCopyW
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletCardModel&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status));
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletCardModel&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status)&&(identical(other.isPinBlocked, isPinBlocked) || other.isPinBlocked == isPinBlocked));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status);
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status,isPinBlocked);
@override
String toString() {
return 'WalletCardModel(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status)';
return 'WalletCardModel(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status, isPinBlocked: $isPinBlocked)';
}
@@ -48,7 +48,7 @@ abstract mixin class $WalletCardModelCopyWith<$Res> {
factory $WalletCardModelCopyWith(WalletCardModel value, $Res Function(WalletCardModel) _then) = _$WalletCardModelCopyWithImpl;
@useResult
$Res call({
int cardId, int walletId, int userId, String status
int cardId, int walletId, int userId, String status, bool isPinBlocked
});
@@ -65,13 +65,14 @@ class _$WalletCardModelCopyWithImpl<$Res>
/// Create a copy of WalletCardModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,Object? isPinBlocked = null,}) {
return _then(_self.copyWith(
cardId: null == cardId ? _self.cardId : cardId // ignore: cast_nullable_to_non_nullable
as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nullable_to_non_nullable
as int,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as int,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,
as String,isPinBlocked: null == isPinBlocked ? _self.isPinBlocked : isPinBlocked // ignore: cast_nullable_to_non_nullable
as bool,
));
}
@@ -156,10 +157,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status, bool isPinBlocked)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _WalletCardModel() when $default != null:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
return orElse();
}
@@ -177,10 +178,10 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status, bool isPinBlocked) $default,) {final _that = this;
switch (_that) {
case _WalletCardModel():
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
throw StateError('Unexpected subclass');
}
@@ -197,10 +198,10 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int cardId, int walletId, int userId, String status)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int cardId, int walletId, int userId, String status, bool isPinBlocked)? $default,) {final _that = this;
switch (_that) {
case _WalletCardModel() when $default != null:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
return null;
}
@@ -212,13 +213,14 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
@JsonSerializable()
class _WalletCardModel implements WalletCardModel {
const _WalletCardModel({required this.cardId, required this.walletId, required this.userId, required this.status});
const _WalletCardModel({required this.cardId, required this.walletId, required this.userId, required this.status, this.isPinBlocked = false});
factory _WalletCardModel.fromJson(Map<String, dynamic> json) => _$WalletCardModelFromJson(json);
@override final int cardId;
@override final int walletId;
@override final int userId;
@override final String status;
@override@JsonKey() final bool isPinBlocked;
/// Create a copy of WalletCardModel
/// with the given fields replaced by the non-null parameter values.
@@ -233,16 +235,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WalletCardModel&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WalletCardModel&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status)&&(identical(other.isPinBlocked, isPinBlocked) || other.isPinBlocked == isPinBlocked));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status);
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status,isPinBlocked);
@override
String toString() {
return 'WalletCardModel(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status)';
return 'WalletCardModel(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status, isPinBlocked: $isPinBlocked)';
}
@@ -253,7 +255,7 @@ abstract mixin class _$WalletCardModelCopyWith<$Res> implements $WalletCardModel
factory _$WalletCardModelCopyWith(_WalletCardModel value, $Res Function(_WalletCardModel) _then) = __$WalletCardModelCopyWithImpl;
@override @useResult
$Res call({
int cardId, int walletId, int userId, String status
int cardId, int walletId, int userId, String status, bool isPinBlocked
});
@@ -270,13 +272,14 @@ class __$WalletCardModelCopyWithImpl<$Res>
/// Create a copy of WalletCardModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,Object? isPinBlocked = null,}) {
return _then(_WalletCardModel(
cardId: null == cardId ? _self.cardId : cardId // ignore: cast_nullable_to_non_nullable
as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nullable_to_non_nullable
as int,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as int,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,
as String,isPinBlocked: null == isPinBlocked ? _self.isPinBlocked : isPinBlocked // ignore: cast_nullable_to_non_nullable
as bool,
));
}

View File

@@ -12,6 +12,7 @@ _WalletCardModel _$WalletCardModelFromJson(Map<String, dynamic> json) =>
walletId: (json['walletId'] as num).toInt(),
userId: (json['userId'] as num).toInt(),
status: json['status'] as String,
isPinBlocked: json['isPinBlocked'] as bool? ?? false,
);
Map<String, dynamic> _$WalletCardModelToJson(_WalletCardModel instance) =>
@@ -20,4 +21,5 @@ Map<String, dynamic> _$WalletCardModelToJson(_WalletCardModel instance) =>
'walletId': instance.walletId,
'userId': instance.userId,
'status': instance.status,
'isPinBlocked': instance.isPinBlocked,
};

View File

@@ -325,4 +325,54 @@ class TreezorRepositoryImpl implements TreezorRepository {
),
);
}
@override
Future<void> setCardPin({
required String walletId,
required String newPin,
required String confirmPin,
required String scaProof,
}) async {
await _remote.setCardPin(
walletId: walletId,
newPin: newPin,
confirmPin: confirmPin,
scaProof: scaProof,
);
}
@override
Future<void> changeCardPin({
required String walletId,
required String currentPin,
required String newPin,
required String confirmPin,
required String scaProof,
}) async {
await _remote.changeCardPin(
walletId: walletId,
currentPin: currentPin,
newPin: newPin,
confirmPin: confirmPin,
scaProof: scaProof,
);
}
@override
Future<void> unblockCardPin({required String walletId}) async {
await _remote.unblockCardPin(walletId: walletId);
}
@override
Future<void> renewCard({
required String childProfileId,
required String publicToken,
required String scaProof,
}) async {
await _remote.renewCard(
childProfileId: childProfileId,
publicToken: publicToken,
scaProof: scaProof,
);
}
}

View File

@@ -15,5 +15,6 @@ abstract class ChildProfileEntity with _$ChildProfileEntity {
required String treezorUserId,
required String address,
required int createdAt,
@Default(false) bool hasCardPin,
}) = _ChildProfileEntity;
}

View File

@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ChildProfileEntity {
String get id; String get deviceIdentificator; String get parentId; String get firstName; String get lastName; int get bornAt; String get walletId; String get treezorUserId; String get address; int get createdAt;
String get id; String get deviceIdentificator; String get parentId; String get firstName; String get lastName; int get bornAt; String get walletId; String get treezorUserId; String get address; int get createdAt; bool get hasCardPin;
/// Create a copy of ChildProfileEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $ChildProfileEntityCopyWith<ChildProfileEntity> get copyWith => _$ChildProfileEn
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChildProfileEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChildProfileEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.hasCardPin, hasCardPin) || other.hasCardPin == hasCardPin));
}
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt,hasCardPin);
@override
String toString() {
return 'ChildProfileEntity(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt)';
return 'ChildProfileEntity(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt, hasCardPin: $hasCardPin)';
}
@@ -45,7 +45,7 @@ abstract mixin class $ChildProfileEntityCopyWith<$Res> {
factory $ChildProfileEntityCopyWith(ChildProfileEntity value, $Res Function(ChildProfileEntity) _then) = _$ChildProfileEntityCopyWithImpl;
@useResult
$Res call({
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin
});
@@ -62,7 +62,7 @@ class _$ChildProfileEntityCopyWithImpl<$Res>
/// Create a copy of ChildProfileEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,Object? hasCardPin = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
@@ -74,7 +74,8 @@ as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nu
as String,treezorUserId: null == treezorUserId ? _self.treezorUserId : treezorUserId // ignore: cast_nullable_to_non_nullable
as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,
as int,hasCardPin: null == hasCardPin ? _self.hasCardPin : hasCardPin // ignore: cast_nullable_to_non_nullable
as bool,
));
}
@@ -159,10 +160,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ChildProfileEntity() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
return orElse();
}
@@ -180,10 +181,10 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin) $default,) {final _that = this;
switch (_that) {
case _ChildProfileEntity():
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
throw StateError('Unexpected subclass');
}
@@ -200,10 +201,10 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin)? $default,) {final _that = this;
switch (_that) {
case _ChildProfileEntity() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt);case _:
return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstName,_that.lastName,_that.bornAt,_that.walletId,_that.treezorUserId,_that.address,_that.createdAt,_that.hasCardPin);case _:
return null;
}
@@ -215,7 +216,7 @@ return $default(_that.id,_that.deviceIdentificator,_that.parentId,_that.firstNam
class _ChildProfileEntity implements ChildProfileEntity {
const _ChildProfileEntity({required this.id, required this.deviceIdentificator, required this.parentId, required this.firstName, required this.lastName, required this.bornAt, required this.walletId, required this.treezorUserId, required this.address, required this.createdAt});
const _ChildProfileEntity({required this.id, required this.deviceIdentificator, required this.parentId, required this.firstName, required this.lastName, required this.bornAt, required this.walletId, required this.treezorUserId, required this.address, required this.createdAt, this.hasCardPin = false});
@override final String id;
@@ -228,6 +229,7 @@ class _ChildProfileEntity implements ChildProfileEntity {
@override final String treezorUserId;
@override final String address;
@override final int createdAt;
@override@JsonKey() final bool hasCardPin;
/// Create a copy of ChildProfileEntity
/// with the given fields replaced by the non-null parameter values.
@@ -239,16 +241,16 @@ _$ChildProfileEntityCopyWith<_ChildProfileEntity> get copyWith => __$ChildProfil
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChildProfileEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChildProfileEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.parentId, parentId) || other.parentId == parentId)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.bornAt, bornAt) || other.bornAt == bornAt)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.treezorUserId, treezorUserId) || other.treezorUserId == treezorUserId)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.hasCardPin, hasCardPin) || other.hasCardPin == hasCardPin));
}
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,parentId,firstName,lastName,bornAt,walletId,treezorUserId,address,createdAt,hasCardPin);
@override
String toString() {
return 'ChildProfileEntity(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt)';
return 'ChildProfileEntity(id: $id, deviceIdentificator: $deviceIdentificator, parentId: $parentId, firstName: $firstName, lastName: $lastName, bornAt: $bornAt, walletId: $walletId, treezorUserId: $treezorUserId, address: $address, createdAt: $createdAt, hasCardPin: $hasCardPin)';
}
@@ -259,7 +261,7 @@ abstract mixin class _$ChildProfileEntityCopyWith<$Res> implements $ChildProfile
factory _$ChildProfileEntityCopyWith(_ChildProfileEntity value, $Res Function(_ChildProfileEntity) _then) = __$ChildProfileEntityCopyWithImpl;
@override @useResult
$Res call({
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt
String id, String deviceIdentificator, String parentId, String firstName, String lastName, int bornAt, String walletId, String treezorUserId, String address, int createdAt, bool hasCardPin
});
@@ -276,7 +278,7 @@ class __$ChildProfileEntityCopyWithImpl<$Res>
/// Create a copy of ChildProfileEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? parentId = null,Object? firstName = null,Object? lastName = null,Object? bornAt = null,Object? walletId = null,Object? treezorUserId = null,Object? address = null,Object? createdAt = null,Object? hasCardPin = null,}) {
return _then(_ChildProfileEntity(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
@@ -288,7 +290,8 @@ as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nu
as String,treezorUserId: null == treezorUserId ? _self.treezorUserId : treezorUserId // ignore: cast_nullable_to_non_nullable
as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,
as int,hasCardPin: null == hasCardPin ? _self.hasCardPin : hasCardPin // ignore: cast_nullable_to_non_nullable
as bool,
));
}

View File

@@ -9,5 +9,6 @@ abstract class WalletCardEntity with _$WalletCardEntity {
required int walletId,
required int userId,
required String status,
@Default(false) bool isPinBlocked,
}) = _WalletCardEntity;
}

View File

@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$WalletCardEntity {
int get cardId; int get walletId; int get userId; String get status;
int get cardId; int get walletId; int get userId; String get status; bool get isPinBlocked;
/// Create a copy of WalletCardEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $WalletCardEntityCopyWith<WalletCardEntity> get copyWith => _$WalletCardEntityCo
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletCardEntity&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status));
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletCardEntity&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status)&&(identical(other.isPinBlocked, isPinBlocked) || other.isPinBlocked == isPinBlocked));
}
@override
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status);
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status,isPinBlocked);
@override
String toString() {
return 'WalletCardEntity(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status)';
return 'WalletCardEntity(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status, isPinBlocked: $isPinBlocked)';
}
@@ -45,7 +45,7 @@ abstract mixin class $WalletCardEntityCopyWith<$Res> {
factory $WalletCardEntityCopyWith(WalletCardEntity value, $Res Function(WalletCardEntity) _then) = _$WalletCardEntityCopyWithImpl;
@useResult
$Res call({
int cardId, int walletId, int userId, String status
int cardId, int walletId, int userId, String status, bool isPinBlocked
});
@@ -62,13 +62,14 @@ class _$WalletCardEntityCopyWithImpl<$Res>
/// Create a copy of WalletCardEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,Object? isPinBlocked = null,}) {
return _then(_self.copyWith(
cardId: null == cardId ? _self.cardId : cardId // ignore: cast_nullable_to_non_nullable
as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nullable_to_non_nullable
as int,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as int,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,
as String,isPinBlocked: null == isPinBlocked ? _self.isPinBlocked : isPinBlocked // ignore: cast_nullable_to_non_nullable
as bool,
));
}
@@ -153,10 +154,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status, bool isPinBlocked)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _WalletCardEntity() when $default != null:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
return orElse();
}
@@ -174,10 +175,10 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int cardId, int walletId, int userId, String status, bool isPinBlocked) $default,) {final _that = this;
switch (_that) {
case _WalletCardEntity():
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
throw StateError('Unexpected subclass');
}
@@ -194,10 +195,10 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int cardId, int walletId, int userId, String status)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int cardId, int walletId, int userId, String status, bool isPinBlocked)? $default,) {final _that = this;
switch (_that) {
case _WalletCardEntity() when $default != null:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
return $default(_that.cardId,_that.walletId,_that.userId,_that.status,_that.isPinBlocked);case _:
return null;
}
@@ -209,13 +210,14 @@ return $default(_that.cardId,_that.walletId,_that.userId,_that.status);case _:
class _WalletCardEntity implements WalletCardEntity {
const _WalletCardEntity({required this.cardId, required this.walletId, required this.userId, required this.status});
const _WalletCardEntity({required this.cardId, required this.walletId, required this.userId, required this.status, this.isPinBlocked = false});
@override final int cardId;
@override final int walletId;
@override final int userId;
@override final String status;
@override@JsonKey() final bool isPinBlocked;
/// Create a copy of WalletCardEntity
/// with the given fields replaced by the non-null parameter values.
@@ -227,16 +229,16 @@ _$WalletCardEntityCopyWith<_WalletCardEntity> get copyWith => __$WalletCardEntit
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WalletCardEntity&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WalletCardEntity&&(identical(other.cardId, cardId) || other.cardId == cardId)&&(identical(other.walletId, walletId) || other.walletId == walletId)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.status, status) || other.status == status)&&(identical(other.isPinBlocked, isPinBlocked) || other.isPinBlocked == isPinBlocked));
}
@override
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status);
int get hashCode => Object.hash(runtimeType,cardId,walletId,userId,status,isPinBlocked);
@override
String toString() {
return 'WalletCardEntity(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status)';
return 'WalletCardEntity(cardId: $cardId, walletId: $walletId, userId: $userId, status: $status, isPinBlocked: $isPinBlocked)';
}
@@ -247,7 +249,7 @@ abstract mixin class _$WalletCardEntityCopyWith<$Res> implements $WalletCardEnti
factory _$WalletCardEntityCopyWith(_WalletCardEntity value, $Res Function(_WalletCardEntity) _then) = __$WalletCardEntityCopyWithImpl;
@override @useResult
$Res call({
int cardId, int walletId, int userId, String status
int cardId, int walletId, int userId, String status, bool isPinBlocked
});
@@ -264,13 +266,14 @@ class __$WalletCardEntityCopyWithImpl<$Res>
/// Create a copy of WalletCardEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? cardId = null,Object? walletId = null,Object? userId = null,Object? status = null,Object? isPinBlocked = null,}) {
return _then(_WalletCardEntity(
cardId: null == cardId ? _self.cardId : cardId // ignore: cast_nullable_to_non_nullable
as int,walletId: null == walletId ? _self.walletId : walletId // ignore: cast_nullable_to_non_nullable
as int,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as int,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,
as String,isPinBlocked: null == isPinBlocked ? _self.isPinBlocked : isPinBlocked // ignore: cast_nullable_to_non_nullable
as bool,
));
}

View File

@@ -100,4 +100,27 @@ abstract class TreezorRepository {
required String walletId,
required WalletLimitsEntity limits,
});
Future<void> setCardPin({
required String walletId,
required String newPin,
required String confirmPin,
required String scaProof,
});
Future<void> changeCardPin({
required String walletId,
required String currentPin,
required String newPin,
required String confirmPin,
required String scaProof,
});
Future<void> unblockCardPin({required String walletId});
Future<void> renewCard({
required String childProfileId,
required String publicToken,
required String scaProof,
});
}