/// Order Repository Interface
///
/// Defines the contract for order-related data operations.
library;

import 'package:worker/features/orders/domain/entities/order.dart';
import 'package:worker/features/orders/domain/entities/order_detail.dart';
import 'package:worker/features/orders/domain/entities/order_status.dart';
import 'package:worker/features/orders/domain/entities/payment_term.dart';

/// Order Repository Interface
abstract class OrderRepository {
  /// Get list of orders
  Future<List<Order>> getOrdersList({
    int limitStart = 0,
    int limitPageLength = 0,
  });

  /// Get order detail by ID
  Future<OrderDetail> getOrderDetail(String orderId);

  /// Get list of available order statuses
  Future<List<OrderStatus>> getOrderStatusList();

  /// Get list of available payment terms
  Future<List<PaymentTerm>> getPaymentTermsList();

  /// Create new order
  Future<Map<String, dynamic>> createOrder({
    required List<Map<String, dynamic>> items,
    required Map<String, dynamic> deliveryAddress,
    required String paymentMethod,
    bool needsInvoice = false,
    bool ignorePricingRule = false,
    bool contractRequest = false,
    String? notes,
  });

  /// Generate QR code for payment
  Future<Map<String, dynamic>> generateQrCode(String orderId);

  /// Upload bill/invoice file
  Future<Map<String, dynamic>> uploadBill({
    required String filePath,
    required String orderId,
  });

  /// Update order address
  Future<void> updateOrderAddress({
    required String orderId,
    required String shippingAddressName,
    required String customerAddress,
  });

  /// Cancel order
  Future<void> cancelOrder(String orderId);
}
