import 'package:equatable/equatable.dart';

class OccupancyHeatMapModel extends Equatable {
  final String uuid;

  final DateTime eventDate;

  final int countTotalPresenceDetected;

  const OccupancyHeatMapModel({
    required this.uuid,
    required this.eventDate,
    required this.countTotalPresenceDetected,
  });

  factory OccupancyHeatMapModel.fromJson(Map<String, dynamic> json) {
    return OccupancyHeatMapModel(
      uuid: json['uuid'] as String? ?? '',
      eventDate: DateTime.parse(
        json['event_date'] as String? ?? '${DateTime.now()}',
      ),
      countTotalPresenceDetected: json['count_total_presence_detected'] as int? ?? 0,
    );
  }

  @override
  List<Object?> get props => [uuid, eventDate, countTotalPresenceDetected];
}
