package com.neusoft.smart.pos.promotion.service.remote;

import com.neusoft.smart.pos.dto.member.response.DetailedMemberResponse;
import com.neusoft.smart.pos.dto.promotion.bean.CalculateBean;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "service-member")
public interface RemoteMemberService {
	
	@ApiOperation(value = "get single member by condition")
	@GetMapping("/members/single")
	ResponseData<DetailedMemberResponse> getMemberByCondition(
			@RequestParam(value = "mobile", defaultValue = "", required = false) String mobile,
			@RequestParam(value = "cardNum", defaultValue = "", required = false) String cardNum,
			@RequestParam(value = "org", defaultValue = "-1", required = false) Integer org,
			@RequestParam(value = "store", defaultValue = "-1", required = false) Integer store);

	@ApiOperation(value = "calculate order")
	@PostMapping("/member/calculate-member-bonus")
	ResponseData<CalculateBean> calculateByMemberLevelPolicy(
			@RequestParam(value = "mobile", defaultValue = "", required = false) String mobile,
			@RequestParam(value = "cardNum", defaultValue = "", required = false) String cardNum,
			@RequestParam(value = "org", defaultValue = "-1", required = false) Integer org,
			@RequestParam(value = "store", defaultValue = "-1", required = false) Integer store,
			@RequestParam(value = "calculateBean", defaultValue = "-1", required = true) CalculateBean bean);
}
