import 'package:flutter/foundation.dart';

@immutable
class EarningsSummaryEntity {
  const EarningsSummaryEntity({
    required this.totalEarningsByWeek,
    required this.totalEarningsByMonth,
    required this.totalWorkedHoursByWeek,
    required this.totalWorkedHoursByMonth,
    required this.payoutByWeek,
    required this.payoutByMonth,
    required this.startDatePeriod,
    required this.endDatePeriod,
    required this.maxEarningInPeriod,
    required this.minEarningInPeriod,
  });

  const EarningsSummaryEntity.empty({
    this.totalEarningsByWeek = 0,
    this.totalEarningsByMonth = 0,
    this.totalWorkedHoursByWeek = 0,
    this.totalWorkedHoursByMonth = 0,
    this.payoutByWeek = 0,
    this.payoutByMonth = 0,
    this.startDatePeriod,
    this.endDatePeriod,
    this.maxEarningInPeriod = 0,
    this.minEarningInPeriod = 0,
  });

  final double totalEarningsByWeek;
  final double totalEarningsByMonth;
  final double totalWorkedHoursByWeek;
  final double totalWorkedHoursByMonth;
  final double payoutByWeek;
  final double payoutByMonth;
  final DateTime? startDatePeriod;
  final DateTime? endDatePeriod;
  final int maxEarningInPeriod;
  final int minEarningInPeriod;

  EarningsSummaryEntity copyWith({
    double? totalEarningsByWeek,
    double? totalEarningsByMonth,
    double? totalWorkedHoursByWeek,
    double? totalWorkedHoursByMonth,
    double? payoutByWeek,
    double? payoutByMonth,
    DateTime? startDatePeriod,
    DateTime? endDatePeriod,
    int? maxEarningInPeriod,
    int? minEarningInPeriod,
  }) {
    return EarningsSummaryEntity(
      totalEarningsByWeek: totalEarningsByWeek ?? this.totalEarningsByWeek,
      totalEarningsByMonth: totalEarningsByMonth ?? this.totalEarningsByMonth,
      totalWorkedHoursByWeek:
          totalWorkedHoursByWeek ?? this.totalWorkedHoursByWeek,
      totalWorkedHoursByMonth:
          totalWorkedHoursByMonth ?? this.totalWorkedHoursByMonth,
      payoutByWeek: payoutByWeek ?? this.payoutByWeek,
      payoutByMonth: payoutByMonth ?? this.payoutByMonth,
      startDatePeriod: startDatePeriod,
      endDatePeriod: endDatePeriod,
      maxEarningInPeriod: maxEarningInPeriod ?? this.maxEarningInPeriod,
      minEarningInPeriod: minEarningInPeriod ?? this.minEarningInPeriod,
    );
  }
}
