-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
095ac10
commit d74922d
Showing
4 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
lib/ui/proposals/list/interactor/get_proposals_use_case_input.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:hypha_wallet/core/network/models/dao_data_model.dart'; | ||
import 'package:hypha_wallet/ui/proposals/filter/interactor/filter_status.dart'; | ||
|
||
class GetProposalsUseCaseInput { | ||
final List<DaoData> daos; | ||
final FilterStatus filterStatus; | ||
|
||
GetProposalsUseCaseInput(this.daos, this.filterStatus); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import 'package:hypha_wallet/core/error_handler/model/hypha_error.dart'; | ||
import 'package:hypha_wallet/core/network/models/dao_data_model.dart'; | ||
import 'package:hypha_wallet/core/network/models/proposal_model.dart'; | ||
import 'package:hypha_wallet/core/network/repository/auth_repository.dart'; | ||
import 'package:hypha_wallet/core/network/repository/proposal_repository.dart'; | ||
import 'package:hypha_wallet/ui/architecture/interactor/base_usecase.dart'; | ||
import 'package:hypha_wallet/ui/architecture/result/result.dart'; | ||
import 'package:hypha_wallet/ui/proposals/filter/interactor/filter_status.dart'; | ||
import 'package:hypha_wallet/ui/proposals/list/interactor/get_proposals_use_case_input.dart'; | ||
|
||
// TODO(Zied): add 'extends' (check) | ||
class GetProposalsUseCase { | ||
class GetProposalsUseCase extends InputUseCase<Result<List<ProposalModel>, HyphaError>, GetProposalsUseCaseInput> { | ||
final AuthRepository _authRepository; | ||
final ProposalRepository _proposalRepository; | ||
|
||
GetProposalsUseCase(this._authRepository, this._proposalRepository); | ||
|
||
Future<Result<List<ProposalModel>, HyphaError>> run(List<DaoData> daos, FilterStatus filterStatus) async => _proposalRepository.getProposals(_authRepository.authDataOrCrash.userProfileData, daos, filterStatus); | ||
@override | ||
Future<Result<List<ProposalModel>, HyphaError>> run(GetProposalsUseCaseInput input) async => _proposalRepository.getProposals(_authRepository.authDataOrCrash.userProfileData, input); | ||
} |