TF-2858 Implement store event attendance status on presentation layer

This commit is contained in:
dab246
2024-05-17 17:58:23 +07:00
committed by Dat H. Pham
parent 9ce2fa69db
commit 5bac79b97a
21 changed files with 295 additions and 107 deletions
@@ -1,10 +1,14 @@
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_reply_state.dart';
class CalendarEventAccepting extends CalendarEventReplying {}
class CalendarEventAccepted extends CalendarEventReplySuccess {
CalendarEventAccepted(super.calendarEventAcceptResponse);
CalendarEventAccepted(super.calendarEventAcceptResponse, super.emailId);
@override
EventActionType getEventActionType() => EventActionType.yes;
}
class CalendarEventAcceptFailure extends CalendarEventReplyFailure {
@@ -1,13 +1,14 @@
import 'package:jmap_dart_client/jmap/mail/calendar/reply/calendar_event_maybe_response.dart';
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_reply_state.dart';
class CalendarEventMaybeReplying extends CalendarEventReplying {}
class CalendarEventMaybeSuccess extends CalendarEventReplySuccess {
final CalendarEventMaybeResponse calendarEventMaybeResponse;
CalendarEventMaybeSuccess(this.calendarEventMaybeResponse)
: super(calendarEventMaybeResponse);
CalendarEventMaybeSuccess(super.calendarEventMaybeResponse, super.emailId);
@override
EventActionType getEventActionType() => EventActionType.maybe;
}
class CalendarEventMaybeFailure extends CalendarEventReplyFailure {
@@ -1,13 +1,14 @@
import 'package:jmap_dart_client/jmap/mail/calendar/reply/calendar_event_reject_response.dart';
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
import 'package:tmail_ui_user/features/email/domain/state/calendar_event_reply_state.dart';
class CalendarEventRejecting extends CalendarEventReplying {}
class CalendarEventRejected extends CalendarEventReplySuccess {
final CalendarEventRejectResponse calendarEventRejectResponse;
CalendarEventRejected(this.calendarEventRejectResponse)
: super(calendarEventRejectResponse);
CalendarEventRejected(super.calendarEventRejectResponse, super.emailId);
@override
EventActionType getEventActionType() => EventActionType.no;
}
class CalendarEventRejectFailure extends CalendarEventReplyFailure {
@@ -1,16 +1,21 @@
import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:jmap_dart_client/jmap/core/method/response/calendar_event_reply_response.dart';
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
class CalendarEventReplying extends LoadingState {}
class CalendarEventReplySuccess extends UIState {
abstract class CalendarEventReplySuccess extends UIState {
final EmailId emailId;
final CalendarEventReplyResponse calendarEventReplyResponse;
CalendarEventReplySuccess(this.calendarEventReplyResponse);
CalendarEventReplySuccess(this.calendarEventReplyResponse, this.emailId);
@override
List<Object?> get props => [calendarEventReplyResponse];
List<Object?> get props => [calendarEventReplyResponse, emailId];
EventActionType getEventActionType();
}
class CalendarEventReplyFailure extends FeatureFailure {