import 'package:fcs/domain/entities/package.dart';

class Processing {
  String? id;
  //for consignee
  String? userID;
  String? userName;
  String? userPhoneNumber;
  //for shipper
  String? fcsID;
  String? shipperName;
  String? shipperPhoneNumber;

  List<Package> packages;

  Processing(
      {this.id,
      this.userID,
      this.userName,
      this.userPhoneNumber,
      this.fcsID,
      this.shipperName,
      this.shipperPhoneNumber,
      this.packages = const []});

  @override
  bool operator ==(Object other) => other is Processing && other.id == id;

  @override
  int get hashCode => id.hashCode;

  bool isChangedForEdit(Processing processing) {
    return processing.userID != this.userID ||
        processing.fcsID != this.fcsID ||
        processing.packages != this.packages;
  }

  @override
  String toString() {
    return 'Processing{id: $id}';
  }
}
