package com.xunhong.erp.turbo.biz.app.service;

import com.xunhong.erp.turbo.api.biz.api.SupplierInvoiceServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.SupplierInvoiceUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoicePageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.SupplierInvoiceShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.SupplierInvoiceVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.SupplierInvoiceUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoiceListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoicePageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.SupplierInvoiceShowQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyifei
 */
@Slf4j
@Service
@DubboService(interfaceClass = SupplierInvoiceServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class SupplierInvoiceServiceImpl implements SupplierInvoiceServiceI {

	private final SupplierInvoiceCreateCmdExe supplierInvoiceCreateCmdExe;
	private final SupplierInvoiceUpdateCmdExe supplierInvoiceUpdateCmdExe;
	private final SupplierInvoicePageQryExe supplierInvoicePageQryExe;
	private final SupplierInvoiceListQryExe supplierInvoiceListQryExe;
	private final SupplierInvoiceShowQryExe supplierInvoiceShowQryExe;
	private final SupplierInvoiceDestroyCmdExe supplierInvoiceDestroyCmdExe;

	@Override
	public SupplierInvoiceVO create(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
		return supplierInvoiceCreateCmdExe.execute(supplierInvoiceCreateCmd);
	}

	@Override
	public PageDTO<SupplierInvoiceVO> page(SupplierInvoicePageQry supplierInvoicePageQry) {
		return PageDTO.of(supplierInvoicePageQryExe.execute(supplierInvoicePageQry));
	}

	@Override
	public List<SupplierInvoiceVO> list(SupplierInvoiceListQry supplierInvoiceListQry) {
		return supplierInvoiceListQryExe.execute(supplierInvoiceListQry);
	}

	@Override
	public SupplierInvoiceVO update(SupplierInvoiceUpdateCmd invoiceUpdateCmd) {
		return supplierInvoiceUpdateCmdExe.execute(invoiceUpdateCmd);
	}

	@Override
	public SupplierInvoiceVO show(SupplierInvoiceShowQry supplierInvoiceShowQry) {
		return supplierInvoiceShowQryExe.execute(supplierInvoiceShowQry);
	}

	@Override
	public void destroy(SupplierInvoiceDestroyCmd supplierInvoiceDestroyCmd) {
		supplierInvoiceDestroyCmdExe.execute(supplierInvoiceDestroyCmd);
	}
}

