package com.neusoft.smart.pos.trade.service;


import com.neusoft.smart.pos.constants.DictionaryConstant;
import com.neusoft.smart.pos.dto.trade.response.GetPayTypeDictsResponse;
import com.neusoft.smart.pos.framework.utils.ListUtils;
import com.neusoft.smart.pos.trade.repository.PayTypeRepository;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("payTypeService")
public class PayTypeService {

	@Autowired
    private PayTypeRepository payTypeRepository;

	/**
	 * 可用支付方式列表查询方法
	 * @return
	 */
	public GetPayTypeDictsResponse queryPayTypes() {
		val payTypes = payTypeRepository.queryPayTypes(DictionaryConstant.IS_ENABLE_QY.getCode(), DictionaryConstant.IS_SHOW_S.getCode());
		val payTypesResponse = new GetPayTypeDictsResponse();
		payTypesResponse.setPayTypes(ListUtils.convertListToList(payTypes, GetPayTypeDictsResponse.PayTypeInfo.class));
		return payTypesResponse;
	}

}
