part of '../analytic.dart';

@freezed
class CategoryAnalytic with _$CategoryAnalytic {
  const factory CategoryAnalytic({
    required String organizationId,
    required String outletId,
    required String outletName,
    required String dateFrom,
    required String dateTo,
    required List<CategoryAnalyticItem> data,
  }) = _CategoryAnalytic;

  factory CategoryAnalytic.empty() => const CategoryAnalytic(
    organizationId: "",
    outletId: "",
    outletName: "",
    dateFrom: "",
    dateTo: "",
    data: [],
  );
}

@freezed
class CategoryAnalyticItem with _$CategoryAnalyticItem {
  const factory CategoryAnalyticItem({
    required String categoryId,
    required String categoryName,
    required int totalRevenue,
    required int totalQuantity,
    required int productCount,
    required int orderCount,
  }) = _CategoryAnalyticItem;

  factory CategoryAnalyticItem.empty() => const CategoryAnalyticItem(
    categoryId: "",
    categoryName: "",
    totalRevenue: 0,
    totalQuantity: 0,
    productCount: 0,
    orderCount: 0,
  );
}
