import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'marianum_dates_state.freezed.dart';
part 'marianum_dates_state.g.dart';

@freezed
abstract class MarianumDatesState with _$MarianumDatesState {
  const factory MarianumDatesState({
    required bool showPastEvents,
    required List<MarianumDate> events,
  }) = _MarianumDatesState;

  factory MarianumDatesState.fromJson(Map<String, Object?> json) =>
      _$MarianumDatesStateFromJson(json);
}

@freezed
abstract class MarianumDate with _$MarianumDate {
  const factory MarianumDate({
    required String uid,
    required String title,
    required String? description,
    required DateTime start,
    required DateTime end,
    required bool isAllDay,
  }) = _MarianumDate;

  factory MarianumDate.fromJson(Map<String, Object?> json) =>
      _$MarianumDateFromJson(json);
}
