import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';

class InspectionHistoryState extends Equatable {
  final String deviceId;
  final int totalCount;
  final int passCount;
  final int warningCount;
  final int failCount;

  const InspectionHistoryState({
    required this.deviceId,
    this.totalCount = 0,
    this.passCount = 0,
    this.warningCount = 0,
    this.failCount = 0,
  });

  InspectionHistoryState copyWith({
    String? deviceId,
    int? totalCount,
    int? passCount,
    int? warningCount,
    int? failCount,
  }) {
    return InspectionHistoryState(
      deviceId: deviceId ?? this.deviceId,
      totalCount: totalCount ?? this.totalCount,
      passCount: passCount ?? this.passCount,
      warningCount: warningCount ?? this.warningCount,
      failCount: failCount ?? this.failCount,
    );
  }

  @override
  List<Object?> get props => [
        deviceId,
        totalCount,
        passCount,
        warningCount,
        failCount,
      ];
}

class InspectionRecord extends Equatable {
  final String deviceName;
  final String inspectorName;
  final String inspectionTime;
  final String result;
  final String remark;
  final List<InspectionItemRecord> items;
  final IconData icon;

  const InspectionRecord({
    required this.deviceName,
    required this.inspectorName,
    required this.inspectionTime,
    required this.result,
    required this.remark,
    required this.items,
    required this.icon,
  });

  @override
  List<Object?> get props => [
        deviceName,
        inspectorName,
        inspectionTime,
        result,
        remark,
        items,
        icon,
      ];
}

class InspectionItemRecord extends Equatable {
  final String name;
  final String result;

  const InspectionItemRecord({
    required this.name,
    required this.result,
  });

  @override
  List<Object?> get props => [name, result];
}