-
Notifications
You must be signed in to change notification settings - Fork 1
/
cancel_credential_operation_usecase.dart
37 lines (32 loc) · 1.68 KB
/
cancel_credential_operation_usecase.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright © 2022 Nevis Security AG. All rights reserved.
import 'package:injectable/injectable.dart';
import 'package:nevis_mobile_authentication_sdk_example_app_flutter/domain/model/operation/password_change_state.dart';
import 'package:nevis_mobile_authentication_sdk_example_app_flutter/domain/model/operation/password_enrollment_state.dart';
import 'package:nevis_mobile_authentication_sdk_example_app_flutter/domain/model/operation/pin_change_state.dart';
import 'package:nevis_mobile_authentication_sdk_example_app_flutter/domain/model/operation/pin_enrollment_state.dart';
import 'package:nevis_mobile_authentication_sdk_example_app_flutter/domain/repository/state_repository.dart';
abstract class CancelCredentialOperationUseCase {
Future<void> execute();
}
@Injectable(as: CancelCredentialOperationUseCase)
class CancelCredentialOperationUseCaseImpl
implements CancelCredentialOperationUseCase {
final StateRepository<PinEnrollmentState> _pinEnrollmentStateRepository;
final StateRepository<PasswordEnrollmentState>
_passwordEnrollmentStateRepository;
final StateRepository<PinChangeState> _pinChangeStateRepository;
final StateRepository<PasswordChangeState> _passwordChangeStateRepository;
CancelCredentialOperationUseCaseImpl(
this._pinEnrollmentStateRepository,
this._passwordEnrollmentStateRepository,
this._pinChangeStateRepository,
this._passwordChangeStateRepository,
);
@override
Future<void> execute() async {
await _pinEnrollmentStateRepository.state?.cancel();
await _passwordEnrollmentStateRepository.state?.cancel();
await _pinChangeStateRepository.state?.cancel();
await _passwordChangeStateRepository.state?.cancel();
}
}