import 'inventory_item.dart';

/// The result of an inventory quantity adjustment or write operation.
class InventoryAdjustmentResult {
  /// Whether the operation succeeded.
  final bool success;

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

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

  const InventoryAdjustmentResult.success(InventoryItem item)
    : success = true,
      updatedItem = item,
      errorMessage = null;

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