Surface/lib/types/notification.dart

27 lines
735 B
Dart
Raw Normal View History

2024-11-23 08:55:23 +00:00
import 'package:freezed_annotation/freezed_annotation.dart';
part 'notification.freezed.dart';
part 'notification.g.dart';
@freezed
class SnNotification with _$SnNotification {
const factory SnNotification({
required int id,
required DateTime createdAt,
required DateTime updatedAt,
required DateTime? deletedAt,
required String topic,
required String title,
required String? subtitle,
required String body,
@Default({}) Map<String, dynamic> metadata,
required int priority,
required int? senderId,
required int accountId,
required DateTime? readAt,
}) = _SnNotification;
factory SnNotification.fromJson(Map<String, dynamic> json) =>
_$SnNotificationFromJson(json);
}