import 'package:equatable/equatable.dart';

/// Product entity - pure domain model
/// Represents a product in the warehouse management system
class ProductEntity extends Equatable {
  final int id;
  final String name;
  final String code;
  final String fullName;
  final String? description;
  final String? lotCode;
  final String? lotNumber;
  final String? logo;
  final String? barcode;

  // Quantity fields
  final int quantity;
  final int totalQuantity;
  final int passedQuantity;
  final double? passedQuantityWeight;
  final int issuedQuantity;
  final double? issuedQuantityWeight;
  final int piecesInStock;
  final double weightInStock;

  // Weight and pieces
  final double weight;
  final int pieces;
  final double conversionRate;
  final double? percent;

  // Price and status
  final double? price;
  final bool isActive;
  final bool isConfirm;
  final int? productStatusId;
  final int productTypeId;

  // Relations
  final int? orderId;
  final int? parentId;
  final int? receiverStageId;
  final dynamic order;

  // Dates
  final String? startDate;
  final String? endDate;

  // Lists
  final List<dynamic> productions;
  final List<dynamic> customerProducts;
  final List<dynamic> productStages;
  final dynamic childrenProducts;
  final dynamic productStageWareHouses;
  final dynamic productStageDetailWareHouses;
  final dynamic productExportExcelSheetDataModels;
  final dynamic materialLabels;
  final dynamic materials;
  final dynamic images;
  final dynamic attachmentFiles;

  const ProductEntity({
    required this.id,
    required this.name,
    required this.code,
    required this.fullName,
    this.description,
    this.lotCode,
    this.lotNumber,
    this.logo,
    this.barcode,
    required this.quantity,
    required this.totalQuantity,
    required this.passedQuantity,
    this.passedQuantityWeight,
    required this.issuedQuantity,
    this.issuedQuantityWeight,
    required this.piecesInStock,
    required this.weightInStock,
    required this.weight,
    required this.pieces,
    required this.conversionRate,
    this.percent,
    this.price,
    required this.isActive,
    required this.isConfirm,
    this.productStatusId,
    required this.productTypeId,
    this.orderId,
    this.parentId,
    this.receiverStageId,
    this.order,
    this.startDate,
    this.endDate,
    this.productions = const [],
    this.customerProducts = const [],
    this.productStages = const [],
    this.childrenProducts,
    this.productStageWareHouses,
    this.productStageDetailWareHouses,
    this.productExportExcelSheetDataModels,
    this.materialLabels,
    this.materials,
    this.images,
    this.attachmentFiles,
  });

  @override
  List<Object?> get props => [
        id,
        name,
        code,
        fullName,
        description,
        lotCode,
        lotNumber,
        logo,
        barcode,
        quantity,
        totalQuantity,
        passedQuantity,
        passedQuantityWeight,
        issuedQuantity,
        issuedQuantityWeight,
        piecesInStock,
        weightInStock,
        weight,
        pieces,
        conversionRate,
        percent,
        price,
        isActive,
        isConfirm,
        productStatusId,
        productTypeId,
        orderId,
        parentId,
        receiverStageId,
        order,
        startDate,
        endDate,
        productions,
        customerProducts,
        productStages,
        childrenProducts,
        productStageWareHouses,
        productStageDetailWareHouses,
        productExportExcelSheetDataModels,
        materialLabels,
        materials,
        images,
        attachmentFiles,
      ];
}
