part of 'date_selector_bloc.dart';

enum EndDateType { endDate, endsAfter }

enum EventRepeatType {
  weekly,
  daily,
}

@immutable
class DateSelectorState {
  final DateTime? startDate;
  final DateTime? endDate;
  final EventScheduleType? recurringType;
  final EndDateType? endDateType;
  final EventRepeatType? repeatType;
  final int andsAfterWeeksCount;

  const DateSelectorState(
      {this.startDate,
      this.endDate,
      this.recurringType = EventScheduleType.oneTime,
      this.endDateType,
      this.repeatType,
      this.andsAfterWeeksCount = 1});

  DateSelectorState copyWith({
    DateTime? startDate,
    DateTime? endDate,
    EventScheduleType? recurringType,
    EndDateType? endDateType,
    EventRepeatType? repeatType,
    int? andsAfterWeeksCount,
  }) {
    return DateSelectorState(
      startDate: startDate ?? this.startDate,
      endDate: endDate ?? this.endDate,
      recurringType: recurringType ?? this.recurringType,
      endDateType: endDateType ?? this.endDateType,
      repeatType: repeatType ?? this.repeatType,
      andsAfterWeeksCount: andsAfterWeeksCount ?? this.andsAfterWeeksCount,
    );
  }
}
