/// Order Status Provider
///
/// Provides order status list from the API.
library;

import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:worker/features/orders/domain/entities/order_status.dart';
import 'package:worker/features/orders/presentation/providers/order_data_providers.dart';

part 'order_status_provider.g.dart';

/// Provider for fetching order status list
///
/// This provider automatically fetches the list when accessed.
/// Returns AsyncValue<List<OrderStatus>> which handles loading/error states.
@riverpod
Future<List<OrderStatus>> orderStatusList(Ref ref) async {
  final repository = await ref.watch(orderRepositoryProvider.future);
  return repository.getOrderStatusList();
}
