import 'package:niogu_app/core/enums/order_source.dart';
import 'package:niogu_app/core/enums/order_status.dart';
import 'package:niogu_app/core/enums/payment_status.dart';
import 'package:niogu_app/core/enums/purchase_status.dart';

enum TransactionReportItemEmpty {
  loading,
  empty_database,
  empty_search_result,
  has_data,
}

class TransactionReportItem {
  final String id;
  final String transactionNumber;
  final String title;
  final String subtitle;
  final double amount;
  final DateTime date;
  final bool isIncome;

  TransactionReportItem({
    required this.id,
    required this.transactionNumber,
    required this.title,
    required this.subtitle,
    required this.amount,
    required this.date,
    required this.isIncome,
  });
}

class OrderDetail {
  final String orderId;
  final String orderNumber;
  final DateTime orderDate;
  final OrderSource orderSource;
  final OrderStatus orderStatus;
  final String outletName;
  final String userName;
  final String? localPhotoPath;
  final String? customerName;
  final String? customerPhone;
  final String? customerAddress;
  final String? note;
  final List<OrderItem> items;
  final double totalOrder;
  final double discount;
  final double tax;
  final double totalAmount;
  final double payAmount;
  final double changeAmount;
  final String? paymentProofPath;

  OrderDetail({
    required this.orderId,
    required this.orderNumber,
    required this.orderDate,
    required this.orderSource,
    required this.orderStatus,
    required this.outletName,
    required this.userName,
    this.localPhotoPath,
    this.customerName,
    this.customerPhone,
    this.customerAddress,
    this.note,
    required this.items,
    required this.totalOrder,
    required this.discount,
    required this.tax,
    required this.totalAmount,
    required this.payAmount,
    required this.changeAmount,
    required this.paymentProofPath
  });
}

class OrderItem {
  final String name;
  final String? variantName;
  final double sellingPrice;
  final double quantity;
  final double subtotal;

  const OrderItem({
    required this.name,
    this.variantName,
    required this.sellingPrice,
    required this.quantity,
    required this.subtotal,
  });
}

class PurchaseDetail {
  final String purchaseId;
  final String purchaseNumber;
  final DateTime purchaseDate;
  final String outletName;
  final String userName;
  final PurchaseStatus purchaseStatus;
  final String? localPhotoPath;
  final String? supplierName;
  final String? supplierPhone;
  final String? note;
  final List<PurchaseItem> items;
  final double totalPurchase;
  final double discount;
  final double tax;
  final PaymentStatus paymentStatus;
  final double totalAmount;
  final double payAmount;
  final double changeAmount;
  final double underPaymentAmount;
  final double debtAmount;
  final String? paymentProofPath;

  const PurchaseDetail({
    required this.purchaseId,
    required this.purchaseNumber,
    required this.purchaseDate,
    required this.userName,
    required this.purchaseStatus,
    required this.outletName,
    this.localPhotoPath,
    this.supplierName,
    this.supplierPhone,
    this.note,
    required this.items,
    required this.totalPurchase,
    required this.discount,
    required this.tax,
    required this.paymentStatus,
    required this.totalAmount,
    required this.payAmount,
    required this.changeAmount,
    required this.underPaymentAmount,
    required this.debtAmount,
    this.paymentProofPath,
  });
}

class PurchaseItem {
  final String name;
  final String? variantName;
  final double purchasePrice;
  final double quantity;
  final double subtotal;

  const PurchaseItem({
    required this.name,
    this.variantName,
    required this.purchasePrice,
    required this.quantity,
    required this.subtotal,
  });
}
