part of '../order.dart';

abstract class IOrderRepository {
  Future<Either<OrderFailure, ListOrder>> getOrders({
    int page = 1,
    int limit = 10,
    String status = 'completed',
    required DateTime startDate,
    required DateTime endDate,
    String? search,
  });

  Future<Either<OrderFailure, Order>> getOrderById(String id);

  Future<Either<OrderFailure, Order>> createOrder({
    required OrderRequest request,
  });

  Future<Either<OrderFailure, Order>> createOrderWithPayment({
    required OrderRequest request,
    required String paymentMethodId,
  });

  Future<Either<OrderFailure, Order>> addItemOrder({
    required String id,
    required List<AddItemOrderRequest> request,
    String? idempotencyKey,
  });

  Future<Either<OrderFailure, Payment>> createPayment({
    required PaymentRequest request,
    String? idempotencyKey,
  });

  Future<Either<OrderFailure, Unit>> voidOrder({
    required String orderId,
    required String reason,
    String type = "ITEM", // TYPE: ALL, ITEM
    required List<OrderItem> orderItems,
    String? idempotencyKey,
  });

  Future<Either<OrderFailure, Payment>> createSplitBill(
    PaymentSplitBillRequest request, {
    String? idempotencyKey,
  });

  Future<Either<OrderFailure, Unit>> refundOrder({
    required String id,
    required String reason,
    required int refundAmount,
    String? idempotencyKey,
  });
}
