package com.xunhong.erp.turbo.biz.app.executor.query;

import com.xunhong.erp.turbo.api.biz.dto.qry.OrderShipListQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderShipVO;
import com.xunhong.erp.turbo.biz.app.assembler.OrderShipAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.OrderShip;
import com.xunhong.erp.turbo.biz.domain.gateway.OrderShipGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author shenyifei
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class OrderShipListQryExe {

	private final OrderShipGateway orderShipGateway;
	private final OrderShipAssembler orderShipAssembler;

	public List<OrderShipVO> execute(OrderShipListQry orderShipListQry) {
		List<OrderShip> orderShipList = orderShipGateway.list(orderShipListQry);
		return orderShipList.stream().map(orderShipAssembler::toOrderShipVO).toList();
	}
}

