import 'package:freezed_annotation/freezed_annotation.dart';

part 'marianum_message_state.freezed.dart';
part 'marianum_message_state.g.dart';

@freezed
abstract class MarianumMessageState with _$MarianumMessageState {
  const factory MarianumMessageState({
    required MarianumMessageList messageList,
  }) = _MarianumMessageState;

  factory MarianumMessageState.fromJson(Map<String, dynamic> json) =>
      _$MarianumMessageStateFromJson(json);
}

@freezed
abstract class MarianumMessageList with _$MarianumMessageList {
  const factory MarianumMessageList({
    required String base,
    required List<MarianumMessage> messages,
  }) = _MarianumMessageList;

  factory MarianumMessageList.fromJson(Map<String, dynamic> json) =>
      _$MarianumMessageListFromJson(json);
}

@freezed
abstract class MarianumMessage with _$MarianumMessage {
  const factory MarianumMessage({
    @Default('') String id,
    required String name,
    required String date,
    @Default('') String description,
    required String url,
  }) = _MarianumMessage;

  factory MarianumMessage.fromJson(Map<String, dynamic> json) =>
      _$MarianumMessageFromJson(json);
}

enum GradeAveragesGradingSystem { highSchool, middleSchool }
