TF-2858 Implement store event attendance status on presentation layer
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/repository/calendar_event_repository.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_accept_state.dart';
|
||||
|
||||
@@ -13,12 +14,13 @@ class AcceptCalendarEventInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
AccountId accountId,
|
||||
Set<Id> blobIds
|
||||
Set<Id> blobIds,
|
||||
EmailId emailId,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(CalendarEventAccepting());
|
||||
final result = await _calendarEventRepository.acceptEventInvitation(accountId, blobIds);
|
||||
yield Right(CalendarEventAccepted(result));
|
||||
yield Right(CalendarEventAccepted(result, emailId));
|
||||
} catch (e) {
|
||||
yield Left(CalendarEventAcceptFailure(exception: e));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/repository/calendar_event_repository.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_reject_state.dart';
|
||||
|
||||
@@ -13,12 +14,13 @@ class RejectCalendarEventInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
AccountId accountId,
|
||||
Set<Id> blobIds
|
||||
Set<Id> blobIds,
|
||||
EmailId emailId,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(CalendarEventRejecting());
|
||||
final result = await _calendarEventRepository.rejectEventInvitation(accountId, blobIds);
|
||||
yield Right(CalendarEventRejected(result));
|
||||
yield Right(CalendarEventRejected(result, emailId));
|
||||
} catch (e) {
|
||||
yield Left(CalendarEventRejectFailure(exception: e));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/repository/calendar_event_repository.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_maybe_state.dart';
|
||||
|
||||
@@ -13,12 +14,13 @@ class MaybeCalendarEventInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
AccountId accountId,
|
||||
Set<Id> blobIds
|
||||
Set<Id> blobIds,
|
||||
EmailId emailId,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(CalendarEventMaybeReplying());
|
||||
final result = await _calendarEventRepository.maybeEventInvitation(accountId, blobIds);
|
||||
yield Right(CalendarEventMaybeSuccess(result));
|
||||
yield Right(CalendarEventMaybeSuccess(result, emailId));
|
||||
} catch (e) {
|
||||
yield Left(CalendarEventMaybeFailure(exception: e));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user