// ignore_for_file: invalid_annotation_target

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:tm_app/data/services/model/meta/meta.dart';

part 'notification_data.freezed.dart';
part 'notification_data.g.dart';

@freezed
abstract class NotificationData with _$NotificationData {
  const factory NotificationData({
    required List<NotificationItem>? notifications,
    required Meta? meta,
  }) = _NotificationData;

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

@freezed
abstract class NotificationItem with _$NotificationItem {
  const factory NotificationItem({
    required String? id,
    @JsonKey(name: 'user_id') required String? userId,
    required String? title,
    required String? message,
    required String? link,
    required String? image,
    required String? priority,
    required String? type,
    @JsonKey(name: 'event_type') required String? eventType,
    required String? status,
    required Map<String, dynamic>? methods,
    required Map<String, dynamic>? metadata,
    @JsonKey(name: 'schedule_at') required int? scheduleAt,
    @JsonKey(name: 'created_at') required String? createdAt,
    @JsonKey(name: 'updated_at') required String? updatedAt,
    required bool? seen,
    @JsonKey(name: 'seen_at') required int? seenAt,
    @JsonKey(name: 'is_scheduled') required bool? isScheduled,
    @JsonKey(name: 'scheduled_at') required int? scheduledAt,
  }) = _NotificationItem;

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