import '../domain/entities/inventory_detail.dart';
import '../domain/entities/inventory_filters.dart';
import '../domain/entities/inventory_summary_list_result.dart';
import '../domain/repositories/inventory_repository.dart';

/// 재고 현황 API를 호출하는 애플리케이션 서비스.
class InventoryService {
  const InventoryService({required InventoryRepository repository})
    : _repository = repository;

  final InventoryRepository _repository;

  /// 재고 요약 목록을 조회한다.
  Future<InventorySummaryListResult> fetchSummaries({
    InventorySummaryFilter? filter,
  }) {
    return _repository.listSummaries(filter: filter);
  }

  /// 특정 제품 상세를 조회한다.
  Future<InventoryDetail> fetchDetail(
    int productId, {
    InventoryDetailFilter? filter,
  }) {
    return _repository.fetchDetail(productId, filter: filter);
  }
}
