import 'package:freezed_annotation/freezed_annotation.dart';

part 'recent_activity.freezed.dart';
part 'recent_activity.g.dart';

@freezed
class RecentActivity with _$RecentActivity {
  const factory RecentActivity({
    required int id,
    @JsonKey(name: 'activity_type') required String activityType,
    @JsonKey(name: 'entity_type') required String entityType,
    @JsonKey(name: 'entity_id') required int entityId,
    @JsonKey(name: 'entity_name') required String entityName,
    required String description,
    @JsonKey(name: 'user_id') int? userId,
    @JsonKey(name: 'user_name') String? userName,
    required DateTime timestamp,
    Map<String, dynamic>? metadata,
  }) = _RecentActivity;

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