import { Injectable, inject } from '@angular/core';
import { DBHOrderItemListItemDTO, OrderItemDTO, OrderItemSubsetDTO, OrderService } from '@generated/swagger/oms-api';

@Injectable({ providedIn: 'root' })
export class PickupShelfService {
  private _orderService = inject(OrderService);

  getOrderByOrderId(orderId: number) {
    return this._orderService.OrderGetOrder(orderId);
  }
  patchOrderItemSubset(item: DBHOrderItemListItemDTO, changes: Partial<OrderItemSubsetDTO>) {
    return this._orderService.OrderPatchOrderItemSubset({
      orderId: item.orderId,
      orderItemId: item.orderItemId,
      orderItemSubsetId: item.orderItemSubsetId,
      orderItemSubset: changes,
    });
  }

  getOrderItemSubsetTasks(item: DBHOrderItemListItemDTO) {
    return this._orderService.OrderGetOrderItemSubsetTasks({
      orderId: item.orderId,
      orderItemId: item.orderItemId,
      orderItemSubsetId: item.orderItemSubsetId,
    });
  }
}
