import 'order.dart';

/// The result of an order write operation (status update, note addition, etc.).
class OrderActionResult {
  /// Whether the operation succeeded.
  final bool success;

  /// The updated [Order] after the operation, or `null` on failure.
  final Order? updatedOrder;

  /// A human-readable error message when [success] is `false`.
  final String? errorMessage;

  const OrderActionResult.success(Order order)
    : success = true,
      updatedOrder = order,
      errorMessage = null;

  const OrderActionResult.failure(String message)
    : success = false,
      updatedOrder = null,
      errorMessage = message;
}
